AFTD Auto-Formalizing Theoretical Domains

factorcritical_twins_forced_edge_is_bridge

theoremverified

In a finite 1-factor-critical graph, if two distinct vertices have identical neighborhoods outside the pair, any forced matching edge incident to one is a bridge after deleting the other. The twins may be adjacent or nonadjacent.

Statement

theorem factorcritical_twins_forced_edge_is_bridge {V : Type*} [Fintype V] [DecidableEq V] (G : SimpleGraph V) (hcrit : is_k_factor_critical G 1) (x y z : V) (hxy : x ≠ y) (htwin : ∀ a, a ≠ x → a ≠ y → (G.Adj x a ↔ G.Adj y a)) (hyz : z ≠ y) (hxz : G.Adj x z) (hforced : ¬ ∃ P : ((G.induce {a | a ≠ y}).deleteEdges {s(⟨x,hxy⟩,⟨z,hyz⟩)}).Subgraph, P.IsPerfectMatching) : ¬ ((G.induce {a | a ≠ y}).deleteEdges {s(⟨x,hxy⟩,⟨z,hyz⟩)}).Reachable ⟨x,hxy⟩ ⟨z,hyz⟩
Source
OP-1957; common generalization of the proved false-twin forced-edge bridge lemma and the adjacent-twin switch, supported by experiment 37003.
Verified
22 Nov 2026
Axioms
Classical.choiceQuot.soundpropext
Built on 5
Used by 1

The proof, explained

