AFTD Auto-Formalizing Theoretical Domains

op874_cycle_palette_kernel

theoremverified

For four colors, the listed properness and adjacent-palette inequalities on an eight-edge cyclic word, together with two matching-palette distinctions, force a repetition between two consecutive colors among positions 1, 3, 5, and 7.

Statement

theorem op874_cycle_palette_kernel
    (a x c t d y b s : Fin 4)
    (h₁ : a ≠ s) (h₂ : a ≠ x) (h₃ : c ≠ x) (h₄ : c ≠ t)
    (h₅ : d ≠ t) (h₆ : d ≠ y) (h₇ : b ≠ y) (h₈ : b ≠ s)
    (h₉ : a ≠ b) (h₁₀ : c ≠ d) (h₁₁ : a ≠ c) (h₁₂ : d ≠ b)
    (hp : ¬ ((s = t ∧ a = d) ∨ (s = d ∧ a = t)))
    (hq : ¬ ((s = t ∧ b = c) ∨ (s = c ∧ b = t))) :
    x = t ∨ t = y ∨ y = s ∨ s = x
Source
Four-color arithmetic for the OP-874 local interface analysis, https://arxiv.org/abs/2610.41950.
Verified
26 Nov 2026
Axioms
Classical.choiceQuot.soundpropext
Used by 2

The proof, explained

The theorem is proved by contradiction using the pigeonhole principle on the four-element set of colors Fin 4. Assuming no consecutive vertices among x, t, y, s share a color, we consider candidate five-element subsets {a, c, s, t, x} and {b, d, s, t, y}; since Fin 4 cannot contain five distinct elements, this forces s = c ∨ t = a ∨ s = t and s = d ∨ t = b ∨ s = t. A third pigeonhole argument on {a, b, c, d, s} rules out s = t via the matching-palette conditions hp and hq. Finally, case analysis on the remaining alternatives (s = c or t = a, and s = d or t = b) contradicts the cycle properness or palette conditions in every branch.

  1. No five pairwise distinct elements can exist in Fin 4.

    Assuming five elements a, b, c, d, e in Fin 4 are pairwise distinct, the set {a, b, c, d, e} has cardinality 5. However, by Finset.card_le_univ and Fintype.card_fin, any subset of Fin 4 has cardinality at most |Fin 4| = 4. This yields 5 ≤ 4, an arithmetic contradiction closed by omega.

    lines 5–9

    uses Finset.card_le_univ, Fintype.card_fin

      have hs : ({a,b,c,d,e} : Finset (Fin 4)).card = 5 := by
        simp [hab,hac,had,hae,hbc,hbd,hbe,hcd,hce,hde]
      have hb := Finset.card_le_univ ({a,b,c,d,e} : Finset (Fin 4))
      simp only [Fintype.card_fin] at hb
      omega
  2. Assume for contradiction that no two consecutive colors among x, t, y, s are equal: x ≠ t, t ≠ y, y ≠ s, and s ≠ x.

    We begin a proof by contradiction by negating the target disjunction x = t ∨ t = y ∨ y = s ∨ s = x and pushing the negation inwards to obtain the conjunction of the four inequalities.

    lines 19–20

      by_contra hn
      push Not at hn
  3. Either s = c, t = a, or s = t.

    Suppose for contradiction that s ≠ c, t ≠ a, and s ≠ t. Then all ten pairs among the five colors a, c, s, t, x in Fin 4 are distinct: a ≠ c by h₁₁, a ≠ s by h₁, a ≠ t from the negated disjunction, a ≠ x by h₂, c ≠ s from the negated disjunction, c ≠ t by h₄, c ≠ x by h₃, s ≠ t from the negated disjunction, s ≠ x from the contradiction hypothesis hn, and t ≠ x from hn. Having five distinct colors in Fin 4 contradicts op874_no_five_distinct_high_colors.

    lines 21–24

    uses op874_no_five_distinct_high_colors

      have hA : s = c ∨ t = a ∨ s = t := by
        by_contra h
        push Not at h
        exact op874_no_five_distinct_high_colors a c s t x h₁₁ h₁ h.2.1.symm h₂ h.1.symm h₄ h₃ h.2.2 hn.2.2.2 hn.1.symm
  4. Either s = d, t = b, or s = t.

    Suppose for contradiction that s ≠ d, t ≠ b, and s ≠ t. Then all ten pairs among the five colors b, d, s, t, y in Fin 4 are distinct: b ≠ d by h₁₂, b ≠ s by h₈, b ≠ t from the negated disjunction, b ≠ y by h₇, d ≠ s from the negated disjunction, d ≠ t by h₅, d ≠ y by h₆, s ≠ t from the negated disjunction, s ≠ y from hn, and t ≠ y from hn. Having five distinct colors in Fin 4 again contradicts op874_no_five_distinct_high_colors.

    lines 25–28

    uses op874_no_five_distinct_high_colors

      have hB : s = d ∨ t = b ∨ s = t := by
        by_contra h
        push Not at h
        exact op874_no_five_distinct_high_colors b d s t y h₁₂.symm h₈ h.2.1.symm h₇ h.1.symm h₅ h₆ h.2.2 hn.2.2.1.symm hn.2.1
  5. s ≠ t.

    Suppose s = t. Then a ≠ d, since s = t ∧ a = d would contradict hp via Or.inl. Similarly, b ≠ c, since s = t ∧ b = c would contradict hq via Or.inl. Furthermore, substituting s = t into h₄ (c ≠ t) and h₅ (d ≠ t) gives c ≠ s and d ≠ s. Together with h₉ (a ≠ b), h₁₁ (a ≠ c), h₁ (a ≠ s), h₁₂ (d ≠ b), h₈ (b ≠ s), and h₁₀ (c ≠ d), all five elements a, b, c, d, s in Fin 4 are pairwise distinct, which contradicts op874_no_five_distinct_high_colors.

    lines 29–35

    uses Or.inl, op874_no_five_distinct_high_colors

      have hst : s ≠ t := by
        intro he
        have had : a ≠ d := by intro h; exact hp (Or.inl ⟨he,h⟩)
        have hbc : b ≠ c := by intro h; exact hq (Or.inl ⟨he,h⟩)
        have hcs : c ≠ s := by simpa [he] using h₄
        have hds : d ≠ s := by simpa [he] using h₅
        exact op874_no_five_distinct_high_colors a b c d s h₉ h₁₁ had h₁ hbc h₁₂.symm h₈ h₁₀ hcs hds
  6. Every remaining case leads to a contradiction, concluding the proof.

    We analyze the remaining cases of the disjunctions hA (s = c ∨ t = a ∨ s = t) and hB (s = d ∨ t = b ∨ s = t). The alternative s = t is ruled out in all branches by s ≠ t. If s = c, then s = d forces c = d (contradicting h₁₀), while t = b gives s = c ∧ b = t (contradicting hq via Or.inr). If t = a, then s = d gives s = d ∧ a = t (contradicting hp via Or.inr), while t = b forces a = b (contradicting h₉).

    lines 36–45

    uses Or.inr

      rcases hA with hsc | hta | he
      · rcases hB with hsd | htb | he
        · exact h₁₀ (hsc.symm.trans hsd)
        · exact hq (Or.inr ⟨hsc,htb.symm⟩)
        · exact hst he
      · rcases hB with hsd | htb | he
        · exact hp (Or.inr ⟨hsd,hta.symm⟩)
        · exact h₉ (hta.symm.trans htb)
        · exact hst he
      · exact hst he
