AFTD Auto-Formalizing Theoretical Domains

odd_cycle_single_defect_off_palette_demand_completion

theoremverified

On every odd cycle, one low-port defect can be completed in four high colors when a nondefect interface demands a color outside the two allowed at the defect.

Statement

theorem odd_cycle_single_defect_off_palette_demand_completion
    (n : ℕ) [NeZero n] (hn : 3 ≤ n) (hodd : Odd n)
    (d : Fin n → Fin 4) (a b : Fin 4) (hab : a ≠ b)
    (hoff : ∃ i : Fin n, i ≠ 0 ∧ d i ≠ a ∧ d i ≠ b) :
    ∃ c p q : Fin n → Fin 4,
      (∀ i, c (i - 1) ≠ c i ∧ p i ≠ q i ∧
        p i ≠ c (i - 1) ∧ p i ≠ c i ∧
        q i ≠ c (i - 1) ∧ q i ≠ c i) ∧
      (∀ i, i ≠ 0 → d i = c (i - 1) ∨ d i = c i) ∧
      (p 0 = a ∨ p 0 = b) ∧
      q 1 = c (-1) ∧ p (-1) ≠ q 0 ∧
      (∀ i, i ≠ 0 → i + 1 ≠ 0 → p i ≠ q (i + 1))
Source
OP-874 one-defect cycle-demand reduction; experiments 35105–35107.
Verified
20 Nov 2026
Axioms
Classical.choiceQuot.soundpropext
Built on 2

The proof, explained

The proof reduces the cycle completion problem to two structural lemmas. First, `odd_cycle_off_palette_factor_word` uses the off-palette demand hypothesis to build a base edge coloring $c$ along with auxiliary colors $t \in \{a, b\}$ and $u$ that avoid boundary edge colors and satisfy an interior occurrence property. Second, `single_defect_high_states_of_factor_word` uses this factor word to construct the complementary high-state sequences $p$ and $q$ meeting the local color-avoidance and transition conditions. Combining $c$, $p$, and $q$ directly satisfies all required properties of the completion.

  1. There exist a base edge coloring $c : \text{Fin } n \to \text{Fin } 4$ and two auxiliary colors $t, u \in \text{Fin } 4$ satisfying the demand, boundary, and recurrence conditions.

    We apply `odd_cycle_off_palette_factor_word` using the cycle length hypotheses, the distinct defect colors $a \ne b$, and the assumed off-palette demand. This produces a coloring $c$ where adjacent edges have different colors ($c(i-1) \ne c(i)$), the demand at every non-defect vertex is met ($d(i) \in \{c(i-1), c(i)\}$), $t \in \{a, b\}$, $t \ne u$, both $t$ and $u$ avoid the boundary edge colors $c(-1)$ and $c(0)$, the colors $c(1)$ and $c(-1)$ are distinct, and $u$ appears at some interior index ($c(i) = u$ for some $i \notin \{0, -1\}$).

    lines 13–14

    uses odd_cycle_off_palette_factor_word

      obtain ⟨c, t, u, hc, hd, ht, htu, htlast, ht0, hulast, hu0, hfirst, hint⟩ :=
        odd_cycle_off_palette_factor_word n hn hodd d a b hab hoff
  2. There exist high-state sequences $p, q : \text{Fin } n \to \text{Fin } 4$ compatible with the base coloring $c$ and auxiliary colors $t, u$.

    We apply `single_defect_high_states_of_factor_word` to $c$, $t$, and $u$. This provides two functions $p, q : \text{Fin } n \to \text{Fin } 4$ such that at every vertex $i$, $p(i) \ne q(i)$ and both avoid the incident edge colors $c(i-1)$ and $c(i)$. In addition, $p(0) = t$, $q(0) = u$, and the sequences satisfy the boundary conditions $q(1) = c(-1)$, $p(-1) \ne q(0)$, and the transition condition $p(i) \ne q(i+1)$ for all $i \notin \{0, -1\}$.

    lines 15–16

    uses single_defect_high_states_of_factor_word

      obtain ⟨p, q, hpq, hp0, hq0, hq1, hlast, hstep⟩ :=
        single_defect_high_states_of_factor_word n hn c t u hc htu ht0 htlast hu0 hulast hfirst hint
  3. The triple $(c, p, q)$ satisfies all conditions for completing the cycle with a single defect.

    We supply $c$, $p$, and $q$ as the witnesses. The non-defect demand condition, boundary requirements ($q(1) = c(-1)$, $p(-1) \ne q(0)$), and step transitions are supplied directly by the hypotheses obtained in the previous steps. At every vertex $i$, combining the fact that $c$ is a proper edge coloring with the local avoidance properties of $p$ and $q$ ensures that $c(i-1) \ne c(i)$ and that $p(i), q(i)$ avoid each other and the incident edge colors. Finally, the defect palette condition $p(0) \in \{a, b\}$ follows by rewriting $t$ to $p(0)$ via $p(0) = t$ in the fact $t \in \{a, b\}$.

    lines 17–20

      refine ⟨c, p, q, ?_, hd, ?_, hq1, hlast, hstep⟩
      · intro i
        exact ⟨hc i, hpq i⟩
      · simpa only [hp0] using ht
