One pattern with reversal picks out the Rote-Fibonacci words

5 of 5 main results in Lean (100%) · AI-generated and directed by Tyler B. Hughes · No human mathematician has yet refereed the proof.

A block is a run of neighbouring letters. Lean proves every infinite word of 0s and 1s in which each block occurs at least twice, and no block is x x xᴿ (a nonempty x, x again, x backwards), is periodic or has exactly the blocks of the Rote–Fibonacci word.

Every one-sided or two-sided infinite word of 0s and 1s in which every finite block occurs at least twice and no block has the form x x xᴿ (x nonempty, xᴿ its reversal) is periodic or has exactly the same finite blocks as the Rote–Fibonacci word r; the word g_rf(b₅) of Badkobeh and Ochem has exactly the same finite blocks as r; and every one-sided infinite word of 0s and 1s that avoids x x xᴿ has critical exponent at least 2 + φ, where φ = (1 + √5)/2.

Du, Mousavi, Schaeffer and Shallit (2014) built the Rote–Fibonacci word r from the Fibonacci word, showed that it avoids x x xᴿ, and asked (Conjecture 46) whether every infinite word of 0s and 1s avoiding x x xᴿ has critical exponent at least 2 + φ ≈ 3.618: it must contain blocks that repeat themselves as close to 2 + φ times as one likes, or more. Lean proves more: apart from periodic words, every avoider in which each block comes back is r, as far as its finite blocks can tell.

The pattern, the word, and a near miss

With x = 0 the pattern x x xᴿ is 000; with x = 01 it is 010110; with x = 10 it is 101001; with x = 011 it is 011011110. The word 0110 contains none of these shapes.

The Fibonacci word f = 0100101001001… starts from 0 and replaces every 0 by 01 and every 1 by 0, again and again. The Rote–Fibonacci word is r = 001001101101100100110…, and its n-th letter, counting from 0, is 1 exactly when ⌊(n + 2)/φ⌋ is even. For every j, the letters j and j + 1 of r are equal exactly when letter j + 1 of f is 1.

For each length n from 1 to 15, r has exactly 2n different blocks of length n. Lean proves this count for every n ≥ 1.

The word 0010011011 0010011011 0010011011 … repeats forever, so it is periodic. It avoids x x xᴿ, and it agrees with r on its leftmost 11 letters, yet it contains the block 00110110010011, which is not one of the 28 blocks of length 14 in r. This is why the theorem must allow periodic words.

Infinite words, blocks and the pattern

An infinite word lists a letter 0 or 1 at every position, either from 0 onwards or in both directions. A block is a run of consecutive letters. The word is recurrent when every block occurs at least twice, and then it occurs again and again. A word avoids x x xᴿ when no block is some nonempty x, then x again, then x reversed. Every one-sided recurrent word has a two-sided recurrent partner with exactly the same blocks, which is periodic only if the word is.

  • A one-sided recurrent word has a two-sided recurrent partner with the same blocks

    For every one-sided recurrent word x there is a two-sided recurrent word y with exactly the same blocks, such that y periodic makes x periodic and if x avoids the pattern, so does y.

    theorem RoteFibonacciReversal.oneSided_to_twoSided (x : ℕ → Bool) (hx : RecurrentOne x) :
      ∃ y,
      (∀ (u : List Bool), IsFactorTwo y u ↔ IsFactorOne x u) ∧
        RecurrentTwo y ∧ (PeriodicTwo y → PeriodicOne x) ∧ (AvoidsXXXROne x → AvoidsXXXRTwo y)
  • Being a block of a one-sided word
  • Being a block of a two-sided word
  • Having the same blocks
  • Recurrence of a one-sided word
  • Recurrence of a two-sided word
  • Periodicity of a one-sided word
  • Periodicity of a two-sided word
  • Containing x x xᴿ
  • Avoiding x x xᴿ, one-sided
  • Avoiding x x xᴿ, two-sided

The Rote–Fibonacci word

