perfect_matching_of_adjacency_involution
A simple graph has a perfect matching if it has an involution that sends every vertex to an adjacent vertex.
Statement
theorem perfect_matching_of_adjacency_involution {V : Type*} (G : SimpleGraph V) (f : V → V) (hinv : Function.Involutive f) (hadj : ∀ x, G.Adj x (f x)) : ∃ P : G.Subgraph, P.IsPerfectMatching
- Source
- OP-1957: explicit matching witness.
- Verified
- 22 Nov 2026
- Axioms
propext- Used by 11
- op1957_exceptional_pool_example_not_extendibleThe exceptional 44-vertex graph is not 11-extendible.
- 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…
- boundary_seven_block_example_cross_edge_essentialIn the explicitly defined 28-vertex four-block graph, the edge from 0 to 14 is present, and deleting it leaves a graph that is not…
- op1957_barrier_count_example_not_extendibleThe explicit 44-vertex barrier count example is not 11-extendible.
- op1957_hidden_barrier_not_extendibleThe 40-vertex hidden-barrier graph is not 10-extendible.
- op1957_empty_pool_control_delete_0_16_not_extendibleDeleting edge {0,16} from the displayed 28-vertex control with parameter 5 yields a graph that is not 7-extendible.
- op1957_dense_balanced_half_conditions_do_not_force_separatorThere is a graph on 16 vertices of minimum degree at least 10 and independence number at most two, whose every induced subgraph has at…
- op1957_empty_pool_c_control_not_extendibleThe explicit control with z=17 is not 7-extendible.
- boundary_five_seven_example_edge_essentialIn the explicitly defined 28-vertex four-block graph, the edge from 0 to 14 is present and the graph obtained by deleting it is not…
- op1957_half_pool_example_not_extendibleThe explicit 52-vertex half-pool example is not 13-extendible.
- 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
The proof constructs an explicit spanning subgraph $P$ of $G$ whose edges connect each vertex $x$ to $f(x)$. Because $f$ is an involution mapping every vertex to an adjacent vertex, this relation is symmetric and forms a valid subgraph of $G$. The subgraph is a perfect matching because each vertex $x$ has exactly one partner in $P$, namely $f(x)$.
A valid subgraph $P$ of $G$ is constructed with all vertices of $V$ and with edges connecting each vertex $x$ to $f(x)$.
Working under classical logic, we define a subgraph $P$ whose vertex set is the universe of all vertices and whose adjacency relation is $y = f(x)$. We verify the three axioms defining a subgraph: 1. Every edge of $P$ is an edge of $G$, which holds because $G\text{.Adj}(x, f(x))$ is given by `hadj`. 2. Every endpoint of an edge belongs to the vertex set `Set.univ`, which holds by `Set.mem_univ`. 3. The adjacency relation is symmetric: if $y = f(x)$, then $x = f(f(x)) = f(y)$ because $f$ is an involution (`hinv`), so $x = f(y)$.
uses
Set.mem_univclassical let P : G.Subgraph := ⟨Set.univ, fun x y => y = f x, by intro x y h; subst y; exact hadj x, by intro x y h; exact Set.mem_univ x, by constructor intro x y h subst y exact (hinv x).symm⟩
To prove that $P$ is a perfect matching, it suffices to show that each vertex has a unique neighbor in $P$.
We supply $P$ as the witness for the existential quantifier. Rewriting with `SimpleGraph.Subgraph.isPerfectMatching_iff` transforms the goal into showing that for every vertex $v$, there exists a unique vertex $w$ adjacent to $v$ in $P$.
uses
SimpleGraph.Subgraph.isPerfectMatching_iffrefine ⟨P, ?_⟩ rw [SimpleGraph.Subgraph.isPerfectMatching_iff]
Every vertex has $f(x)$ as its unique neighbor in $P$, completing the proof.
For any vertex $x$, its unique neighbor in $P$ is $f(x)$: the adjacency condition $f(x) = f(x)$ holds reflexively, and if any vertex $y$ is adjacent to $x$ in $P$, then $y = f(x)$ by definition of $P$'s edges.
intro x exact ⟨f x, rfl, fun y h => h⟩
Set.mem_univ- Every element of a type belongs to the universal set `univ` of that type.
SimpleGraph.Subgraph.isPerfectMatching_iff- A subgraph of a simple graph is a perfect matching if and only if every vertex in the graph has exactly one neighbor in the subgraph.
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 perfect_matching_of_adjacency_involution {V : Type*} (G : SimpleGraph V) (f : V → V) (hinv : Function.Involutive f) (hadj : ∀ x, G.Adj x (f x)) : ∃ P : G.Subgraph, P.IsPerfectMatching := by classical let P : G.Subgraph := ⟨Set.univ, fun x y => y = f x, by intro x y h; subst y; exact hadj x, by intro x y h; exact Set.mem_univ x, by constructor intro x y h subst y exact (hinv x).symm⟩ refine ⟨P, ?_⟩ rw [SimpleGraph.Subgraph.isPerfectMatching_iff] intro x exact ⟨f x, rfl, fun y h => h⟩