AFTD Auto-Formalizing Theoretical Domains

extendible_independent_common_nonneighbor_deficit_le_zero

theoremverified

Under the stated high-degree extendibility and independence assumptions, a nonempty independent U and a disjoint anticomplete W satisfy 2|U|+|W|≤2k.

Statement

theorem extendible_independent_common_nonneighbor_deficit_le_zero
    (k : ℕ) (G : SimpleGraph (Fin (4*k))) [DecidableRel G.Adj]
    (hext : is_k_extendable G k)
    (hdegree : ∀ v, 2*k+2 ≤ (G.neighborFinset v).card)
    (hind : ∀ I : Finset (Fin (4*k)),
      (∀ x ∈ I, ∀ y ∈ I, x ≠ y → ¬ G.Adj x y) → I.card ≤ k)
    (U W : Finset (Fin (4*k))) (hdis : Disjoint U W) (hU : U.Nonempty)
    (hUind : ∀ u ∈ U, ∀ v ∈ U, ¬ G.Adj u v)
    (hanti : ∀ u ∈ U, ∀ w ∈ W, ¬ G.Adj u w) :
    2*U.card+W.card ≤ 2*k
Source
Positive-separator transfer for OP-1957; https://arxiv.org/abs/2611.22690.
Verified
28 Nov 2026
Axioms
Classical.choiceQuot.soundpropext
Built on 10

The proof, explained

