finite_matching_has_submatching_of_each_smaller_size
Every finite matching with at least k edges contains a submatching with exactly k edges.
Statement
theorem finite_matching_has_submatching_of_each_smaller_size {V : Type*} [Fintype V] [DecidableEq V] (G : SimpleGraph V) (M : G.Subgraph) (hM : M.IsMatching) (k : ℕ) (hk : k ≤ M.edgeSet.ncard) : ∃ N : G.Subgraph, N.IsMatching ∧ N ≤ M ∧ N.edgeSet.ncard = k
- Source
- OP-1957; restricting a finite matching to a specified number of its edges.
- Verified
- 26 Nov 2026
- Axioms
Classical.choiceQuot.soundpropext- Built on 1
- is_k_extendableFor a finite vertex type V (with [Fintype V]), a simple graph G : SimpleGraph V and k : ℕ, is_k_extendable G k is the Prop that is the…
- Used by 8
- extendible_independent_common_nonneighbor_deficit_le_zeroUnder the stated high-degree extendibility and independence assumptions, a nonempty independent U and a disjoint anticomplete W satisfy…
- op1957_min_degree_forces_matchingA finite graph on at least 2k vertices with minimum degree at least k has a matching of k edges.
- extendible_balanced_cut_odd_bound_of_near_perfect_hypothesisUnder the displayed assumptions and the explicitly assumed near-perfect maximum-matching property, the opposite side of a balanced cut has…
- extendible_balanced_cut_exposed_barrier_odd_boundIf every vertex of an opposite-side set X can be matched to distinct vertices left uncovered by a balanced-side (k−r)-matching, then the…
- balanced_cut_four_odd_components_force_deficiency_threeWith the stated extendibility, separator, degree and independence conditions, four odd components force maximum matching deficiency at…
- extendible_balanced_cut_maximum_matching_sizes_equalFor a k-extendible graph of order 4k, maximum matchings on the two halves of a balanced cut have equal sizes if their sizes sum to at…
- extendible_high_degree_balanced_cut_odd_component_boundUnder the displayed extendibility, separator, degree and independence assumptions, each balanced cut has at most two odd components on the…
- extendible_independent_common_nonneighbor_deficit_le_oneUnder the stated high-degree extendibility and independence assumptions, a nonempty independent U and a disjoint anticomplete W satisfy…
The proof, explained
To construct a submatching of size k from a matching M with at least k edges, we select a subset E of k edges from M. We define a subgraph N having edge set E and whose vertices are the endpoints of these edges. Because N inherits its edges from M, every vertex in N has at most its degree in M (which is 1), so N is a matching. Since N has exactly k edges and is a subgraph of M by construction, it is the desired submatching.
There exists a subset E of k edges from the edge set of M.
Because the vertex set V is finite, the edge set of M can be regarded as a finite set F whose cardinality equals the set cardinality of M's edge set. Since this cardinality is at least k, Finset.exists_subset_card_eq produces a sub-finset E ⊆ F containing exactly k edges.
uses
Set.ncard_eq_toFinset_card',Finset.exists_subset_card_eqset_option maxHeartbeats 4000000 in classical let F : Finset (Sym2 V) := M.edgeSet.toFinset have hF : k ≤ F.card := by dsimp [F] rw [← Set.ncard_eq_toFinset_card'] exact hk obtain ⟨E,hEF,hEcard⟩ := Finset.exists_subset_card_eq hF
Every edge in E is an edge of M.
Since E is a subset of F, any edge s(u, v) ∈ E belongs to M.edgeSet.toFinset, and therefore to M.edgeSet, meaning u and v are adjacent in M.
uses
SimpleGraph.Subgraph.mem_edgeSet.mp,Set.mem_toFinset.mphave hEM : ∀ u v, s(u,v) ∈ E → M.Adj u v := by intro u v h have hh := hEF h change s(u,v) ∈ M.edgeSet.toFinset at hh exact SimpleGraph.Subgraph.mem_edgeSet.mp (Set.mem_toFinset.mp hh)
The edges in E and their incident vertices form a valid subgraph N of G.
We define N to have adjacency relation s(u, v) ∈ E and vertex set consisting of all endpoints of edges in E. Every edge in E is an edge in M (and thus in G), the endpoints of any edge in E belong to the vertex set by construction, and the adjacency relation is symmetric because unordered pairs satisfy s(u, v) = s(v, u).
uses
Sym2.eq_swaplet N : G.Subgraph := { verts := {v | ∃ w, s(v,w) ∈ E} Adj := fun u v => s(u,v) ∈ E adj_sub := by intro u v h; exact M.adj_sub (hEM u v h) edge_vert := by intro u v h; exact ⟨v,h⟩ symm := ⟨by intro u v h; simpa [Sym2.eq_swap] using h⟩ }
N is a matching.
Every vertex v of N is incident to at least one edge s(v, w) ∈ E by definition of N's vertex set. Because this edge is also in M and M is a matching, v has a unique neighbor in M. Since any neighbor z of v in N is also a neighbor in M, uniqueness forces z = w, meaning v has degree exactly 1 in N.
have hN : N.IsMatching := by intro v hv obtain ⟨w,hw⟩ := hv have hMv := hEM v w hw refine ⟨w,hw,?_⟩ intro z hz exact (hM (M.edge_vert hMv)).unique (hEM v z hz) hMv
N is a subgraph of M.
Every vertex in N is incident to an edge in E ⊆ E(M), so it is a vertex of M. Moreover, every adjacency in N is in E, hence is an adjacency in M.
have hNM : N ≤ M := by constructor · intro v hv obtain ⟨w,hw⟩ := hv exact M.edge_vert (hEM v w hw) · intro u v huv exact hEM u v huv
N has exactly k edges, completing the proof.
By induction on unordered pairs, an edge belongs to N.edgeSet if and only if it belongs to E, so N.edgeSet is definitionally equal to E as a set. Its cardinality is therefore |E| = k. Together with the facts that N is a matching and N ≤ M, N provides the required witness.
uses
Sym2.inductionOn,Set.ncard_coe_finsethave hcard : N.edgeSet.ncard = k := by have heq : N.edgeSet = (E : Set (Sym2 V)) := by ext e induction e using Sym2.inductionOn with | _ u v => rfl rw [heq,Set.ncard_coe_finset,hEcard] exact ⟨N,hN,hNM,hcard⟩
Set.ncard_eq_toFinset_card'- For a set s with finite coercion, the set cardinality s.ncard equals the cardinality of the associated finset s.toFinset.
Finset.exists_subset_card_eq- Any finite set of cardinality at least n contains a subset of cardinality exactly n.
SimpleGraph.Subgraph.mem_edgeSet.mp- If an unordered pair s(u, v) is in the edge set of a subgraph, then u and v are adjacent in that subgraph.
Set.mem_toFinset.mp- If an element belongs to s.toFinset, then it belongs to the set s.
Sym2.eq_swap- The unordered pair s(a, b) equals the unordered pair s(b, a).
Sym2.inductionOn- To prove a property for all unordered pairs, it suffices to prove it for pairs of the form s(x, y).
Set.ncard_coe_finset- The set cardinality of a coerced finset equals the finset's 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
Choose a tactic — a marked line — to see the goals Lean had before and after it, as in Lean’s infoview. Step with ← → or j k.
theorem finite_matching_has_submatching_of_each_smaller_size {V : Type*} [Fintype V] [DecidableEq V] (G : SimpleGraph V) (M : G.Subgraph) (hM : M.IsMatching) (k : ℕ) (hk : k ≤ M.edgeSet.ncard) : ∃ N : G.Subgraph, N.IsMatching ∧ N ≤ M ∧ N.edgeSet.ncard = k := by set_option maxHeartbeats 4000000 in classical let F : Finset (Sym2 V) := M.edgeSet.toFinset have hF : k ≤ F.card := by dsimp [F] rw [← Set.ncard_eq_toFinset_card'] exact hk obtain ⟨E,hEF,hEcard⟩ := Finset.exists_subset_card_eq hF have hEM : ∀ u v, s(u,v) ∈ E → M.Adj u v := by intro u v h have hh := hEF h change s(u,v) ∈ M.edgeSet.toFinset at hh exact SimpleGraph.Subgraph.mem_edgeSet.mp (Set.mem_toFinset.mp hh) let N : G.Subgraph := { verts := {v | ∃ w, s(v,w) ∈ E} Adj := fun u v => s(u,v) ∈ E adj_sub := by intro u v h; exact M.adj_sub (hEM u v h) edge_vert := by intro u v h; exact ⟨v,h⟩ symm := ⟨by intro u v h; simpa [Sym2.eq_swap] using h⟩ } have hN : N.IsMatching := by intro v hv obtain ⟨w,hw⟩ := hv have hMv := hEM v w hw refine ⟨w,hw,?_⟩ intro z hz exact (hM (M.edge_vert hMv)).unique (hEM v z hz) hMv have hNM : N ≤ M := by constructor · intro v hv obtain ⟨w,hw⟩ := hv exact M.edge_vert (hEM v w hw) · intro u v huv exact hEM u v huv have hcard : N.edgeSet.ncard = k := by have heq : N.edgeSet = (E : Set (Sym2 V)) := by ext e induction e using Sym2.inductionOn with | _ u v => rfl rw [heq,Set.ncard_coe_finset,hEcard] exact ⟨N,hN,hNM,hcard⟩