odd_cycle_off_palette_factor_word
On an odd cycle of length $n \ge 3$ with interface demand function $d$ and two defect colors $a \ne b$, if some non-defect interface demands a color outside $\{a, b\}$, then there exists a proper edge coloring $c$ and auxiliary colors $t, u$ such that $d$ is satisfied at all non-defect positions, $t \in \{a, b\}$, $t \ne u$, neither $t$ nor $u$ equals $c(-1)$ or $c(0)$, $c(1) \ne c(-1)$, and $u$ appears as an edge color at some interior position.
single_defect_high_states_of_factor_word
Given a proper edge coloring $c$ on an $n$-cycle ($n \ge 3$) and auxiliary colors $t \ne u$ avoiding the boundary edge colors $c(-1)$ and $c(0)$, with $c(1) \ne c(-1)$ and $u$ appearing internally, there exist complementary high-state functions $p, q : \text{Fin } n \to \text{Fin } 4$ that avoid each other and the incident edge colors at every vertex, with $p(0) = t$, $q(0) = u$, $q(1) = c(-1)$, $p(-1) \ne q(0)$, and satisfying the step transition $p(i) \ne q(i+1)$ away from the defect interface.

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 odd_cycle_single_defect_off_palette_demand_completion    (n : ℕ) [NeZero n] (hn : 3 ≤ n) (hodd : Odd n)    (d : Fin n → Fin 4) (a b : Fin 4) (hab : a ≠ b)    (hoff : ∃ i : Fin n, i ≠ 0 ∧ d i ≠ a ∧ d i ≠ b) :    ∃ c p q : Fin n → Fin 4,      (∀ i, c (i - 1) ≠ c i ∧ p i ≠ q i ∧        p i ≠ c (i - 1) ∧ p i ≠ c i ∧        q i ≠ c (i - 1) ∧ q i ≠ c i) ∧      (∀ i, i ≠ 0 → d i = c (i - 1) ∨ d i = c i) ∧      (p 0 = a ∨ p 0 = b) ∧      q 1 = c (-1) ∧ p (-1) ≠ q 0 ∧      (∀ i, i ≠ 0 → i + 1 ≠ 0 → p i ≠ q (i + 1)) := by  obtain ⟨c, t, u, hc, hd, ht, htu, htlast, ht0, hulast, hu0, hfirst, hint⟩ :=    odd_cycle_off_palette_factor_word n hn hodd d a b hab hoff  obtain ⟨p, q, hpq, hp0, hq0, hq1, hlast, hstep⟩ :=    single_defect_high_states_of_factor_word n hn c t u hc htu ht0 htlast hu0 hulast hfirst hint  refine ⟨c, p, q, ?_, hd, ?_, hq1, hlast, hstep⟩  · intro i    exact ⟨hc i, hpq i⟩  · simpa only [hp0] using ht
See it in the graphDiscuss this resultChallenge it