# Linear algebra proofs in combinatorics?

Simple linear algebra methods are a surprisingly powerful tool to prove combinatorial results. Some examples of combinatorial theorems with linear algebra proofs are the (weak) perfect graph theorem, the Frankl-Wilson theorem, and Fisher's inequality.

Are there other good examples?

Some other examples are the Erdos-Moser conjecture (see R. Proctor, Solution of two difficult problems with linear algebra, Amer. Math. Monthly 89 (1992), 721-734), a few results at http://math.mit.edu/~rstan/312/linalg.pdf, and Lovasz's famous result on the Shannon capacity of a 5-cycle and other graphs (IEEE Trans. Inform. Theory 25 (1979), 1-7). For a preliminary manuscript of Babai and Frankl on this subject (Linear Algebra Methods in Combinatorics), see http://people.cs.uchicago.edu/~laci/CLASS/HANDOUTS-COMB/BaFrNew.pdf .

2022 version of Babai & Frankl text: https://people.cs.uchicago.edu/~laci/babai-frankl-book2022.pdf

• Right, I thought immediately of the lovely manuscript by Babai and Frankl. Too bad it is not more easily available: I was lucky enough to take a combinatorics class from Babai in 1998 and thereby acquire a copy. I still have it! (Do you know why they have apparently lost interest in publishing it?) Mar 4, 2010 at 0:12
• I don't know why Babai and Frankl have lost interest in publishing it, but the preliminary manuscript is still readily available from the link above. Mar 4, 2010 at 0:49
• @Richard - Much thanks! There is a lot of good information in your post. Mar 4, 2010 at 2:24
• Aug 27, 2013 at 12:01

The AMS has a new book out, Jiri Matousek, Thirty-three Miniatures: Mathematical and Algorithmic Applications of Linear Algebra. Info at http://www.ams.org/bookstore-getitem/item=STML-53

"This volume contains a collection of clever mathematical applications of linear algebra, mainly in combinatorics, geometry, and algorithms."

• Thanks Gerry. The book looks good, I'll probably pick it up. I really enjoyed Using the Borsuk-Ulam Theorem by the same author. Mar 10, 2010 at 21:28

Hoffman and Singleton proved that a regular graph with girth 5 and diameter 2 has to have degree 2, 3, 7, or 57. If I recall correctly, the proof used spectral properties of the adjacency matrix to produce some non-polynomial equation for which these were the integer solutions.

There are unique examples of the first three cases: degree 2 is a pentagon, degree 3 is the Petersen graph, and degree 7 is the Hoffman-Singleton graph. The existence of the degree 57 graph is still open (as far as I know).

The Lindstrom-Gessel-Viennot Lemma uses the reflection principle on $S_n$ to say that the number of nonintersecting families of lattice paths in the plane equals the determinant of a matrix so that the $i,j$-th entry is the number of paths from the $i$th source to the $j$th sink.

This was not a linear algebra proof. However, this determinant can be used to enumerate plane partitions inside an $a\times b \times c~$ box, to $q$-enumerate plane partitions by weight, and to count domino tilings of an Aztec diamond. The resulting determinants can be manipulated and evaluated in ways which are natural in linear algebra, but not as clear on the objects, such as factoring the matrices. These enumerations can be viewed as applications of simple results in linear algebra.

Notes:

Lattice paths are defined and the sources and sinks are restricted so that any nonintersecting family must be an even permutation from source indices to sink indices, usually the identity.

Others independently discovered this result, e.g., Karlin and McGregor.

The same idea applies to Brownian motion.

Here is a link to a Tricki article that has some further examples.

http://www.tricki.org/article/Dimension_arguments_in_combinatorics

• This article is very nice, for the trick and also the exposition. Thanks!. A curiosity, who is its author? Sorry, but the author isn't listed at the site. Maybe you? :-) Mar 4, 2010 at 22:14
• Actually yes ... It's possible to see who Tricki articles are by if you look at their revision history. Mar 5, 2010 at 11:39

These references may be more shallow than you desired, but they are both fun and lucid.

1) Noga Alon's Tools From Higher Algebra contains many things (or at least references to those things) that only require linear algebra at heart, such as Rayleigh's Principle.

2) A Course in Combinatorics by van Lint and Wilson is laced with gems in self-contained sections, such that each page is an adventure. You'll find Lots of techniques here that only require linear algebra, including the awkward-looking "interlacing property" of eigenvalues that have popped up way too much for me to ignore by now.

My favorite is actually the aforementioned Babai/Frankl manuscript, which is still very readable and useful.

-Yan

• Thanks. The book by van Lint and Wilson is indeed one of my favorites. You're quite right that it's hard to ignore (no matter how hard I try) interlacing eigenvalues. Mar 10, 2010 at 16:17

