Keyboard shortcuts

Press ← or → to navigate between chapters

Press ? to show this help

Press Esc to hide this help

ForbiddenWordCounting

Abstract

First-hit decompositions give the forbidden binary-word counting identity.

Definition 1.1 (words).

Formalization. D5/S1/Words/Forbidden/ForbiddenWordCounting.words (✓ std3).

Source. Repository-derived.

Commentary.

The image of all functions from Fin m to Bool under List.ofFn is precisely the set of length-m binary lists, including the empty list when m is zero.

Theorem 1.2 (mem_words).

Proof. Machine-checked in Lean as D5/S1/Words/Forbidden/ForbiddenWordCounting.mem_words (✓ std3). ∎

Source. Repository-derived.

Commentary.

The displayed statement uses the literal binary-word counts and border operations. All counts in real or rational arithmetic carry the displayed coercions. Nat.sub denotes truncated subtraction. All hypotheses and parameters have their displayed domains.

Definition 1.3 (omega).

Formalization. D5/S1/Words/Forbidden/ForbiddenWordCounting.omega (✓ std3).

Citation. Miklós Bóna, Balázs Maga, Jacob Richey (2026). Letter frequency in shifts of finite type with one forbidden word. URL: https://arxiv.org/abs/2606.06655v2.

Commentary.

“For positive integer and any word of length , denote by Ωₙʷ the set of words of length with no factor, i.e.” (Definition 2.1, p. 3.)

Words are List Bool, true is 1, and List.IsInfix is factor containment. The source definition at positive lengths is extended to length zero by the same filter.

Theorem 1.4 (mem_omega).

Proof. Machine-checked in Lean as D5/S1/Words/Forbidden/ForbiddenWordCounting.mem_omega (✓ std3). ∎

Source. Repository-derived.

Commentary.

The displayed statement uses the literal binary-word counts and border operations. All counts in real or rational arithmetic carry the displayed coercions. Nat.sub denotes truncated subtraction. All hypotheses and parameters have their displayed domains.

Definition 1.5 (rho).

Formalization. D5/S1/Words/Forbidden/ForbiddenWordCounting.rho (✓ std3).

Citation. Miklós Bóna, Balázs Maga, Jacob Richey (2026). Letter frequency in shifts of finite type with one forbidden word. URL: https://arxiv.org/abs/2606.06655v2.

Commentary.

“For any word and positive integer , denote by the frequency of s over all words in Ωₙʷ:” (Definition 2.4, pp. 3–4.) “Set if it exists.” (p. 4.)

The quotient is the literal source sum divided by m times the number of avoiding words. List.count true counts ones. Counts are coerced into the reals; division is real division. The value at m = 0 is a totalization that has no effect on convergence.

Definition 1.6 (IsBorder).

Formalization. D5/S1/Words/Forbidden/ForbiddenWordCounting.IsBorder (✓ std3).

Citation. Miklós Bóna, Balázs Maga, Jacob Richey (2026). Letter frequency in shifts of finite type with one forbidden word. URL: https://arxiv.org/abs/2606.06655v2.

Commentary.

“Fix two words , with . Denote by the set of borders of and :” (Definition 2.6, p. 4.)

The source border relation is specialized to v = w. Nonempty words are both a prefix and a suffix; the whole word is included.

Definition 1.7 (BalancedBorders).

Formalization. D5/S1/Words/Forbidden/ForbiddenWordCounting.BalancedBorders (✓ std3).

Citation. Miklós Bóna, Balázs Maga, Jacob Richey (2026). Letter frequency in shifts of finite type with one forbidden word. URL: https://arxiv.org/abs/2606.06655v2.

Commentary.

“A word has balanced borders if for all , .” (Definition 3.2, p. 9.)

The displayed equality has the two sides exchanged and uses List.count true for the number of ones.

Theorem 1.8 (self_border).

Proof. Machine-checked in Lean as D5/S1/Words/Forbidden/ForbiddenWordCounting.self_border (✓ std3). ∎

Source. Repository-derived.

Commentary.

The displayed statement uses the literal binary-word counts and border operations. All counts in real or rational arithmetic carry the displayed coercions. Nat.sub denotes truncated subtraction. All hypotheses and parameters have their displayed domains.

Definition 1.9 (avoidCoeff).

Formalization. D5/S1/Words/Forbidden/ForbiddenWordCounting.avoidCoeff (✓ std3).

Source. Repository-derived.

Commentary.

The displayed statement uses the literal binary-word counts and border operations. All counts in real or rational arithmetic carry the displayed coercions. Nat.sub denotes truncated subtraction. All hypotheses and parameters have their displayed domains.

Definition 1.10 (avoidSeries).

Formalization. D5/S1/Words/Forbidden/ForbiddenWordCounting.avoidSeries (✓ std3).

Source. Repository-derived.

Commentary.

The displayed statement uses the literal binary-word counts and border operations. All counts in real or rational arithmetic carry the displayed coercions. Nat.sub denotes truncated subtraction. All hypotheses and parameters have their displayed domains.

Definition 1.11 (wordMonomial).

Formalization. D5/S1/Words/Forbidden/ForbiddenWordCounting.wordMonomial (✓ std3).

