AFTD Auto-Formalizing Theoretical Domains

odd_component_bound_after_forced_matching

theoremverified

If a forced matching meets the far side only inside one selected odd component and leaves r vertices on the cut, the far side has at most r+1 odd components.

Statement

theorem odd_component_bound_after_forced_matching
    (k r : ℕ) (G : SimpleGraph (Fin (4*k))) [DecidableRel G.Adj]
    (C : Finset (Fin (4*k)))
    (K : (G.induce {v | v ∉ C}).ConnectedComponent)
    (hK : K ∈ (G.induce {v | v ∉ C}).oddComponents)
    (P T : G.Subgraph) (hP : P.IsPerfectMatching) (hT : T.IsMatching) (hTP : T ≤ P)
    (hsub : T.verts ⊆ (C : Set (Fin (4*k))) ∪
      (in1206_component_vertices G {v | v ∉ C} K : Set (Fin (4*k))))
    (hremain : ((C : Set (Fin (4*k))) \ T.verts).ncard = r) :
    (G.induce {v | v ∉ C}).oddComponents.ncard ≤ r+1
Source
Odd-component transfer for OP-1957; https://arxiv.org/abs/2611.22690.
Verified
26 Nov 2026
Axioms
Classical.choiceQuot.soundpropext
Built on 2
Used by 1

The proof, explained