It's not quite what you have asked for, but very close:

Some facts - and proofs! - in combinatorics can be interpreted as linear algebra over the "field with one element". In this very nicely written article Henry Cohn gives a concrete meaning to this and shows how to make a proof from linear algebra into a proof about a combinatorical statement by rephrasing it into axiomatic projective geometry.

(by the way: Lior's answer is an instance of linear algebra over field with one element)

This is a crosspost from Why linear algebra is fun!(or ?), suggested by Kevin O'Bryant. I think it's relevant here. Everything below is verbatim from the earlier post.

My favorite application of linear algebra, as introduced to me by Fan Chung, is Oddtown (which I learned about from a manuscript of Lovasz, but may not be due to him).

The $n$ residents of Oddtown love to form clubs; call the family of these $\mathcal{F}$. If $F_1$ and $F_2$ are in $\mathcal{F}$, then $|F_1|$ must be odd (this is Oddtown!) and $|F_1 \cap F_2|$ must be even unless $F_1 = F_2$ ($\scriptsize{go\;Oddtown?}$). The question is, how many clubs may these $n$ people form?

The answer (taken from Tibor Szabó's lecture notes) is this:

Let $\mathcal{F} = \{F_1,\ldots,F_m\} \subseteq 2^{[n]}$ be a set of clubs in Oddtown. Let $\mathbf{v}_i \in \{0,1\}^n$ be the characteristic vector of $F_i$; the $j$th coordinate is 1 iff $j \in F_i$.

Note that $\mathbf{v}_i^T \mathbf{v}_j = |F_i \cap F_j|$.

Now, $\mathbf{v}_1,\ldots,\mathbf{v}_m$ is independent over $\mathbb{F}^n_2$: if $\lambda_1\mathbf{v}_1 + \cdots + \lambda_m\mathbf{v}_m = 0$, then for each $i$ we have $$0 \;=\; (\lambda_1\mathbf{v}_1 + \cdots + \lambda_m\mathbf{v}_m)^T\mathbf{v}_i \;=\; \lambda_1\mathbf{v}_1^T\mathbf{v}_i + \cdots + \lambda_i\mathbf{v}_i^T\mathbf{v}_i + \ldots + \lambda_m\mathbf{v}_m^T\mathbf{v}_i \;=\; \lambda_i$$

Since $\mathbf{v}_1,\ldots,\mathbf{v}_m$ are linearly independent vectors over $\mathbb{F}^n_2$, $m \leq n$, and Oddtown can have at most $n$ clubs.

The polynomial method in combinatorial incidence geometry relies crucially on linear algebra to locate a non-trivial polynomial of controlled degree that vanishes at a specified set of points. A good example of the method in action is Dvir's proof of the finite field Kakeya conjecture, see e.g. http://terrytao.wordpress.com/2008/03/24/dvirs-proof-of-the-finite-field-kakeya-conjecture/ .

• This is also in Matousek's book mentioned by Gerry Myerson. Mar 28, 2012 at 0:26

The proof that every $n\times n$ semi-magic square can be written as an integer linear combination of $n^2-2n+2$ permutation matrices.

Here is an example I learned about this month: The edges of the complete graph cannot be partitioned into fewer than $n-1$ complete bipartite graphs. Apparently the only known proofs involve linear algebra.

• I should add that Richard Brualdi, from whom I learned this, will be writing a book over the course of the next year largely on the connections between linear algebra and graph theory. Jul 27, 2010 at 13:27
• Recently Sundar Vishwanathan gave a combinatorial proof: arxiv.org/abs/1007.1553 Sep 7, 2010 at 13:57
• Nice proof in arxiv.org/abs/1007.1553 ! (Typo: $\sum_{i=1}^n$ should be $\sum_{i=1}^{n-2}$ in the last formula of the proof; also, $k > n^n$ can just as well be replaced by $k > n^{n-1}$.) Can something similar be done with this problem: artofproblemsolving.com/Forum/viewtopic.php?f=41&t=271585 ? Mar 27, 2012 at 23:05
• @Tracy, Brualdi, The Mutually Beneficial Relationship of Graphs and Matrices, bookstore.ams.org/cbms-115 May 5, 2023 at 3:54

There is nice linear-algebra proof of the following result in discrete geometry:

Any $$n$$ lines in general position cut from the plane at least $$n-2$$ triangles.

See А. Я. Белов Об одной задаче комбинаторной геометрии (thanks to Arseny and Garry). You will find there more examples of such problems.

• Alexey Kanel-Belov Mar 4, 2010 at 3:29
• Perhaps the paper in question is A problem in combinatorial geometry, Uspekhi Mat Nauk 47 (1992), no. 3 (285), 151-152, translation in Russian Math Surveys 47 (1992), no. 3, 167-168, MR 93h:52016. Maybe it's also in A Kanel'-Belov and A Kovaldzhi, Taking on triangles: in search of answers between the lines, Quantum 11 (2001), no. 4, 10-16. Mar 4, 2010 at 4:02

The following is a good illustration:

Let $P$ be a finite set ("points"), and let $L\subset 2^P$ ("lines") be such that distinct lines intersect in at most one point and any two distinct points are contained in a line. Let $V$ be the real vector space with basis $P$, $W$ the vector space with basis $L$. There are natural linear maps $T\colon V\to W$ and $S\colon W\to V$ mapping every point to the sum of the lines containing it, and every line to the sum of the points in it. Then $ST = J+D-I$ where $J$ is the all-ones matrix (through every two distinct points there is a unique line), $I$ the identity matrix and $D$ is diagonal with entries counting the lines through each point.

Assume that not all points are collinear. Then all the diagonal entries of $D-I$ are at least one; it is then easy to verify that the determinant of $ST$ is positive, and conclude that $|L| \geq |P|$.

• This is the same result as the Fisher's inequality. Jan 12, 2015 at 13:32

Linear algebra is also useful for proving lower bounds in extremal "bootstrap percolation" type problems. For example, Alon and Kalai used linear algebra (actually, exterior algebra) to (independently) answer the following question, first considered by Bollobás:

What is the minimum number of edges in a graph $G$ on $n$ vertices such that the non-edges of $G$ can be added, one edge at a time, so that every edge completes a $k$-clique when it is added?

Some more recent applications of linear algebra in bootstrap percolation can be found in a paper of Balogh, Bollobás, Morris and Riordan. Specifically, they use linear algebra to prove Lemma 3, which is the main tool of the paper.

I can personally tell you that this lemma can be quite useful. It is used in two (joint) papers of mine: see here and here. In particular, in the second paper, we use this linear algebraic lemma to prove a conjecture of Balogh and Bollobás on $r$-neighbour bootstrap percolation in the hypercube.

Here's a surprising use of inner product spaces in algebraic combinatorics. For $$S,T\subseteq[n-1]$$, let $$\beta(S,T) := \#\{w\in \mathfrak{S}_n\colon D(w)=S, D(w^{-1})=T\},$$ where $$D(w)$$ is the descent set of the permutation $$w$$. Set $$f(n):=\mathrm{max}_{S,T\subseteq[n-1]}\beta(S,T)$$.

Claim: There is some $$S\subseteq[n-1]$$ for which $$f(n)=\beta(S,S)$$.

Proof: It follows from the RSK correspondence and some basic theory of symmetric/quasi-symmetric functions that for any $$S,T\subseteq[n-1]$$, $$\beta(S,T) = \langle s_{B_S}, s_{B_T}\rangle$$ where here $$s_{B_S}$$ is the (skew) Schur function associated to the border strip shape $$B_S$$ determined by the subset $$S$$, and $$\langle \cdot , \cdot \rangle$$ is the canonical inner product on the space of symmetric functions (where usual Schur functions give an orthonormal basis): see e.g. Stanley's Enumerative Combinatorics, Vol. 2, Corollary 7.23.8. So the Cauchy-Schwarz inequality for inner product spaces tells us that $$\beta(S,T)^2 \leq \beta(S,S) \beta(T,T),$$ and thus one of $$\beta(S,S)$$ or $$\beta(T,T)$$ must be greater than or equal to $$\beta(S,T)$$, from which the claim immediately follows. $$\square$$

Variants of the EKR Theorem offer a wide class of examples. This page has a nice list going, by the way.

A friend of mine once made the outrageous claim -- but hear me out -- that most "linear algebra proofs" in combinatorics are not truly using linear algebra. I think he was getting at such arguments' use of a preferential basis (think positive or $\{0,1\}$-matrices) when linear algebra should, in its purest sense, be basis-independent. In the standard proof of Fisher's inequality, you set up and compute a determinant, get that some matrix has full rank, and then conclude the inequality. But there are no linear transformations (debateable). He conceded that, for instance, Perron-Frobenius belongs inside "matrix analysis", but not "linear algebra"!

I argued a little, but then eventually kind of saw his point. I guess I now really appreciate the obvious (but fortunate) fact that inner products count something!

Here are some examples where the dimension of a vector space of polynomials is used to solve a combinatorial problem.

Theorem 1 There are at most $$n(n+1)/2$$ equiangular lines in $$\mathbb{R}^n$$.

Proof. [Koornwinder] Let $$L_1, \dots, L_m$$ be $$m$$ lines passing through origin in $$\mathbb{R}^n$$ with angle $$\arccos(\alpha)$$ between every pair of them. Pick unit vectors $$u_1, \dots, u_m$$ on each line. Then we have $$\langle u_i, u_j \rangle ^2 = \alpha^2$$ for all $$i \neq j$$, and $$\langle u_i, u_i \rangle = 1$$ for all $$i$$. Define polynomials $$P_1, \dots, P_m$$ with $$P_i(x) = \langle u_i, x \rangle^2 - \alpha^2 \langle x, x \rangle$$. Then we have $$P_i(u_j) = (1-\alpha^2)\delta_{i, j}$$, and therefore, these $$m$$ polynomials are linearly independent (unless $$\alpha^2 = 1$$, but this case is easy since $$\mathbb{R}^n$$ has no more than $$n$$ mutually orthogonal nonzero vectors). The space of $$n$$-variable homogenous polynomials with degree at most $$2$$ has dimension $${n + 1\choose 2}$$, and therefore $$m \leq n(n+1)/2$$.

Theorem 2 [Larman, Rogers, Seidel] A two-distance set in $$\mathbb R^n$$ has cardinality at most $$(n+4)(n+1)/2$$.

Proof. Let $$u_1, \dots, u_m$$ be $$m$$ points in $$R^n$$ and $$a$$, $$b$$ be the two non-zero real number such that $$\|u_i - u_j\| \in \{a, b\}$$. Define $$P_i(x) = (\|u_i - x\|^2 - a^2)(\|u_i - x\|^2 - b^2)$$. Then, $$P_i(u_j) = a^2b^2\delta_{i, j}$$. Therefore, the polynomials $$P_i$$'s are linearly independent. Moreover, these polynomials lie in the vector space spanned by polynomials of the type $$\left(\sum_{i = 1}^nx_i^2\right)^2, \left(\sum_{i = 1}^n x_i^2\right)x_j, x_ix_j, x_i, 1.$$ The number of such polynomials is $$1 + n + n(n+1)/2 + n + 1 = (n+4)(n+1)/2$$, which gives us the bound.

For more such examples see "Linear Algebra Methods in Combinatorics" by Babai and Frankl, linked in Stanley's answer.

• Similar techniques are used in this paper by Babai, Snevily and Wilson to prove several results on codes and sets: sciencedirect.com/science/article/pii/0097316595900217 Nov 25, 2015 at 17:33
• Minor correction made in proof of Theorem 1 -- hopefully I didn't distort the intent. Dec 7, 2023 at 6:18

There is also a book in Russian, Линейно-алгебраический метод в комбинаторике by Raygorodsky, that deals with this.

http://www.ozon.ru/context/detail/id/3625051/

I must mention the critical lemma proving the sensitivity conjecture:

Every induced subgraph of the hypercube graph $$Q_n$$ with more than $$2^{n-1}$$ vertices has a vertex with degree at least $$\sqrt n$$.

Which is proved using some basic linear algebra here.

Counting the number of even and odd sized subsets of a set $$A$$ of size $$n$$:

• $$P(A)$$ has a structure of vector space over $$\mathbb F_2$$ with the symmetric difference. Equivalently, one just takes the characteristic vectors in $$\mathbb F_2^n$$ with the usual addition.

• The even sized subsets form a subspace $$W$$.

• The odd sized is then the “affine” subspace $$W+{a}$$ for some $$a\in A$$.

• so both should have the size $$\frac{2^n}{2}=2^{n-1}$$.

(I find the other counting proofs (at least for even $$n$$) less satisfying).

• Better not try this for $n = 0$! What are the other proofs that you find less satisfying? Nov 28, 2021 at 21:37
• I like this proof, but you do not need actually need linear algebra. Your third bullet point gives an explicit bijection without having to know that the even sized subsets are a subspace. Given an even sized subset $A$, remove $1$ if $1 \in A$, and add $1$ if $1 \notin A$. This defines a bijection between the even sized and odd sized subsets. Nov 28, 2021 at 22:17
• It's a matter of personal taste, but I also like the proof via the binomial formula. Just substitute $x=1$ and $y=-1$ into $(x+y)^n$. Nov 29, 2021 at 0:30
• @TonyHuynh of course you don't "need" linear algebra, but using linear algebra something are automatic; e.g. you don't need to verify that you get a bijection by "adding" 1. Dec 15, 2021 at 14:34
• @TonyHuynh I agree that the binomial proof is cool! Dec 15, 2021 at 14:36

Using the natural inner product, it follows quickly that the character table of a finite group in characteristic 0 is square - that is, there are as many conjugacy classes as irreducible representations.

• Is this really a result in "combinatorics" though? Dec 7, 2023 at 12:40
• @SamHopkins, I asked myself the very same question, and I have no definitive answer. Personally, yes, but then, for me everything discrete is combinatorics. Dec 7, 2023 at 13:41