The Fibonacci word f comes from 0 by replacing 0 with 01 and 1 with 0 again and again. The Rote–Fibonacci word r has 1 at position n exactly when ⌊(n + 2)/φ⌋ is even, and letters j and j + 1 of r agree exactly when letter j + 1 of f is 1. Seeing r as a rotation by an irrational angle, Lean proves that r has 2n blocks of each length n ≥ 1, that every block of r comes back within a bounded gap, that r is not periodic, and that r has blocks repeating as close to 2 + φ times as one likes. The binary word Badkobeh and Ochem code from b₅ is another such rotation, with the same blocks as r.

  • Badkobeh and Ochem's binary word and r have the same blocks

    Badkobeh and Ochem's binary word, coded from b₅, and the Rote–Fibonacci word r have exactly the same finite blocks.

    theorem RoteFibonacciReversal.wGrf_hasSameFactors_roteFib :
      HasSameFactorsOne wGrf roteFib
  • The golden ratio φ
  • The Fibonacci word f
  • The Rote–Fibonacci word r
  • The agreement word
  • Badkobeh and Ochem's binary word
  • The word of a rotation
  • A rotation that misses the cut points
  • Rotation words that miss the cuts have the same blocks

    If the orbits from t₁ and t₂ both miss 0 and 1/2, their rotation words have exactly the same blocks.

    theorem RoteFibonacciReversal.rotCode_same_factors {t₁ : ℝ} {t₂ : ℝ} (h1 : AvoidsCuts t₁) (h2 : AvoidsCuts t₂) :
      HasSameFactorsOne (rotCode t₁) (rotCode t₂)
  • r is a rotation word

    For every n, letter n of r is letter n of the rotation word from 1/2 + 1/φ.

    theorem RoteFibonacciReversal.roteFib_eq_rotCode (n : ℕ) :
      roteFib n = rotCode (1 / 2 + 2 * (1 / (2 * φ))) n
  • Neighbouring letters of r agree where f has a 1

    For every j, letters j and j + 1 of r are equal exactly when letter j + 1 of f is 1.

    theorem RoteFibonacciReversal.roteFib_eqDiff_eq_fibWord_succ (j : ℕ) :
      eqDiff roteFib j = fibWord (j + 1)
  • Badkobeh and Ochem's binary word is a rotation word

    For every n, letter n of Badkobeh and Ochem's binary word is letter n of the rotation word from 1/(2φ).

    theorem RoteFibonacciReversal.wGrf_eq_rotCode (n : ℕ) :
      wGrf n = rotCode (1 / (2 * φ)) n
  • r has 2n blocks of each length n ≥ 1

    For every n ≥ 1, the Rote–Fibonacci word has exactly 2n different blocks of length n.

    theorem RoteFibonacciReversal.roteFib_factor_complexity {n : ℕ} (hn : 1 ≤ n) :
      factorComplexity roteFib n = 2 * n
  • Every block of r comes back within a bounded gap

    For every block w of r there is R such that, from any position, w starts again within R places.

    theorem RoteFibonacciReversal.roteFib_uniformly_recurrent :
      UniformlyRecurrentOne roteFib
  • r is not eventually periodic

    There are no N and p ≥ 1 with r(n + p) = r(n) for every n ≥ N.

    theorem RoteFibonacciReversal.roteFib_not_eventuallyPeriodic :
      ¬EventuallyPeriodicOne roteFib
  • Swapping 0 and 1 in a block of r gives a block of r

    For every finite word u, u is a block of r exactly when u with 0 and 1 swapped is a block of r.

    theorem RoteFibonacciReversal.roteFib_factors_closed_comp (u : List Bool) :
      IsFactorOne roteFib u ↔ IsFactorOne roteFib (compWord u)
  • r has blocks repeating nearly 2 + φ times

    For every ε > 0, r has a nonempty block u with a period p ≥ 1 such that |u|/p > 2 + φ − ε.

    theorem RoteFibonacciReversal.roteFib_has_pow_approaching_two_add_phi (ε : ℝ) (hε : 0 < ε) :
      ∃ u p, u ≠ [] ∧ 1 ≤ p ∧ IsFactorOne roteFib u ∧ IsPeriod u p ∧ 2 + φ - ε < ↑u.length / ↑p

Short and long tiles, level after level

