The transitive tournament on five letters can be dodged
Result page Proof blueprint → Paper PDF Verification archive
Lean proves unconditionally that the endless binary word U = τ(b₅) avoids the xyx-formula of TT(5), every 47-letter binary word contains TT(4), and for k ≥ 3 the formula of TT(k) is 2-avoidable exactly when k ≥ 5.
The morphic binary word U = τ(b₅) avoids the xyx-formula of the 5-vertex transitive tournament TT(5), every binary word of length 17 contains TT(3) (sharp at 16), every binary word of length 47 contains TT(4) (sharp at 46), every single-arc deletion of TT(5) is unavoidable on {0, 1} (sharp lengths 46 to 74), and for every k ≥ 3 the formula of TT(k) is 2-avoidable if and only if k ≥ 5. All are proved unconditionally in Lean.
Ochem and Rosenfeld (2021) listed showing that the xyx-formula of the transitive tournament on 5 vertices is 2-avoidable among the things they had attempted "without success". Edition 3 proves unconditionally inside Lean 4 that the explicit binary image U = τ(b₅) avoids TT(5), settles every TT(k) for k ≥ 3, and proves TT(5) is fragment-minimal.
The endless 0-1 string U = τ(b₅) avoids the formula of TT(5); with the 17- and 47-letter bounds, TT(k) for k ≥ 3 is 2-avoidable exactly when k ≥ 5
Walkthrough: 5 of 5 main results in Lean
Lean re-proves Ochem and Rosenfeld’s homomorphism lemma and builds their word b₅ itself. The two descent provers run outside Lean and feed nothing into its proof. Thue’s ternary word is used only for the paper’s remark on avoidability index 3, which Lean does not state.
Published inputs
- Ochem & Rosenfeld (2021, Section 2) (Ported into Lean): Introduced the replacement rule f (0 → 01, 1 → 23, 2 → 4, 3 → 21, 4 → 0) and its fixed point b₅, the endless string on the letters 0 to 4, beginning with 0, that f leaves unchanged; Lean builds b₅ from f.
- Ochem & Rosenfeld (2021, Lemma 18) (Re-proved in Lean): If an arrow-keeping map runs from H to G and the formula of H is 2-avoidable, so is the formula of G; proved again in Lean.
- Ochem & Rosenfeld (2021, Theorem 15) (Assumed outside Lean): Thue’s ternary word w₃ avoids the formula of TT(3), and so that of TT(4).
What this paper adds
- TT(3) at 17 letters & the tools of the descent: Every 0-1 string of 17 letters contains TT(3); f lengthens b₅-shaped strings of 3 or more letters; τ decodes factors of b₅; Descent soundness
- Kernel avoidance of TT(5) & TT(4)/minimality trees: U = τ(b₅) avoids TT(5) inside Lean; TT(4) at length 47 & all ten single-arc deletions in Lean
- Exact 2-avoidability threshold (all k ≥ 3): TT(k), k ≥ 3, is 2-avoidable exactly when k ≥ 5
TT(k), k ≥ 3, is 2-avoidable iff k ≥ 5 (all 5/5 in Lean)
Lean proves unconditionally that U = τ(b₅) avoids TT(5), every length-47 binary word contains TT(4), TT(5) is fragment-minimal, and for every k ≥ 3 the formula of TT(k) is 2-avoidable exactly when k ≥ 5.
All 5 of 5 main results proved unconditionally inside pure-kernel Lean 4 + Mathlib with zero external certificates.
Listed as open in the paper
- Whether the graph on the factors of U, joining x and y when xyx or yxy is a factor of U, can be coloured with 4 colours so that joined factors differ (Conjecture 8, part 1).
- Whether the number of 0-1 strings of n letters that avoid the formula of TT(5) grows exponentially or polynomially in n (Conjecture 8, part 2).
Adjacent prior work (not used as inputs)
- Ochem & Rosenfeld (2021, Section 7): Listed showing that the formula of TT(5) is 2-avoidable among the things they had attempted “without success”; this paper answers it.
- Ochem & Rosenfeld (2021, Theorems 19 and 23): Proved that the formula of every directed cycle needs exactly 3 letters to be avoided, and that the complete loopless digraph on 4 vertices, with all 12 arcs, is 2-avoidable.
- Cassaigne’s algorithm, in Ochem & Rosenfeld (2021): Ochem and Rosenfeld check avoidance with Cassaigne’s algorithm for circular HD0L languages. The Lean proof here does not use it.
- Badkobeh & Ochem (2023): Characterize two other 0-1 images of b₅, h₁₂(b₅) and c(b₅), by what they avoid. The paper’s script compute.py, not Lean, checks that U has a different factor set from each, even after reversal or complement.
- Domenech & Ochem (2021): Showed that every minimally nice formula on at most 3 variables, including F_C3, is avoided up to reversal by a ternary word.
- Ochem & Rosenfeld (2017); Gamard, Ochem, Richomme & Séébold (2018): Decided 2-avoidability for every formula with at most two variables and determined the avoidability index of every circular formula.
Four blocks in the opening letters of U
Build b₅ from 0 by the rule f: 0 → 01 → 0123 → 0123421 → 01234210423 → 01234210423010421. Replace each letter by its τ block (0 → 01, 1 → 1001, 2 → 0110, 3 → 1, 4 → 0) and U begins 0110010110100. In its leading 9 letters take A = 0, B = 1 and C = 01: ABA = 010 is letters 5 to 7, ACA = 0010 is letters 4 to 7 and BCB = 1011 is letters 6 to 9. Adding D = 10 gives TT(4) within the leading 13 letters: ADA = 0100 is letters 10 to 13, BDB = 1101 is letters 8 to 11 and CDC = 011001 is letters 1 to 6. The certified claim that U avoids TT(5) says no choice of five blocks A to E, these or any others, ever works.
Blocks, formulas and avoiding
An arrow diagram stands for a formula, one fragment XYX for each arrow X → Y. A string contains the formula when some non-empty block for each vertex puts every fragment in it as a factor, and the formula is 2-avoidable when some endless 0-1 string contains no occurrence. An arrow-keeping map from H to G carries occurrences of G back to occurrences of H, so TT(5) sitting inside TT(k) makes every TT(k) with k ≥ 5 2-avoidable once TT(5) is.
- 2-avoidable
- A factor of a string
- Factor means infix
- A string is a factor of itself
- A factor of a factor is a factor
- A string is a factor of anything it begins
- A string is a factor of anything it ends
- A factor of the start is a factor of the whole
- Renaming letters keeps factors
- A factor is no longer than the string
- A factor sits at some position
- Reading u at a position shows it is a factor
- The start of an endless string
- The start of length n has n letters
- The letters of a start are those of W
- A shorter start begins a longer one
- A factor of an endless string
- A factor of W is a factor of a start
- A factor of a start is a factor of W
- Renaming letters keeps factors of W
- Arrow diagram
- Arrow-keeping map
- Occurrence of a formula in a string
- Occurrence of a formula in an endless string
- A string avoids a formula
- An endless string avoids a formula
- An occurrence in a factor is one in the whole
- An occurrence in the start is one in the whole
- An occurrence in a start is one in W
If every string of one length contains a formula, it is not 2-avoidable
If every 0-1 string of N letters contains the formula of G, then no endless 0-1 string avoids it, since its start of N letters already contains it.
theorem XYXAvoid.not_avoidable2_of_forall_len {V : Type u_1} {G : LooplessDigraph V} (N : ℕ) (hN : ∀ (w : List Bool), w.length = N → OccursDigraph G w) : ¬Avoidable2 G- Renaming letters keeps occurrences
- Renaming letters keeps occurrences in W
Swapping 0 and 1 changes nothing
A 0-1 string with every 0 turned into 1 and every 1 into 0 contains the formula of G exactly when the original string does.
theorem XYXAvoid.occursDigraph_map_not_iff {V : Type u_1} {G : LooplessDigraph V} (w : List Bool) : OccursDigraph G (List.map not w) ↔ OccursDigraph G w- A cube contains every formula
- A cube in W contains every formula
- An arrow-keeping map carries occurrences back
- An arrow-keeping map carries occurrences back in W
A string that avoids H avoids G when H maps into G
If there is an arrow-keeping map from H to G and W avoids the formula of H, then W avoids the formula of G.
theorem XYXAvoid.avoidsInf_of_hom {V₁ : Type u_1} {V₂ : Type u_2} {α : Type u_3} {H : LooplessDigraph V₁} {G : LooplessDigraph V₂} (φ : DigraphHom H G) {W : ℕ → α} (hav : AvoidsDigraphInf H W) : AvoidsDigraphInf G W2-avoidability passes along an arrow-keeping map
If there is an arrow-keeping map from H to G and the formula of H is 2-avoidable, then so is the formula of G.
theorem XYXAvoid.avoidable2_of_hom {V₁ : Type u_1} {V₂ : Type u_2} {H : LooplessDigraph V₁} {G : LooplessDigraph V₂} (φ : DigraphHom H G) (hH : Avoidable2 H) : Avoidable2 G- The transitive tournament TT(k)
- TT(m) sits inside TT(n)
If TT(5) is 2-avoidable, so is every TT(k) with k ≥ 5
If the formula of TT(5) is 2-avoidable, then so is the formula of TT(k) for every k ≥ 5, because TT(5) sits inside TT(k).
theorem XYXAvoid.tt_k_avoidable2_of_tt5 (h5 : Avoidable2 (TT 5)) (k : ℕ) (a.0 : 5 ≤ k) : Avoidable2 (TT k)
- If TT(n) is not 2-avoidable, neither is TT(m) for m ≤ n
Every 0-1 string of 17 letters contains TT(3)
A decision tree with 132 leaves reads a string that begins with 0, one letter at a time, and at each leaf names blocks a, b, c with aba, aca and bcb already in the letters read. Lean evaluates the tree check to depth 16 and proves that a passed check covers every string of 17 letters that begins with 0. Strings that begin with 1 follow by swapping 0 and 1, so no endless 0-1 string avoids TT(3), and the 16-letter string 0011010110101100 shows that 17 cannot be lowered.
Every 0-1 string of 17 letters contains TT(3)
For every 0-1 string of 17 letters there are non-empty blocks A, B, C with ABA, ACA and BCB all factors of it.
theorem XYXAvoid.tt3_unavoidable_17 (w : List Bool) (hw : w.length = 17) : OccursDigraph (TT 3) w
TT(3) is not 2-avoidable
No endless 0-1 string avoids the formula of TT(3).
theorem XYXAvoid.tt3_not_avoidable2 : ¬Avoidable2 (TT 3)
- Decision tree
- u sits at position p
- A passed position check gives a factor
- Checking a tree for TT(3)
- A start can be extended by one letter
A passed tree check proves TT(3) occurs
If the tree check passes from the start pref with d letters to go, then every 0-1 string that begins with pref and has d more letters contains the formula of TT(3).
theorem XYXAvoid.checkTT3Tree_sound (t : CertTree3) (pref : List Bool) (d : ℕ) (a.0 : checkTT3Tree t pref d = true) (w : List Bool) (a.0 : pref <+: w) (a.0 : w.length = pref.length + d) : OccursDigraph (TT 3) w
- The tree for TT(3)
The TT(3) tree passes
The tree for TT(3) passes the check from the start 0 with 16 letters to go; Lean evaluates it.
theorem XYXAvoid.tt3CertTree_valid : checkTT3Tree tt3CertTree [false] 16 = true
- The XYX pairs starting at one position
- Removing repeated pairs
- Removing repeats keeps every pair
- All XYX pairs of a string
- Where an XYX factor sits
- The pair list misses no pair
- Searching a string for TT(3)
The search finds every TT(3) occurrence
If w contains the formula of TT(3), the search for it says yes.
theorem XYXAvoid.hasTT3_of_occurs {w : List Bool} (hocc : OccursDigraph (TT 3) w) : hasTT3 w = true- The string 0011010110101100
- 0011010110101100 has 16 letters
- The search finds no TT(3) in 0011010110101100
Some 0-1 string of 16 letters avoids TT(3)
There is a 0-1 string of 16 letters, 0011010110101100, that avoids the formula of TT(3), so 17 cannot be lowered.
theorem XYXAvoid.tt3_sharp_16 : ∃ w, w.length = 16 ∧ AvoidsDigraph (TT 3) w
The endless strings b₅ and U
A replacement rule gives each letter a block. Applying f: 0 → 01, 1 → 23, 2 → 4, 3 → 21, 4 → 0 again and again from 0 gives rows that each begin the next, and Lean builds from them the endless string b₅ = 01234210423010421…. Replacing each letter of b₅ by its block under τ: 0 → 01, 1 → 1001, 2 → 0110, 3 → 1, 4 → 0 gives the endless 0-1 string U, and Lean checks its leading 100 letters and finds TT(3) and TT(4) in its leading 9 and 13.
- The endless string U
- Applying a replacement rule
- The empty string stays empty
- The image of a followed by w
- The image of one letter
- The image of a join is the join of images
- Applying a rule n times
- The endless string grown by a rule
- Applying a rule to an endless string
- The rule f
- The endless string b₅
- The rule τ
- Writing a 0-1 string with digits
Growing and decoding on factors of b₅
Lean proves that any two neighbouring letters of b₅ form one of 9 pairs, because the pairs of each row come from pairs of the row before. Checking the cases of three letters in a row shows that f makes every b₅-shaped string of 3 or more letters longer. A decoder that reads at most 5 letters names the leading letter of any τ image of a b₅-shaped string, so τ can be decoded on factors of b₅: two of them with the same image are equal.
τ can be decoded on factors of b₅
If two factors of b₅ have the same image under τ, they are equal.
theorem XYXAvoid.applyMorph_tau_injective_on_b5_factors {u : List (Fin 5)} {v : List (Fin 5)} (hu : IsFactorInf u b5) (hv : IsFactorInf v b5) (heq : applyMorph tau u = applyMorph tau v) : u = vf makes every b₅-shaped string of 3 or more letters longer
If u is b₅-shaped and has at least 3 letters, then its image under f has more letters than u.
theorem XYXAvoid.fB5_strictly_expanding_on_validB5 {u : List (Fin 5)} (hu : ValidB5 u) (hlen : 3 ≤ u.length) : u.length < (applyMorph fB5 u).length- The 9 neighbour pairs
- A b₅-shaped string
f keeps strings b₅-shaped
The image of a b₅-shaped string under f is b₅-shaped.
theorem XYXAvoid.validB5_applyMorph_fB5 {w : List (Fin 5)} (hw : ValidB5 w) : ValidB5 (applyMorph fB5 w)Every row from 0 is b₅-shaped
The string got from 0 by applying f n times is b₅-shaped, for every n.
theorem XYXAvoid.validB5_iterMorph_fB5 (n : ℕ) : ValidB5 (iterMorph fB5 n [0])
Every factor of b₅ is b₅-shaped
Every factor of the endless string b₅ is b₅-shaped: any two neighbouring letters form one of the 9 pairs.
theorem XYXAvoid.validB5_of_isFactorInf_b5 {u : List (Fin 5)} (h : IsFactorInf u b5) : ValidB5 uThree letters in a row grow to at least 4
If ab and bc are both among the 9 pairs, then the blocks f(a), f(b) and f(c) have at least 4 letters in all.
- The τ decoder
The decoder names the leading letter
On the τ image of a b₅-shaped string a followed by u, the decoder names a.
theorem XYXAvoid.tauHeadTag_applyMorph (a : Fin 5) (u : List (Fin 5)) (hu : ValidB5 (a :: u)) : tauHeadTag (applyMorph tau (a :: u)) = some a
Equal τ images start with the same letter
If two b₅-shaped strings, each with at least one letter, have the same τ image, they start with the same letter.
τ can be decoded on b₅-shaped strings
If two b₅-shaped strings have the same image under τ, they are equal.
Why a closed list of states rules out an occurrence
A descent keeps a list of states, each a system of demands an occurrence must meet, with a count such as the number of blocks not yet fixed. Lean proves that if every possible occurrence would satisfy the starting state at its total block length, and every satisfied state of the list leads to one with a lower count, or with the same count and a smaller size, then there is no occurrence. The reason is that pairs of whole numbers ordered this way cannot go down forever.
A closed list where the count falls, or the size falls at equal count, proves avoidance
Give each state a count. Suppose every occurrence of G in W satisfies a starting state of a list at its total block length, and every satisfied state of the list leads to one with a lower count, satisfied at some size, possibly a larger one, or with the same count, satisfied at a smaller size. Then W avoids G.
theorem XYXAvoid.freeze_or_desub_soundness {V : Type u_1} {α : Type u_2} {State : Type u_3} [Fintype V] (G : LooplessDigraph V) (W : ℕ → α) (freeVars : State → ℕ) (Sat : State → ℕ → Prop) (Cert : Set State) (s₀ : State) (hstart : s₀ ∈ Cert) (hinit : ∀ (h : V → List α), (∀ (v : V), h v ≠ []) → (∀ (u v : V), G.adj u v → IsFactorInf (h u ++ h v ++ h u) W) → Sat s₀ (occMeasure h)) (hclosed : ∀ s ∈ Cert, ∀ (μ : ℕ), Sat s μ → (∃ s' ∈ Cert, freeVars s' < freeVars s ∧ ∃ μ', Sat s' μ') ∨ ∃ s' ∈ Cert, freeVars s' = freeVars s ∧ ∃ μ' < μ, Sat s' μ') : AvoidsDigraphInf G W- Total block length
Unconditional avoidance of TT(5), minimality, and the threshold
Lean checks decision trees proving TT(4) unavoidable at length 47 (sharp at 46) and six single-arc deletions of TT(5) unavoidable, and reduces the other four deletions to TT(4), so all ten are unavoidable (sharp lengths 46 to 74). It proves that U = τ(b₅) avoids TT(5) by an exact interval-exchange coding of b₅ and a split on how many of the five blocks have at least 16 letters. Plugging both into the threshold reduction proves unconditionally that TT(k) (k ≥ 3) is 2-avoidable if and only if k ≥ 5.
TT(4) is not 2-avoidable
Follows from the kernel-checked length-47 decision tree for TT(4).
U = τ(b₅) contains no occurrence of TT(5)
No five non-empty blocks put every fragment of the formula of TT(5) in U. Lean splits on how many of the five blocks have at least 16 letters (none, one, two, or three or more) and rules out each case.
TT(4) unavoidable at length 47 and TT(5) fragment-minimal
Proves every 47-letter binary word contains TT(4) (sharp at 46) and removing any single arc of TT(5) leaves an unavoidable formula with sharp avoiding lengths 46 to 74.
theorem XYXAvoid.prop_tt4_min_unconditional : (∀ (w : List Bool), w.length = 47 → OccursDigraph (TT 4) w) ∧ (∃ w, w.length = 46 ∧ AvoidsDigraph (TT 4) w) ∧ ¬Avoidable2 (TT 4) ∧ ∀ (a b : Fin 5), ↑a < ↑b → (∀ (w : List Bool), w.length = tt5MinusSharpLen a b + 1 → OccursDigraph (tt5Minus a b) w) ∧ (∃ w, w.length = tt5MinusSharpLen a b ∧ AvoidsDigraph (tt5Minus a b) w) ∧ ¬Avoidable2 (tt5Minus a b) ∧ 46 ≤ tt5MinusSharpLen a b ∧ tt5MinusSharpLen a b ≤ 74For k ≥ 3, TT(k) is 2-avoidable iff k ≥ 5 (unconditional)
Discharges both hypotheses of the threshold theorem inside Lean to settle the entire transitive-tournament family unconditionally.
theorem XYXAvoid.thm_threshold_unconditional (k : ℕ) (a.0 : 3 ≤ k) : Avoidable2 (TT k) ↔ 5 ≤ k
U = τ(b₅) avoids TT(5), so TT(5) is 2-avoidable
Proves unconditionally inside Lean that the endless binary word U = τ(b₅) contains no occurrence of the xyx-formula of TT(5).
theorem XYXAvoid.thm_tt5_avoid_unconditional : AvoidsDigraphInf (TT 5) U ∧ Avoidable2 (TT 5)
Given both facts as hypotheses, TT(k) for k ≥ 3 is 2-avoidable exactly when k ≥ 5
Suppose the formula of TT(4) is not 2-avoidable, and U avoids the formula of TT(5). Then for every k ≥ 3, the formula of TT(k) is 2-avoidable exactly when k ≥ 5.
theorem XYXAvoid.tt_k_avoidability_threshold (h_tt4_unavoid : ¬Avoidable2 (TT 4)) (h_U_avoids_tt5 : AvoidsDigraphInf (TT 5) U) (k : ℕ) (a.0 : 3 ≤ k) : Avoidable2 (TT k) ↔ 5 ≤ k
If U avoids TT(5), every TT(k) with k ≥ 5 is 2-avoidable
If the endless string U avoids the formula of TT(5), then the formula of TT(k) is 2-avoidable for every k ≥ 5.