AFTD Auto-Formalizing Theoretical Domains

op874_sparse_words_proper_and_pair_rich

theoremverified

The sparse fixed factor words are proper and matching endpoint color pairs are unequal.

Statement

theorem op874_sparse_words_proper_and_pair_rich :
    (∀ (s : Bool) (i : Fin 5), In1098Sparse.word s (i - 1) ≠ In1098Sparse.word s i) ∧
    (∀ i : Fin 5, let j := In1098Sparse.perm i;
      ¬ ((In1098Sparse.word false (i-1) = In1098Sparse.word true (j-1) ∧
          In1098Sparse.word false i = In1098Sparse.word true j) ∨
         (In1098Sparse.word false (i-1) = In1098Sparse.word true j ∧
          In1098Sparse.word false i = In1098Sparse.word true (j-1))))
Source
Sparse fixed-high matching-factor obstruction, experiments 36281 and 36285.
Verified
22 Nov 2026
Axioms
propext
Built on 1

The proof, explained

The theorem states two combinatorial properties of two cyclic words of length 5: adjacent letters along each cyclic word are distinct, and a specified permutation between their index sets produces no matching adjacent letter pairs (in either orientation). Since both properties are universal quantifications over finite sets with decidable equality, the proof proceeds by exhaustive finite verification using the `decide` tactic.

  1. Both cyclic words avoid adjacent identical letters, and no adjacent pair in the first word matches the corresponding adjacent pair in the second word under the given index permutation. automation

    The theorem asserts two properties: first, that for both choices of the boolean parameter $s$ and each index $i \in \mathrm{Fin}\ 5$, the cyclic word has distinct adjacent letters $\mathrm{word}(s, i-1) \neq \mathrm{word}(s, i)$; second, that for each $i \in \mathrm{Fin}\ 5$ and $j = \mathrm{perm}(i)$, the adjacent pair of letters in the first word does not equal the adjacent pair in the second word, either in order or reversed. Because the domains $\mathrm{Bool}$ and $\mathrm{Fin}\ 5$ are finite (with 2 and 5 elements, respectively) and all letter values are explicit constants in $\mathbb{N}$, the proposition is decidable. The `decide` tactic verifies the claim by exhaustively computing all finitely many cases ($2 \times 5 = 10$ tests for the first condition, and 5 tests for the second).

    line 7

              In1098Sparse.word false i = In1098Sparse.word true (j-1)))) := by decide

Written by a model (gemini-3.8-flash) from the Lean proof and the goal states Lean reported at each step. Lean verified the proof; this explanation is a reading aid and is not itself machine-checked.

Lean source view module on GitHub

theorem op874_sparse_words_proper_and_pair_rich :    (∀ (s : Bool) (i : Fin 5), In1098Sparse.word s (i - 1) ≠ In1098Sparse.word s i) ∧    (∀ i : Fin 5, let j := In1098Sparse.perm i;      ¬ ((In1098Sparse.word false (i-1) = In1098Sparse.word true (j-1) ∧          In1098Sparse.word false i = In1098Sparse.word true j) ∨         (In1098Sparse.word false (i-1) = In1098Sparse.word true j ∧          In1098Sparse.word false i = In1098Sparse.word true (j-1)))) := by decide
See it in the graphDiscuss this resultChallenge it