Tribonacci word

DefinitionFinite Tribonacci words#✓fully proved

The finite Tribonacci words \(W(n)\), for \(n \ge 0\), are the words over the alphabet \(\{a, b, c\}\) defined by \(W(0) = a\), \(W(1) = ab\), \(W(2) = abac\) and \(W(n + 3) = W(n + 2)\,W(n + 1)\,W(n)\) for every \(n \ge 0\), where juxtaposition denotes concatenation.

def tribonacciWordApprox : Nat → List TribonacciLetter
  | 0 => [.a]
  | 1 => [.a, .b]
  | 2 => [.a, .b, .a, .c]
  | n + 3 => tribonacciWordApprox (n + 2) ++ tribonacciWordApprox (n + 1) ++
      tribonacciWordApprox n
Uses 1 · Used by 8

TheoremRecursion for the finite Tribonacci words#✓fully proved

For every \(n \ge 0\), the finite Tribonacci word \(W(n + 3)\) is the concatenation \(W(n + 2)\,W(n + 1)\,W(n)\).

theorem tribonacciWordApprox_add_three (n : Nat) :
    tribonacciWordApprox (n + 3) =
      tribonacciWordApprox (n + 2) ++ tribonacciWordApprox (n + 1) ++
        tribonacciWordApprox n
Uses 2 · Used by 1

TheoremLength recurrence for finite Tribonacci words#✓fully proved

Writing \(|w|\) for the length of a word \(w\), for every \(n \ge 0\) the finite Tribonacci words satisfy \(|W(n + 3)| = |W(n + 2)| + |W(n + 1)| + |W(n)|\).

theorem tribonacciWordApprox_length_add_three (n : Nat) :
    (tribonacciWordApprox (n + 3)).length =
      (tribonacciWordApprox (n + 2)).length +
        (tribonacciWordApprox (n + 1)).length + (tribonacciWordApprox n).length
Uses 2 · Used by 1

TheoremLength lower bound for finite Tribonacci words#✓fully proved

For every \(n \ge 0\), the finite Tribonacci word \(W(n)\) has length at least \(n + 1\).

theorem tribonacciWordApprox_length_ge (n : Nat) :
    n + 1 ≤ (tribonacciWordApprox n).length
Uses 3 · Used by 2

TheoremEach finite Tribonacci word is a prefix of the next#✓fully proved

For every \(n \ge 0\), the finite Tribonacci word \(W(n)\) is a prefix of \(W(n + 1)\).

theorem tribonacciWordApprox_prefix_succ : ∀ n : Nat,
    List.IsPrefix (tribonacciWordApprox n) (tribonacciWordApprox (n + 1))
Uses 3 · Used by 1

TheoremFinite Tribonacci words form a prefix chain#✓fully proved

For all natural numbers \(m \le n\), the finite Tribonacci word \(W(m)\) is a prefix of \(W(n)\).

theorem tribonacciWordApprox_prefix {m n : Nat} (h : m ≤ n) :
    List.IsPrefix (tribonacciWordApprox m) (tribonacciWordApprox n)
Uses 3 · Used by 2

TheoremLengths of finite Tribonacci words are monotone#✓fully proved

For all natural numbers \(m \le n\), the length of the finite Tribonacci word \(W(m)\) is at most the length of \(W(n)\).

theorem tribonacciWordApprox_length_mono {m n : Nat} (h : m ≤ n) :
    (tribonacciWordApprox m).length ≤ (tribonacciWordApprox n).length
Uses 3

DefinitionThe infinite Tribonacci word#✓fully proved

The infinite Tribonacci word is the sequence over the alphabet \(\{a, b, c\}\) whose letter at each position \(k \ge 0\) (positions counted from \(0\)) is the letter at position \(k\) of the finite Tribonacci word \(W(k)\); this position exists because \(W(k)\) has length at least \(k + 1\).

def tribonacciWord (k : Nat) : TribonacciLetter :=
  (tribonacciWordApprox k)[k]'(by
    have h := tribonacciWordApprox_length_ge k
    omega)
Uses 3 · Used by 4

TheoremFinite Tribonacci words agree with the infinite word#✓fully proved

For all natural numbers \(k \le n\) such that \(k\) is less than the length of the finite Tribonacci word \(W(n)\), the letter of \(W(n)\) at position \(k\) equals the letter of the infinite Tribonacci word at position \(k\), positions being counted from \(0\).

theorem tribonacciWord_eq_getElem_of_le (k n : Nat) (hkn : k ≤ n)
    (hk : k < (tribonacciWordApprox n).length) :
    (tribonacciWordApprox n)[k]'hk = tribonacciWord k
Uses 5
10 fully proved

The dependency explorer needs JavaScript and its graph data.

Download the complete graph data.