AFTD Auto-Formalizing Theoretical Domains

forced_matching_edge_excludes_adjacent_true_twin

theoremverified

A forced edge of a perfect matching cannot have an endpoint with a distinct adjacent true twin other than the edge's other endpoint.

Statement

theorem forced_matching_edge_excludes_adjacent_true_twin
    {V : Type*} (H : SimpleGraph V) (P : H.Subgraph) (hP : P.IsPerfectMatching)
    (x y a : V) (hxy : P.Adj x y) (hax : a ≠ x) (hay : a ≠ y)
    (hxa : H.Adj x a)
    (htwin : ∀ z, z ≠ x → z ≠ a → (H.Adj x z ↔ H.Adj a z))
    (hforced : ∀ Q : H.Subgraph, Q.IsPerfectMatching → Q.Adj x y) : False
Source
OP-1957; residual exclusion for the saturated three-vertex boundary block.
Verified
22 Nov 2026
Axioms
Classical.choiceQuot.soundpropext
Built on 1
Used by 2

The proof, explained

The proof proceeds by contradiction. If an endpoint x of a forced matching edge xy in a perfect matching P had an adjacent true twin a distinct from x and y, then taking the matching partner w of a in P yields four pairwise distinct vertices x, y, a, w. By the true twin property, the presence of matching edges xy and aw in H implies the existence of graph edges ya and xw, creating an alternating 4-cycle (x, y, a, w). This allows an alternating 4-switch that replaces xy and aw with ya and xw to produce another perfect matching without xy, contradicting the fact that forced matching edges block such 4-switches (forced_matching_edge_blocks_four_and_six_switches).

  1. There exists a vertex w matched to a in P

    Because P is a perfect matching, every vertex of H is spanned by P and is incident to a unique matching edge. Applying this to vertex a yields a partner w such that a and w are adjacent in P.

    lines 7–8

      classical
      obtain ⟨w, haw, -⟩ := hP.1 (hP.2 a)
  2. The inequalities x ≠ y, x ≠ a, y ≠ a, and a ≠ w hold

    In any simple graph, adjacent vertices are distinct, so the matching edges xy and aw immediately imply x ≠ y and a ≠ w. The inequalities x ≠ a and y ≠ a are obtained by symmetry from the theorem hypotheses hax and hay.

    lines 9–12

      have hxy_ne : x ≠ y := hxy.ne
      have hxa_ne : x ≠ a := hax.symm
      have hya_ne : y ≠ a := hay.symm
      have haw_ne : a ≠ w := haw.ne
  3. x ≠ w

    Suppose for contradiction that x = w. Then x would be matched to a via the edge aw. However, x is already matched to y via edge xy. Since P is a matching, no vertex can have two distinct matching edges, which forces a = y, contradicting the assumption that a ≠ y.

    lines 13–17

      have hxw_ne : x ≠ w := by
        intro h
        have h1 : P.Adj x a := h ▸ haw.symm
        have h_eq : a = y := hP.1.eq_of_adj_left h1 hxy
        exact hay h_eq
  4. y ≠ w

    Suppose for contradiction that y = w. Then y would be matched to a via edge aw. But y is already matched to x via edge xy. Because P is a matching, this forces a = x, contradicting the assumption that a ≠ x.

    lines 18–22

      have hyw_ne : y ≠ w := by
        intro h
        have h1 : P.Adj y a := h ▸ haw.symm
        have h_eq : a = x := hP.1.eq_of_adj_left h1 hxy.symm
        exact hax h_eq
  5. The four vertices x, y, a, w are pairwise distinct automation

    The vector [x, y, a, w] is an injective function from Fin 4 to V. Evaluating all 16 pairs of indices (i, j), cases with i = j hold by reflexivity, while each case with i ≠ j equates two of the vertices and is discharged by one of the six previously proven distinctness facts.

    lines 23–31

      have hinj : Function.Injective (![x, y, a, w] : Fin 4 → V) := by
        intro i j hij
        fin_cases i <;> fin_cases j <;> try rfl
        all_goals {
          dsimp at hij
          subst hij
          first | exact (hxy_ne rfl).elim | exact (hxa_ne rfl).elim | exact (hxw_ne rfl).elim
                | exact (hya_ne rfl).elim | exact (hyw_ne rfl).elim | exact (haw_ne rfl).elim
        }
  6. y is adjacent to a in H

    The matching edge xy is also an edge of H. Since x and a are true twins in H, they have identical neighborhoods outside {x, a}. Because y ≠ x and y ≠ a, the edge xy implies that a is adjacent to y in H, and thus y is adjacent to a by symmetry.

    lines 32–35

      have hya : H.Adj y a := by
        have hyx : y ≠ x := hxy.ne.symm
        have h_xy_sub : H.Adj x y := P.adj_sub hxy
        exact ((htwin y hyx hya_ne).mp h_xy_sub).symm
  7. x is adjacent to w in H

    The matching edge aw is an edge of H. Since x and a are true twins and w ≠ x, w ≠ a, the adjacency of a and w in H implies that x is adjacent to w in H.

    lines 36–40

      have hxw : H.Adj x w := by
        have hwx : w ≠ x := hxw_ne.symm
        have hwa : w ≠ a := haw_ne.symm
        have h_aw : H.Adj a w := P.adj_sub haw
        exact (htwin w hwx hwa).mpr h_aw
  8. False (a contradiction is derived)

    By lemma forced_matching_edge_blocks_four_and_six_switches, a forced edge in a perfect matching cannot form an alternating 4-cycle switch with another matching edge. The four distinct vertices x, y, a, w, together with matching edges xy and aw and graph edges ya and xw, constitute precisely such a forbidden alternating 4-cycle, yielding False.

    lines 41–42

    uses forced_matching_edge_blocks_four_and_six_switches

      have hblock := (forced_matching_edge_blocks_four_and_six_switches H P hP x y hxy hforced).1
      exact hblock ⟨a, w, hinj, haw, hya, hxw⟩
