AFTD Auto-Formalizing Theoretical Domains

extendible_balanced_cut_even_component_odd_bound

theoremverified

Under the displayed extendibility, separator, degree, and balanced-side matching conditions, if the opposite side has an even component then it has at most r odd components.

Statement

theorem extendible_balanced_cut_even_component_odd_bound
    (k r : ℕ) (G : SimpleGraph (Fin (4*k))) [DecidableRel G.Adj]
    (hext : is_k_extendable G k)
    (hsep : ∀ S P Q : Finset (Fin (4*k)), P.Nonempty → Q.Nonempty →
      Disjoint S P → Disjoint S Q → Disjoint P Q → S ∪ P ∪ Q = Finset.univ →
      (∀ u ∈ P, ∀ v ∈ Q, ¬ G.Adj u v) → 2*k ≤ S.card)
    (hdegree : ∀ v, 2*k+1 ≤ (G.neighborFinset v).card)
    (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)
    (K : (G.induce {v | v ∉ C}).ConnectedComponent)
    (hK : K ∉ (G.induce {v | v ∉ C}).oddComponents) :
    (G.induce {v | v ∉ C}).oddComponents.ncard ≤ r
Source
Balanced-cut parity reduction for OP-1957; https://arxiv.org/abs/2611.22690.
Verified
26 Nov 2026
Axioms
Classical.choiceQuot.soundpropext
Built on 5
Used by 1

The proof, explained

