op874_bad_matching_ports_force_factor_matching
In a finite set with two distinct symmetric factor neighbors per vertex, a class-switching matching involution, and an ownership map, suppose every false vertex owns a factor neighbor and every true vertex is owned by a false vertex. Then the undirected factor edges owned at one endpoint form a perfect matching.
Statement
theorem op874_bad_matching_ports_force_factor_matching {V : Type*} [Fintype V] [DecidableEq V] (flag : V → Bool) (mate own : V → V) (step : V → Fin 2 → V) (hmate : ∀ v, mate (mate v) = v) (hflip : ∀ v, flag (mate v) = !flag v) (hcover : ∀ p, flag p = true → ∃ q, flag q = false ∧ own q = p) (howneradj : ∀ q, flag q = false → ∃ i, step q i = own q) (hsym : ∀ v i, ∃ j, step (step v i) j = v) (hdist : ∀ v, step v 0 ≠ step v 1) : ∀ v, ∃! i, (flag v = false ∧ own v = step v i) ∨ (flag (step v i) = false ∧ own (step v i) = v)
- Source
- Structural reduction for the exact-owner global-pair route to OP-874; experiment 43048 tests the hypotheses.
- Verified
- 29 Nov 2026
- Axioms
Classical.choiceQuot.soundpropext- Built on 1
- op874_opposite_paired_cover_is_bijectiveFor a finite set split into two classes by a fixed-point-free class-switching involution, any map for which each true vertex has a false…
- Used by 1
- op874_bad_port_color_cover_forces_factor_matchingSuppose matching edges exchange two ownership classes, each vertex owns its matching edge or one of two symmetric distinct factor…
The proof, explained
The theorem shows that the undirected factor edges owned by their false endpoints form a 1-factor (a perfect matching). First, an established lemma shows that ownership restricts to a bijection from false vertices to true vertices, and factor stepping is verified to be injective on ports {0, 1}. The proof then splits on the flag of an arbitrary vertex v: if v is false, it owns a unique factor neighbor and cannot be owned by another false neighbor; if v is true, it is owned by a unique false vertex q, which is adjacent to v, and symmetry provides a unique return port from v to q.
Ownership maps false vertices injectively to true vertices, and we fix an arbitrary vertex v.
By op874_opposite_paired_cover_is_bijective, using the flag-reversing matching involution (hmate, hflip) and the assumption that every true vertex is owned (hcover), the ownership map own sends false vertices to true vertices and is injective on false vertices. We then fix an arbitrary vertex v.
uses
op874_opposite_paired_cover_is_bijectiveclassical have hb := op874_opposite_paired_cover_is_bijective flag mate own hmate hflip hcover intro v
For each vertex v, the port-stepping map i ↦ step v i from Fin 2 to V is injective.
Let i, j ∈ {0, 1} with step v i = step v j. Exhaustive case analysis on {0, 1} shows that if i = j the equality is reflexivity, while if i ≠ j, we obtain step v 0 = step v 1, directly contradicting the hypothesis hdist that the two factor neighbors are distinct. False.elim derives the conclusion from this contradiction.
uses
False.elimhave hinjstep : Function.Injective (step v) := by intro i j h fin_cases i <;> fin_cases j · rfl · exact False.elim (hdist v h) · exact False.elim (hdist v h.symm) · rfl
When flag v = false, there exists a port i along which v owns its neighbor.
We split into cases on whether flag v is false or true. When flag v = false, hypothesis howneradj guarantees that v owns one of its factor neighbors, so step v i = own v for some port i ∈ {0, 1}. This satisfies the first disjunct using Or.inl, leaving uniqueness to be proved.
uses
Or.inlcases hv : flag v with | false => obtain ⟨i, hi⟩ := howneradj v hv refine ⟨i, Or.inl ⟨rfl, hi.symm⟩, ?_⟩
When flag v = false, the port i at v is unique.
Suppose another port j satisfies the disjunction. If the first branch holds, step v j = own v. If the second branch were to hold, step v j would be a false vertex that owns v; but by the bijectivity result (hb), the owner of any false vertex has a true flag, contradicting flag v = false. Thus step v j = own v = step v i, and injectivity of step v ensures j = i.
intro j hj have hstep : step v j = own v := by rcases hj with ⟨_, h⟩ | ⟨hf, ho⟩ · exact h.symm · have ht := (hb (step v j) hf).1 rw [ho, hv] at ht contradiction have heq : step v j = step v i := hstep.trans hi.symm exact hinjstep heq
When flag v = true, there exists a port j along which the neighbor is false and owns v.
When flag v = true, hypothesis hcover provides a false vertex q that owns v. By howneradj, q owns one of its factor neighbors, so step q i = own q = v for some port i. Factor edge symmetry (hsym) provides a return port j such that step v j = q. Since q is false and owns v, this port j satisfies the second disjunct using Or.inr, leaving uniqueness to be proved.
uses
Or.inr| true => obtain ⟨q, hq, hqown⟩ := hcover v hv obtain ⟨i, hi⟩ := howneradj q hq have hi' : step q i = v := hi.trans hqown obtain ⟨j, hj⟩ := hsym q i rw [hi'] at hj refine ⟨j, Or.inr ⟨hj ▸ hq, by rw [hj]; exact hqown⟩, ?_⟩When flag v = true, the port j at v is unique.
Suppose another port k satisfies the disjunction. The first branch requires flag v = false, contradicting flag v = true. Thus the second branch must hold, so step v k is a false vertex owning v. Since q is also a false vertex owning v, the injectivity of own on false vertices (from hb) implies step v k = q. Since step v j = q as well, step v k = step v j, and injectivity of step v yields k = j.
intro k hk have hkq : step v k = q := by rcases hk with ⟨hf, _⟩ | ⟨hf, ho⟩ · contradiction · symm apply (hb (step v k) hf).2 q hq exact hqown.trans ho.symm have heq : step v k = step v j := hkq.trans hj.symm exact hinjstep heq
op874_opposite_paired_cover_is_bijective- Under a flag-reversing involution, if every true vertex is owned by some false vertex, then the ownership map sends every false vertex to a true vertex and is injective on false vertices.
False.elim- From a contradiction (a proof of False), any proposition can be deduced (the principle of explosion).
Or.inl- Constructs a proof of A ∨ B from a proof of the left disjunct A.
Or.inr- Constructs a proof of A ∨ B from a proof of the right disjunct 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
Choose a tactic — a marked line — to see the goals Lean had before and after it, as in Lean’s infoview. Step with ← → or j k.
theorem op874_bad_matching_ports_force_factor_matching {V : Type*} [Fintype V] [DecidableEq V] (flag : V → Bool) (mate own : V → V) (step : V → Fin 2 → V) (hmate : ∀ v, mate (mate v) = v) (hflip : ∀ v, flag (mate v) = !flag v) (hcover : ∀ p, flag p = true → ∃ q, flag q = false ∧ own q = p) (howneradj : ∀ q, flag q = false → ∃ i, step q i = own q) (hsym : ∀ v i, ∃ j, step (step v i) j = v) (hdist : ∀ v, step v 0 ≠ step v 1) : ∀ v, ∃! i, (flag v = false ∧ own v = step v i) ∨ (flag (step v i) = false ∧ own (step v i) = v) := by classical have hb := op874_opposite_paired_cover_is_bijective flag mate own hmate hflip hcover intro v have hinjstep : Function.Injective (step v) := by intro i j h fin_cases i <;> fin_cases j · rfl · exact False.elim (hdist v h) · exact False.elim (hdist v h.symm) · rfl cases hv : flag v with | false => obtain ⟨i, hi⟩ := howneradj v hv refine ⟨i, Or.inl ⟨rfl, hi.symm⟩, ?_⟩ intro j hj have hstep : step v j = own v := by rcases hj with ⟨_, h⟩ | ⟨hf, ho⟩ · exact h.symm · have ht := (hb (step v j) hf).1 rw [ho, hv] at ht contradiction have heq : step v j = step v i := hstep.trans hi.symm exact hinjstep heq | true => obtain ⟨q, hq, hqown⟩ := hcover v hv obtain ⟨i, hi⟩ := howneradj q hq have hi' : step q i = v := hi.trans hqown obtain ⟨j, hj⟩ := hsym q i rw [hi'] at hj refine ⟨j, Or.inr ⟨hj ▸ hq, by rw [hj]; exact hqown⟩, ?_⟩ intro k hk have hkq : step v k = q := by rcases hk with ⟨hf, _⟩ | ⟨hf, ho⟩ · contradiction · symm apply (hb (step v k) hf).2 q hq exact hqown.trans ho.symm have heq : step v k = step v j := hkq.trans hj.symm exact hinjstep heq