AFTD Auto-Formalizing Theoretical Domains

extendible_graph_matchable_deletion_inherits_extendibility

theoremverified

If a graph is (r+j)-extendible and a 2j-vertex set U induces a perfect matching, then its induced complement is r-extendible, provided the complement has at least 2r+2 vertices and an r-matching.

Statement

theorem extendible_graph_matchable_deletion_inherits_extendibility
    {V : Type*} [Fintype V] [DecidableEq V]
    (G : SimpleGraph V) (U : Finset V) (r j : ℕ)
    (hG : is_k_extendable G (r + j)) (hU : U.card = 2 * j)
    (hUmatch : ∃ P : (G.induce {v | v ∈ U}).Subgraph, P.IsPerfectMatching)
    (hCcard : 2 * r + 2 ≤ Fintype.card {v : V // v ∉ U})
    (hCmatch : ∃ M : (G.induce {v | v ∉ U}).Subgraph,
      M.IsMatching ∧ M.edgeSet.ncard = r) :
    is_k_extendable (G.induce {v | v ∉ U}) r
Source
Induced-core reduction for the exact 2k separator in the OP-1957 two-bridge route.
Verified
20 Nov 2026
Axioms
Classical.choiceQuot.soundpropext
Built on 3
Used by 13

The proof, explained

To show that the deletion of U leaves an r-extendible graph, an arbitrary r-matching M in G[Uᶜ] is combined with the assumed perfect matching PU of size j on G[U]. Because their vertex sets U and Uᶜ are disjoint, their union is a matching of size r + j in G, which extends to a perfect matching Q of G by (r + j)-extendibility. Since PU already saturates all vertices of U within G[U], no edge of Q can connect U to Uᶜ, so the restriction of Q to G[Uᶜ] is a perfect matching extending M.

  1. The union of two vertex-disjoint matchings is a matching whose edge count is the sum of their edge counts.

    By isMatching_sup_disjoint_encard, the union of two vertex-disjoint matchings M and M' is a matching, and its extended cardinality is the sum of their extended cardinalities. Since the graph is finite, the edge sets are finite, so converting extended natural counts to ordinary natural counts yields (M ⊔ M').edgeSet.ncard = M.edgeSet.ncard + M'.edgeSet.ncard.

    lines 5–12

    uses isMatching_sup_disjoint_encard, Set.ncard_def, Set.toFinite, Set.Finite.encard_eq_coe, Nat.cast_add, ENat.toNat_natCast

      have h := isMatching_sup_disjoint_encard M M' hM hM' hd
      refine ⟨h.1, ?_⟩
      rw [Set.ncard_def, h.2]
      have hfinM : M.edgeSet.Finite := Set.toFinite _
      have hfinM' : M'.edgeSet.Finite := Set.toFinite _
      rw [Set.Finite.encard_eq_coe hfinM, Set.Finite.encard_eq_coe hfinM']
      rw [← Set.ncard_def, ← Set.ncard_def]
      rw [← Nat.cast_add, ENat.toNat_natCast]
  2. To show the induced complement is r-extendible, it suffices to extend an arbitrary r-matching.

    The definition of r-extendibility requires that the vertex count is at least 2r + 2, that an r-matching exists, and that every r-matching extends to a perfect matching. The first two conditions are given directly by hypotheses hCcard and hCmatch, so refine reduces the goal to extending an arbitrary r-matching M.

    lines 23–24

      refine ⟨hCcard, hCmatch, ?_⟩
      intro M hM hMcard
  3. The matching M on the complement and the perfect matching PU on U embed into G as vertex-disjoint matchings MU and MC.

    Let PU be the assumed perfect matching on G[U]. We view the vertex sets U and Uᶜ as subsets of V and define inclusion homomorphisms fU : G[U] → G and fC : G[Uᶜ] → G using Subtype.val. Because Subtype.val is injective, the pushforwards MU = PU.map fU and MC = M.map fC are matchings in G.

    lines 25–37

    uses Subtype.val_injective

      obtain ⟨PU, hPU⟩ := hUmatch
      let S : Set V := {v : V | v ∈ U}
      have hSC : {v : V | v ∉ U} = Sᶜ := rfl
      let fU : (G.induce S) →g G :=
        { toFun := Subtype.val, map_rel' := by intro a b h; simpa using h }
      let fC : (G.induce Sᶜ) →g G :=
        { toFun := Subtype.val, map_rel' := by intro a b h; simpa using h }
      have hfU : Function.Injective fU := Subtype.val_injective
      have hfC : Function.Injective fC := Subtype.val_injective
      let MU : G.Subgraph := PU.map fU
      let MC : G.Subgraph := M.map fC
      have hMU_match : MU.IsMatching := hPU.1.map fU hfU
      have hMC_match : MC.IsMatching := hM.map fC hfC
  4. The embedded matching MU spans U and has j edges.

    Since PU is a perfect matching of G[U], its vertex set is all of U, so MU.verts = U. Any matching satisfies 2 * |E| = |V| by in1076_matching_twice_card. Since |U| = 2j by hU, we have 2 * |E(MU)| = 2j, which gives |E(MU)| = j by linear arithmetic.

    lines 38–50

    uses SimpleGraph.Subgraph.map_verts, in1076_matching_twice_card, Set.ncard_coe_finset

      have hMU_verts : MU.verts = S := by
        rw [SimpleGraph.Subgraph.map_verts]
        ext v
        constructor
        · rintro ⟨x, -, rfl⟩; exact x.property
        · intro hv; exact ⟨⟨v, hv⟩, hPU.2 ⟨v, hv⟩, rfl⟩
      have hMU_card : MU.edgeSet.ncard = j := by
        have h := in1076_matching_twice_card hMU_match
        have hS : S.ncard = 2 * j := by
          have : S = ↑U := by ext; simp [S]
          rw [this, Set.ncard_coe_finset, hU]
        rw [hMU_verts, hS] at h
        omega
  5. The embedded matching MC has r edges.

    Because fC is injective, MC.verts has the same cardinality as M.verts by Set.ncard_image_of_injective. Applying in1076_matching_twice_card to both MC and M relates their edge counts to their vertex counts; since M has r edges, MC also has r edges.

    lines 51–58

    uses SimpleGraph.Subgraph.map_verts, Set.ncard_image_of_injective, in1076_matching_twice_card

      have hMC_card : MC.edgeSet.ncard = r := by
        have hMC_verts_card : MC.verts.ncard = M.verts.ncard := by
          rw [SimpleGraph.Subgraph.map_verts]
          exact Set.ncard_image_of_injective M.verts hfC
        have h1 := in1076_matching_twice_card hMC_match
        have h2 := in1076_matching_twice_card hM
        rw [hMC_verts_card, ← h2, hMcard] at h1
        omega
  6. The union MC ⊔ MU is a matching in G with r + j edges.

    The vertices of MU are U and the vertices of MC lie in Uᶜ, so they are disjoint. Applying extendible_graph_matchable_deletion_inherits_extendibility_sup_ncard shows that MC ⊔ MU is a matching in G with r + j edges.

    lines 59–68

    uses Set.disjoint_left, SimpleGraph.Subgraph.map_verts, extendible_graph_matchable_deletion_inherits_extendibility_sup_ncard

      have hdisj : Disjoint MC.verts MU.verts := by
        rw [Set.disjoint_left]
        intro x hxMC hxMU
        rw [hMU_verts] at hxMU
        rw [SimpleGraph.Subgraph.map_verts] at hxMC
        obtain ⟨y, -, rfl⟩ := hxMC
        exact y.property hxMU
      have hsup := extendible_graph_matchable_deletion_inherits_extendibility_sup_ncard MC MU hMC_match hMU_match hdisj
      have htot_card : (MC ⊔ MU).edgeSet.ncard = r + j := by
        rw [hsup.2, hMC_card, hMU_card]
  7. MC ⊔ MU extends to a perfect matching Q of G.

    Because G is (r + j)-extendible, the matching MC ⊔ MU of size r + j extends to a perfect matching Q of G. In particular, MC ≤ Q and MU ≤ Q by transitivity with le_sup_left and le_sup_right.

    lines 69–71

    uses le_trans, le_sup_left, le_sup_right

      obtain ⟨Q, hQ, hle⟩ := hG.2.2 (MC ⊔ MU) hsup.1 htot_card
      have hMC_le_Q : MC ≤ Q := le_trans le_sup_left hle
      have hMU_le_Q : MU ≤ Q := le_trans le_sup_right hle
  8. Every edge of Q incident to Uᶜ has its other endpoint in Uᶜ.

    Suppose for contradiction that an edge (a, b) of Q has a in Uᶜ and b in U. Since MU spans U, b is incident to an edge (b, c) of MU, which is also an edge of Q because MU ≤ Q. Since Q is a matching, the neighbor of b in Q is unique, so c = a. But c is in U while a is in Uᶜ, a contradiction. Hence b must lie in Uᶜ.

    lines 72–78

      have hmate {a b : V} (ha : a ∈ Sᶜ) (hab : Q.Adj a b) : b ∈ Sᶜ := by
        intro hb
        obtain ⟨c, hbc, -⟩ := hMU_match (v := b) (by rw [hMU_verts]; exact hb)
        have hQbc : Q.Adj b c := hMU_le_Q.2 hbc
        have hca : c = a := (hQ.1 (hQ.2 b)).unique hQbc hab.symm
        have hcS : c ∈ S := hMU_verts ▸ MU.edge_vert hbc.symm
        exact ha (hca ▸ hcS)
  9. The pullback of Q to G[Uᶜ] is a perfect matching extending M.

    Define R as the pullback (comap) of Q to G[Uᶜ]. Every vertex a in Uᶜ has a unique neighbor b in Q; by the preceding lemma, b lies in Uᶜ, so R is a perfect matching of G[Uᶜ]. Finally, M ≤ R is equivalent to MC ≤ Q via map_le_iff_le_comap, which was already established.

    lines 79–92

    uses Subtype.ext, SimpleGraph.Subgraph.map_le_iff_le_comap

      let R : (G.induce Sᶜ).Subgraph := Q.comap fC
      refine ⟨R, ⟨?_, ?_⟩, ?_⟩
      · intro a ha
        obtain ⟨b, hab, huniq⟩ := hQ.1 (hQ.2 a.val)
        let b' : {v : V // v ∈ Sᶜ} := ⟨b, hmate a.property hab⟩
        refine ⟨b', ?_, ?_⟩
        · exact ⟨Q.adj_sub hab, hab⟩
        · intro c hc
          apply Subtype.ext
          exact huniq c.val hc.2
      · intro a
        exact hQ.2 a.val
      · rw [← SimpleGraph.Subgraph.map_le_iff_le_comap]
        exact hMC_le_Q
isMatching_sup_disjoint_encard
If two matchings in a graph have disjoint vertex sets, their union is a matching whose extended cardinality is the sum of their extended cardinalities.
Set.ncard_def
The natural cardinality of a set equals the conversion of its extended cardinality to a natural number.
Set.toFinite
A subtype of a finite type is finite.
Set.Finite.encard_eq_coe
For a finite set, its extended cardinality is the coercion of its natural cardinality.
Nat.cast_add
The coercion to a numerical type preserves addition.
ENat.toNat_natCast
Converting a coerced natural number back to a natural number is the identity.
Subtype.val_injective
The subtype inclusion map is injective.
SimpleGraph.Subgraph.map_verts
The vertices of a mapped subgraph are the image of its original vertices under the homomorphism.
in1076_matching_twice_card
For any matching in a finite graph, twice its edge count equals its vertex count.
Set.ncard_coe_finset
The natural cardinality of a coerced finset equals the card of the finset.
Set.ncard_image_of_injective
An injective map preserves the natural cardinality of a set.
Set.disjoint_left
Two sets are disjoint if and only if no element of the first belongs to the second.
extendible_graph_matchable_deletion_inherits_extendibility_sup_ncard
The union of two vertex-disjoint matchings is a matching whose edge count is the sum of their edge counts.
le_trans
Order transitivity: if a ≤ b and b ≤ c, then a ≤ c.
le_sup_left
In a join semilattice, a ≤ a ⊔ b.
le_sup_right
In a join semilattice, b ≤ a ⊔ b.
Subtype.ext
Two elements of a subtype are equal if their underlying values are equal.
SimpleGraph.Subgraph.map_le_iff_le_comap
For a graph homomorphism f, the image map and preimage comap on subgraphs form an adjunction: map f H ≤ H' if and only if H ≤ comap f H'.

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

lemma extendible_graph_matchable_deletion_inherits_extendibility_sup_ncard    {V : Type*} [Fintype V] {G : SimpleGraph V}    (M M' : SimpleGraph.Subgraph G) (hM : M.IsMatching) (hM' : M'.IsMatching) (hd : Disjoint M.verts M'.verts) :    (M ⊔ M').IsMatching ∧ (M ⊔ M').edgeSet.ncard = M.edgeSet.ncard + M'.edgeSet.ncard := by  have h := isMatching_sup_disjoint_encard M M' hM hM' hd  refine ⟨h.1, ?_⟩  rw [Set.ncard_def, h.2]  have hfinM : M.edgeSet.Finite := Set.toFinite _  have hfinM' : M'.edgeSet.Finite := Set.toFinite _  rw [Set.Finite.encard_eq_coe hfinM, Set.Finite.encard_eq_coe hfinM']  rw [← Set.ncard_def, ← Set.ncard_def]  rw [← Nat.cast_add, ENat.toNat_natCast]theorem extendible_graph_matchable_deletion_inherits_extendibility    {V : Type*} [Fintype V] [DecidableEq V]    (G : SimpleGraph V) (U : Finset V) (r j : ℕ)    (hG : is_k_extendable G (r + j)) (hU : U.card = 2 * j)    (hUmatch : ∃ P : (G.induce {v | v ∈ U}).Subgraph, P.IsPerfectMatching)    (hCcard : 2 * r + 2 ≤ Fintype.card {v : V // v ∉ U})    (hCmatch : ∃ M : (G.induce {v | v ∉ U}).Subgraph,      M.IsMatching ∧ M.edgeSet.ncard = r) :    is_k_extendable (G.induce {v | v ∉ U}) r := by  refine ⟨hCcard, hCmatch, ?_⟩  intro M hM hMcard  obtain ⟨PU, hPU⟩ := hUmatch  let S : Set V := {v : V | v ∈ U}  have hSC : {v : V | v ∉ U} = Sᶜ := rfl  let fU : (G.induce S) →g G :=    { toFun := Subtype.val, map_rel' := by intro a b h; simpa using h }  let fC : (G.induce Sᶜ) →g G :=    { toFun := Subtype.val, map_rel' := by intro a b h; simpa using h }  have hfU : Function.Injective fU := Subtype.val_injective  have hfC : Function.Injective fC := Subtype.val_injective  let MU : G.Subgraph := PU.map fU  let MC : G.Subgraph := M.map fC  have hMU_match : MU.IsMatching := hPU.1.map fU hfU  have hMC_match : MC.IsMatching := hM.map fC hfC  have hMU_verts : MU.verts = S := by    rw [SimpleGraph.Subgraph.map_verts]    ext v    constructor    · rintro ⟨x, -, rfl⟩; exact x.property    · intro hv; exact ⟨⟨v, hv⟩, hPU.2 ⟨v, hv⟩, rfl⟩  have hMU_card : MU.edgeSet.ncard = j := by    have h := in1076_matching_twice_card hMU_match    have hS : S.ncard = 2 * j := by      have : S = ↑U := by ext; simp [S]      rw [this, Set.ncard_coe_finset, hU]    rw [hMU_verts, hS] at h    omega  have hMC_card : MC.edgeSet.ncard = r := by    have hMC_verts_card : MC.verts.ncard = M.verts.ncard := by      rw [SimpleGraph.Subgraph.map_verts]      exact Set.ncard_image_of_injective M.verts hfC    have h1 := in1076_matching_twice_card hMC_match    have h2 := in1076_matching_twice_card hM    rw [hMC_verts_card, ← h2, hMcard] at h1    omega  have hdisj : Disjoint MC.verts MU.verts := by    rw [Set.disjoint_left]    intro x hxMC hxMU    rw [hMU_verts] at hxMU    rw [SimpleGraph.Subgraph.map_verts] at hxMC    obtain ⟨y, -, rfl⟩ := hxMC    exact y.property hxMU  have hsup := extendible_graph_matchable_deletion_inherits_extendibility_sup_ncard MC MU hMC_match hMU_match hdisj  have htot_card : (MC ⊔ MU).edgeSet.ncard = r + j := by    rw [hsup.2, hMC_card, hMU_card]  obtain ⟨Q, hQ, hle⟩ := hG.2.2 (MC ⊔ MU) hsup.1 htot_card  have hMC_le_Q : MC ≤ Q := le_trans le_sup_left hle  have hMU_le_Q : MU ≤ Q := le_trans le_sup_right hle  have hmate {a b : V} (ha : a ∈ Sᶜ) (hab : Q.Adj a b) : b ∈ Sᶜ := by    intro hb    obtain ⟨c, hbc, -⟩ := hMU_match (v := b) (by rw [hMU_verts]; exact hb)    have hQbc : Q.Adj b c := hMU_le_Q.2 hbc    have hca : c = a := (hQ.1 (hQ.2 b)).unique hQbc hab.symm    have hcS : c ∈ S := hMU_verts ▸ MU.edge_vert hbc.symm    exact ha (hca ▸ hcS)  let R : (G.induce Sᶜ).Subgraph := Q.comap fC  refine ⟨R, ⟨?_, ?_⟩, ?_⟩  · intro a ha    obtain ⟨b, hab, huniq⟩ := hQ.1 (hQ.2 a.val)    let b' : {v : V // v ∈ Sᶜ} := ⟨b, hmate a.property hab⟩    refine ⟨b', ?_, ?_⟩    · exact ⟨Q.adj_sub hab, hab⟩    · intro c hc      apply Subtype.ext      exact huniq c.val hc.2  · intro a    exact hQ.2 a.val  · rw [← SimpleGraph.Subgraph.map_le_iff_le_comap]    exact hMC_le_Q
See it in the graphDiscuss this resultChallenge it