The theorem is proved by contradiction: we assume that the complement R = V(G) \ C has strictly more than r odd components. Because |R| = 2k is even, the total number of odd components in G[R] must also be even, forcing it to be at least r + 2 when r is even and at least r + 1 when r is odd. The proof then establishes that any subset U ⊆ C of size 2r admits an r-edge matching into R that meets every odd component an even number of times: if r is even, this follows from `balanced_cut_evenly_distributed_cross_matching_sharp`; if r is odd, `balanced_cut_even_component_parity_cross_matching` uses the assumed even component K to absorb the parity shift. Finally, `extendible_balanced_cut_odd_bound_of_even_cross_matching` turns this cross-matching property into the bound |oddComponents| ≤ r, contradicting the initial assumption.

  1. Assume for contradiction that G[R] has more than r odd components, and set up notation for the complement subgraph H = G[R], its odd components O, and component vertex sets F.

    We argue by contradiction, assuming ¬(|H.oddComponents| ≤ r). We define R = V(G) \ C as the opposite side of the cut, H = G[R] as the induced subgraph on R, O as the finset of odd connected components of H, and F as the function mapping each component of H to its vertex set in the ambient graph.

    lines 14–20

      set_option maxHeartbeats 4000000 in
        classical
        by_contra hnot
        let R : Set (Fin (4*k)) := {v | v ∉ C}
        let H := G.induce R
        let O : Finset H.ConnectedComponent := H.oddComponents.toFinset
        let F : H.ConnectedComponent → Finset (Fin (4*k)) := in1206_component_vertices G R
  2. The complement R has 2k vertices, the number of odd components of H is even, and |O| ≥ r + 1.

    Since |V(G)| = 4k and |C| = 2k, the complement R has size 4k - 2k = 2k. By `SimpleGraph.odd_ncard_oddComponents`, the number of odd components of H has the same parity as |R| = 2k, so it is even. Finally, the negation of |O| ≤ r implies |O| ≥ r + 1.

    lines 21–33

    uses Nat.card_coe_set_eq, Set.ncard_compl, Set.ncard_coe_finset, Nat.card_eq_fintype_card, Fintype.card_fin, SimpleGraph.odd_ncard_oddComponents, Nat.odd_iff, Set.ncard_eq_toFinset_card'

        have hRsize : Nat.card R = 2*k := by
          rw [Nat.card_coe_set_eq]
          change ((C : Set (Fin (4*k)))ᶜ).ncard = 2*k
          rw [Set.ncard_compl, Set.ncard_coe_finset, Nat.card_eq_fintype_card, Fintype.card_fin, hcard]
          omega
        have hpar := SimpleGraph.odd_ncard_oddComponents H
        rw [hRsize,Nat.odd_iff,Nat.odd_iff] at hpar
        have hOcard : O.card = H.oddComponents.ncard := by
          dsimp [O]
          exact (Set.ncard_eq_toFinset_card' H.oddComponents).symm
        have hq : r+1 ≤ O.card := by
          change ¬ H.oddComponents.ncard ≤ r at hnot
          omega
  3. The component vertex sets F(i) for i ∈ O and F(K) are disjoint from C and pairwise disjoint from one another.

    By construction, every component of H is contained in R = Cᶜ, so its vertices are disjoint from C. Distinct connected components in an induced subgraph have disjoint vertex sets (`induced_component_ambient_vertex_properties`). Because K is an even component while every i ∈ O is an odd component, K ≠ i, so F(K) is disjoint from F(i) for all i ∈ O.

    lines 34–55

    uses Finset.disjoint_left.mpr, induced_component_ambient_vertex_properties

        have hCH : ∀ i ∈ O, Disjoint C (F i) := by
          intro i hi
          apply Finset.disjoint_left.mpr
          intro v hvC hvF
          have hvR : v ∈ R := (induced_component_ambient_vertex_properties G R i i).1 hvF
          exact hvR hvC
        have hCK : Disjoint C (F K) := by
          apply Finset.disjoint_left.mpr
          intro v hvC hvF
          have hvR : v ∈ R := (induced_component_ambient_vertex_properties G R K K).1 hvF
          exact hvR hvC
        have hdis : ∀ i ∈ O, ∀ j ∈ O, i ≠ j → Disjoint (F i) (F j) := by
          intro i hi j hj hij
          exact (induced_component_ambient_vertex_properties G R i j).2.2.1 hij
        have hKF : ∀ i ∈ O, Disjoint (F K) (F i) := by
          intro i hi
          have hi' : i ∈ H.oddComponents := by simpa [O] using hi
          have hne : K ≠ i := by
            intro he
            apply hK
            simpa [R,H,he] using hi'
          exact (induced_component_ambient_vertex_properties G R K i).2.2.1 hne
  4. Every odd component has cardinality at least 2.

    Each odd component i has a vertex a. By the degree hypothesis, deg(a) ≥ 2k + 1. Since |C| = 2k, the neighbors of a cannot all lie in C, so a must have a neighbor b ∈ R. Being adjacent to a in H, b lies in the same component i as a. Since a ≠ b, the component contains at least two distinct vertices, so |F(i)| ≥ 2.

    lines 56–83

    uses induced_component_ambient_vertex_properties, Finset.card_le_card, Finset.not_subset.mp, congrArg, Finset.card_pair, Set.ncard_eq_toFinset_card'

        have hsize : ∀ i ∈ O, 2 ≤ (F i).card := by
          intro i hi
          have hc := (induced_component_ambient_vertex_properties G R i i).2.1
          change 2 ≤ (in1206_component_vertices G R i).card
          rw [hc]
          obtain ⟨a,ha⟩ := i.nonempty_supp
          have hneg : ¬ G.neighborFinset a.val ⊆ C := by
            intro h
            have hh := Finset.card_le_card h
            have hd := hdegree a.val
            omega
          obtain ⟨b,hbN,hbC⟩ := Finset.not_subset.mp hneg
          have hab : G.Adj a.val b := by simpa using hbN
          let b' : R := ⟨b,hbC⟩
          have hb : b' ∈ i.supp := i.mem_supp_of_adj_mem_supp ha hab
          have habne : a ≠ b' := by
            intro he
            have hv := congrArg Subtype.val he
            exact (G.ne_of_adj hab) hv
          have hpair : ({a,b'} : Finset R) ⊆ i.supp.toFinset := by
            intro x hx
            simp only [Finset.mem_insert,Finset.mem_singleton] at hx
            rcases hx with rfl | rfl
            · exact Set.mem_toFinset.mpr ha
            · exact Set.mem_toFinset.mpr hb
          have hh := Finset.card_le_card hpair
          rw [Finset.card_pair habne, ← Set.ncard_eq_toFinset_card'] at hh
          exact hh
  5. The even component vertex set F(K) is nonempty, and there are no edges in G[R] between distinct components.

    As a connected component, K has nonempty support, so |F(K)| > 0. By `induced_component_ambient_vertex_properties`, vertices in any component F(i) or F(K) have no neighbors in R outside their own component.

    lines 84–96

    uses Set.ncard_pos, Set.toFinite, Finset.card_pos.mp, induced_component_ambient_vertex_properties

        have hKN : (F K).Nonempty := by
          obtain ⟨a,ha⟩ := K.nonempty_supp
          have hn : 0 < K.supp.ncard := (Set.ncard_pos (Set.toFinite _)).mpr ⟨a,ha⟩
          apply Finset.card_pos.mp
          have hc := (induced_component_ambient_vertex_properties G R K K).2.1
          change 0 < (in1206_component_vertices G R K).card
          omega
        have hanti : ∀ i ∈ O, ∀ u ∈ F i, ∀ v, v ∉ C → v ∉ F i → ¬ G.Adj u v := by
          intro i hi u hu v hvC hvF
          exact (induced_component_ambient_vertex_properties G R i i).2.2.2 u hu v hvC hvF
        have hKanti : ∀ u ∈ F K, ∀ v, v ∉ C → v ∉ F K → ¬ G.Adj u v := by
          intro u hu v hvC hvF
          exact (induced_component_ambient_vertex_properties G R K K).2.2.2 u hu v hvC hvF
  6. For any U ⊆ C with |U| = 2r, there exists an r-edge matching between U and R meeting every odd component an even number of times.

    We split into cases on whether r is even. If r is even, then because |O| is even and |O| ≥ r + 1, we have |O| ≥ r + 2; `balanced_cut_evenly_distributed_cross_matching_sharp` yields a matching of size r into R with an exceptional component set B of size at most r % 2 = 0, so B = ∅ and every odd component meets the matching evenly. If r is odd, writing r = n + 1 with n even, we have |O| ≥ n + 2, and `balanced_cut_even_component_parity_cross_matching` uses the even component F(K) to absorb the parity discrepancy, again producing a matching of size n + 1 = r meeting every odd component in O an even number of times.

    lines 97–129

    uses Nat.even_iff.mp, balanced_cut_evenly_distributed_cross_matching_sharp, Finset.disjoint_left.mp, Finset.inter_comm, False.elim, Nat.even_iff, balanced_cut_even_component_parity_cross_matching

        have 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 H.ConnectedComponent, B.card = 0 ∧
                ∀ i ∈ H.oddComponents.toFinset, i ∉ B →
                  Even ((F i) ∩ ((Finset.univ : Finset (Fin r)).image g)).card := by
          intro U hUC hU
          by_cases hre : Even r
          · have hrmod : r%2 = 0 := Nat.even_iff.mp hre
            have hO : r+2 ≤ O.card := by omega
            obtain ⟨f,g,hf,hg,hfg,hgroups,B,hB,hp⟩ :=
              balanced_cut_evenly_distributed_cross_matching_sharp k r G hsep C U hcard hUC (by omega) O F hO hCH hdis hsize hanti
            refine ⟨f,g,hf,hg,?_,B,by omega,?_⟩
            · intro a
              obtain ⟨i,hi,hgi⟩ := hgroups a
              refine ⟨(hfg a).1,?_,(hfg a).2⟩
              intro hgC
              exact Finset.disjoint_left.mp (hCH i hi) hgC hgi
            · intro i hi hiB
              simpa [Finset.inter_comm] using hp i hi hiB
          · cases r with
            | zero => exact False.elim (hre (by simp))
            | succ n =>
              have hn : Even n := by
                rw [Nat.even_iff] at hre ⊢
                omega
              have hO : n+2 ≤ O.card := by omega
              obtain ⟨f,g,hf,hg,hfg,hp⟩ :=
                balanced_cut_even_component_parity_cross_matching k n hn G hsep C U (F K) hcard hUC (by omega)
                  hCK hKN hKanti O F hO hCH hKF hdis hsize hanti
              refine ⟨f,g,hf,hg,hfg,∅,by simp,?_⟩
              intro i hi _
              simpa [Finset.inter_comm] using hp i hi
  7. The number of odd components of G[R] is at most r, completing the proof by contradiction.

    Having verified that every 2r-subset of C admits a cross-matching meeting every odd component an even number of times, `extendible_balanced_cut_odd_bound_of_even_cross_matching` applies and concludes that G[R] has at most r odd components. This directly contradicts the assumption hnot.

    lines 130–131

    uses extendible_balanced_cut_odd_bound_of_even_cross_matching

        have hb := extendible_balanced_cut_odd_bound_of_even_cross_matching k r G hext C hcard M hM hMC hm hcross
        exact hnot hb
Nat.even_iff
A natural number n is even if and only if n % 2 = 0.
Nat.even_iff.mp
If a natural number is even, then its remainder modulo 2 is 0.
Nat.odd_iff
A natural number n is odd if and only if n % 2 = 1.
Nat.card_coe_set_eq
The cardinality `Nat.card` of a coerced set `↑s` equals the set cardinality `s.ncard`.
Set.ncard_compl
For a set `s` in a finite type `α`, the cardinality of its complement `sᶜ` is `Nat.card α - s.ncard`.
Set.ncard_coe_finset
The set cardinality `(↑s).ncard` of a coerced finset `s` equals `s.card`.
Nat.card_eq_fintype_card
The cardinality `Nat.card α` of a finite type `α` equals `Fintype.card α`.
Fintype.card_fin
The cardinality of `Fin n` is `n`.
SimpleGraph.odd_ncard_oddComponents
In any finite graph, the number of odd connected components has the same parity as the total number of vertices.
Set.ncard_eq_toFinset_card'
The set cardinality `s.ncard` of a finite set `s` equals `s.toFinset.card`.
Finset.disjoint_left.mpr
Two finite sets are disjoint if no element of the first belongs to the second.
Finset.disjoint_left.mp
If two finite sets are disjoint, any element in the first does not belong to the second.
induced_component_ambient_vertex_properties
For connected components of an induced subgraph, their vertex sets are contained in the inducing set, have cardinalities matching the component supports, are pairwise disjoint for distinct components, and have no induced edges to the rest of the inducing set.
Finset.card_le_card
If s ⊆ t for finsets s and t, then |s| ≤ |t|.
Finset.not_subset.mp
If a finset s is not a subset of t, then there is some element in s not in t.
congrArg
Applying a function to equal arguments yields equal values.
Finset.card_pair
A set containing two distinct elements has cardinality 2.
Set.ncard_pos
A finite set has strictly positive cardinality if and only if it is nonempty.
Set.toFinite
Every set on a finite type is finite.
Finset.card_pos.mp
A finset with strictly positive cardinality is nonempty.
Finset.inter_comm
Intersection of finsets is commutative.
False.elim
From a contradiction (False), any statement follows.
balanced_cut_evenly_distributed_cross_matching_sharp
Under balanced-cut and separator assumptions, given at least r + 2 components of size at least 2 and U ⊆ C of size at least 2r, there exists an injective cross-matching of size r into the components such that at most r % 2 components meet the matching an odd number of times.
balanced_cut_even_component_parity_cross_matching
Under balanced-cut and separator assumptions with even n, given an even component H and at least n + 2 other components of size at least 2, there exists an injective cross-matching of size n + 1 from U into the complement such that every component in the collection meets the matching an even number of times.
extendible_balanced_cut_odd_bound_of_even_cross_matching
In a k-extendable graph with a balanced cut C of size 2k containing a matching M with |M| + r = k, if every subset U ⊆ C of size 2r admits a cross-matching into Cᶜ meeting every odd component an even number of times, then Cᶜ has at most r 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_even_component_odd_bound    (k r : ℕ) (G : SimpleGraph (Fin (4*k))) [DecidableRel G.Adj]    (hext : is_k_extendable G k)    (hsep : ∀ S P Q : Finset (Fin (4*k)), P.Nonempty → Q.Nonempty →      Disjoint S P → Disjoint S Q → Disjoint P Q → S ∪ P ∪ Q = Finset.univ →      (∀ u ∈ P, ∀ v ∈ Q, ¬ G.Adj u v) → 2*k ≤ S.card)    (hdegree : ∀ v, 2*k+1 ≤ (G.neighborFinset v).card)    (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)    (K : (G.induce {v | v ∉ C}).ConnectedComponent)    (hK : K ∉ (G.induce {v | v ∉ C}).oddComponents) :    (G.induce {v | v ∉ C}).oddComponents.ncard ≤ r := by  set_option maxHeartbeats 4000000 in    classical    by_contra hnot    let R : Set (Fin (4*k)) := {v | v ∉ C}    let H := G.induce R    let O : Finset H.ConnectedComponent := H.oddComponents.toFinset    let F : H.ConnectedComponent → Finset (Fin (4*k)) := in1206_component_vertices G R    have hRsize : Nat.card R = 2*k := by      rw [Nat.card_coe_set_eq]      change ((C : Set (Fin (4*k)))ᶜ).ncard = 2*k      rw [Set.ncard_compl, Set.ncard_coe_finset, Nat.card_eq_fintype_card, Fintype.card_fin, hcard]      omega    have hpar := SimpleGraph.odd_ncard_oddComponents H    rw [hRsize,Nat.odd_iff,Nat.odd_iff] at hpar    have hOcard : O.card = H.oddComponents.ncard := by      dsimp [O]      exact (Set.ncard_eq_toFinset_card' H.oddComponents).symm    have hq : r+1 ≤ O.card := by      change ¬ H.oddComponents.ncard ≤ r at hnot      omega    have hCH : ∀ i ∈ O, Disjoint C (F i) := by      intro i hi      apply Finset.disjoint_left.mpr      intro v hvC hvF      have hvR : v ∈ R := (induced_component_ambient_vertex_properties G R i i).1 hvF      exact hvR hvC    have hCK : Disjoint C (F K) := by      apply Finset.disjoint_left.mpr      intro v hvC hvF      have hvR : v ∈ R := (induced_component_ambient_vertex_properties G R K K).1 hvF      exact hvR hvC    have hdis : ∀ i ∈ O, ∀ j ∈ O, i ≠ j → Disjoint (F i) (F j) := by      intro i hi j hj hij      exact (induced_component_ambient_vertex_properties G R i j).2.2.1 hij    have hKF : ∀ i ∈ O, Disjoint (F K) (F i) := by      intro i hi      have hi' : i ∈ H.oddComponents := by simpa [O] using hi      have hne : K ≠ i := by        intro he        apply hK        simpa [R,H,he] using hi'      exact (induced_component_ambient_vertex_properties G R K i).2.2.1 hne    have hsize : ∀ i ∈ O, 2 ≤ (F i).card := by      intro i hi      have hc := (induced_component_ambient_vertex_properties G R i i).2.1      change 2 ≤ (in1206_component_vertices G R i).card      rw [hc]      obtain ⟨a,ha⟩ := i.nonempty_supp      have hneg : ¬ G.neighborFinset a.val ⊆ C := by        intro h        have hh := Finset.card_le_card h        have hd := hdegree a.val        omega      obtain ⟨b,hbN,hbC⟩ := Finset.not_subset.mp hneg      have hab : G.Adj a.val b := by simpa using hbN      let b' : R := ⟨b,hbC⟩      have hb : b' ∈ i.supp := i.mem_supp_of_adj_mem_supp ha hab      have habne : a ≠ b' := by        intro he        have hv := congrArg Subtype.val he        exact (G.ne_of_adj hab) hv      have hpair : ({a,b'} : Finset R) ⊆ i.supp.toFinset := by        intro x hx        simp only [Finset.mem_insert,Finset.mem_singleton] at hx        rcases hx with rfl | rfl        · exact Set.mem_toFinset.mpr ha        · exact Set.mem_toFinset.mpr hb      have hh := Finset.card_le_card hpair      rw [Finset.card_pair habne, ← Set.ncard_eq_toFinset_card'] at hh      exact hh    have hKN : (F K).Nonempty := by      obtain ⟨a,ha⟩ := K.nonempty_supp      have hn : 0 < K.supp.ncard := (Set.ncard_pos (Set.toFinite _)).mpr ⟨a,ha⟩      apply Finset.card_pos.mp      have hc := (induced_component_ambient_vertex_properties G R K K).2.1      change 0 < (in1206_component_vertices G R K).card      omega    have hanti : ∀ i ∈ O, ∀ u ∈ F i, ∀ v, v ∉ C → v ∉ F i → ¬ G.Adj u v := by      intro i hi u hu v hvC hvF      exact (induced_component_ambient_vertex_properties G R i i).2.2.2 u hu v hvC hvF    have hKanti : ∀ u ∈ F K, ∀ v, v ∉ C → v ∉ F K → ¬ G.Adj u v := by      intro u hu v hvC hvF      exact (induced_component_ambient_vertex_properties G R K K).2.2.2 u hu v hvC hvF    have 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 H.ConnectedComponent, B.card = 0 ∧            ∀ i ∈ H.oddComponents.toFinset, i ∉ B →              Even ((F i) ∩ ((Finset.univ : Finset (Fin r)).image g)).card := by      intro U hUC hU      by_cases hre : Even r      · have hrmod : r%2 = 0 := Nat.even_iff.mp hre        have hO : r+2 ≤ O.card := by omega        obtain ⟨f,g,hf,hg,hfg,hgroups,B,hB,hp⟩ :=          balanced_cut_evenly_distributed_cross_matching_sharp k r G hsep C U hcard hUC (by omega) O F hO hCH hdis hsize hanti        refine ⟨f,g,hf,hg,?_,B,by omega,?_⟩        · intro a          obtain ⟨i,hi,hgi⟩ := hgroups a          refine ⟨(hfg a).1,?_,(hfg a).2⟩          intro hgC          exact Finset.disjoint_left.mp (hCH i hi) hgC hgi        · intro i hi hiB          simpa [Finset.inter_comm] using hp i hi hiB      · cases r with        | zero => exact False.elim (hre (by simp))        | succ n =>          have hn : Even n := by            rw [Nat.even_iff] at hre ⊢            omega          have hO : n+2 ≤ O.card := by omega          obtain ⟨f,g,hf,hg,hfg,hp⟩ :=            balanced_cut_even_component_parity_cross_matching k n hn G hsep C U (F K) hcard hUC (by omega)              hCK hKN hKanti O F hO hCH hKF hdis hsize hanti          refine ⟨f,g,hf,hg,hfg,∅,by simp,?_⟩          intro i hi _          simpa [Finset.inter_comm] using hp i hi    have hb := extendible_balanced_cut_odd_bound_of_even_cross_matching k r G hext C hcard M hM hMC hm hcross    exact hnot hb
See it in the graphDiscuss this resultChallenge it