Source. Repository-derived.

Commentary.

The displayed statement uses the literal binary-word counts and border operations. All counts in real or rational arithmetic carry the displayed coercions. Nat.sub denotes truncated subtraction. All hypotheses and parameters have their displayed domains.

Theorem 1.12 (avoidCoeff_zero).

Proof. Machine-checked in Lean as D5/S1/Words/Forbidden/ForbiddenWordCounting.avoidCoeff_zero (✓ std3). ∎

Source. Repository-derived.

Commentary.

The empty word is the unique length-zero word avoiding a nonempty forbidden word, and its weight is one.

Definition 1.13 (letterSeries).

Formalization. D5/S1/Words/Forbidden/ForbiddenWordCounting.letterSeries (✓ std3).

Source. Repository-derived.

Commentary.

The displayed statement uses the literal binary-word counts and border operations. All counts in real or rational arithmetic carry the displayed coercions. Nat.sub denotes truncated subtraction. All hypotheses and parameters have their displayed domains.

Definition 1.14 (borderLengths).

Formalization. D5/S1/Words/Forbidden/ForbiddenWordCounting.borderLengths (✓ std3).

Source. Repository-derived.

Commentary.

The displayed statement uses the literal binary-word counts and border operations. All counts in real or rational arithmetic carry the displayed coercions. Nat.sub denotes truncated subtraction. All hypotheses and parameters have their displayed domains.

Definition 1.15 (overlapSeries).

Formalization. D5/S1/Words/Forbidden/ForbiddenWordCounting.overlapSeries (✓ std3).

Source. Repository-derived.

Commentary.

The displayed statement uses the literal binary-word counts and border operations. All counts in real or rational arithmetic carry the displayed coercions. Nat.sub denotes truncated subtraction. All hypotheses and parameters have their displayed domains.

Definition 1.16 (countingIdentity).

Formalization. D5/S1/Words/Forbidden/ForbiddenWordCounting.countingIdentity (✓ std3).

Source. Repository-derived.

Commentary.

The displayed statement uses the literal binary-word counts and border operations. All counts in real or rational arithmetic carry the displayed coercions. Nat.sub denotes truncated subtraction. All hypotheses and parameters have their displayed domains.

Definition 1.17 (imbalance).

Formalization. D5/S1/Words/Forbidden/ForbiddenWordCounting.imbalance (✓ std3).

Source. Repository-derived.

Commentary.

The displayed statement uses the literal binary-word counts and border operations. All counts in real or rational arithmetic carry the displayed coercions. Nat.sub denotes truncated subtraction. All hypotheses and parameters have their displayed domains.

Theorem 1.18 (mem_borderLengths).

Proof. Machine-checked in Lean as D5/S1/Words/Forbidden/ForbiddenWordCounting.mem_borderLengths (✓ std3). ∎

Source. Repository-derived.

Commentary.

The displayed statement uses the literal binary-word counts and border operations. All counts in real or rational arithmetic carry the displayed coercions. Nat.sub denotes truncated subtraction. All hypotheses and parameters have their displayed domains.

Theorem 1.19 (forbidden_word_counting_identity).

Proof. Machine-checked in Lean as D5/S1/Words/Forbidden/ForbiddenWordCounting.forbidden_word_counting_identity (✓ std3). ∎

Citation. Miklós Bóna, Balázs Maga, Jacob Richey (2026). Letter frequency in shifts of finite type with one forbidden word. URL: https://arxiv.org/abs/2606.06655v2.

Commentary.

This is the cleared-denominator form of the generating function identity in Fact 2.9, p. 5. A word is either avoiding or has a unique first-hit prefix. Appending the forbidden word records an overlap with a border. The two decompositions give the identity coefficient by coefficient.

Theorem 1.20 (full_mem_borderLengths).

Proof. Machine-checked in Lean as D5/S1/Words/Forbidden/ForbiddenWordCounting.full_mem_borderLengths (✓ std3). ∎

Source. Repository-derived.

Commentary.

The displayed statement uses the literal binary-word counts and border operations. All counts in real or rational arithmetic carry the displayed coercions. Nat.sub denotes truncated subtraction. All hypotheses and parameters have their displayed domains.

Theorem 1.21 (borderLengths_iff_border).

Proof. Machine-checked in Lean as D5/S1/Words/Forbidden/ForbiddenWordCounting.borderLengths_iff_border (✓ std3). ∎

Source. Repository-derived.

Commentary.

The displayed statement uses the literal binary-word counts and border operations. All counts in real or rational arithmetic carry the displayed coercions. Nat.sub denotes truncated subtraction. All hypotheses and parameters have their displayed domains.

Theorem 1.22 (omega_nonempty).

Proof. Machine-checked in Lean as D5/S1/Words/Forbidden/ForbiddenWordCounting.omega_nonempty (✓ std3). ∎

Source. Repository-derived.

Commentary.

The displayed statement uses the literal binary-word counts and border operations. All counts in real or rational arithmetic carry the displayed coercions. Nat.sub denotes truncated subtraction. All hypotheses and parameters have their displayed domains.

References