AFTD Auto-Formalizing Theoretical Domains

induced_matching_lifts

theoremverified

A matching of an induced graph lifts to an ambient matching supported in the inducing set with the same size.

Statement

theorem induced_matching_lifts
    {V : Type*} [Fintype V] [DecidableEq V] (G : SimpleGraph V) (R : Set V)
    (M : (G.induce R).Subgraph) (hM : M.IsMatching) :
    ∃ N : G.Subgraph, N.IsMatching ∧ N.verts ⊆ R ∧ N.edgeSet.ncard = M.edgeSet.ncard
Source
Balanced-cut k=7 reduction for OP-1957; https://arxiv.org/abs/2611.22690.
Verified
26 Nov 2026
Axioms
Classical.choiceQuot.soundpropext
Built on 1
Used by 2

The proof, explained

The proof pushes the matching M forward to a subgraph N of G along the canonical inclusion homomorphism f : G[R] → G. Because f is injective, N is a matching supported on R with the same vertex cardinality as M. Since any matching in a finite graph has twice as many vertices as edges, the equality of vertex counts implies that N and M have the same number of edges.

  1. The inclusion map from the induced subgraph G[R] to G is an injective graph homomorphism, and pushing M forward along it yields a matching N in G.

    We define the canonical graph homomorphism f : G[R] → G by mapping vertices via the subtype inclusion into V. By Subtype.val_injective, f is injective. The pushforward subgraph N = M.map f is then a matching in G because pushing forward a matching along an injective graph homomorphism preserves the matching property.

    lines 5–11

    uses Subtype.val_injective

      set_option maxHeartbeats 4000000 in
        classical
        let f : (G.induce R) →g G :=
          { toFun := Subtype.val, map_rel' := by intro a b h; exact h }
        have hf : Function.Injective f := Subtype.val_injective
        let N := M.map f
        have hN : N.IsMatching := hM.map f hf
  2. The vertex set of N is contained in R.

    By SimpleGraph.Subgraph.map_verts, the vertices of N are the image f(V(M)). Any vertex in this image is of the form f(y) for some y in V(M); since y belongs to the subtype R, f(y) belongs to R by definition.

    lines 12–15

    uses SimpleGraph.Subgraph.map_verts

        have hsub : N.verts ⊆ R := by
          rw [SimpleGraph.Subgraph.map_verts]
          rintro x ⟨y,hy,rfl⟩
          exact y.property
  3. N and M have the same number of vertices: |V(N)| = |V(M)|.

    Using SimpleGraph.Subgraph.map_verts, the vertices of N form the image f(V(M)). Since f is injective, Set.ncard_image_of_injective ensures that this image has the same cardinality as V(M).

    lines 16–18

    uses SimpleGraph.Subgraph.map_verts, Set.ncard_image_of_injective

        have hverts : N.verts.ncard = M.verts.ncard := by
          rw [SimpleGraph.Subgraph.map_verts]
          exact Set.ncard_image_of_injective M.verts hf
  4. N has the same number of edges as M, completing the proof that N is the required ambient matching.

    By in1076_matching_twice_card, the number of vertices in any matching is twice its number of edges. Applying this to both N and M and substituting |V(N)| = |V(M)| gives 2 * |E(N)| = 2 * |E(M)|. Linear integer arithmetic (omega) then implies |E(N)| = |E(M)|, and N provides the desired existential witness.

    lines 19–23

    uses in1076_matching_twice_card

        have h1 := in1076_matching_twice_card hN
        have h2 := in1076_matching_twice_card hM
        rw [hverts,← h2] at h1
        refine ⟨N,hN,hsub,?_⟩
        omega
Subtype.val_injective
The coercion from a subtype to its ambient type is injective.
SimpleGraph.Subgraph.map_verts
The vertex set of the image subgraph under a graph homomorphism f is the image under f of the original vertex set.
Set.ncard_image_of_injective
An injective map preserves the cardinality (ncard) of a set.
in1076_matching_twice_card
In any matching of a finite graph, the number of vertices is twice the number of edges.

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 induced_matching_lifts    {V : Type*} [Fintype V] [DecidableEq V] (G : SimpleGraph V) (R : Set V)    (M : (G.induce R).Subgraph) (hM : M.IsMatching) :    ∃ N : G.Subgraph, N.IsMatching ∧ N.verts ⊆ R ∧ N.edgeSet.ncard = M.edgeSet.ncard := by  set_option maxHeartbeats 4000000 in    classical    let f : (G.induce R) →g G :=      { toFun := Subtype.val, map_rel' := by intro a b h; exact h }    have hf : Function.Injective f := Subtype.val_injective    let N := M.map f    have hN : N.IsMatching := hM.map f hf    have hsub : N.verts ⊆ R := by      rw [SimpleGraph.Subgraph.map_verts]      rintro x ⟨y,hy,rfl⟩      exact y.property    have hverts : N.verts.ncard = M.verts.ncard := by      rw [SimpleGraph.Subgraph.map_verts]      exact Set.ncard_image_of_injective M.verts hf    have h1 := in1076_matching_twice_card hN    have h2 := in1076_matching_twice_card hM    rw [hverts,← h2] at h1    refine ⟨N,hN,hsub,?_⟩    omega
See it in the graphDiscuss this resultChallenge it