AFTD Auto-Formalizing Theoretical Domains

extendible_balanced_cut_odd_bound_of_parity_cross_matching

theoremverified

For the stated order-4k extendible graph and balanced-side matching with deficiency r, the opposite side has at most r+1 odd components whenever the displayed parity-controlled crossing-matching condition holds.

Statement

theorem extendible_balanced_cut_odd_bound_of_parity_cross_matching
    (k r : ℕ) (G : SimpleGraph (Fin (4*k))) [DecidableRel G.Adj]
    (hext : is_k_extendable G k)
    (C : Finset (Fin (4*k))) (hcard : C.card = 2*k)
    (M : G.Subgraph) (hM : M.IsMatching) (hMC : M.verts ⊆ (C : Set (Fin (4*k))))
    (hm : M.edgeSet.ncard+r = k)
    (hcross : ∀ U : Finset (Fin (4*k)), U ⊆ C → U.card = 2*r →
      ∃ f g : Fin r → Fin (4*k), Function.Injective f ∧ Function.Injective g ∧
        (∀ i, f i ∈ U ∧ g i ∉ C ∧ G.Adj (f i) (g i)) ∧
        ∃ B : Finset (G.induce {v | v ∉ C}).ConnectedComponent, B.card ≤ 1 ∧
          ∀ i ∈ (G.induce {v | v ∉ C}).oddComponents.toFinset, i ∉ B →
            Even ((in1206_component_vertices G {v | v ∉ C} i) ∩
              ((Finset.univ : Finset (Fin r)).image g)).card) :
    (G.induce {v | v ∉ C}).oddComponents.ncard ≤ r+1
Source
Balanced-cut reduction for OP-1957; https://arxiv.org/abs/2611.22690.
Verified
26 Nov 2026
Axioms
Classical.choiceQuot.soundpropext
Built on 6
Used by 1

The proof, explained