Currie and Rampersad cut an avoider into two kinds of tiles, short S and long L, taken from a suitable pair, with the tiles alternately written as they are and with 0 and 1 swapped. At level 0 the tiles are S = 00100 and L = 00100100. Each level gives the next: the next short tile is the old tiles spelled by Σ = LSLSLLSLLSLSL, and the next long tile those spelled by Λ = LSLSLLSLLSLSLLSLLSLSL. The short tile at level i has at least 5 · 2ⁱ letters.

  • Writing out at the next level is writing out θ

    For every suitable pair, starting swap and word u, writing u out in the next level's tiles gives θ(u) written out in the old tiles.

    theorem RoteFibonacciReversal.H_nextPair (sp : SuitablePair) (ph : Bool) (u : List SL) :
      H (nextPair sp) ph u = H sp ph (applyMorph theta u)
  • The letters S and L
  • The substitution Φ
  • The substitution θ
  • A suitable pair
  • The short and the long tile
  • Writing out in tiles, alternately swapped
  • The level-0 pair
  • The next level, after Currie and Rampersad's Lemma 10
  • The pair at level i
  • The short tile at level i has at least 5 · 2ⁱ letters

    For every i, the short tile of the level-i pair has at least 5 · 2ⁱ letters.

    theorem RoteFibonacciReversal.levelPair_blk_S_length_ge (i : ℕ) :
      5 * 2 ^ i ≤ (blk (levelPair i) SL.S).length
  • A word written in the tiles of a pair
  • A word spelled by a substitution
  • Φ three times is θ, shifted by SLSL

    For every word u in S and L, Φ³(u) followed by SLSL equals SLSL followed by θ(u).

    theorem RoteFibonacciReversal.iterMorph_Phi_three_conj (u : List SL) :
      iterMorph Phi 3 u ++ cWord = cWord ++ applyMorph theta u

Thirty-seven forbidden block patterns

Currie and Rampersad list 37 words in S and L, the set B. Whatever the suitable pair and whichever way the alternation starts, writing any of them out in tiles produces some x x xᴿ. Lean checks this with one symbolic certificate per word, an identity of words in letters that stand for the unknown tiles and their reversals and swaps, so the check covers every suitable pair at once.

  • The 37 words of B always produce x x xᴿ

    For every suitable pair, every word b of B and either starting swap, b written out in the tiles of the pair contains x x xᴿ for some nonempty x.

    theorem RoteFibonacciReversal.currie_rampersad_lemma4 (sp : SuitablePair) (b : List SL) (hb : b ∈ B_set) (ph : Bool) :
      ContainsXXXR (H sp ph b)
  • The 37 words of B
  • The 37 certificates
  • Checking a certificate
  • A checked certificate works for every pair

    If a certificate checks, then for every suitable pair its word written out, starting unswapped, contains x x xᴿ.

    theorem RoteFibonacciReversal.checkSymCert_sound (cert : SymCert) (h : checkSymCert cert = true) (sp : SuitablePair) :
      ContainsXXXR (H sp false cert.word)
  • All 37 certificates check

    Lean's kernel checks every one of the 37 certificates.

    theorem RoteFibonacciReversal.lem4Certs_all_valid :
      lem4Certs.all checkSymCert = true

Descending through every level