We argue by contradiction, assuming 2|U| + |W| > 2k. Using the degree condition deg(v) ≥ 2k + 2 and the fact that all neighbors of any vertex in U lie outside U ∪ W, we deduce 3 ≤ |U| ≤ k, which allows us to select a subset W₀ ⊆ W of size 2k + 1 - 2|U| and find an edge {z, z'} outside U ∪ W₀ to embed in a 2k-element set R. By balanced cut theorems for k-extendable graphs, maximum matchings in C = Rᶜ and R have equal size at least k - 1, so combining a (k - 1)-submatching in C with {z, z'} gives a k-matching spanning a 2k-element set S disjoint from U ∪ W₀. Finally, S induces a perfect matching, which contradicts the general anticomplete matching obstruction theorem since 2|U| + |W₀| = 2k + 1 > 4k - 2k.

  1. Every matching M in a graph induces a subgraph on its vertices that possesses a perfect matching.

    For each vertex v in M, let f(v) denote the unique neighbor of v in M, chosen via Classical.choose_spec. Because M is a matching, each vertex has degree 1, so f is a fixed-point-free involution on M.verts (Subtype.ext). Applying perfect_matching_of_adjacency_involution yields a perfect matching on the induced subgraph G[M.verts].

    lines 4–17

    uses Classical.choose_spec, Subtype.ext, perfect_matching_of_adjacency_involution

      classical
      let f : M.verts → M.verts := fun v =>
        ⟨Classical.choose (hM v.property), M.edge_vert (Classical.choose_spec (hM v.property)).1.symm⟩
      have hf : ∀ v : M.verts, M.Adj v.val (f v).val := by
        intro v
        exact (Classical.choose_spec (hM v.property)).1
      have hinv : Function.Involutive f := by
        intro v
        apply Subtype.ext
        exact (hM (f v).property).unique (hf (f v)) (hf v).symm
      have hadj : ∀ v : M.verts, (G.induce M.verts).Adj v (f v) := by
        intro v
        exact M.adj_sub (hf v)
      exact perfect_matching_of_adjacency_involution (G.induce M.verts) f hinv hadj
  2. It suffices to derive a contradiction from the assumption 2|U| + |W| > 2k.

    We assume the negation 2|U| + |W| > 2k for contradiction (by_contra hn).

    lines 29–32

      set_option maxHeartbeats 4000000 in
      set_option linter.unnecessarySimpa false in
      classical
      by_contra hn
  3. The independent set U contains at least 3 vertices (3 ≤ |U|). automation

    Suppose for contradiction that |U| ≤ 2. Pick a vertex u ∈ U (since U is nonempty). Since U is independent and anticomplete to W, all neighbors of u must lie in (U ∪ W)ᶜ, so deg(u) ≤ |(U ∪ W)ᶜ| by Finset.card_le_card. By Finset.card_compl, Finset.card_union_of_disjoint, and Fintype.card_fin, |(U ∪ W)ᶜ| = 4k - (|U| + |W|). But deg(u) ≥ 2k + 2, whereas |U| + |W| = (2|U| + |W|) - |U| ≥ (2k + 1) - 2 = 2k - 1, which implies 4k - (|U| + |W|) ≤ 2k + 1 < 2k + 2, an arithmetic contradiction closed by omega.

    lines 33–50

    uses Finset.card_le_card, Finset.card_compl, Finset.card_union_of_disjoint, Fintype.card_fin

      have hUlarge : 3 ≤ U.card := by
        by_contra hs
        have hsmall : U.card ≤ 2 := by omega
        obtain ⟨u, hu⟩ := hU
        have hNbr : G.neighborFinset u ⊆ (U ∪ W)ᶜ := by
          intro v hv
          have huv : G.Adj u v := by simpa using hv
          simp only [Finset.mem_compl, Finset.mem_union]
          intro hvUW
          rcases hvUW with hvU | hvW
          · exact hUind u hu v hvU huv
          · exact hanti u hu v hvW huv
        have hc := Finset.card_le_card hNbr
        have hcomp := Finset.card_compl (U ∪ W)
        have hunion := Finset.card_union_of_disjoint hdis
        have hd := hdegree u
        simp only [Fintype.card_fin] at hcomp
        omega
  4. The size of U satisfies 3 ≤ |U| ≤ k (so k ≥ 3), and there exists a subset W₀ ⊆ W of size q = 2k + 1 - 2|U| disjoint from U.

    Because U is independent, the hypothesis hind implies |U| ≤ k, which with 3 ≤ |U| gives k ≥ 3. Under the contradiction hypothesis, q = 2k + 1 - 2|U| ≤ |W|, so by Finset.exists_subset_card_eq we can choose a subset W₀ ⊆ W with |W₀| = q. Since U and W are disjoint, U and W₀ are disjoint by Finset.disjoint_of_subset_right.

    lines 51–57

    uses Finset.exists_subset_card_eq, Finset.disjoint_of_subset_right

      have hUk : U.card ≤ k := hind U (by intro x hx y hy hne; exact hUind x hx y hy)
      have hk : 3 ≤ k := by omega
      let q := 2*k+1 - 2*U.card
      have hq : q + 2*U.card = 2*k+1 := by dsimp [q]; omega
      have hqW : q ≤ W.card := by omega
      obtain ⟨W0, hW0W, hW0card⟩ := Finset.exists_subset_card_eq hqW
      have hdis0 : Disjoint U W0 := Finset.disjoint_of_subset_right hW0W hdis
  5. The set X = U ∪ W₀ has size at most 2k - 2, and there exist adjacent vertices z, z' outside X.

    By Finset.card_union_of_disjoint and |U| ≥ 3, |X| = |U| + q = 2k + 1 - |U| ≤ 2k - 2. By Finset.card_compl and Fintype.card_fin, |Xᶜ| = 4k - |X| ≥ 2k + 2 > 0, so by Finset.card_pos.mp and Finset.mem_compl.mp there is a vertex z ∉ X. Since deg(z) ≥ 2k + 2 > |X|, the neighborhood of z cannot be contained in X, so by Finset.not_subset.mp there is an adjacent vertex z' ∉ X.

    lines 58–77

    uses Finset.card_union_of_disjoint, Finset.card_compl, Fintype.card_fin, Finset.card_pos.mp, Finset.mem_compl.mp, Finset.not_subset.mp

      let X : Finset (Fin (4*k)) := U ∪ W0
      have hXcard : X.card = 2*k+1 - U.card := by
        dsimp [X]
        rw [Finset.card_union_of_disjoint hdis0]
        omega
      have hXle : X.card ≤ 2*k - 2 := by omega
      have hXcompl_pos : 0 < Xᶜ.card := by
        rw [Finset.card_compl]
        simp only [Fintype.card_fin]
        omega
      obtain ⟨z, hzcompl⟩ := Finset.card_pos.mp hXcompl_pos
      have hzX : z ∉ X := Finset.mem_compl.mp hzcompl
      have hnot : ¬ G.neighborFinset z ⊆ X := by
        intro hh
        have hc := Finset.card_le_card hh
        have hd := hdegree z
        omega
      obtain ⟨z', hz'nbr, hz'X⟩ := Finset.not_subset.mp hnot
      have hzz'adj : G.Adj z z' := by simpa using hz'nbr
      have hzne : z ≠ z' := G.ne_of_adj hzz'adj
  6. The pair {z, z'} is disjoint from X, and X ∪ {z, z'} extends to a subset R of size 2k, whose complement C = Rᶜ also has size 2k.

    Since neither z nor z' is in X, {z, z'} is disjoint from X (Finset.disjoint_left.mpr) and has size 2 (Finset.card_pair_eq_two_iff). Thus X' = X ∪ {z, z'} has size |X| + 2 ≤ 2k (Finset.card_union_of_disjoint). By Finset.exists_subsuperset_card_eq with Finset.subset_univ, X' extends to a subset R of size 2k. Its complement C = Rᶜ also has size 4k - 2k = 2k (Finset.card_compl, Fintype.card_fin), and U, W₀, z, z' all belong to R.

    lines 78–115

    uses Finset.disjoint_left.mpr, Finset.card_pair_eq_two_iff, Finset.card_union_of_disjoint, Finset.exists_subsuperset_card_eq, Finset.subset_univ, Finset.card_compl, Fintype.card_fin

      have hdis_zz' : Disjoint X ({z, z'} : Finset (Fin (4*k))) := by
        apply Finset.disjoint_left.mpr
        intro x hxX hxzz'
        simp only [Finset.mem_insert, Finset.mem_singleton] at hxzz'
        rcases hxzz' with rfl | rfl
        · exact hzX hxX
        · exact hz'X hxX
      have hcard_zz' : ({z, z'} : Finset (Fin (4*k))).card = 2 := by
        rw [Finset.card_pair_eq_two_iff]
        exact hzne
      let X' : Finset (Fin (4*k)) := X ∪ {z, z'}
      have hX'card : X'.card = X.card + 2 := by
        dsimp [X']
        rw [Finset.card_union_of_disjoint hdis_zz', hcard_zz']
      have hX'le : X'.card ≤ 2*k := by omega
      obtain ⟨R, hX'R, hRuniv, hRcard⟩ := Finset.exists_subsuperset_card_eq
        (s := X') (t := Finset.univ) (n := 2*k) (Finset.subset_univ X') hX'le (by simp; omega)
      let C : Finset (Fin (4*k)) := Rᶜ
      have hCcard : C.card = 2*k := by
        have hh := Finset.card_compl R
        simp only [Fintype.card_fin] at hh
        dsimp [C]
        omega
      have hCset : (C : Set (Fin (4*k))) = (R : Set (Fin (4*k)))ᶜ := by ext x; simp [C]
      have hUinR : U ⊆ R := by
        intro x hx
        apply hX'R
        exact Finset.mem_union_left _ (Finset.mem_union_left _ hx)
      have hWinR : W0 ⊆ R := by
        intro x hx
        apply hX'R
        exact Finset.mem_union_left _ (Finset.mem_union_right _ hx)
      have hzinR : z ∈ R := by
        apply hX'R
        exact Finset.mem_union_right _ (by simp)
      have hz'inR : z' ∈ R := by
        apply hX'R
        exact Finset.mem_union_right _ (by simp)
  7. There exists a matching T of size k - 1 whose vertices lie entirely within C.

    Let M and N be maximum matchings in C and R respectively (finite_subset_has_maximum_matching). By extendible_balanced_cut_matching_symmetry_of_independence, |M| = |N|. Since minimum degree is at least 2k + 1, extendible_equal_cut_maximum_matching_deficiency_at_most_one gives |M| ≥ k - 1. By finite_matching_has_submatching_of_each_smaller_size, M contains a submatching T with k - 1 edges, with vertices in C by Set.Subset.trans.

    lines 116–126

    uses finite_subset_has_maximum_matching, extendible_balanced_cut_matching_symmetry_of_independence, extendible_equal_cut_maximum_matching_deficiency_at_most_one, finite_matching_has_submatching_of_each_smaller_size, Set.Subset.trans

      obtain ⟨M, hM, hMC, hmaxM⟩ := finite_subset_has_maximum_matching G C
      obtain ⟨N, hN, hNR, hmaxNR⟩ := finite_subset_has_maximum_matching G R
      have hNC : N.verts ⊆ (C : Set (Fin (4*k)))ᶜ := by simpa [hCset] using hNR
      have hmaxN : ∀ T : G.Subgraph, T.IsMatching → T.verts ⊆ (C : Set (Fin (4*k)))ᶜ → T.edgeSet.ncard ≤ N.edgeSet.ncard := by
        simpa [hCset] using hmaxNR
      have heq := extendible_balanced_cut_matching_symmetry_of_independence k G hext hind C hCcard M N hM hN hMC hNC hmaxM hmaxN
      have hdegree_one : ∀ v, 2*k+1 ≤ (G.neighborFinset v).card := fun v => by
        have := hdegree v; omega
      have hnear := extendible_equal_cut_maximum_matching_deficiency_at_most_one k G hext hdegree_one C hCcard M N hM hN hMC hNC hmaxM hmaxN heq hind
      obtain ⟨T, hT, hTM, hTcard⟩ := finite_matching_has_submatching_of_each_smaller_size G M hM (k-1) (by omega)
      have hTC : T.verts ⊆ (C : Set (Fin (4*k))) := Set.Subset.trans hTM.1 hMC
  8. The submatching T and the edge {z, z'} combine to form a matching T ⊔ E of size k, spanning a vertex set S of size 2k.

    The single edge {z, z'} forms a matching E of size 1 with vertex set {z, z'} (indexed_disjoint_cross_edges_form_matching, Subsingleton.elim). Since T has vertices in C and {z, z'} ⊆ R = Cᶜ, their vertex sets are disjoint (Set.disjoint_left.mpr). By extendible_graph_matchable_deletion_inherits_extendibility_sup_ncard, T ⊔ E is a matching with (k - 1) + 1 = k edges. By in1076_matching_twice_card and Set.ncard_eq_toFinset_card', the vertex set S of T ⊔ E has size 2k.

    lines 127–150

    uses indexed_disjoint_cross_edges_form_matching, Subsingleton.elim, Set.disjoint_left.mpr, extendible_graph_matchable_deletion_inherits_extendibility_sup_ncard, in1076_matching_twice_card, Set.ncard_eq_toFinset_card'

      let f : Fin 1 → Fin (4*k) := fun _ => z
      let g : Fin 1 → Fin (4*k) := fun _ => z'
      obtain ⟨E, hE, hEcard, hEverts⟩ := indexed_disjoint_cross_edges_form_matching G 1 f g
        (by intro i j h; exact Subsingleton.elim i j)
        (by intro i j h; exact Subsingleton.elim i j)
        (by intro i j; exact hzne)
        (by intro i; exact hzz'adj)
      have hTE : Disjoint T.verts E.verts := by
        apply Set.disjoint_left.mpr
        intro x hxT hxE
        have hxC := hTC hxT
        rw [hEverts] at hxE
        rcases hxE with ⟨i, hi⟩ | ⟨i, hi⟩
        · have hxR : x ∈ R := by simpa [f, hi] using hzinR
          simpa [C, hxR] using hxC
        · have hxR : x ∈ R := by simpa [g, hi] using hz'inR
          simpa [C, hxR] using hxC
      have hTE' := extendible_graph_matchable_deletion_inherits_extendibility_sup_ncard T E hT hE hTE
      have hTEcard : (T ⊔ E).edgeSet.ncard = k := by rw [hTE'.2, hTcard, hEcard]; omega
      let S : Finset (Fin (4*k)) := (T ⊔ E).verts.toFinset
      have hScard : S.card = 2*k := by
        change ((T ⊔ E).verts.toFinset).card = 2*k
        rw [← Set.ncard_eq_toFinset_card']
        simpa only [hTEcard] using (in1076_matching_twice_card hTE'.1).symm
  9. The vertex set S is disjoint from U ∪ W₀, and the induced subgraph G[S] has a perfect matching.

    Vertices of T lie in C (disjoint from R ⊇ U ∪ W₀), while {z, z'} was chosen outside X = U ∪ W₀, so S is disjoint from U ∪ W₀ (Finset.disjoint_left.mpr). By extendible_independent_common_nonneighbor_deficit_le_zero_match_verts_perfect, the matching T ⊔ E induces a perfect matching on the subgraph G[S].

    lines 151–178

    uses Finset.disjoint_left.mpr, extendible_independent_common_nonneighbor_deficit_le_zero_match_verts_perfect

      have hSdis : Disjoint S (U ∪ W0) := by
        apply Finset.disjoint_left.mpr
        intro x hxS hxUW
        have hxTE : x ∈ (T ⊔ E).verts := by simpa [S] using hxS
        change x ∈ T.verts ∪ E.verts at hxTE
        rcases hxTE with hxT | hxE
        · have hxC := hTC hxT
          have hxR : x ∈ R := by
            rcases Finset.mem_union.mp hxUW with hxU | hxW
            · exact hUinR hxU
            · exact hWinR hxW
          simpa [C, hxR] using hxC
        · rw [hEverts] at hxE
          rcases hxE with ⟨i, hi⟩ | ⟨i, hi⟩
          · have hxz : x = z := by simpa [f] using hi.symm
            have hzUW : z ∉ U ∪ W0 := hzX
            rw [hxz] at hxUW
            exact hzUW hxUW
          · have hxz' : x = z' := by simpa [g] using hi.symm
            have hz'UW : z' ∉ U ∪ W0 := hz'X
            rw [hxz'] at hxUW
            exact hz'UW hxUW
      have hSMatch : ∃ P : (G.induce {v | v ∈ S}).Subgraph, P.IsPerfectMatching := by
        have hSeq : {v | v ∈ S} = (T ⊔ E).verts := by
          ext v
          simp [S]
        rw [hSeq]
        exact extendible_independent_common_nonneighbor_deficit_le_zero_match_verts_perfect G (T ⊔ E) hTE'.1
  10. The existence of the perfect matching on G[S] yields a contradiction.

    Since 2|U| + |W₀| = 2k + 1 > 2k = 4k - 2k (Fintype.card_fin), and W₀ ⊆ W is anticomplete to the independent set U, theorem extendible_independent_anticomplete_matching_obstruction_general asserts that G[S] cannot have a perfect matching. This contradiction finishes the proof.

    lines 179–186

    uses Fintype.card_fin, extendible_independent_anticomplete_matching_obstruction_general

      have hlarge : Fintype.card (Fin (4*k)) - 2*k < 2*U.card + W0.card := by
        simp only [Fintype.card_fin]
        omega
      have hanti0 : ∀ u ∈ U, ∀ v ∈ W0, ¬ G.Adj u v := by
        intro u hu v hv
        exact hanti u hu v (hW0W hv)
      exact extendible_independent_anticomplete_matching_obstruction_general G k hext U W0 S
        hdis0 hUind hanti0 hSdis hScard hlarge hSMatch
Classical.choose_spec
The witness chosen by `Classical.choose` satisfies the defining property of the existential hypothesis.
Finset.card_compl
The cardinality of the complement of a subset of a finite type is the cardinality of the type minus the cardinality of the subset.
Finset.card_le_card
A subset of a finite set has cardinality less than or equal to that of the superset.
Finset.card_pair_eq_two_iff
A set of two elements {a, b} has cardinality 2 if and only if a ≠ b.
Finset.card_pos.mp
A finite set with strictly positive cardinality is nonempty.
Finset.card_union_of_disjoint
The cardinality of the union of two disjoint finite sets is the sum of their cardinalities.
Finset.disjoint_left.mpr
Two finite sets are disjoint if no element of the first belongs to the second.
Finset.disjoint_of_subset_right
If a set is disjoint from another set, it is disjoint from all its subsets.
Finset.exists_subset_card_eq
Any finite set contains a subset of any given cardinality up to its own size.
Finset.exists_subsuperset_card_eq
Between a finite set and an ambient superset, there exists an intermediate set of any specified cardinality between their cardinalities.
Finset.mem_compl.mp
An element belonging to the complement of a finite set does not belong to the set.
Finset.not_subset.mp
If a finite set is not a subset of another, there is an element in the first that is not in the second.
Finset.subset_univ
Every subset of a finite type is contained in the universal finite set.
Fintype.card_fin
The cardinality of the standard finite type Fin n is n.
Subsingleton.elim
In a type with at most one element, any two elements are equal.
Subtype.ext
Two terms of a subtype are equal if their underlying values are equal.
extendible_independent_anticomplete_matching_obstruction_general
In a k-extendable graph, an independent set U anticomplete to W₀ cannot coexist with a 2k-element set S disjoint from U ∪ W₀ that induces a perfect matching when |V| - 2k < 2|U| + |W₀|.
extendible_independent_common_nonneighbor_deficit_le_zero_match_verts_perfect
The vertices of any matching in a graph induce a subgraph containing a perfect matching.
extendible_equal_cut_maximum_matching_deficiency_at_most_one
In a k-extendable graph with minimum degree at least 2k+1 and balanced maximum matchings, each maximum matching has size at least k-1.
extendible_balanced_cut_matching_symmetry_of_independence
In a k-extendable graph with independence number at most k, maximum matchings on the two sides of a cut of size 2k have equal size.
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.
finite_matching_has_submatching_of_each_smaller_size
Any matching contains a submatching of any smaller size.
finite_subset_has_maximum_matching
Any finite vertex subset in a graph contains a matching of maximum possible size.
in1076_matching_twice_card
The number of vertices saturated by a matching is twice the number of edges.
indexed_disjoint_cross_edges_form_matching
A collection of edges with mutually disjoint endpoints forms a matching of the corresponding size.
perfect_matching_of_adjacency_involution
An adjacency-preserving fixed-point-free involution on the vertex set of a graph induces a perfect matching.
Set.Subset.trans
Subset inclusion on sets is transitive.
Set.disjoint_left.mpr
Two sets are disjoint if no element in the first belongs to the second.
Set.ncard_eq_toFinset_card'
The cardinality of a finite set equals the cardinality of its finset representation.

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_independent_common_nonneighbor_deficit_le_zero_match_verts_perfect    {V : Type*} (G : SimpleGraph V) (M : G.Subgraph) (hM : M.IsMatching) :    ∃ P : (G.induce M.verts).Subgraph, P.IsPerfectMatching := by  classical  let f : M.verts → M.verts := fun v =>    ⟨Classical.choose (hM v.property), M.edge_vert (Classical.choose_spec (hM v.property)).1.symm⟩  have hf : ∀ v : M.verts, M.Adj v.val (f v).val := by    intro v    exact (Classical.choose_spec (hM v.property)).1  have hinv : Function.Involutive f := by    intro v    apply Subtype.ext    exact (hM (f v).property).unique (hf (f v)) (hf v).symm  have hadj : ∀ v : M.verts, (G.induce M.verts).Adj v (f v) := by    intro v    exact M.adj_sub (hf v)  exact perfect_matching_of_adjacency_involution (G.induce M.verts) f hinv hadjtheorem extendible_independent_common_nonneighbor_deficit_le_zero    (k : ℕ) (G : SimpleGraph (Fin (4*k))) [DecidableRel G.Adj]    (hext : is_k_extendable G k)    (hdegree : ∀ v, 2*k+2 ≤ (G.neighborFinset v).card)    (hind : ∀ I : Finset (Fin (4*k)),      (∀ x ∈ I, ∀ y ∈ I, x ≠ y → ¬ G.Adj x y) → I.card ≤ k)    (U W : Finset (Fin (4*k))) (hdis : Disjoint U W) (hU : U.Nonempty)    (hUind : ∀ u ∈ U, ∀ v ∈ U, ¬ G.Adj u v)    (hanti : ∀ u ∈ U, ∀ w ∈ W, ¬ G.Adj u w) :    2*U.card+W.card ≤ 2*k := by  set_option maxHeartbeats 4000000 in  set_option linter.unnecessarySimpa false in  classical  by_contra hn  have hUlarge : 3 ≤ U.card := by    by_contra hs    have hsmall : U.card ≤ 2 := by omega    obtain ⟨u, hu⟩ := hU    have hNbr : G.neighborFinset u ⊆ (U ∪ W)ᶜ := by      intro v hv      have huv : G.Adj u v := by simpa using hv      simp only [Finset.mem_compl, Finset.mem_union]      intro hvUW      rcases hvUW with hvU | hvW      · exact hUind u hu v hvU huv      · exact hanti u hu v hvW huv    have hc := Finset.card_le_card hNbr    have hcomp := Finset.card_compl (U ∪ W)    have hunion := Finset.card_union_of_disjoint hdis    have hd := hdegree u    simp only [Fintype.card_fin] at hcomp    omega  have hUk : U.card ≤ k := hind U (by intro x hx y hy hne; exact hUind x hx y hy)  have hk : 3 ≤ k := by omega  let q := 2*k+1 - 2*U.card  have hq : q + 2*U.card = 2*k+1 := by dsimp [q]; omega  have hqW : q ≤ W.card := by omega  obtain ⟨W0, hW0W, hW0card⟩ := Finset.exists_subset_card_eq hqW  have hdis0 : Disjoint U W0 := Finset.disjoint_of_subset_right hW0W hdis  let X : Finset (Fin (4*k)) := U ∪ W0  have hXcard : X.card = 2*k+1 - U.card := by    dsimp [X]    rw [Finset.card_union_of_disjoint hdis0]    omega  have hXle : X.card ≤ 2*k - 2 := by omega  have hXcompl_pos : 0 < Xᶜ.card := by    rw [Finset.card_compl]    simp only [Fintype.card_fin]    omega  obtain ⟨z, hzcompl⟩ := Finset.card_pos.mp hXcompl_pos  have hzX : z ∉ X := Finset.mem_compl.mp hzcompl  have hnot : ¬ G.neighborFinset z ⊆ X := by    intro hh    have hc := Finset.card_le_card hh    have hd := hdegree z    omega  obtain ⟨z', hz'nbr, hz'X⟩ := Finset.not_subset.mp hnot  have hzz'adj : G.Adj z z' := by simpa using hz'nbr  have hzne : z ≠ z' := G.ne_of_adj hzz'adj  have hdis_zz' : Disjoint X ({z, z'} : Finset (Fin (4*k))) := by    apply Finset.disjoint_left.mpr    intro x hxX hxzz'    simp only [Finset.mem_insert, Finset.mem_singleton] at hxzz'    rcases hxzz' with rfl | rfl    · exact hzX hxX    · exact hz'X hxX  have hcard_zz' : ({z, z'} : Finset (Fin (4*k))).card = 2 := by    rw [Finset.card_pair_eq_two_iff]    exact hzne  let X' : Finset (Fin (4*k)) := X ∪ {z, z'}  have hX'card : X'.card = X.card + 2 := by    dsimp [X']    rw [Finset.card_union_of_disjoint hdis_zz', hcard_zz']  have hX'le : X'.card ≤ 2*k := by omega  obtain ⟨R, hX'R, hRuniv, hRcard⟩ := Finset.exists_subsuperset_card_eq    (s := X') (t := Finset.univ) (n := 2*k) (Finset.subset_univ X') hX'le (by simp; omega)  let C : Finset (Fin (4*k)) := Rᶜ  have hCcard : C.card = 2*k := by    have hh := Finset.card_compl R    simp only [Fintype.card_fin] at hh    dsimp [C]    omega  have hCset : (C : Set (Fin (4*k))) = (R : Set (Fin (4*k)))ᶜ := by ext x; simp [C]  have hUinR : U ⊆ R := by    intro x hx    apply hX'R    exact Finset.mem_union_left _ (Finset.mem_union_left _ hx)  have hWinR : W0 ⊆ R := by    intro x hx    apply hX'R    exact Finset.mem_union_left _ (Finset.mem_union_right _ hx)  have hzinR : z ∈ R := by    apply hX'R    exact Finset.mem_union_right _ (by simp)  have hz'inR : z' ∈ R := by    apply hX'R    exact Finset.mem_union_right _ (by simp)  obtain ⟨M, hM, hMC, hmaxM⟩ := finite_subset_has_maximum_matching G C  obtain ⟨N, hN, hNR, hmaxNR⟩ := finite_subset_has_maximum_matching G R  have hNC : N.verts ⊆ (C : Set (Fin (4*k)))ᶜ := by simpa [hCset] using hNR  have hmaxN : ∀ T : G.Subgraph, T.IsMatching → T.verts ⊆ (C : Set (Fin (4*k)))ᶜ → T.edgeSet.ncard ≤ N.edgeSet.ncard := by    simpa [hCset] using hmaxNR  have heq := extendible_balanced_cut_matching_symmetry_of_independence k G hext hind C hCcard M N hM hN hMC hNC hmaxM hmaxN  have hdegree_one : ∀ v, 2*k+1 ≤ (G.neighborFinset v).card := fun v => by    have := hdegree v; omega  have hnear := extendible_equal_cut_maximum_matching_deficiency_at_most_one k G hext hdegree_one C hCcard M N hM hN hMC hNC hmaxM hmaxN heq hind  obtain ⟨T, hT, hTM, hTcard⟩ := finite_matching_has_submatching_of_each_smaller_size G M hM (k-1) (by omega)  have hTC : T.verts ⊆ (C : Set (Fin (4*k))) := Set.Subset.trans hTM.1 hMC  let f : Fin 1 → Fin (4*k) := fun _ => z  let g : Fin 1 → Fin (4*k) := fun _ => z'  obtain ⟨E, hE, hEcard, hEverts⟩ := indexed_disjoint_cross_edges_form_matching G 1 f g    (by intro i j h; exact Subsingleton.elim i j)    (by intro i j h; exact Subsingleton.elim i j)    (by intro i j; exact hzne)    (by intro i; exact hzz'adj)  have hTE : Disjoint T.verts E.verts := by    apply Set.disjoint_left.mpr    intro x hxT hxE    have hxC := hTC hxT    rw [hEverts] at hxE    rcases hxE with ⟨i, hi⟩ | ⟨i, hi⟩    · have hxR : x ∈ R := by simpa [f, hi] using hzinR      simpa [C, hxR] using hxC    · have hxR : x ∈ R := by simpa [g, hi] using hz'inR      simpa [C, hxR] using hxC  have hTE' := extendible_graph_matchable_deletion_inherits_extendibility_sup_ncard T E hT hE hTE  have hTEcard : (T ⊔ E).edgeSet.ncard = k := by rw [hTE'.2, hTcard, hEcard]; omega  let S : Finset (Fin (4*k)) := (T ⊔ E).verts.toFinset  have hScard : S.card = 2*k := by    change ((T ⊔ E).verts.toFinset).card = 2*k    rw [← Set.ncard_eq_toFinset_card']    simpa only [hTEcard] using (in1076_matching_twice_card hTE'.1).symm  have hSdis : Disjoint S (U ∪ W0) := by    apply Finset.disjoint_left.mpr    intro x hxS hxUW    have hxTE : x ∈ (T ⊔ E).verts := by simpa [S] using hxS    change x ∈ T.verts ∪ E.verts at hxTE    rcases hxTE with hxT | hxE    · have hxC := hTC hxT      have hxR : x ∈ R := by        rcases Finset.mem_union.mp hxUW with hxU | hxW        · exact hUinR hxU        · exact hWinR hxW      simpa [C, hxR] using hxC    · rw [hEverts] at hxE      rcases hxE with ⟨i, hi⟩ | ⟨i, hi⟩      · have hxz : x = z := by simpa [f] using hi.symm        have hzUW : z ∉ U ∪ W0 := hzX        rw [hxz] at hxUW        exact hzUW hxUW      · have hxz' : x = z' := by simpa [g] using hi.symm        have hz'UW : z' ∉ U ∪ W0 := hz'X        rw [hxz'] at hxUW        exact hz'UW hxUW  have hSMatch : ∃ P : (G.induce {v | v ∈ S}).Subgraph, P.IsPerfectMatching := by    have hSeq : {v | v ∈ S} = (T ⊔ E).verts := by      ext v      simp [S]    rw [hSeq]    exact extendible_independent_common_nonneighbor_deficit_le_zero_match_verts_perfect G (T ⊔ E) hTE'.1  have hlarge : Fintype.card (Fin (4*k)) - 2*k < 2*U.card + W0.card := by    simp only [Fintype.card_fin]    omega  have hanti0 : ∀ u ∈ U, ∀ v ∈ W0, ¬ G.Adj u v := by    intro u hu v hv    exact hanti u hu v (hW0W hv)  exact extendible_independent_anticomplete_matching_obstruction_general G k hext U W0 S    hdis0 hUind hanti0 hSdis hScard hlarge hSMatch
See it in the graphDiscuss this resultChallenge it