AFTD Auto-Formalizing Theoretical Domains

factor_critical_anticomplete_cut_side_even

theoremverified

In a finite k-factor-critical graph, if two disjoint anticomplete vertex sets have a complement of exactly k vertices, then the first set has even cardinality.

Statement

theorem factor_critical_anticomplete_cut_side_even
    {V : Type*} [Fintype V] [DecidableEq V] (G : SimpleGraph V) (k : ℕ)
    (hG : is_k_factor_critical G k) (A B : Finset V)
    (hAB : Disjoint A B) (hcross : ∀ a ∈ A, ∀ b ∈ B, ¬ G.Adj a b)
    (hcut : ((Finset.univ : Finset V) \ (A ∪ B)).card = k) : Even A.card
Source
Parity of crossing cut sides in the OP-1957 strict-interior route.
Verified
20 Nov 2026
Axioms
Classical.choiceQuot.soundpropext
Built on 1
  • is_k_factor_criticalA simple graph G on a finite vertex type V is k-factor-critical if for every subset S of V with cardinality k, the induced subgraph on Sᶜ…
Used by 7

The proof, explained

The theorem is proved by contradiction using a helper lemma: in any graph, if two disjoint vertex sets A and B are anticomplete and G[A ∪ B] has a perfect matching, then the matching cannot cross between A and B, which forces |A| to be even. To prove the main theorem, suppose for contradiction that |A| is odd. The complement C = V \ (A ∪ B) has size k, so by k-factor-criticality, the subgraph induced by V \ C = A ∪ B must have a perfect matching. This contradicts the helper lemma, completing the proof that |A| is even.

  1. Suppose, for contradiction, that the induced subgraph G[A ∪ B] has a perfect matching P.

    We assume the negation of the helper lemma's goal, introducing the assumed perfect matching P on the induced subgraph G[A ∪ B].

    lines 6–7

      classical
      rintro ⟨P, hP⟩
  2. The subgraph R of P induced by the vertices in A is a matching.

    We restrict the matching P to the vertices belonging to A. For each vertex a ∈ A, its unique partner b in the perfect matching P cannot belong to B because A and B are anticomplete (no edge in G connects A and B). Hence b must belong to A as well, so ab is an edge of R and is the unique edge incident to a in R.

    lines 8–20

    uses False.elim

      let C : Set {v : V // v ∈ A ∨ v ∈ B} := {v | v.val ∈ A}
      let R := P.induce C
      have hRmatch : R.IsMatching := by
        intro a ha
        have haA : a.val ∈ A := ha
        obtain ⟨b, hab, huniq⟩ := hP.1 (hP.2 a)
        have hbA : b.val ∈ A := by
          rcases b.property with hbA | hbB
          · exact hbA
          · exact False.elim (hcross a.val haA b.val hbB (P.adj_sub hab))
        refine ⟨b, ⟨haA, hbA, hab⟩, ?_⟩
        intro c hc
        exact huniq c hc.2.2
  3. The number of vertices in R equals |A|.

    We construct a canonical bijection between the vertex set of R and the elements of A. Equality of their underlying values ensures the map is a two-sided inverse by extensionality on subtypes. Since bijections between finite types preserve cardinality, the number of vertices in R equals |A|.

    lines 21–29

    uses Subtype.ext, Set.toFinset_card, Fintype.card_congr

      let e : R.verts ≃ {v : V // v ∈ A} := {
        toFun := fun ⟨⟨v, hv⟩, ha⟩ => ⟨v, ha⟩
        invFun := fun ⟨v, hv⟩ => ⟨⟨v, Or.inl hv⟩, hv⟩
        left_inv := by intro v; apply Subtype.ext; apply Subtype.ext; rfl
        right_inv := by intro v; apply Subtype.ext; rfl }
      have hcard : R.verts.toFinset.card = A.card := by
        rw [Set.toFinset_card]
        have he := Fintype.card_congr e
        simpa using he
  4. A contradiction is reached, proving that G[A ∪ B] has no perfect matching.

    Any graph that admits a matching on its vertices has an even number of vertices. Since R is a matching, its vertex count |A| must be even. However, |A| is assumed to be odd, which is a contradiction because an integer cannot be both even and odd.

    lines 30–32

    uses Nat.not_odd_iff_even.mpr

      have heven := hRmatch.even_card
      rw [hcard] at heven
      exact (Nat.not_odd_iff_even.mpr heven) hodd
  5. Suppose, for contradiction, that |A| is not even; then |A| is odd.

    We begin the proof of the main theorem by contradiction: assuming |A| is not even, parity implies that |A| must be odd.

    lines 39–41

    uses Nat.not_even_iff_odd.mp

      classical
      by_contra hn
      have hodd : Odd A.card := Nat.not_even_iff_odd.mp hn
  6. The induced subgraph G[A ∪ B] has a perfect matching.

    Let C = V \ (A ∪ B) be the complement of A ∪ B in V. By assumption, |C| = k. Since G is k-factor-critical, deleting C leaves an induced subgraph G[V \ C] with a perfect matching. But V \ C is precisely A ∪ B, so G[A ∪ B] has a perfect matching.

    lines 42–49

      let C : Finset V := Finset.univ \ (A ∪ B)
      have hm := hG C hcut
      have heq : (C : Set V)ᶜ = {v | v ∈ A ∨ v ∈ B} := by
        ext v
        simp [C] <;> tauto
      have hm' : ∃ P : (G.induce {v | v ∈ A ∨ v ∈ B}).Subgraph, P.IsPerfectMatching := by
        rw [← heq]
        exact hm
  7. A contradiction is reached, concluding that |A| must be even.

    By the auxiliary lemma in1076_factorcritical_odd_union_no_matching, since A and B are disjoint, anticomplete, and |A| is odd, G[A ∪ B] cannot admit a perfect matching. This directly contradicts the perfect matching obtained from k-factor-criticality.

    line 50

    uses in1076_factorcritical_odd_union_no_matching

      exact in1076_factorcritical_odd_union_no_matching G A B hAB hodd hcross hm'
False.elim
From a contradiction (a proof of False), any conclusion follows.
Fintype.card_congr
A bijection between two finite types implies that they have the same cardinality.
Nat.not_even_iff_odd.mp
If a natural number is not even, then it is odd.
Nat.not_odd_iff_even.mpr
If a natural number is even, then it is not odd.
Set.toFinset_card
The cardinality of the finset corresponding to a set equals the cardinality of the set as a finite type.
Subtype.ext
Two elements of a subtype are equal if their underlying values are equal.
in1076_factorcritical_odd_union_no_matching
In any graph, if two disjoint vertex sets A and B have no edges between them and |A| is odd, then the subgraph induced by A ∪ B does not admit a perfect matching.

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 in1076_factorcritical_odd_union_no_matching    {V : Type*} [Fintype V] [DecidableEq V] (G : SimpleGraph V) (A B : Finset V)    (hAB : Disjoint A B) (hodd : Odd A.card)    (hcross : ∀ a ∈ A, ∀ b ∈ B, ¬ G.Adj a b) :    ¬ ∃ P : (G.induce {v | v ∈ A ∨ v ∈ B}).Subgraph, P.IsPerfectMatching := by  classical  rintro ⟨P, hP⟩  let C : Set {v : V // v ∈ A ∨ v ∈ B} := {v | v.val ∈ A}  let R := P.induce C  have hRmatch : R.IsMatching := by    intro a ha    have haA : a.val ∈ A := ha    obtain ⟨b, hab, huniq⟩ := hP.1 (hP.2 a)    have hbA : b.val ∈ A := by      rcases b.property with hbA | hbB      · exact hbA      · exact False.elim (hcross a.val haA b.val hbB (P.adj_sub hab))    refine ⟨b, ⟨haA, hbA, hab⟩, ?_⟩    intro c hc    exact huniq c hc.2.2  let e : R.verts ≃ {v : V // v ∈ A} := {    toFun := fun ⟨⟨v, hv⟩, ha⟩ => ⟨v, ha⟩    invFun := fun ⟨v, hv⟩ => ⟨⟨v, Or.inl hv⟩, hv⟩    left_inv := by intro v; apply Subtype.ext; apply Subtype.ext; rfl    right_inv := by intro v; apply Subtype.ext; rfl }  have hcard : R.verts.toFinset.card = A.card := by    rw [Set.toFinset_card]    have he := Fintype.card_congr e    simpa using he  have heven := hRmatch.even_card  rw [hcard] at heven  exact (Nat.not_odd_iff_even.mpr heven) hoddtheorem factor_critical_anticomplete_cut_side_even    {V : Type*} [Fintype V] [DecidableEq V] (G : SimpleGraph V) (k : ℕ)    (hG : is_k_factor_critical G k) (A B : Finset V)    (hAB : Disjoint A B) (hcross : ∀ a ∈ A, ∀ b ∈ B, ¬ G.Adj a b)    (hcut : ((Finset.univ : Finset V) \ (A ∪ B)).card = k) : Even A.card := by  classical  by_contra hn  have hodd : Odd A.card := Nat.not_even_iff_odd.mp hn  let C : Finset V := Finset.univ \ (A ∪ B)  have hm := hG C hcut  have heq : (C : Set V)ᶜ = {v | v ∈ A ∨ v ∈ B} := by    ext v    simp [C] <;> tauto  have hm' : ∃ P : (G.induce {v | v ∈ A ∨ v ∈ B}).Subgraph, P.IsPerfectMatching := by    rw [← heq]    exact hm  exact in1076_factorcritical_odd_union_no_matching G A B hAB hodd hcross hm'
See it in the graphDiscuss this resultChallenge it