Take a two-sided recurrent avoider that is not periodic. Level 0: a careful case analysis of short stretches shows it is written in the tiles 00100 and 00100100, alternately swapped, unless it is periodic. From one level to the next: the word of S and L letters avoids all 37 words of B, and three parsings show it is periodic or spelled by Σ and Λ, which is the next level. By induction the avoider is written in level-i tiles for every i, and never with two short tiles in a row.

  • A non-periodic avoider is written in tiles at every level

    For every two-sided recurrent avoider that is not periodic and every level i, the avoider is a recurrent word in S and L with no SS, written in the level-i tiles.

    theorem RoteFibonacciReversal.descent_level {x : ℤ → Bool} (hrec : RecurrentTwo x) (hav : AvoidsXXXRTwo x) (haper : ¬PeriodicTwo x) (i : ℕ) :
      ∃ y, IsHImage (levelPair i) x y ∧ RecurrentTwo y ∧ ∀ (k : ℤ), ¬(y k = SL.S ∧ y (k + 1) = SL.S)
  • Level 0, a two-sided recurrent avoider is periodic or written in 00100 and 00100100, alternately swapped

    Every two-sided recurrent avoider of x x xᴿ is periodic, or is a recurrent word in S and L written out in the level-0 tiles, alternately swapped.

    theorem RoteFibonacciReversal.level0_structure {x : ℤ → Bool} (hrec : RecurrentTwo x) (hav : AvoidsXXXRTwo x) :
      PeriodicTwo x ∨ ∃ y, IsHImage level0Pair x y ∧ RecurrentTwo y
  • The word of tiles avoids B

    If an avoider x is y written in the tiles of some pair, then no word of B is a block of y.

    theorem RoteFibonacciReversal.isHImage_avoids_B_set {sp : SuitablePair} {x : ℤ → Bool} {y : ℤ → SL} (hh : IsHImage sp x y) (hav : AvoidsXXXRTwo x) (b : List SL) (a.0 : b ∈ B_set) :
      ¬IsFactorTwo y b
  • Avoiding B means periodic or spelled by θ

    A two-sided recurrent word in S and L with no block from B is periodic, or has no SS and is a recurrent word spelled by θ.

    theorem RoteFibonacciReversal.three_phi_parsings {y : ℤ → SL} (hrec : RecurrentTwo y) (hnoB : ∀ b ∈ B_set, ¬IsFactorTwo y b) :
      PeriodicTwo y ∨ (∀ (i : ℤ), ¬(y i = SL.S ∧ y (i + 1) = SL.S)) ∧ ∃ y₃, IsMorphImage theta y y₃ ∧ RecurrentTwo y₃
  • Climbing one level

    If x is y written in the tiles of a pair and y is z spelled by θ, then x is z written in the tiles of the next pair.

    theorem RoteFibonacciReversal.isHImage_nextPair_of_theta {sp : SuitablePair} {x : ℤ → Bool} {y : ℤ → SL} {z : ℤ → SL} (hh : IsHImage sp x y) (ht : IsMorphImage theta y z) :
      IsHImage (nextPair sp) x z

Periodic or the blocks of r

A block v of the avoider fits inside two neighbouring tiles of level |v|, which are long enough. Those two tiles are not both short, r contains every such pair written out at every level in one of the two alternations, and swapping 0 and 1 in a block of r gives a block of r, so v is a block of r. Conversely each block of r comes back in r within a bounded gap, so a long enough block of the avoider, being a block of r, contains it. The one-sided theorem follows by passing to a two-sided partner with the same blocks, and the theorem for Badkobeh and Ochem's binary word because it has the blocks of r.

  • A two-sided recurrent avoider is periodic or has the blocks of r

    Every two-sided infinite word of 0s and 1s in which every block occurs at least twice and which avoids x x xᴿ is periodic or has exactly the same blocks as r.

    theorem RoteFibonacciReversal.rote_fib_rigidity_two_sided {x : ℤ → Bool} (hrec : RecurrentTwo x) (hav : AvoidsXXXRTwo x) :
      PeriodicTwo x ∨ ∀ (u : List Bool), IsFactorTwo x u ↔ IsFactorOne roteFib u
  • A one-sided recurrent avoider is periodic or has the blocks of r

    Every one-sided infinite word of 0s and 1s in which every block occurs at least twice and which avoids x x xᴿ is periodic or has exactly the same blocks as the Rote–Fibonacci word r.

    theorem RoteFibonacciReversal.rote_fib_rigidity_one_sided {x : ℕ → Bool} (hrec : RecurrentOne x) (hav : AvoidsXXXROne x) :
      PeriodicOne x ∨ HasSameFactorsOne x roteFib
  • A one-sided recurrent avoider is periodic or has the blocks of Badkobeh and Ochem's binary word

    Every one-sided recurrent word of 0s and 1s avoiding x x xᴿ is periodic or has exactly the same blocks as Badkobeh and Ochem's binary word, coded from b₅.

    theorem RoteFibonacciReversal.rote_fib_rigidity_grf_b5 {x : ℕ → Bool} (hrec : RecurrentOne x) (hav : AvoidsXXXROne x) :
      PeriodicOne x ∨ HasSameFactorsOne x wGrf
  • r contains the blocks of the fixed point of Φ at every level

    For every level i and every block u of the fixed point of Φ, u written out in the level-i tiles, with one of the two starting swaps, is a block of r.

    theorem RoteFibonacciReversal.roteFib_contains_H_levelPair (i : ℕ) (u : List SL) (a.0 : IsFactorOne phiInf u) :
      ∃ ph, IsFactorOne roteFib (H (levelPair i) ph u)
  • The fixed point of Φ
  • Every pair but SS occurs in the fixed point of Φ

    SL, LS and LL are all blocks of the fixed point of Φ.

    theorem RoteFibonacciReversal.phiInf_has_non_SS_pair (a : SL) (b : SL) (h : ¬(a = SL.S ∧ b = SL.S)) :
      IsFactorOne phiInf [a, b]
  • A short block of x fits in two tiles

    If x is y written in the tiles of a pair and v is a block of x no longer than the short tile, then v is a stretch of two neighbouring letters of y written out, with some starting swap.

    theorem RoteFibonacciReversal.isHImage_factor_in_two_blocks {sp : SuitablePair} {x : ℤ → Bool} {y : ℤ → SL} (hh : IsHImage sp x y) {v : List Bool} (hv : IsFactorTwo x v) (hlen : v.length ≤ (blk sp SL.S).length) :
      ∃ k ph, v <:+: H sp ph [y k, y (k + 1)]