Finset.card_le_univ
The cardinality of any finite subset of a finite type is at most the total cardinality of that type.
Fintype.card_fin
The cardinality of the standard finite type Fin n is equal to n.
op874_no_five_distinct_high_colors
No five elements in Fin 4 can be pairwise distinct, as Fin 4 has only four elements.
Or.inl
Proves a disjunction a ∨ b from a proof of the left alternative a.
Or.inr
Proves a disjunction a ∨ b from a proof of the right alternative b.

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

private theorem op874_no_five_distinct_high_colors (a b c d e : Fin 4)    (hab : a ≠ b) (hac : a ≠ c) (had : a ≠ d) (hae : a ≠ e)    (hbc : b ≠ c) (hbd : b ≠ d) (hbe : b ≠ e)    (hcd : c ≠ d) (hce : c ≠ e) (hde : d ≠ e) : False := by  have hs : ({a,b,c,d,e} : Finset (Fin 4)).card = 5 := by    simp [hab,hac,had,hae,hbc,hbd,hbe,hcd,hce,hde]  have hb := Finset.card_le_univ ({a,b,c,d,e} : Finset (Fin 4))  simp only [Fintype.card_fin] at hb  omegatheorem op874_cycle_palette_kernel    (a x c t d y b s : Fin 4)    (h₁ : a ≠ s) (h₂ : a ≠ x) (h₃ : c ≠ x) (h₄ : c ≠ t)    (h₅ : d ≠ t) (h₆ : d ≠ y) (h₇ : b ≠ y) (h₈ : b ≠ s)    (h₉ : a ≠ b) (h₁₀ : c ≠ d) (h₁₁ : a ≠ c) (h₁₂ : d ≠ b)    (hp : ¬ ((s = t ∧ a = d) ∨ (s = d ∧ a = t)))    (hq : ¬ ((s = t ∧ b = c) ∨ (s = c ∧ b = t))) :    x = t ∨ t = y ∨ y = s ∨ s = x := by  by_contra hn  push Not at hn  have hA : s = c ∨ t = a ∨ s = t := by    by_contra h    push Not at h    exact op874_no_five_distinct_high_colors a c s t x h₁₁ h₁ h.2.1.symm h₂ h.1.symm h₄ h₃ h.2.2 hn.2.2.2 hn.1.symm  have hB : s = d ∨ t = b ∨ s = t := by    by_contra h    push Not at h    exact op874_no_five_distinct_high_colors b d s t y h₁₂.symm h₈ h.2.1.symm h₇ h.1.symm h₅ h₆ h.2.2 hn.2.2.1.symm hn.2.1  have hst : s ≠ t := by    intro he    have had : a ≠ d := by intro h; exact hp (Or.inl ⟨he,h⟩)    have hbc : b ≠ c := by intro h; exact hq (Or.inl ⟨he,h⟩)    have hcs : c ≠ s := by simpa [he] using h₄    have hds : d ≠ s := by simpa [he] using h₅    exact op874_no_five_distinct_high_colors a b c d s h₉ h₁₁ had h₁ hbc h₁₂.symm h₈ h₁₀ hcs hds  rcases hA with hsc | hta | he  · rcases hB with hsd | htb | he    · exact h₁₀ (hsc.symm.trans hsd)    · exact hq (Or.inr ⟨hsc,htb.symm⟩)    · exact hst he  · rcases hB with hsd | htb | he    · exact hp (Or.inr ⟨hsd,hta.symm⟩)    · exact h₉ (hta.symm.trans htb)    · exact hst he  · exact hst he
See it in the graphDiscuss this resultChallenge it