The proof argues by contradiction: suppose the edge xz is not a bridge in G - y, which implies that (G - y) ∖ {xz} is connected. Deleting the edge xz from G produces a graph F in which F - y = (G - y) ∖ {xz} is connected, and for every other vertex b ≠ y, F - b has a perfect matching (using a partner-switching lemma for twins when b ≠ x, z). A general parity theorem on single-vertex deletions then implies that F - y must also have a perfect matching, contradicting the assumption that xz was a forced edge in G - y.

  1. Assume for contradiction that x and z are reachable in (G - y) ∖ {xz}.

    We enter the classical logic setting and assume the negation of the conclusion: that x and z remain connected by a path in (G - y) ∖ {xz}, which means that the edge xz is not a bridge in G - y.

    lines 2–3

      classical
      intro hreach
  2. The graph (G - y) ∖ {xz} is connected.

    Let F = G ∖ {xz}. Since G is 1-factor-critical and has at least two vertices (x ≠ y), G is connected by nontrivial_factorcritical_graph_connected. Because x and y are twins outside {x, y} and z is a neighbor of x distinct from y, z is also a neighbor of y. Deleting a twin vertex that shares a common neighbor preserves connectivity by connected_graph_delete_twin_with_common_neighbor_connected, so G - y is connected. By SimpleGraph.isBridge_iff and not_not.mpr, reachability of x and z in (G - y) ∖ {xz} means xz is not a bridge in G - y; removing a non-bridge edge from a connected graph leaves it connected.

    lines 4–11

    uses nontrivial_factorcritical_graph_connected, connected_graph_delete_twin_with_common_neighbor_connected, SimpleGraph.isBridge_iff, not_not.mpr

      let F := G.deleteEdges {s(x,z)}
      have hzy : z ≠ y := hyz
      have hzx : z ≠ x := hxz.ne.symm
      have hyzG : G.Adj y z := (htwin z hzx hzy).mp hxz
      have hconn : (G.induce {a | a ≠ y}).Connected :=
        connected_graph_delete_twin_with_common_neighbor_connected G (nontrivial_factorcritical_graph_connected G hcrit x y hxy) x y z hxy hxz hyzG htwin
      have hconn' := hconn.connected_delete_edge_of_not_isBridge (x := ⟨x,hxy⟩) (y := ⟨z,hyz⟩)
        (by rw [SimpleGraph.isBridge_iff]; exact not_not.mpr hreach)
  3. The graph F - y is identical to (G - y) ∖ {xz}, and hence F - y is connected.

    Deleting the edge xz and then deleting the vertex y yields the exact same graph as deleting y first and then removing the edge xz. Checking adjacency on both sides using SimpleGraph.induce_adj, SimpleGraph.deleteEdges_adj, Set.mem_singleton_iff, Sym2.eq_iff, and Subtype.ext_iff proves F - y = (G - y) ∖ {xz}. Rewriting with this equality shows F - y is connected.

    lines 12–17

    uses SimpleGraph.induce_adj, SimpleGraph.deleteEdges_adj, Set.mem_singleton_iff, Sym2.eq_iff, Subtype.ext_iff

      have heq : (F.induce {a | a ≠ y}) = ((G.induce {a | a ≠ y}).deleteEdges
          {s(⟨x,hxy⟩,⟨z,hyz⟩)}) := by
        ext a b
        simp only [F, SimpleGraph.induce_adj, SimpleGraph.deleteEdges_adj,
          Set.mem_singleton_iff, Sym2.eq_iff, Subtype.ext_iff]
      have hFconn : (F.induce {a | a ≠ y}).Connected := by rw [heq]; exact hconn'
  4. For any vertex b ≠ y, the graph G - b has a perfect matching P.

    Because G is 1-factor-critical, deleting any single vertex b leaves an induced subgraph G - b that admits a perfect matching P.

    lines 18–27

      have hother : ∀ b : V, b ≠ y → ∃ P : (F.induce {v | v ≠ b}).Subgraph, P.IsPerfectMatching := by
        intro b hby
        have hm := hcrit {b} (by simp)
        have hs : (↑({b} : Finset V) : Set V)ᶜ = {v | v ≠ b} := by
          ext v
          simp
        have hm' : ∃ P : (G.induce {v | v ≠ b}).Subgraph, P.IsPerfectMatching := by
          rw [← hs]
          exact hm
        obtain ⟨P, hP⟩ := hm'
  5. If b = x or b = z, the matching P in G - b already avoids the edge xz.

    We seek a perfect matching Q in G - b containing no edge with endpoints {x, z}. If b = x, the vertex x is not in G - b, so no edge of P can have endpoints {x, z} (analyzed via Sym2.eq_iff.mp). Similarly, if b = z, vertex z is absent from G - b, so P cannot contain the edge xz either.

    lines 28–43

    uses Sym2.eq_iff.mp

        have hQ : ∃ Q : (G.induce {v | v ≠ b}).Subgraph, Q.IsPerfectMatching ∧
            ∀ a c, Q.Adj a c → s(a.val,c.val) ≠ s(x,z) := by
          by_cases hbx : b = x
          · subst b
            refine ⟨P, hP, ?_⟩
            intro a c hac he
            rcases Sym2.eq_iff.mp he with ⟨ha,hc⟩ | ⟨ha,hc⟩
            · exact a.property ha
            · exact c.property hc
          · by_cases hbz : b = z
            · subst b
              refine ⟨P, hP, ?_⟩
              intro a c hac he
              rcases Sym2.eq_iff.mp he with ⟨ha,hc⟩ | ⟨ha,hc⟩
              · exact c.property hc
              · exact a.property ha
  6. If b ≠ x and b ≠ z, there is a perfect matching Q in G - b avoiding the edge xz.

    When b ≠ x, z, both x and z are present in G - b, and so is y since b ≠ y. The twin relationship between x and y is preserved in G - b using Subtype.ext and congrArg. If P does not contain the edge xz, we keep Q = P. If P contains the edge between x and z, perfect_matching_twins_switch_partner allows us to switch partners with the twin y, yielding a perfect matching Q in G - b that avoids the edge xz (with edge equality checked via Sym2.eq_iff.mp and Subtype.ext).

    lines 44–75

    uses congrArg, Subtype.ext, perfect_matching_twins_switch_partner, Sym2.eq_iff.mp

            · have hxb : x ≠ b := fun h => hbx h.symm
              have hyb : y ≠ b := hby.symm
              have hzb : z ≠ b := fun h => hbz h.symm
              have hxy' : (⟨x,hxb⟩ : {v : V // v ≠ b}) ≠ ⟨y,hyb⟩ := by
                intro h
                exact hxy (congrArg Subtype.val h)
              have htwin' : ∀ a : {v : V // v ≠ b}, a ≠ ⟨x,hxb⟩ → a ≠ ⟨y,hyb⟩ →
                  ((G.induce {v | v ≠ b}).Adj ⟨x,hxb⟩ a ↔
                    (G.induce {v | v ≠ b}).Adj ⟨y,hyb⟩ a) := by
                intro a hax hay
                change G.Adj x a.val ↔ G.Adj y a.val
                apply htwin a.val
                · intro he; apply hax; exact Subtype.ext he
                · intro he; apply hay; exact Subtype.ext he
              have hzy' : (⟨z,hzb⟩ : {v : V // v ≠ b}) ≠ ⟨y,hyb⟩ := by
                intro he; exact hyz (congrArg Subtype.val he)
              have hQ' : ∃ Q : (G.induce {v | v ≠ b}).Subgraph,
                  Q.IsPerfectMatching ∧ ¬ Q.Adj ⟨x,hxb⟩ ⟨z,hzb⟩ := by
                by_cases hp : P.Adj ⟨x,hxb⟩ ⟨z,hzb⟩
                · exact perfect_matching_twins_switch_partner _ P hP _ _ _ hxy' hzy' htwin' hp
                · exact ⟨P, hP, hp⟩
              obtain ⟨Q, hmatch, hno⟩ := hQ'
              refine ⟨Q, hmatch, ?_⟩
              intro a c hac he
              rcases Sym2.eq_iff.mp he with ⟨ha,hc⟩ | ⟨ha,hc⟩
              · have ha' : a = ⟨x,hxb⟩ := Subtype.ext ha
                have hc' : c = ⟨z,hzb⟩ := Subtype.ext hc
                exact hno (ha' ▸ hc' ▸ hac)
              · have ha' : a = ⟨z,hzb⟩ := Subtype.ext ha
                have hc' : c = ⟨x,hxb⟩ := Subtype.ext hc
                exact hno (hc' ▸ ha' ▸ hac.symm)
        obtain ⟨Q, hmatch, havoid⟩ := hQ
  7. The matching Q is a perfect matching in F - b.

    Because Q avoids the edge xz, all edges of Q belong to F = G ∖ {xz} by SimpleGraph.deleteEdges_adj.mpr. Thus Q embeds into F - b via SimpleGraph.toSubgraph, and by SimpleGraph.Subgraph.IsPerfectMatching.toSubgraph_iff, it is a perfect matching of F - b.

    lines 76–80

    uses SimpleGraph.deleteEdges_adj.mpr, SimpleGraph.toSubgraph, SimpleGraph.Subgraph.IsPerfectMatching.toSubgraph_iff

        have hle : Q.spanningCoe ≤ F.induce {v | v ≠ b} := by
          intro a c hac
          change F.Adj a.val c.val
          exact SimpleGraph.deleteEdges_adj.mpr ⟨Q.adj_sub hac, by simpa using havoid a c hac⟩
        exact ⟨SimpleGraph.toSubgraph (G := F.induce {v | v ≠ b}) Q.spanningCoe hle, (SimpleGraph.Subgraph.IsPerfectMatching.toSubgraph_iff hle).mpr hmatch⟩
  8. A contradiction is reached, so xz must be a bridge in G - y.

    By connected_deletion_matches_if_all_other_deletions_match applied to F and y, since F - y is connected and every other single-vertex deletion F - b admits a perfect matching, F - y must itself have a perfect matching. Since F - y = (G - y) ∖ {xz}, this gives a perfect matching of (G - y) ∖ {xz}, directly contradicting the hypothesis that the edge xz is forced in G - y.

    lines 81–83

    uses connected_deletion_matches_if_all_other_deletions_match

      have hmatch := connected_deletion_matches_if_all_other_deletions_match F y hFconn hother
      rw [heq] at hmatch
      exact hforced hmatch
