The Tutte matrix and the randomized perfect-matching test for general graphs #
A finite simple graph G on a linearly ordered vertex type V has the Tutte matrix
Cslib.Algorithms.Matching.tutteMatrix G: its entry (i, j) is X s(i, j) when ij is an edge
and i < j, -X s(i, j) when ij is an edge and j < i, and 0 otherwise, with one
indeterminate per unordered pair. It is skew-symmetric. Tutte's matrix theorem: its
determinant is a nonzero polynomial exactly when G has a perfect matching
(Cslib.Algorithms.Matching.det_tutteMatrix_ne_zero_iff) [Tut47]
Motwani and Raghavan, Section 7.3. The sources state it over a field; the
statement here holds over every nontrivial commutative ring, a generality of this formalization
that the same proof gives. It is distinct from Tutte's combinatorial criterion in terms of odd
components, which Mathlib has as SimpleGraph.tutte.
In the Leibniz expansion of a skew-symmetric determinant the permutations with an odd cycle cancel
(Matrix.det_eq_sum_even_cycleType_of_transpose_eq_neg). A surviving nonzero term is a permutation
along the edges of G with only even cycles, which gives a perfect matching
(SimpleGraph.exists_isPerfectMatching_of_perm). Conversely, at the indicator of the edges of a
perfect matching M the Tutte matrix is the signed permutation matrix of the involution M, of
determinant ±1.
The randomized test of Lovász [Lov79a] substitutes values r : Sym2 V → R for the
indeterminates (Cslib.Algorithms.Matching.tutteEval G r) and checks whether the determinant is
nonzero. Its error is one-sided. Without a perfect matching the determinant is always 0
(Cslib.Algorithms.Matching.det_tutteEval_eq_zero). With one, over an integral domain and with the
values drawn independently and uniformly from a finite set S, the determinant vanishes with
probability at most |V| / |S| (Cslib.Algorithms.Matching.card_det_tutteEval_eq_zero_div_le),
by the Schwartz–Zippel lemma.
Main definitions #
Cslib.Algorithms.Matching.tutteMatrix: the Tutte matrix of a simple graph.Cslib.Algorithms.Matching.tutteEval: the Tutte matrix at given values.
Main results #
Cslib.Algorithms.Matching.det_tutteMatrix_ne_zero_iff: Tutte's matrix theorem, the determinant is nonzero exactly when the graph has a perfect matching.Cslib.Algorithms.Matching.det_tutteEval_eq_zero: no false positives.Cslib.Algorithms.Matching.card_det_tutteEval_eq_zero_div_le: false negatives with probability at most|V| / |S|.Cslib.Algorithms.Matching.exists_det_tutteEval_ne_zero: values from any set of more than|V|elements detect a perfect matching.
References #
The Tutte matrix of G at the values r : Sym2 V → R: r s(i, j) at each edge with
i < j, -r s(i, j) at each edge with j < i, and 0 elsewhere.
An entry of the Tutte matrix at values.
The Tutte matrix of a simple graph G: X s(i, j) at each edge with i < j,
-X s(i, j) at each edge with j < i, and 0 elsewhere.
The Tutte matrix at values is skew-symmetric.
Substituting values for the indeterminates of the Tutte matrix.
An entry of the Tutte matrix has total degree at most 1.
The determinant of the Tutte matrix at values is the determinant polynomial evaluated at them.
A nonzero determinant of the Tutte matrix at some values gives a perfect matching: in the
Leibniz expansion the permutations with an odd cycle cancel, and a surviving nonzero term is a
permutation along the edges of G with only even cycles.
No false positives: without a perfect matching, the Tutte matrix has determinant 0 at
all values.
Without a perfect matching, the determinant of the Tutte matrix is the zero polynomial.
With a perfect matching M, the determinant of the Tutte matrix is a nonzero polynomial: at
the indicator of the edges of M the Tutte matrix is the signed permutation matrix of the
involution M, of determinant ±1.
Tutte's matrix theorem [Tut47]: the determinant of the Tutte matrix of a simple graph
is a nonzero polynomial exactly when the graph has a perfect matching. The sources state it over a
field; this formalization proves it over every nontrivial commutative ring. For Tutte's
combinatorial criterion (odd components) see Mathlib's SimpleGraph.tutte.
The determinant of the Tutte matrix has total degree at most |V|.
The randomized perfect-matching test: for a simple graph with a perfect matching, over an
integral domain, the Tutte matrix at values drawn independently and uniformly from a finite set
S is singular with probability at most |V| / |S|.
Values from any set of more than |V| elements of an integral domain detect a perfect
matching: some choice of them makes the Tutte matrix nonsingular.