# Documentation

Mathlib.Combinatorics.SimpleGraph.Matching

# Matchings #

A matching for a simple graph is a set of disjoint pairs of adjacent vertices, and the set of all the vertices in a matching is called its support (and sometimes the vertices in the support are said to be saturated by the matching). A perfect matching is a matching whose support contains every vertex of the graph.

In this module, we represent a matching as a subgraph whose vertices are each incident to at most one edge, and the edges of the subgraph represent the paired vertices.

## Main definitions #

• SimpleGraph.Subgraph.IsMatching: M.IsMatching means that M is a matching of its underlying graph. denoted M.is_matching.

• SimpleGraph.Subgraph.IsPerfectMatching defines when a subgraph M of a simple graph is a perfect matching, denoted M.IsPerfectMatching.

## TODO #

• Define an other function and prove useful results about it (https://leanprover.zulipchat.com/#narrow/stream/252551-graph-theory/topic/matchings/near/266205863)

• Provide a bicoloring for matchings (https://leanprover.zulipchat.com/#narrow/stream/252551-graph-theory/topic/matchings/near/265495120)

• Tutte's Theorem

• Hall's Marriage Theorem (see combinatorics.hall)

def SimpleGraph.Subgraph.IsMatching {V : Type u} {G : } (M : ) :

The subgraph M of G is a matching if every vertex of M is incident to exactly one edge in M. We say that the vertices in M.support are matched or saturated.

Instances For
noncomputable def SimpleGraph.Subgraph.IsMatching.toEdge {V : Type u} {G : } {M : } (v : M.verts) :

Given a vertex, returns the unique edge of the matching it is incident to.

Instances For
theorem SimpleGraph.Subgraph.IsMatching.toEdge_eq_of_adj {V : Type u} {G : } {M : } {v : V} {w : V} (hv : v M.verts) (hvw : ) :
SimpleGraph.Subgraph.IsMatching.toEdge h { val := v, property := hv } = { val := Quotient.mk () (v, w), property := hvw }
theorem SimpleGraph.Subgraph.IsMatching.toEdge_eq_toEdge_of_adj {V : Type u} {G : } {M : } {v : V} {w : V} (hv : v M.verts) (hw : w M.verts) (ha : ) :
SimpleGraph.Subgraph.IsMatching.toEdge h { val := v, property := hv } = SimpleGraph.Subgraph.IsMatching.toEdge h { val := w, property := hw }

The subgraph M of G is a perfect matching on G if it's a matching and every vertex G is matched.

Instances For
theorem SimpleGraph.Subgraph.IsMatching.support_eq_verts {V : Type u} {G : } {M : } :
= M.verts
theorem SimpleGraph.Subgraph.isMatching_iff_forall_degree {V : Type u} {G : } {M : } [(v : V) → ] :
∀ (v : V), v M.verts
theorem SimpleGraph.Subgraph.IsMatching.even_card {V : Type u} {G : } {M : } [Fintype M.verts] :
theorem SimpleGraph.Subgraph.isPerfectMatching_iff {V : Type u} {G : } (M : ) :
∀ (v : V), ∃! w,
theorem SimpleGraph.Subgraph.isPerfectMatching_iff_forall_degree {V : Type u} {G : } {M : } [(v : V) → ] :
∀ (v : V),