Documentation

CslibFrontier.Foundations.Combinatorics.Words.Zimin

Zimin's Theorem and the Bean–Ehrenfeucht–McNulty Characterization #

This module establishes the equivalence of four conditions characterizing unavoidable word patterns ([BeanEhrenfeuchtMcNulty1979, Theorem 3.22, pp. 284–285]; [Zimin1984, Theorem 1]; [Sapir2014, Theorem 2.5.14]): a finite pattern w : List A is unavoidable if and only if some canonical Zimin word ziminWord k reflects w, if and only if w reduces to [] by iteratively deleting free sets (Cslib.Word.IsFreeSetReducible), if and only if w reduces to [] by iteratively deleting free letters and identifying distinct occurring letters (Cslib.Word.IsBEMReducible).

Note the formalization conventions relative to the classical literature:

To establish necessity (IsUnavoidable w → ∃ k, Reflects (ziminWord k) w) constructively under standard Lean axioms, we iterate a q-uniform affine-line block morphism over Fin q × Fin q for q = w.length + 2, project along a boundary-safe coordinate slot found by pigeonhole, and lift reflection in ziminWord k₀ across deleted non-occurring-slot letters via rainbow-padded Zimin words. As corollaries we deduce that every nonempty unavoidable pattern admits a free letter and that every unavoidable pattern over r letters has length at most 2 ^ r - 1.

Main results #

Every unavoidable pattern is reflected by some canonical Zimin word ziminWord k ([Zimin1984, Theorem 1]; [Sapir2014, Theorem 2.5.14]). This gives the existential-index form (∃ k, Reflects (ziminWord k) w) using non-erasing substitutions on occurring letters and contiguous factor containment.

Zimin's Theorem ([Zimin1984, Theorem 1]; [Sapir2014, Theorem 2.5.14]): a pattern w : List A is unavoidable if and only if some canonical Zimin word ziminWord k reflects w.

This states the existential-index characterization (∃ k, Reflects (ziminWord k) w), whereas [Sapir2014, Theorem 2.5.14] fixes k to the number of distinct letters occurring in w; reflection (Reflects) uses a non-erasing substitution on letters occurring in w and contiguous factor containment.

Zimin–Sapir Theorem ([Zimin1984, Theorem 1]; [Sapir2014, Theorem 2.5.14]): a pattern w : List A is unavoidable if and only if w reduces to [] by iteratively deleting free sets.

Here IsFreeSetReducible terminates at the empty word [] (including the empty pattern) rather than at a single-letter word as in [Sapir2014, Theorem 2.5.14]; for nonempty words the two stopping conventions are equivalent by one final deletion of the remaining singleton.

Deleting a free set reflects unavoidability backwards: if X is a free set for w and deleteLetters X w is unavoidable, then w is unavoidable.

Deleting a free letter reflects unavoidability backwards: if x is a free letter for w and deleteLetter x w is unavoidable, then w is unavoidable.

Bean–Ehrenfeucht–McNulty Theorem ([BeanEhrenfeuchtMcNulty1979, Theorem 3.22, pp. 284–285]): a pattern w : List A is unavoidable if and only if w reduces to [] by iteratively deleting a free letter or identifying two distinct letters occurring in w.

Here IsBEMReducible terminates at the empty word [] (including the empty pattern) rather than at a word of length 1 as in [BeanEhrenfeuchtMcNulty1979, Theorem 3.22]; for nonempty words the two stopping conventions are equivalent by one final free-letter deletion of the singleton. Pattern avoidance (IsUnavoidable) uses non-erasing substitutions on occurring letters and contiguous factor containment.

theorem Cslib.Word.IsUnavoidable.exists_isFreeLetter {A : Type u_1} {w : List A} (hw : IsUnavoidable w) (hne : w ≠ []) :
∃ (x : A), IsFreeLetter w x

Every nonempty unavoidable pattern has at least one free letter.

theorem Cslib.Word.IsUnavoidable.length_le_two_pow_card_sub_one {A : Type u_1} {w : List A} (hw : IsUnavoidable w) (s : Finset A) (hs : ∀ a ∈ w, a ∈ s) :
w.length ≤ 2 ^ s.card - 1

Every unavoidable pattern w : List A whose letters belong to a finite set s : Finset A has length at most 2 ^ s.card - 1 (matching [BeanEhrenfeuchtMcNulty1979, Theorem 3.13, p. 280]).

Over a [Fintype A] alphabet, every unavoidable pattern w : List A has length at most 2 ^ Fintype.card A - 1.