The proof bounds the total number of odd components on the far side $G - C$ by setting aside the one selected odd component $K$ and bounding the remaining odd components $J$. Since the forced matching $T$ is assumed to meet the far side only inside $K$, all other odd components in $J$ are completely disjoint from $T$. Applying the lemma `odd_groups_budget_after_forced_matching` shows that $|J|$ cannot exceed the number of vertices in $C$ left uncovered by $T$, which is $r$. Adding the distinguished component $K$ back gives at most $r + 1$ odd components in total.

  1. Define the complement $R$ of the cut $C$, the induced subgraph $H = G[R]$, the set $O$ of odd components of $H$, the remaining odd components $J = O \setminus \{K\}$, and auxiliary sets.

    We introduce notation for the vertices $R = V \setminus C$ on the far side of the cut, the induced subgraph $H = G[R]$, and its collection of odd components $O$. We single out the selected odd component $K \in O$ and define $J = O \setminus \{K\}$ to be the set of all other odd components. We also let $F$ map each component of $H$ to its vertices in $G$, and let $L$ denote $R$ viewed as a finite set.

    lines 11–17

      classical
      let R : Set (Fin (4*k)) := {v | v ∉ C}
      let H := G.induce R
      let O : Finset H.ConnectedComponent := H.oddComponents.toFinset
      let J : Finset H.ConnectedComponent := O.erase K
      let F : H.ConnectedComponent → Finset (Fin (4*k)) := in1206_component_vertices G R
      let L : Finset (Fin (4*k)) := R.toFinset
  2. $|J| + 1$ equals the total number of odd components of $H$.

    Since $K$ is assumed to be an odd component, $K \in O$. Removing $K$ from $O$ to form $J$ decreases the cardinality by 1 by `Finset.card_erase_add_one`. Identifying the `Finset` cardinality of $O$ with the set cardinality `H.oddComponents.ncard` via `Set.ncard_eq_toFinset_card'`, we have $|J| + 1 = |O|$.

    lines 18–26

    uses Finset.card_erase_add_one, Set.ncard_eq_toFinset_card'

      have hKO : K ∈ O := by simpa [O,R,H] using hK
      have hJcard : J.card + 1 = H.oddComponents.ncard := by
        have hh := Finset.card_erase_add_one hKO
        have hOcard : O.card = H.oddComponents.ncard := by
          dsimp [O]
          exact (Set.ncard_eq_toFinset_card' H.oddComponents).symm
        dsimp [J]
        rw [← hOcard]
        exact hh
  3. Every component $i \in J$ is distinct from $K$.

    By definition of $J = O \setminus \{K\}$, any element $i \in J$ satisfies $i \neq K$, extracted via `Finset.mem_erase.mp`.

    lines 27–29

    uses Finset.mem_erase.mp

      have hJne : ∀ i ∈ J, i ≠ K := by
        intro i hi
        exact (Finset.mem_erase.mp hi).1
  4. Each component $i \in J$ has an odd number of vertices.

    Since $i \in J \subseteq O$, $i$ is an odd component of $H$. By `induced_component_ambient_vertex_properties`, the vertex set $F(i)$ has cardinality equal to the cardinality of the component's support, which is odd.

    lines 30–36

    uses Finset.mem_erase.mp, induced_component_ambient_vertex_properties

      have hJodd : ∀ i ∈ J, Odd (F i).card := by
        intro i hi
        have hiO : i ∈ O := (Finset.mem_erase.mp hi).2
        have hiOdd : i ∈ H.oddComponents := by simpa [O] using hiO
        have hc := (induced_component_ambient_vertex_properties G R i i).2.1
        rw [hc]
        exact hiOdd
  5. The vertex set of each component $i \in J$ is contained in $L$.

    By `induced_component_ambient_vertex_properties`, all vertices of an induced component of $H$ belong to $R$, hence to $L$.

    lines 37–40

    uses induced_component_ambient_vertex_properties

      have hJsub : ∀ i ∈ J, F i ⊆ L := by
        intro i hi v hv
        have hh := (induced_component_ambient_vertex_properties G R i i).1 hv
        simpa [L] using hh
  6. Distinct components $i, j \in J$ have disjoint vertex sets.

    By `induced_component_ambient_vertex_properties`, distinct connected components of the induced subgraph $H$ have disjoint sets of vertices.

    lines 41–43

    uses induced_component_ambient_vertex_properties

      have hJdis : ∀ i ∈ J, ∀ j ∈ J, 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
  7. There are no edges in $G$ between any component $i \in J$ and the rest of $L$.

    By `induced_component_ambient_vertex_properties`, a connected component in $H$ has no edges in $G$ connecting any vertex $u \in F(i)$ to any vertex $v \in R$ outside $F(i)$.

    lines 44–47

    uses induced_component_ambient_vertex_properties

      have hJanti : ∀ i ∈ J, ∀ u ∈ F i, ∀ v ∈ L, v ∉ F i → ¬ G.Adj u v := by
        intro i hi u hu v hv hvnot
        have hvR : v ∈ R := by simpa [L] using hv
        exact (induced_component_ambient_vertex_properties G R i i).2.2.2 u hu v hvR hvnot
  8. No vertex of any component $i \in J$ is covered by the matching $T$.

    Assume for contradiction that some vertex $u \in F(i)$ is a vertex of $T$. By hypothesis $h_{\text{sub}}$, all vertices of $T$ belong to $C \cup F(K)$, so $u \in C$ or $u \in F(K)$. But $u \in F(i) \subseteq R$, which is disjoint from $C$, so $u \notin C$. Furthermore, since $i \neq K$, $F(i)$ is disjoint from $F(K)$ by `induced_component_ambient_vertex_properties` and `Finset.disjoint_left.mp`, so $u \notin F(K)$. Both cases give a contradiction.

    lines 48–55

    uses induced_component_ambient_vertex_properties, Finset.disjoint_left.mp

      have hJfree : ∀ i ∈ J, ∀ u ∈ F i, u ∉ T.verts := by
        intro i hi u hu huT
        have huR : u ∈ R := (induced_component_ambient_vertex_properties G R i i).1 hu
        rcases hsub huT with huC | huK
        · exact huR huC
        · have hdis : Disjoint (F i) (F K) :=
            (induced_component_ambient_vertex_properties G R i K).2.2.1 (hJne i hi)
          exact Finset.disjoint_left.mp hdis hu huK
  9. $|J| \le |(V \setminus L) \setminus V(T)|$.

    We apply `odd_groups_budget_after_forced_matching` to the family of odd components $J$, using the established properties that the sets $F(i)$ are odd, mutually disjoint, contained in $L$, isolated from the rest of $L$, and contain no vertices of $T$.

    lines 56–57

    uses odd_groups_budget_after_forced_matching

      have hbudget := odd_groups_budget_after_forced_matching G P T hP hT hTP J F L
        hJsub hJodd hJdis hJanti hJfree
  10. The number of vertices outside $L$ that are not in $T$ equals $r$.

    The complement $V \setminus L$ is the cut $C$, so $(V \setminus L) \setminus V(T)$ is precisely $C \setminus V(T)$. By hypothesis $h_{\text{remain}}$, the cardinality of $C \setminus V(T)$ is $r$. We convert between `Finset` and `Set` cardinalities using `Set.ncard_coe_finset`.

    lines 58–63

    uses Set.ncard_coe_finset

      have hcount : ((Finset.univ \ L).filter (fun v => v ∉ T.verts)).card = r := by
        have heq : (((Finset.univ \ L).filter (fun v => v ∉ T.verts)) : Set (Fin (4*k))) =
            (C : Set (Fin (4*k))) \ T.verts := by
          ext v
          simp [L,R]
        rw [← Set.ncard_coe_finset,heq,hremain]
  11. The total number of odd components of $H$ is at most $r + 1$.

    Substituting the count $r$ into the budget inequality yields $|J| \le r$. Since the total number of odd components is $|J| + 1$, linear arithmetic (`omega`) closes the goal.

    lines 64–66

      rw [hcount] at hbudget
      change H.oddComponents.ncard ≤ r+1
      omega
Finset.card_erase_add_one
Removing an element $a$ from a finite set $s$ decreases its cardinality by 1 (so $|s \setminus \{a\}| + 1 = |s|$), provided $a \in s$.
Set.ncard_eq_toFinset_card'
The set cardinality (`ncard`) of a finite set equals the cardinality of its conversion to a `Finset`.
Finset.mem_erase.mp
If an element belongs to $s \setminus \{a\}$, then it is not equal to $a$ and belongs to $s$.
induced_component_ambient_vertex_properties
For components of an induced subgraph on a vertex set $R$, their ambient vertex sets lie in $R$, their cardinalities match the component support sizes, distinct components have disjoint vertex sets, and no edges in the graph connect a component to the rest of $R$.
Finset.disjoint_left.mp
If two sets are disjoint, any element of the first set is not in the second set.
odd_groups_budget_after_forced_matching
In a graph with a matching $T$ extending into a perfect matching $P$, any family of pairwise disjoint odd components inside a vertex set $L$ that are isolated from $L$ and disjoint from $T$ has cardinality at most the number of vertices outside $L$ not covered by $T$.
Set.ncard_coe_finset
The set cardinality (`ncard`) of a `Finset` coerced to a `Set` equals its `Finset` cardinality.

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 odd_component_bound_after_forced_matching    (k r : ℕ) (G : SimpleGraph (Fin (4*k))) [DecidableRel G.Adj]    (C : Finset (Fin (4*k)))    (K : (G.induce {v | v ∉ C}).ConnectedComponent)    (hK : K ∈ (G.induce {v | v ∉ C}).oddComponents)    (P T : G.Subgraph) (hP : P.IsPerfectMatching) (hT : T.IsMatching) (hTP : T ≤ P)    (hsub : T.verts ⊆ (C : Set (Fin (4*k))) ∪      (in1206_component_vertices G {v | v ∉ C} K : Set (Fin (4*k))))    (hremain : ((C : Set (Fin (4*k))) \ T.verts).ncard = r) :    (G.induce {v | v ∉ C}).oddComponents.ncard ≤ r+1 := by  classical  let R : Set (Fin (4*k)) := {v | v ∉ C}  let H := G.induce R  let O : Finset H.ConnectedComponent := H.oddComponents.toFinset  let J : Finset H.ConnectedComponent := O.erase K  let F : H.ConnectedComponent → Finset (Fin (4*k)) := in1206_component_vertices G R  let L : Finset (Fin (4*k)) := R.toFinset  have hKO : K ∈ O := by simpa [O,R,H] using hK  have hJcard : J.card + 1 = H.oddComponents.ncard := by    have hh := Finset.card_erase_add_one hKO    have hOcard : O.card = H.oddComponents.ncard := by      dsimp [O]      exact (Set.ncard_eq_toFinset_card' H.oddComponents).symm    dsimp [J]    rw [← hOcard]    exact hh  have hJne : ∀ i ∈ J, i ≠ K := by    intro i hi    exact (Finset.mem_erase.mp hi).1  have hJodd : ∀ i ∈ J, Odd (F i).card := by    intro i hi    have hiO : i ∈ O := (Finset.mem_erase.mp hi).2    have hiOdd : i ∈ H.oddComponents := by simpa [O] using hiO    have hc := (induced_component_ambient_vertex_properties G R i i).2.1    rw [hc]    exact hiOdd  have hJsub : ∀ i ∈ J, F i ⊆ L := by    intro i hi v hv    have hh := (induced_component_ambient_vertex_properties G R i i).1 hv    simpa [L] using hh  have hJdis : ∀ i ∈ J, ∀ j ∈ J, 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 hJanti : ∀ i ∈ J, ∀ u ∈ F i, ∀ v ∈ L, v ∉ F i → ¬ G.Adj u v := by    intro i hi u hu v hv hvnot    have hvR : v ∈ R := by simpa [L] using hv    exact (induced_component_ambient_vertex_properties G R i i).2.2.2 u hu v hvR hvnot  have hJfree : ∀ i ∈ J, ∀ u ∈ F i, u ∉ T.verts := by    intro i hi u hu huT    have huR : u ∈ R := (induced_component_ambient_vertex_properties G R i i).1 hu    rcases hsub huT with huC | huK    · exact huR huC    · have hdis : Disjoint (F i) (F K) :=        (induced_component_ambient_vertex_properties G R i K).2.2.1 (hJne i hi)      exact Finset.disjoint_left.mp hdis hu huK  have hbudget := odd_groups_budget_after_forced_matching G P T hP hT hTP J F L    hJsub hJodd hJdis hJanti hJfree  have hcount : ((Finset.univ \ L).filter (fun v => v ∉ T.verts)).card = r := by    have heq : (((Finset.univ \ L).filter (fun v => v ∉ T.verts)) : Set (Fin (4*k))) =        (C : Set (Fin (4*k))) \ T.verts := by      ext v      simp [L,R]    rw [← Set.ncard_coe_finset,heq,hremain]  rw [hcount] at hbudget  change H.oddComponents.ncard ≤ r+1  omega
See it in the graphDiscuss this resultChallenge it