The argument extends the partial matching M on C to a matching of size k by adding r crossing edges to V \ C, then invokes k-extendability to complete it to a perfect matching. The 2r vertices of C left unmatched by M provide, via the crossing condition, r vertex-disjoint edges whose outside endpoints satisfy an even-parity condition on all but at most one odd component of G[V \ C]. Because the union matching M ⊔ N has size k and leaves exactly r vertices of C uncovered, an existing parity-deletion theorem bounds the number of odd components of G[V \ C] by r + 1.

  1. The set U = C \ V(M) of vertices in C unmatched by M has cardinality 2r and is contained in C.

    Let D = V(M) be the vertices covered by the matching M. Since M is a matching, |D| = 2|E(M)|. From |E(M)| + r = k and |C| = 2k, we have |D| = 2(k - r) = 2k - 2r. Because V(M) ⊆ C, the unmatched vertices U = C \ D satisfy |U| = |C| - |D| = 2k - (2k - 2r) = 2r, and U ⊆ C by definition of set difference.

    lines 15–33

    uses in1076_matching_twice_card, Set.ncard_eq_toFinset_card', Finset.card_sdiff_add_card_eq_card, Finset.sdiff_subset

      set_option maxHeartbeats 4000000 in
        classical
        let D : Finset (Fin (4*k)) := M.verts.toFinset
        let U : Finset (Fin (4*k)) := C \ D
        have hDC : D ⊆ C := by
          intro v hv
          exact hMC (by simpa [D] using hv)
        have hDcard : D.card + 2*r = 2*k := by
          have hh := in1076_matching_twice_card hM
          have hD : D.card = M.verts.ncard := by
            dsimp [D]
            exact (Set.ncard_eq_toFinset_card' M.verts).symm
          rw [hD] at *
          omega
        have hUcard : U.card = 2*r := by
          have hh := Finset.card_sdiff_add_card_eq_card hDC
          dsimp [U]
          omega
        have hUC : U ⊆ C := Finset.sdiff_subset
  2. There exists a matching N of size r of edges crossing between U and V \ C, together with an exceptional component set B of size at most 1 satisfying the parity condition.

    Applying the crossing hypothesis hcross to U yields two injective maps f, g : Fin r → V(G) such that for each i, f(i) ∈ U ⊆ C, g(i) ∉ C, and {f(i), g(i)} is an edge, together with a set B of at most 1 component of G[V \ C] outside of which each odd component meets range(g) an even number of times. Since range(f) ⊆ C and range(g) ⊆ V \ C, the endpoints are mutually disjoint (f(i) ≠ g(j) for all i, j). By indexed_disjoint_cross_edges_form_matching, these r edges form a matching N of size r whose vertex set is range(f) ∪ range(g).

    lines 34–40

    uses indexed_disjoint_cross_edges_form_matching

        obtain ⟨f,g,hf,hg,hfg,B,hB,hpar⟩ := hcross U hUC hUcard
        have hfgdis : ∀ i j, f i ≠ g j := by
          intro i j he
          have hc := hUC (hfg i).1
          exact (hfg j).2.1 (he ▸ hc)
        obtain ⟨N,hN,hNcard,hNverts⟩ :=
          indexed_disjoint_cross_edges_form_matching G r f g hf hg hfgdis (fun i => (hfg i).2.2)
  3. The matchings M and N are vertex-disjoint, so their union M ⊔ N is a matching of size k.

    The vertices of M lie in D. The vertices of N are either f(i) ∈ U = C \ D (disjoint from D) or g(i) ∉ C (disjoint from C, hence from D). Thus V(M) and V(N) are disjoint. By extendible_graph_matchable_deletion_inherits_extendibility_sup_ncard, M ⊔ N is a matching with |E(M ⊔ N)| = |E(M)| + |E(N)| = (k - r) + r = k.

    lines 41–52

    uses Set.disjoint_left.mpr, Finset.mem_sdiff.mp, extendible_graph_matchable_deletion_inherits_extendibility_sup_ncard

        have hMN : Disjoint M.verts N.verts := by
          apply Set.disjoint_left.mpr
          intro v hvM hvN
          rw [hNverts] at hvN
          rcases hvN with ⟨i,hi⟩ | ⟨i,hi⟩
          · have hn : f i ∉ D := (Finset.mem_sdiff.mp (hfg i).1).2
            apply hn
            simpa [D,hi] using hvM
          · have hc := hMC hvM
            exact (hfg i).2.1 (hi ▸ hc)
        have hT := extendible_graph_matchable_deletion_inherits_extendibility_sup_ncard M N hM hN hMN
        have hTk : (M ⊔ N).edgeSet.ncard = k := by rw [hT.2,hNcard]; omega
  4. Exactly r vertices in C remain uncovered by the combined matching M ⊔ N.

    Let A = range(f). Since f is injective, |A| = r. Furthermore, A ⊆ U ⊆ C and A is disjoint from D = V(M). The vertices of M ⊔ N that lie in C are exactly D ∪ A, since the only other vertices of M ⊔ N are range(g) ⊆ V \ C. Since D and A are disjoint subsets of C with |D| = 2k - 2r and |A| = r, |D ∪ A| = 2k - r. Thus |C \ V(M ⊔ N)| = |C \ (D ∪ A)| = 2k - (2k - r) = r.

    lines 53–106

    uses Finset.card_image_of_injective, Finset.union_subset, Finset.card_sdiff_add_card_eq_card, Finset.card_union_of_disjoint, Set.ncard_coe_finset

        let A : Finset (Fin (4*k)) := Finset.univ.image f
        have hAcard : A.card = r := by
          rw [Finset.card_image_of_injective _ hf]
          simp
        have hAC : A ⊆ C := by
          intro v hv
          obtain ⟨i,_,rfl⟩ := Finset.mem_image.mp hv
          exact hUC (hfg i).1
        have hDA : Disjoint D A := by
          apply Finset.disjoint_left.mpr
          intro v hvD hvA
          obtain ⟨i,_,rfl⟩ := Finset.mem_image.mp hvA
          exact (Finset.mem_sdiff.mp (hfg i).1).2 hvD
        have hfilter : C.filter (fun v => v ∉ (M ⊔ N).verts) = C \ (D ∪ A) := by
          ext v
          simp only [Finset.mem_filter,Finset.mem_sdiff,Finset.mem_union]
          constructor
          · rintro ⟨hvC,hvT⟩
            refine ⟨hvC,?_⟩
            rintro (hvD | hvA)
            · apply hvT
              change v ∈ M.verts ∪ N.verts
              exact Or.inl (by simpa [D] using hvD)
            · obtain ⟨i,_,rfl⟩ := Finset.mem_image.mp hvA
              apply hvT
              change f i ∈ M.verts ∪ N.verts
              right
              rw [hNverts]
              exact Or.inl ⟨i,rfl⟩
          · rintro ⟨hvC,hvnot⟩
            refine ⟨hvC,?_⟩
            intro hvT
            change v ∈ M.verts ∪ N.verts at hvT
            rcases hvT with hvM | hvN
            · exact hvnot (Or.inl (by simpa [D] using hvM))
            · rw [hNverts] at hvN
              rcases hvN with ⟨i,hi⟩ | ⟨i,hi⟩
              · apply hvnot
                right
                exact Finset.mem_image.mpr ⟨i,Finset.mem_univ _,hi⟩
              · exact (hfg i).2.1 (hi ▸ hvC)
        have hremain : (C.filter (fun v => v ∉ (M ⊔ N).verts)).card = r := by
          rw [hfilter]
          have hsub : D ∪ A ⊆ C := Finset.union_subset hDC hAC
          have hh := Finset.card_sdiff_add_card_eq_card hsub
          rw [Finset.card_union_of_disjoint hDA,hAcard] at hh
          omega
        have hremain' : ((C : Set (Fin (4*k))) \ (M ⊔ N).verts).ncard = r := by
          have heq : (C : Set (Fin (4*k))) \ (M ⊔ N).verts =
              (C.filter (fun v => v ∉ (M ⊔ N).verts) : Finset (Fin (4*k))) := by
            ext v
            simp
          rw [heq,Set.ncard_coe_finset]
          exact hremain
  5. For every odd component of G[V \ C] outside B, the number of vertices covered by M ⊔ N is even.

    By induced_component_ambient_vertex_properties, the vertices of any component of G[V \ C] lie in V \ C. Consequently, they are disjoint from V(M) ⊆ C and range(f) ⊆ C. The only vertices of M ⊔ N that can belong to such a component are those in range(g). Thus, the component's intersection with V(M ⊔ N) equals its intersection with range(g). By the parity hypothesis from hcross, this intersection is even for every odd component outside B.

    lines 107–132

    uses induced_component_ambient_vertex_properties

        have hnewpar : ∀ i ∈ (G.induce {v | v ∉ C}).oddComponents.toFinset, i ∉ B →
            Even ((in1206_component_vertices G {v | v ∉ C} i) ∩ (M ⊔ N).verts.toFinset).card := by
          intro i hi hiB
          have heq : (in1206_component_vertices G {v | v ∉ C} i) ∩ (M ⊔ N).verts.toFinset =
              (in1206_component_vertices G {v | v ∉ C} i) ∩ (Finset.univ.image g) := by
            ext v
            simp only [Finset.mem_inter, Set.mem_toFinset, Finset.mem_image, Finset.mem_univ, true_and]
            constructor
            · rintro ⟨hvF,hvT⟩
              refine ⟨hvF,?_⟩
              have hvR := (induced_component_ambient_vertex_properties G {v | v ∉ C} i i).1 hvF
              change v ∈ M.verts ∪ N.verts at hvT
              rcases hvT with hvM | hvN
              · exact False.elim (hvR (hMC hvM))
              · rw [hNverts] at hvN
                rcases hvN with ⟨j,hj⟩ | ⟨j,hj⟩
                · exact False.elim (hvR (hj ▸ hUC (hfg j).1))
                · exact ⟨j,hj⟩
            · rintro ⟨hvF,⟨j,hj⟩⟩
              refine ⟨hvF,?_⟩
              change v ∈ M.verts ∪ N.verts
              right
              rw [hNverts]
              exact Or.inr ⟨j,hj⟩
          rw [heq]
          exact hpar i hi hiB
  6. The induced subgraph G[V \ C] has at most r + 1 odd components.

    Because G is k-extendable and M ⊔ N is a matching of size k, M ⊔ N extends to a perfect matching P of G. Applying odd_component_bound_after_even_deletions with P, the submatching M ⊔ N, the exceptional set B (|B| ≤ 1), the parity property, and |C \ V(M ⊔ N)| = r concludes that G[V \ C] has at most r + 1 odd components.

    lines 133–134

    uses odd_component_bound_after_even_deletions

        obtain ⟨P,hP,hTP⟩ := hext.2.2 (M ⊔ N) hT.1 hTk
        exact odd_component_bound_after_even_deletions k r G C P (M ⊔ N) hP hT.1 hTP B hB hnewpar hremain'
in1076_matching_twice_card
In any matching of a graph, the number of vertices is twice the number of edges.
Set.ncard_eq_toFinset_card'
For any set, its set cardinality (ncard) equals the finset cardinality of its finset conversion.
Finset.card_sdiff_add_card_eq_card
If s ⊆ t are finite sets, then |t \ s| + |s| = |t|.
Finset.sdiff_subset
The set difference s \ t is a subset of s.
indexed_disjoint_cross_edges_form_matching
An indexed family of edges with injective, disjoint endpoint maps forms a matching of the corresponding size covering the union of their ranges.
Set.disjoint_left.mpr
Two sets are disjoint if no element of the first set belongs to the second set.
Finset.mem_sdiff.mp
An element belongs to s \ t only if it belongs to s and does not belong to t.
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.
Finset.card_image_of_injective
The image of a finite set under an injective map has the same cardinality as the original set.
Finset.union_subset
If s ⊆ u and t ⊆ u, then s ∪ t ⊆ u.
Finset.card_union_of_disjoint
The cardinality of the union of two disjoint finite sets is the sum of their cardinalities.
Set.ncard_coe_finset
The set cardinality of a coerced finite set is equal to its finset cardinality.
induced_component_ambient_vertex_properties
The vertices belonging to any connected component of an induced subgraph G[R] form a subset of R.
odd_component_bound_after_even_deletions
If a submatching T of a perfect matching leaves r vertices in C uncovered and meets all but at most one odd component of G[V \ C] an even number of times, then G[V \ C] has at most r + 1 odd components.

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 extendible_balanced_cut_odd_bound_of_parity_cross_matching    (k r : ℕ) (G : SimpleGraph (Fin (4*k))) [DecidableRel G.Adj]    (hext : is_k_extendable G k)    (C : Finset (Fin (4*k))) (hcard : C.card = 2*k)    (M : G.Subgraph) (hM : M.IsMatching) (hMC : M.verts ⊆ (C : Set (Fin (4*k))))    (hm : M.edgeSet.ncard+r = k)    (hcross : ∀ U : Finset (Fin (4*k)), U ⊆ C → U.card = 2*r →      ∃ f g : Fin r → Fin (4*k), Function.Injective f ∧ Function.Injective g ∧        (∀ i, f i ∈ U ∧ g i ∉ C ∧ G.Adj (f i) (g i)) ∧        ∃ B : Finset (G.induce {v | v ∉ C}).ConnectedComponent, B.card ≤ 1 ∧          ∀ i ∈ (G.induce {v | v ∉ C}).oddComponents.toFinset, i ∉ B →            Even ((in1206_component_vertices G {v | v ∉ C} i) ∩              ((Finset.univ : Finset (Fin r)).image g)).card) :    (G.induce {v | v ∉ C}).oddComponents.ncard ≤ r+1 := by  set_option maxHeartbeats 4000000 in    classical    let D : Finset (Fin (4*k)) := M.verts.toFinset    let U : Finset (Fin (4*k)) := C \ D    have hDC : D ⊆ C := by      intro v hv      exact hMC (by simpa [D] using hv)    have hDcard : D.card + 2*r = 2*k := by      have hh := in1076_matching_twice_card hM      have hD : D.card = M.verts.ncard := by        dsimp [D]        exact (Set.ncard_eq_toFinset_card' M.verts).symm      rw [hD] at *      omega    have hUcard : U.card = 2*r := by      have hh := Finset.card_sdiff_add_card_eq_card hDC      dsimp [U]      omega    have hUC : U ⊆ C := Finset.sdiff_subset    obtain ⟨f,g,hf,hg,hfg,B,hB,hpar⟩ := hcross U hUC hUcard    have hfgdis : ∀ i j, f i ≠ g j := by      intro i j he      have hc := hUC (hfg i).1      exact (hfg j).2.1 (he ▸ hc)    obtain ⟨N,hN,hNcard,hNverts⟩ :=      indexed_disjoint_cross_edges_form_matching G r f g hf hg hfgdis (fun i => (hfg i).2.2)    have hMN : Disjoint M.verts N.verts := by      apply Set.disjoint_left.mpr      intro v hvM hvN      rw [hNverts] at hvN      rcases hvN with ⟨i,hi⟩ | ⟨i,hi⟩      · have hn : f i ∉ D := (Finset.mem_sdiff.mp (hfg i).1).2        apply hn        simpa [D,hi] using hvM      · have hc := hMC hvM        exact (hfg i).2.1 (hi ▸ hc)    have hT := extendible_graph_matchable_deletion_inherits_extendibility_sup_ncard M N hM hN hMN    have hTk : (M ⊔ N).edgeSet.ncard = k := by rw [hT.2,hNcard]; omega    let A : Finset (Fin (4*k)) := Finset.univ.image f    have hAcard : A.card = r := by      rw [Finset.card_image_of_injective _ hf]      simp    have hAC : A ⊆ C := by      intro v hv      obtain ⟨i,_,rfl⟩ := Finset.mem_image.mp hv      exact hUC (hfg i).1    have hDA : Disjoint D A := by      apply Finset.disjoint_left.mpr      intro v hvD hvA      obtain ⟨i,_,rfl⟩ := Finset.mem_image.mp hvA      exact (Finset.mem_sdiff.mp (hfg i).1).2 hvD    have hfilter : C.filter (fun v => v ∉ (M ⊔ N).verts) = C \ (D ∪ A) := by      ext v      simp only [Finset.mem_filter,Finset.mem_sdiff,Finset.mem_union]      constructor      · rintro ⟨hvC,hvT⟩        refine ⟨hvC,?_⟩        rintro (hvD | hvA)        · apply hvT          change v ∈ M.verts ∪ N.verts          exact Or.inl (by simpa [D] using hvD)        · obtain ⟨i,_,rfl⟩ := Finset.mem_image.mp hvA          apply hvT          change f i ∈ M.verts ∪ N.verts          right          rw [hNverts]          exact Or.inl ⟨i,rfl⟩      · rintro ⟨hvC,hvnot⟩        refine ⟨hvC,?_⟩        intro hvT        change v ∈ M.verts ∪ N.verts at hvT        rcases hvT with hvM | hvN        · exact hvnot (Or.inl (by simpa [D] using hvM))        · rw [hNverts] at hvN          rcases hvN with ⟨i,hi⟩ | ⟨i,hi⟩          · apply hvnot            right            exact Finset.mem_image.mpr ⟨i,Finset.mem_univ _,hi⟩          · exact (hfg i).2.1 (hi ▸ hvC)    have hremain : (C.filter (fun v => v ∉ (M ⊔ N).verts)).card = r := by      rw [hfilter]      have hsub : D ∪ A ⊆ C := Finset.union_subset hDC hAC      have hh := Finset.card_sdiff_add_card_eq_card hsub      rw [Finset.card_union_of_disjoint hDA,hAcard] at hh      omega    have hremain' : ((C : Set (Fin (4*k))) \ (M ⊔ N).verts).ncard = r := by      have heq : (C : Set (Fin (4*k))) \ (M ⊔ N).verts =          (C.filter (fun v => v ∉ (M ⊔ N).verts) : Finset (Fin (4*k))) := by        ext v        simp      rw [heq,Set.ncard_coe_finset]      exact hremain    have hnewpar : ∀ i ∈ (G.induce {v | v ∉ C}).oddComponents.toFinset, i ∉ B →        Even ((in1206_component_vertices G {v | v ∉ C} i) ∩ (M ⊔ N).verts.toFinset).card := by      intro i hi hiB      have heq : (in1206_component_vertices G {v | v ∉ C} i) ∩ (M ⊔ N).verts.toFinset =          (in1206_component_vertices G {v | v ∉ C} i) ∩ (Finset.univ.image g) := by        ext v        simp only [Finset.mem_inter, Set.mem_toFinset, Finset.mem_image, Finset.mem_univ, true_and]        constructor        · rintro ⟨hvF,hvT⟩          refine ⟨hvF,?_⟩          have hvR := (induced_component_ambient_vertex_properties G {v | v ∉ C} i i).1 hvF          change v ∈ M.verts ∪ N.verts at hvT          rcases hvT with hvM | hvN          · exact False.elim (hvR (hMC hvM))          · rw [hNverts] at hvN            rcases hvN with ⟨j,hj⟩ | ⟨j,hj⟩            · exact False.elim (hvR (hj ▸ hUC (hfg j).1))            · exact ⟨j,hj⟩        · rintro ⟨hvF,⟨j,hj⟩⟩          refine ⟨hvF,?_⟩          change v ∈ M.verts ∪ N.verts          right          rw [hNverts]          exact Or.inr ⟨j,hj⟩      rw [heq]      exact hpar i hi hiB    obtain ⟨P,hP,hTP⟩ := hext.2.2 (M ⊔ N) hT.1 hTk    exact odd_component_bound_after_even_deletions k r G C P (M ⊔ N) hP hT.1 hTP B hB hnewpar hremain'
See it in the graphDiscuss this resultChallenge it