connected_deletion_matches_if_all_other_deletions_match
In a graph where G - u is connected, if every other single-vertex deletion G - b (for b ≠ u) admits a perfect matching, then G - u also admits a perfect matching.
connected_graph_delete_twin_with_common_neighbor_connected
If a connected graph has two distinct twin vertices sharing a common neighbor, deleting one twin leaves the remaining graph connected.
congrArg
Applying a function to equal arguments produces equal values.
nontrivial_factorcritical_graph_connected
A 1-factor-critical graph with at least two vertices is connected.
not_not.mpr
Double negation introduction: if P holds, then ¬¬P holds.
perfect_matching_twins_switch_partner
In a graph with twin vertices, any perfect matching containing an edge incident to one twin can be transformed into a perfect matching that avoids that edge by switching partners with the other twin.
Set.mem_singleton_iff
An element belongs to a singleton set {b} if and only if it equals b.
SimpleGraph.deleteEdges_adj
Two vertices are adjacent in an edge-deleted graph if and only if they were adjacent originally and the edge between them was not deleted.
SimpleGraph.deleteEdges_adj.mpr
If an edge is present in a graph and not in the deletion set, it is present in the edge-deleted graph.
SimpleGraph.induce_adj
Two vertices in an induced subgraph are adjacent if and only if they are adjacent in the ambient graph.
SimpleGraph.isBridge_iff
An edge is a bridge if and only if its endpoints are not reachable from each other after deleting that edge.
SimpleGraph.Subgraph.IsPerfectMatching.toSubgraph_iff
A spanning subgraph viewed as a subgraph of an ambient graph is a perfect matching if and only if the original subgraph was a perfect matching.
SimpleGraph.toSubgraph
Constructs a subgraph from a spanning subgraph and a containment proof.
Subtype.ext
Two subtype elements are equal if their underlying values are equal.
Subtype.ext_iff
Two subtype elements are equal if and only if their underlying values are equal.
Sym2.eq_iff
Two unordered pairs s(a, b) and s(c, d) are equal if and only if (a = c ∧ b = d) or (a = d ∧ b = c).
Sym2.eq_iff.mp
If two unordered pairs s(a, b) and s(c, d) are equal, then either a = c and b = d, or a = d and b = c.

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 factorcritical_twins_forced_edge_is_bridge {V : Type*} [Fintype V] [DecidableEq V] (G : SimpleGraph V) (hcrit : is_k_factor_critical G 1) (x y z : V) (hxy : x ≠ y) (htwin : ∀ a, a ≠ x → a ≠ y → (G.Adj x a ↔ G.Adj y a)) (hyz : z ≠ y) (hxz : G.Adj x z) (hforced : ¬ ∃ P : ((G.induce {a | a ≠ y}).deleteEdges {s(⟨x,hxy⟩,⟨z,hyz⟩)}).Subgraph, P.IsPerfectMatching) : ¬ ((G.induce {a | a ≠ y}).deleteEdges {s(⟨x,hxy⟩,⟨z,hyz⟩)}).Reachable ⟨x,hxy⟩ ⟨z,hyz⟩ := by  classical  intro hreach  let F := G.deleteEdges {s(x,z)}  have hzy : z ≠ y := hyz  have hzx : z ≠ x := hxz.ne.symm  have hyzG : G.Adj y z := (htwin z hzx hzy).mp hxz  have hconn : (G.induce {a | a ≠ y}).Connected :=    connected_graph_delete_twin_with_common_neighbor_connected G (nontrivial_factorcritical_graph_connected G hcrit x y hxy) x y z hxy hxz hyzG htwin  have hconn' := hconn.connected_delete_edge_of_not_isBridge (x := ⟨x,hxy⟩) (y := ⟨z,hyz⟩)    (by rw [SimpleGraph.isBridge_iff]; exact not_not.mpr hreach)  have heq : (F.induce {a | a ≠ y}) = ((G.induce {a | a ≠ y}).deleteEdges      {s(⟨x,hxy⟩,⟨z,hyz⟩)}) := by    ext a b    simp only [F, SimpleGraph.induce_adj, SimpleGraph.deleteEdges_adj,      Set.mem_singleton_iff, Sym2.eq_iff, Subtype.ext_iff]  have hFconn : (F.induce {a | a ≠ y}).Connected := by rw [heq]; exact hconn'  have hother : ∀ b : V, b ≠ y → ∃ P : (F.induce {v | v ≠ b}).Subgraph, P.IsPerfectMatching := by    intro b hby    have hm := hcrit {b} (by simp)    have hs : (↑({b} : Finset V) : Set V)ᶜ = {v | v ≠ b} := by      ext v      simp    have hm' : ∃ P : (G.induce {v | v ≠ b}).Subgraph, P.IsPerfectMatching := by      rw [← hs]      exact hm    obtain ⟨P, hP⟩ := hm'    have hQ : ∃ Q : (G.induce {v | v ≠ b}).Subgraph, Q.IsPerfectMatching ∧        ∀ a c, Q.Adj a c → s(a.val,c.val) ≠ s(x,z) := by      by_cases hbx : b = x      · subst b        refine ⟨P, hP, ?_⟩        intro a c hac he        rcases Sym2.eq_iff.mp he with ⟨ha,hc⟩ | ⟨ha,hc⟩        · exact a.property ha        · exact c.property hc      · by_cases hbz : b = z        · subst b          refine ⟨P, hP, ?_⟩          intro a c hac he          rcases Sym2.eq_iff.mp he with ⟨ha,hc⟩ | ⟨ha,hc⟩          · exact c.property hc          · exact a.property ha        · have hxb : x ≠ b := fun h => hbx h.symm          have hyb : y ≠ b := hby.symm          have hzb : z ≠ b := fun h => hbz h.symm          have hxy' : (⟨x,hxb⟩ : {v : V // v ≠ b}) ≠ ⟨y,hyb⟩ := by            intro h            exact hxy (congrArg Subtype.val h)          have htwin' : ∀ a : {v : V // v ≠ b}, a ≠ ⟨x,hxb⟩ → a ≠ ⟨y,hyb⟩ →              ((G.induce {v | v ≠ b}).Adj ⟨x,hxb⟩ a ↔                (G.induce {v | v ≠ b}).Adj ⟨y,hyb⟩ a) := by            intro a hax hay            change G.Adj x a.val ↔ G.Adj y a.val            apply htwin a.val            · intro he; apply hax; exact Subtype.ext he            · intro he; apply hay; exact Subtype.ext he          have hzy' : (⟨z,hzb⟩ : {v : V // v ≠ b}) ≠ ⟨y,hyb⟩ := by            intro he; exact hyz (congrArg Subtype.val he)          have hQ' : ∃ Q : (G.induce {v | v ≠ b}).Subgraph,              Q.IsPerfectMatching ∧ ¬ Q.Adj ⟨x,hxb⟩ ⟨z,hzb⟩ := by            by_cases hp : P.Adj ⟨x,hxb⟩ ⟨z,hzb⟩            · exact perfect_matching_twins_switch_partner _ P hP _ _ _ hxy' hzy' htwin' hp            · exact ⟨P, hP, hp⟩          obtain ⟨Q, hmatch, hno⟩ := hQ'          refine ⟨Q, hmatch, ?_⟩          intro a c hac he          rcases Sym2.eq_iff.mp he with ⟨ha,hc⟩ | ⟨ha,hc⟩          · have ha' : a = ⟨x,hxb⟩ := Subtype.ext ha            have hc' : c = ⟨z,hzb⟩ := Subtype.ext hc            exact hno (ha' ▸ hc' ▸ hac)          · have ha' : a = ⟨z,hzb⟩ := Subtype.ext ha            have hc' : c = ⟨x,hxb⟩ := Subtype.ext hc            exact hno (hc' ▸ ha' ▸ hac.symm)    obtain ⟨Q, hmatch, havoid⟩ := hQ    have hle : Q.spanningCoe ≤ F.induce {v | v ≠ b} := by      intro a c hac      change F.Adj a.val c.val      exact SimpleGraph.deleteEdges_adj.mpr ⟨Q.adj_sub hac, by simpa using havoid a c hac⟩    exact ⟨SimpleGraph.toSubgraph (G := F.induce {v | v ≠ b}) Q.spanningCoe hle, (SimpleGraph.Subgraph.IsPerfectMatching.toSubgraph_iff hle).mpr hmatch⟩  have hmatch := connected_deletion_matches_if_all_other_deletions_match F y hFconn hother  rw [heq] at hmatch  exact hforced hmatch
See it in the graphDiscuss this resultChallenge it