AFTD Auto-Formalizing Theoretical Domains

op874_bad_port_palette_gives_graph_bipartition

theoremverified

A graph covered by three neighbor maps is two-colorable if the original and selected maps cross the Boolean partition and the involutive unselected map satisfies the displayed all-bad palette and interface hypotheses.

Statement

theorem op874_bad_port_palette_gives_graph_bipartition
    {V : Type*} [Fintype V] [DecidableEq V]
    (G : SimpleGraph V) (flag : V → Bool) (mate selected other : V → V)
    (t s x y : V → Fin 6)
    (hmate : ∀ v, mate (mate v) = v)
    (hflip : ∀ v, flag (mate v) = !flag v)
    (hselected : ∀ v, flag (selected v) = !flag v)
    (hother : ∀ v, other (other v) = v)
    (htsame : ∀ v, t (other v) = t v)
    (hlocal : ∀ v, flag v = false →
      2 ≤ (t v).val ∧ (t v).val ≤ 3 ∧ 4 ≤ (s v).val ∧ 4 ≤ (x v).val ∧
      2 ≤ (y v).val ∧ s v ≠ x v ∧ y v ≠ s v ∧ y v ≠ x v ∧ y v ≠ t v)
    (hcross : ∀ v, flag v = false → flag (other v) = false → y v ≠ y (other v))
    (hcover : ∀ u v, G.Adj u v → v = mate u ∨ v = selected u ∨ v = other u) :
    ∃ f : V → Bool, ∀ u v, G.Adj u v → f u ≠ f v
Source
Structural two-port reduction for OP-874; experiments 43048, 43073 and 43075 test the local-state implications.
Verified
29 Nov 2026
Axioms
Classical.choiceQuot.soundpropext
Built on 1

The proof, explained

We show that the Boolean labeling flag is a proper 2-coloring of G. An auxiliary theorem deduces from the palette and interface assumptions that the third neighbor map other flips flag on every vertex, matching the assumed behavior of mate and selected. Since every edge of G is covered by one of these three maps, any adjacent pair of vertices receives opposite Boolean colors.

  1. The unselected involution reverses the Boolean flag: flag(other(v)) = ¬flag(v) for all v.

    Applying the lemma op874_bad_ports_unselected_matching_crosses with the assumptions that mate and other are involutions, mate flips the flag, t is invariant under other, the port values satisfy the local palette bounds on the false partition, and y values cross on other, we establish that other also flips the flag on every vertex.

    lines 16–17

    uses op874_bad_ports_unselected_matching_crosses

      have hthird := op874_bad_ports_unselected_matching_crosses flag mate other t s x y
        hmate hflip hother htsame hlocal hcross
  2. It suffices to show that flag assigns different values to adjacent vertices.

    We provide flag as the 2-coloring witness. To prove it is proper, we consider arbitrary vertices u and v such that G.Adj u v and must show flag(u) ≠ flag(v).

    lines 18–19

      refine ⟨flag, ?_⟩
      intro u v huv
  3. The neighbor v must be mate(u), selected(u), or other(u).

    By the edge-covering hypothesis hcover, any edge between u and v means that v is the mate, the selected neighbor, or the other neighbor of u. We split the argument into these three cases.

    line 20

      rcases hcover u v huv with h | h | h
  4. If v = mate(u), then flag(u) ≠ flag(v).

    Substituting v = mate(u) and using the hypothesis hflip, flag(v) becomes ¬flag(u). The condition flag(u) ≠ ¬flag(u) holds whether flag(u) is true or false.

    lines 21–22

      · rw [h, hflip]
        cases flag u <;> decide
  5. If v = selected(u), then flag(u) ≠ flag(v).

    Substituting v = selected(u) and using the hypothesis hselected, flag(v) becomes ¬flag(u). A case analysis on the Boolean value of flag(u) confirms flag(u) ≠ ¬flag(u).

    lines 23–24

      · rw [h, hselected]
        cases flag u <;> decide
  6. If v = other(u), then flag(u) ≠ flag(v).

    Substituting v = other(u) and using the previously established fact hthird, flag(v) is ¬flag(u). Evaluating both possibilities for flag(u) confirms flag(u) ≠ ¬flag(u).

    lines 25–26

      · rw [h, hthird]
        cases flag u <;> decide
op874_bad_ports_unselected_matching_crosses
Under the involution, port palette, and crossing hypotheses, the unselected involution flips the Boolean flag for every vertex: flag(other(v)) = ¬flag(v).

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_bad_port_palette_gives_graph_bipartition    {V : Type*} [Fintype V] [DecidableEq V]    (G : SimpleGraph V) (flag : V → Bool) (mate selected other : V → V)    (t s x y : V → Fin 6)    (hmate : ∀ v, mate (mate v) = v)    (hflip : ∀ v, flag (mate v) = !flag v)    (hselected : ∀ v, flag (selected v) = !flag v)    (hother : ∀ v, other (other v) = v)    (htsame : ∀ v, t (other v) = t v)    (hlocal : ∀ v, flag v = false →      2 ≤ (t v).val ∧ (t v).val ≤ 3 ∧ 4 ≤ (s v).val ∧ 4 ≤ (x v).val ∧      2 ≤ (y v).val ∧ s v ≠ x v ∧ y v ≠ s v ∧ y v ≠ x v ∧ y v ≠ t v)    (hcross : ∀ v, flag v = false → flag (other v) = false → y v ≠ y (other v))    (hcover : ∀ u v, G.Adj u v → v = mate u ∨ v = selected u ∨ v = other u) :    ∃ f : V → Bool, ∀ u v, G.Adj u v → f u ≠ f v := by  have hthird := op874_bad_ports_unselected_matching_crosses flag mate other t s x y    hmate hflip hother htsame hlocal hcross  refine ⟨flag, ?_⟩  intro u v huv  rcases hcover u v huv with h | h | h  · rw [h, hflip]    cases flag u <;> decide  · rw [h, hselected]    cases flag u <;> decide  · rw [h, hthird]    cases flag u <;> decide
See it in the graphDiscuss this resultChallenge it