Every one-sided avoider repeats blocks 2 + φ times

Any one-sided infinite avoider, recurrent or not, holds the blocks of some two-sided recurrent word, found with Zorn's lemma. That word is periodic or has the blocks of r. If it is periodic, the avoider has blocks with a period repeated as often as one likes; if not, the avoider holds every block of r, including blocks repeating as close to 2 + φ times as one likes. Either way the critical exponent, the supremum of length over period, is at least 2 + φ.

  • Every one-sided avoider has critical exponent at least 2 + φ

    For every one-sided infinite word w of 0s and 1s avoiding x x xᴿ, recurrent or not, the critical exponent of w is at least 2 + φ.

    theorem RoteFibonacciReversal.arbitrary_avoider_critExpEReal_ge_two_add_phi {w : ℕ → Bool} (hav : AvoidsXXXROne w) :
      ↑(2 + φ) ≤ critExpEReal w
  • The critical exponent
  • A period of a finite word
  • Every avoider has blocks repeating nearly 2 + φ times

    For every avoider w and every ε > 0, w has a nonempty block u with period p ≥ 1 and |u|/p > 2 + φ − ε.

    theorem RoteFibonacciReversal.arbitrary_avoider_critExp_ge_two_add_phi {w : ℕ → Bool} (hav : AvoidsXXXROne w) (ε : ℝ) (hε : 0 < ε) :
      ∃ u p, u ≠ [] ∧ 1 ≤ p ∧ IsFactorOne w u ∧ IsPeriod u p ∧ 2 + φ - ε < ↑u.length / ↑p
  • An avoider holds high powers or all blocks of r

    Every one-sided avoider w either has a p ≥ 1 such that, for every k, it has a block of length k·p with period p, or has every block of r as a block.

    theorem RoteFibonacciReversal.arbitrary_avoider_dichotomy {w : ℕ → Bool} (hav : AvoidsXXXROne w) :
      (∃ p, 1 ≤ p ∧ ∀ (k : ℕ), ∃ u, u.length = k * p ∧ IsFactorOne w u ∧ IsPeriod u p) ∨
      ∀ (u : List Bool), IsFactorOne roteFib u → IsFactorOne w u
  • Every word holds a recurrent two-sided word

    For every one-sided word w of 0s and 1s there is a two-sided recurrent word x all of whose blocks are blocks of w.

    theorem RoteFibonacciReversal.exists_recurrentTwo_in_factors (w : ℕ → Bool) :
      ∃ x, RecurrentTwo x ∧ ∀ (u : List Bool), IsFactorTwo x u → IsFactorOne w u