AFTD Auto-Formalizing Theoretical Domains

truncation_selected_ports_force_opposite_bits

theoremverified

If each endpoint of an edge hides its missing low color on another port, disjoint exposed pairs force those endpoints to have different matching bits.

Statement

theorem truncation_selected_ports_force_opposite_bits
    {V E : Type*} (ends : E → Sym2 V) (c h : V → E → Fin 6)
    (bit : V → Bool) (u v : V) (e f g : E)
    (hue : u ∈ ends e) (hve : v ∈ ends e)
    (huf : u ∈ ends f) (hvg : v ∈ ends g)
    (hfe : f ≠ e) (hge : g ≠ e)
    (hh : ∀ w a b, w ∈ ends a → w ∈ ends b → h w a = h w b → a = b)
    (hch : ∀ w a b, w ∈ ends a → w ∈ ends b → h w a ≠ c w b)
    (hd : Disjoint (truncation_exposed_pair ends c h u e)
                   (truncation_exposed_pair ends c h v e))
    (hfu : h u f = if bit u then 0 else 1)
    (hgv : h v g = if bit v then 0 else 1) :
    bit u ≠ bit v
Source
Local-state interface reduction for the OP-874 one-defect construction.
Verified
20 Nov 2026
Axioms
Classical.choiceQuot.soundpropext
Built on 1
  • truncation_exposed_pairFor a multigraph given by ends : E → Sym2 V and colour assignments c h : V → E → Ω (c v e is the external colour at the port (v, e), h v e…

The proof, explained

The proof proceeds by contradiction: assuming the endpoints u and v have identical matching bits, their respective selected edges f and g must carry the same hidden color, h(u, f) = h(v, g) ∈ {0, 1}. Because hidden colors never clash with primary colors and the edge colorings are injective on incident edges with f ≠ e and g ≠ e, this common color belongs to the exposed pairs at both u and v. This directly contradicts the hypothesis that the two exposed pairs are disjoint, establishing that bit u ≠ bit v.

  1. Assuming for contradiction that bit u = bit v, the hidden colors h(u, f) and h(v, g) are equal.

    We proceed by contradiction and assume bit u = bit v. Since h(u, f) and h(v, g) are defined conditionally on bit u and bit v respectively (evaluating to 0 if the bit is true and 1 if false), substituting bit u = bit v into these definitions shows that h(u, f) = h(v, g).

    lines 16–17

      intro hb
      have heq : h u f = h v g := by rw [hfu, hgv, hb]
  2. The color h(u, f) belongs to the truncation exposed pair at u relative to e.

    By definition, a color ω belongs to truncation_exposed_pair u e if it is not the primary color c(u, a) of any edge a incident to u, and ω ≠ h(u, e). First, h(u, f) cannot equal any primary color c(u, a) because hidden colors and primary colors at the same vertex are always distinct by hypothesis hch. Second, if h(u, f) were equal to h(u, e), the injectivity of h on incident edges (hypothesis hh) would imply f = e, contradicting the assumption f ≠ e (hfe). Thus h(u, f) satisfies both conditions.

    lines 18–23

      have hm1 : h u f ∈ truncation_exposed_pair ends c h u e := by
        refine ⟨?_, ?_⟩
        · intro a ha
          exact (hch u f a huf ha).symm
        · intro he
          exact hfe (hh u f e huf hue he)
  3. The color h(u, f) also belongs to the truncation exposed pair at v relative to e.

    Since h(u, f) = h(v, g), it suffices to show h(v, g) belongs to truncation_exposed_pair v e. Analogously to the previous step, h(v, g) cannot equal any primary color c(v, a) at v by hypothesis hch. In addition, h(v, g) cannot equal h(v, e), because by injectivity of h (hypothesis hh) that would force g = e, contradicting g ≠ e (hge). Hence h(v, g) satisfies both requirements.

    lines 24–30

      have hm2 : h u f ∈ truncation_exposed_pair ends c h v e := by
        rw [heq]
        refine ⟨?_, ?_⟩
        · intro a ha
          exact (hch v g a hvg ha).symm
        · intro he
          exact hge (hh v g e hvg hve he)
  4. A contradiction arises with the assumption that the two exposed pairs are disjoint, so bit u ≠ bit v.

    The hypothesis hd states that truncation_exposed_pair u e and truncation_exposed_pair v e are disjoint. But h(u, f) has been shown to belong to both, so applying Set.disjoint_left.mp to hd and these two memberships produces False, concluding that bit u ≠ bit v.

    line 31

    uses Set.disjoint_left.mp

      exact Set.disjoint_left.mp hd hm1 hm2
Set.disjoint_left.mp
If two sets are disjoint, any element of the first set cannot belong to the second set.

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

open Settheorem truncation_selected_ports_force_opposite_bits    {V E : Type*} (ends : E → Sym2 V) (c h : V → E → Fin 6)    (bit : V → Bool) (u v : V) (e f g : E)    (hue : u ∈ ends e) (hve : v ∈ ends e)    (huf : u ∈ ends f) (hvg : v ∈ ends g)    (hfe : f ≠ e) (hge : g ≠ e)    (hh : ∀ w a b, w ∈ ends a → w ∈ ends b → h w a = h w b → a = b)    (hch : ∀ w a b, w ∈ ends a → w ∈ ends b → h w a ≠ c w b)    (hd : Disjoint (truncation_exposed_pair ends c h u e)                   (truncation_exposed_pair ends c h v e))    (hfu : h u f = if bit u then 0 else 1)    (hgv : h v g = if bit v then 0 else 1) :    bit u ≠ bit v := by  intro hb  have heq : h u f = h v g := by rw [hfu, hgv, hb]  have hm1 : h u f ∈ truncation_exposed_pair ends c h u e := by    refine ⟨?_, ?_⟩    · intro a ha      exact (hch u f a huf ha).symm    · intro he      exact hfe (hh u f e huf hue he)  have hm2 : h u f ∈ truncation_exposed_pair ends c h v e := by    rw [heq]    refine ⟨?_, ?_⟩    · intro a ha      exact (hch v g a hvg ha).symm    · intro he      exact hge (hh v g e hvg hve he)  exact Set.disjoint_left.mp hd hm1 hm2
See it in the graphDiscuss this resultChallenge it