forced_matching_edge_blocks_four_and_six_switches
In a graph with a perfect matching, if an edge uv in the matching is forced (present in every perfect matching), then there cannot exist an alternating 4-cycle switch with another matching edge ab and graph edges va and ub, nor an alternating 6-cycle switch.

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 forced_matching_edge_excludes_adjacent_true_twin    {V : Type*} (H : SimpleGraph V) (P : H.Subgraph) (hP : P.IsPerfectMatching)    (x y a : V) (hxy : P.Adj x y) (hax : a ≠ x) (hay : a ≠ y)    (hxa : H.Adj x a)    (htwin : ∀ z, z ≠ x → z ≠ a → (H.Adj x z ↔ H.Adj a z))    (hforced : ∀ Q : H.Subgraph, Q.IsPerfectMatching → Q.Adj x y) : False := by  classical  obtain ⟨w, haw, -⟩ := hP.1 (hP.2 a)  have hxy_ne : x ≠ y := hxy.ne  have hxa_ne : x ≠ a := hax.symm  have hya_ne : y ≠ a := hay.symm  have haw_ne : a ≠ w := haw.ne  have hxw_ne : x ≠ w := by    intro h    have h1 : P.Adj x a := h ▸ haw.symm    have h_eq : a = y := hP.1.eq_of_adj_left h1 hxy    exact hay h_eq  have hyw_ne : y ≠ w := by    intro h    have h1 : P.Adj y a := h ▸ haw.symm    have h_eq : a = x := hP.1.eq_of_adj_left h1 hxy.symm    exact hax h_eq  have hinj : Function.Injective (![x, y, a, w] : Fin 4 → V) := by    intro i j hij    fin_cases i <;> fin_cases j <;> try rfl    all_goals {      dsimp at hij      subst hij      first | exact (hxy_ne rfl).elim | exact (hxa_ne rfl).elim | exact (hxw_ne rfl).elim            | exact (hya_ne rfl).elim | exact (hyw_ne rfl).elim | exact (haw_ne rfl).elim    }  have hya : H.Adj y a := by    have hyx : y ≠ x := hxy.ne.symm    have h_xy_sub : H.Adj x y := P.adj_sub hxy    exact ((htwin y hyx hya_ne).mp h_xy_sub).symm  have hxw : H.Adj x w := by    have hwx : w ≠ x := hxw_ne.symm    have hwa : w ≠ a := haw_ne.symm    have h_aw : H.Adj a w := P.adj_sub haw    exact (htwin w hwx hwa).mpr h_aw  have hblock := (forced_matching_edge_blocks_four_and_six_switches H P hP x y hxy hforced).1  exact hblock ⟨a, w, hinj, haw, hya, hxw⟩
See it in the graphDiscuss this resultChallenge it