Formalization Blueprint for “An Introduction to Algebraic Combinatorics” by Darij Grinberg

2.3 \(q\)-Binomial Coefficients

Convention 2.134
#

In this section, we will mostly be using FPSs in the indeterminate \(q\). That is, we call the indeterminate \(q\) rather than \(x\). The ring of FPSs in the indeterminate \(q\) over a commutative ring \(K\) will be denoted by \(K[[q]]\). The ring of polynomials in the indeterminate \(q\) over \(K\) will be denoted by \(K[q]\).

2.3.1 Motivation

Proposition 2.135

For any positive integers \(k\) and \(\ell \), we have

\[ \left(\text{\# of partitions with }k\text{ parts and largest part }\ell \right) = \binom {k+\ell -2}{k-1}. \]
theorem AlgebraicCombinatorics.card_partitions_with_parts_and_largest (k : ) (hk : 0 < k) (hℓ : 0 < ) :
(monotoneFunctions (k - 1) ( - 1)).card = (k + - 2).choose (k - 1)
Proof

Consider the Young diagram of a partition with \(k\) parts and largest part \(\ell \). Its lower boundary is a lattice path from \((0,0)\) to \((\ell ,k)\) consisting of east-steps and north-steps. This path begins with an east-step (since otherwise, the partition would have fewer than \(k\) parts) and ends with a north-step (since otherwise, the largest part would be \({\lt}\ell \)). There are precisely \(k+\ell \) steps total, and the first and last are predetermined, so it remains to choose which \(k-1\) of the remaining \(k+\ell -2\) steps are north-steps. The number of such choices is \(\binom {k+\ell -2}{k-1}\).

2.3.2 Definition

Definition 2.136
#

Let \(n\in \mathbb {N}\) and \(k\in \mathbb {Z}\).

(a) The \(q\)-binomial coefficient (or Gaussian binomial coefficient) \(\binom {n}{k}_{q}\) is defined to be the polynomial

\[ \sum _{\substack{[\lambda , \text , {, , i, s, , a, , p, a, r, t, i, t, i, o, n, }, \\ , \text , {, w, i, t, h, , l, a, r, g, e, s, t, , p, a, r, t, , }, \leq , n, -, k, \\ , \text , {, a, n, d, , l, e, n, g, t, h, , }, \leq , k]}}q^{|\lambda |}\in \mathbb {Z}[q]. \]

(b) If \(a\) is any element of a ring \(A\), then we set

\[ \binom {n}{k}_{a} := \binom {n}{k}_{q}[a] = \sum _{\substack{[\lambda , \text , {, , i, s, , a, , p, a, r, t, i, t, i, o, n, }, \\ , \text , {, w, i, t, h, , l, a, r, g, e, s, t, , p, a, r, t, , }, \leq , n, -, k, \\ , \text , {, a, n, d, , l, e, n, g, t, h, , }, \leq , k]}}a^{|\lambda |}\in A. \]
noncomputable def AlgebraicCombinatorics.qBinomial {R : Type u_1} [CommSemiring R] (n k : ) (q : R) :
R

2.3.3 Basic properties

Lemma 2.137

For each \(s \le k \cdot m\), the number of weakly increasing tuples \((f_0, f_1, \ldots , f_{k-1}) \in \{ 0,1,\ldots ,m\} ^k\) with value sum \(s\) equals the number of partitions of \(s\) fitting in a \(k \times m\) box.

theorem AlgebraicCombinatorics.card_monotoneFunctions_sum_eq (k m s : ) (_hs : s k * m) :
{fmonotoneFunctions k m | i : Fin k, (f i) = s}.card = (partitionsInBox s k m).card
Proof

The forward map sends \(f\) to the partition whose parts are the nonzero values of \(f\); the inverse pads the partition’s parts with zeros to length \(k\) and sorts. This is a sum-preserving bijection.

Lemma 2.138

Let \(n, k \in \mathbb {N}\) with \(k \le n\). Then

\[ \binom {n}{k}_{q} = \sum _{m=0}^{k(n-k)} \bigl|\{ \text{partitions of } m \text{ fitting in a } k \times (n{-}k) \text{ box}\} \bigr| \cdot q^{m}. \]
theorem AlgebraicCombinatorics.qBinomial_eq_partition_gf {R : Type u_1} [CommSemiring R] (n k : ) (hk : k n) (q : R) :
qBinomial n k q = mFinset.range (k * (n - k) + 1), (partitionsInBox m k (n - k)).card q ^ m
Proof

This is a restatement of the definition, grouping the sum by partition size \(m = |\lambda |\), and applying Lemma 2.137 to count the monotone functions with each given value sum.

Lemma 2.139

The number of weakly increasing \(k\)-tuples from \(\{ 0, 1, \ldots , \ell \} \) equals \(\binom {k+\ell }{k}\), the number of multisets of size \(k\) from \(\ell + 1\) elements.

Proof

The set of weakly increasing tuples is in bijection with the set of multisets of size \(k\) from \(\ell + 1\) elements, whose cardinality is \(\binom {k+\ell }{k}\) by the stars-and-bars formula.

Proposition 2.140

Let \(n\in \mathbb {N}\) and \(k\in \mathbb {Z}\).

(a) We have

\[ \binom {n}{k}_{q}=\sum _{0\leq i_{1}\leq i_{2}\leq \cdots \leq i_{k}\leq n-k}q^{i_{1}+i_{2}+\cdots +i_{k}}. \]

Here, the sum ranges over all weakly increasing \(k\)-tuples \((i_{1},i_{2},\ldots ,i_{k}) \in \{ 0,1,\ldots ,n-k\} ^{k}\). If \(k{\gt}n\), then this is an empty sum. If \(k{\lt}0\), then this is also an empty sum.

(b) Set \(\operatorname {sum}S=\sum _{s\in S}s\) for any finite set \(S\) of integers. Then, we have

\[ \binom {n}{k}_{q}=\sum _{\substack{[S, \subseteq , \{ , 1, ,, 2, ,, \ldots , ,, n, \} , , ;, \\ , \left , |, S, \right , |, =, k]}}q^{\operatorname {sum}S-(1+2+\cdots +k)}. \]

(c) We have

\[ \binom {n}{k}_{1}=\binom {n}{k}. \]
theorem AlgebraicCombinatorics.qBinomial_eq_sum_increasing_tuples {R : Type u_1} [CommSemiring R] (n k : ) (hk : k n) (q : R) :
qBinomial n k q = fmonotoneFunctions k (n - k), q ^ i : Fin k, (f i)
Proof

(a) The definition of \(\binom {n}{k}_{q}\) yields

\[ \binom {n}{k}_{q} =\sum _{\substack{[\lambda , \text , {, , i, s, , a, , p, a, r, t, i, t, i, o, n, }, \\ , \text , {, w, i, t, h, , l, a, r, g, e, s, t, , p, a, r, t, , }, \leq , n, -, k, \\ , \text , {, a, n, d, , l, e, n, g, t, h, , }, \leq , k]}}q^{|\lambda |} =\sum _{\ell =0}^{k}\; \sum _{\substack{[\lambda , \text , {, , i, s, , a, , p, a, r, t, i, t, i, o, n, }, , \\ , \text , {, w, i, t, h, , l, a, r, g, e, s, t, , p, a, r, t, , }, \leq , n, -, k, \\ , \text , {, a, n, d, , l, e, n, g, t, h, , }, \ell ]}}q^{|\lambda |}. \]

For each fixed \(\ell \in \{ 0,1,\ldots ,k\} \), the partitions \(\lambda \) with largest part \(\leq n-k\) and length \(\ell \) correspond bijectively to \(k\)-tuples \((\lambda _{1},\lambda _{2},\ldots ,\lambda _{k})\in \mathbb {N}^{k}\) satisfying \(n-k\geq \lambda _{1}\geq \lambda _{2}\geq \cdots \geq \lambda _{k}\geq 0\) and having exactly \(\ell \) positive entries (by padding with zeros). Summing over all \(\ell \) and then reversing the \(k\)-tuple (substituting \((i_{k},i_{k-1},\ldots ,i_{1})\) for \((\lambda _{1},\ldots ,\lambda _{k})\)) gives part (a).

(b) There is a bijection from weakly increasing \(k\)-tuples \((i_{1},\ldots ,i_{k})\in \{ 0,1,\ldots ,n-k\} ^{k}\) to strictly increasing \(k\)-tuples \((s_{1},\ldots ,s_{k})\in \{ 1,2,\ldots ,n\} ^{k}\), given by \((i_{1},\ldots ,i_{k})\mapsto (i_{1}+1,\, i_{2}+2,\, \ldots ,\, i_{k}+k)\). Moreover, strictly increasing \(k\)-tuples from \(\{ 1,\ldots ,n\} \) correspond bijectively to \(k\)-element subsets \(S\subseteq \{ 1,\ldots ,n\} \). Combining with (a) gives (b).

(c) Substituting \(1\) for \(q\) in (b) gives \(\binom {n}{k}_{1} = |\{ S\subseteq \{ 1,\ldots ,n\} :\, |S|=k\} | = \binom {n}{k}\).

Proposition 2.141

Let \(n,k\in \mathbb {N}\) satisfy \(k{\gt}n\). Then, \(\binom {n}{k}_{q}=0\).

theorem AlgebraicCombinatorics.qBinomial_zero_of_lt {R : Type u_1} [CommSemiring R] (n k : ) (hk : n < k) (q : R) :
qBinomial n k q = 0
Proof

From \(k{\gt}n\), we obtain \(n-k{\lt}0\). The sum in the definition is empty, since there exists no partition with largest part \(\leq n-k {\lt} 0\). Thus \(\binom {n}{k}_{q} = 0\).

Proposition 2.142

We have \(\binom {n}{0}_{q}=\binom {n}{n}_{q}=1\) for each \(n\in \mathbb {N}\).

theorem AlgebraicCombinatorics.qBinomial_n_zero {R : Type u_1} [CommSemiring R] (n : ) (q : R) :
qBinomial n 0 q = 1
theorem AlgebraicCombinatorics.qBinomial_n_n {R : Type u_1} [CommSemiring R] (n : ) (q : R) :
qBinomial n n q = 1
Proof

For \(\binom {n}{0}_q\): the only weakly increasing \(0\)-tuple is the empty one, whose value sum is \(0\), giving \(q^0 = 1\).

For \(\binom {n}{n}_q\): when \(k = n\), we have \(n - k = 0\), so the values must lie in \(\{ 0\} \), and the only weakly increasing tuple sends everything to \(0\); the value sum is \(0\), giving \(q^0 = 1\).

Convention 2.143
#

Let \(n\in \mathbb {N}\). For any \(k\notin \mathbb {Z}\), we set \(\binom {n}{k}_{q}:=0\).

2.3.4 Recurrence relations

Theorem 2.144

Let \(n\) be a positive integer. Let \(k\in \mathbb {N}\). Then:

(a) We have

\[ \binom {n}{k}_{q}=q^{n-k}\binom {n-1}{k-1}_{q}+\binom {n-1}{k}_{q}. \]

(b) We have

\[ \binom {n}{k}_{q}=\binom {n-1}{k-1}_{q}+q^{k}\binom {n-1}{k}_{q}. \]
theorem AlgebraicCombinatorics.qBinomial_rec_left {R : Type u_1} [CommSemiring R] (n : ) (hn : 0 < n) (k : ) (hk : 0 < k) (q : R) :
qBinomial n k q = q ^ (n - k) * qBinomial (n - 1) (k - 1) q + qBinomial (n - 1) k q
theorem AlgebraicCombinatorics.qBinomial_rec_right {R : Type u_1} [CommSemiring R] (n : ) (hn : 0 < n) (k : ) (hk : 0 < k) (q : R) :
qBinomial n k q = qBinomial (n - 1) (k - 1) q + q ^ k * qBinomial (n - 1) k q
Proof

(a) If \(k=0\), the claim reduces to \(1 = q^{n-k}\cdot 0 + 1\), which holds by Proposition 2.142 and Convention 2.143. So assume \(k {\gt} 0\).

Using Proposition 2.140 (b), we write \(\binom {n}{k}_q\) as a sum over \(k\)-element subsets \(S \subseteq \{ 1,\ldots ,n\} \). We split these subsets into type-1 (containing \(n\)) and type-2 (not containing \(n\)).

The type-2 subsets are exactly the \(k\)-element subsets of \(\{ 1,\ldots ,n-1\} \), contributing \(\binom {n-1}{k}_q\).

The type-1 subsets biject to \((k{-}1)\)-element subsets of \(\{ 1,\ldots ,n-1\} \) via \(S \mapsto S \setminus \{ n\} \). Since \(\operatorname {sum}(S\cup \{ n\} ) = \operatorname {sum}S + n\), the exponent shifts by \(n - k\), giving \(q^{n-k}\binom {n-1}{k-1}_q\).

(b) This is proved similarly, or by combining part (a) with symmetry (applied locally before the main symmetry theorem is established).

2.3.5 Product and quotient formulas

Lemma 2.145

Over a field, if \(q^n \neq 1\) then \([n]_q \neq 0\).

theorem AlgebraicCombinatorics.qInt_ne_zero {R : Type u_2} [Field R] (n : ) (q : R) (hq : q ^ n 1) :
qInt n q 0
Proof

By Lemma 2.149, \((1-q)[n]_q = 1 - q^n\). If \([n]_q = 0\), then \(1 - q^n = 0\), contradicting \(q^n \neq 1\).

Lemma 2.146

Over a field, if \(q^{i} \neq 1\) for all \(i = 1, \ldots , n\), then \([n]_q! \neq 0\).

theorem AlgebraicCombinatorics.qFactorial_ne_zero {R : Type u_2} [Field R] (n : ) (q : R) (hq : iFinset.range n, q ^ (i + 1) 1) :
Proof

Since \([n]_q! = \prod _{i=1}^{n} [i]_q\) and each factor is nonzero by Lemma 2.145, the product is nonzero.

Theorem 2.147

Let \(n,k\in \mathbb {N}\) satisfy \(n\geq k\). Then:

(a) We have

\[ (1-q^{k})(1-q^{k-1})\cdots (1-q^{1})\cdot \binom {n}{k}_{q} =(1-q^{n})(1-q^{n-1})\cdots (1-q^{n-k+1}). \]

(b) We have

\[ \binom {n}{k}_{q}=\frac{(1-q^{n})(1-q^{n-1}) \cdots (1-q^{n-k+1})}{(1-q^{k})(1-q^{k-1})\cdots (1-q^{1})} \]

(in the ring \(\mathbb {Z}[[q]]\) or in the field of rational functions over \(\mathbb {Q}\)).

theorem AlgebraicCombinatorics.qBinomial_quot_formula {R : Type u_2} [CommRing R] (n k : ) (hk : k n) (q : R) :
(∏ iFinset.range k, (1 - q ^ (i + 1))) * qBinomial n k q = iFinset.range k, (1 - q ^ (n - i))
theorem AlgebraicCombinatorics.qBinomial_eq_prod_quot {R : Type u_2} [Field R] (n k : ) (hk : k n) (q : R) (hq : iFinset.range k, q ^ (i + 1) 1) :
qBinomial n k q = iFinset.range k, (1 - q ^ (n - i)) / (1 - q ^ (i + 1))
Proof

(a) By induction on \(n\) (strong induction). For \(k = 0\) both sides equal \(1\). For \(k {\gt} 0\), we use the recurrence from Theorem 2.144 (a) to split \(\binom {n}{k}_q\), multiply both sides by the product \((1-q^k)\cdots (1-q)\), apply the inductive hypothesis to the two resulting terms (at \(n-1\)), and combine using the identity \((1-q^{k+1})q^{n-k-1} + (1-q^{n-k-1}) = 1-q^n\) (after appropriate index shifts).

(b) Divide both sides of (a) by \((1-q^k)(1-q^{k-1})\cdots (1-q)\), which is nonzero when \(q\) is not a root of unity of order \(\leq k\).

2.3.6 \(q\)-integers and \(q\)-factorials

Definition 2.148
#

(a) For any \(n\in \mathbb {N}\), define the \(q\)-integer \([n]_{q}\) to be

\[ [n]_{q}:=q^{0}+q^{1}+\cdots +q^{n-1}\in \mathbb {Z}[q]. \]

(b) For any \(n\in \mathbb {N}\), define the \(q\)-factorial \([n]_{q}!\) to be

\[ [n]_{q}!\ :=[1]_{q}[2]_{q}\cdots [n]_{q}\in \mathbb {Z}[q]. \]

(c) As usual, if \(a\) is an element of a ring \(A\), then \([n]_{a}\) and \([n]_{a}!\) will mean the results of substituting \(a\) for \(q\) in \([n]_{q}\) and \([n]_{q}!\), respectively. Thus, explicitly, \([n]_{a}=a^{0}+a^{1}+\cdots +a^{n-1}\) and \([n]_{a}!=[1]_{a}[2]_{a}\cdots [n]_{a}\).

Lemma 2.149

For any \(n\in \mathbb {N}\), we have

\[ (1-q)\cdot [n]_{q} = 1-q^{n} \]

and hence \([n]_{q}=\frac{1-q^{n}}{1-q}\) (in \(\mathbb {Z}[[q]]\) or in the field of rational functions over \(\mathbb {Q}\)).

theorem AlgebraicCombinatorics.qInt_eq_geom_sum {R : Type u_2} [CommRing R] (n : ) (q : R) :
(1 - q) * qInt n q = 1 - q ^ n
Proof

Telescoping: \((1-q)(q^{0}+q^{1}+\cdots +q^{n-1}) =(q^{0}+\cdots +q^{n-1})-(q^{1}+\cdots +q^{n}) =1-q^{n}\).

Lemma 2.150

For any \(n\in \mathbb {N}\), we have \([n]_{1}=n\) and \([n]_{1}!=n!\).

Proof

\([n]_1 = 1^0+1^1+\cdots +1^{n-1} = \underbrace{1+1+\cdots +1}_{n\text{ times}} = n\). Then \([n]_1! = [1]_1[2]_1\cdots [n]_1 = 1\cdot 2\cdots n = n!\).

Lemma 2.151

For \(k \le n\), we have

\[ [n]_q! = \bigl([n]_q \cdot [n{-}1]_q \cdots [n{-}k{+}1]_q\bigr) \cdot [n{-}k]_q!\, . \]
theorem AlgebraicCombinatorics.qFactorial_split {R : Type u_1} [CommSemiring R] (n k : ) (hk : k n) (q : R) :
qFactorial n q = (∏ iFinset.range k, qInt (n - i) q) * qFactorial (n - k) q
Proof

By induction on \(k\). The base case \(k=0\) is trivial. For \(k+1\), split off the last factor \([n-k]_q\) from the falling product and use \([n-k]_q! = [n-k-1]_q! \cdot [n-k]_q\).

Lemma 2.152

Over a field, when \(q\) is not a root of unity of order \(\le k\),

\[ \binom {n}{k}_q = \prod _{i=0}^{k-1} \frac{[n-i]_q}{[i+1]_q}. \]
theorem AlgebraicCombinatorics.qBinomial_eq_qInt_prod_quot {R : Type u_2} [Field R] (n k : ) (hk : k n) (q : R) (hq : iFinset.range k, q ^ (i + 1) 1) :
qBinomial n k q = (∏ iFinset.range k, qInt (n - i) q) / qFactorial k q
Proof

Divide the product formula from Theorem 2.147 (b) by \((1-q)^k\) to replace each factor \((1-q^m)/(1-q)\) with \([m]_q\).

Theorem 2.153

Let \(n,k\in \mathbb {N}\) with \(n\geq k\). Then,

\[ \binom {n}{k}_{q}=\frac{[n]_{q}[n-1]_{q} \cdots [n-k+1]_{q}}{[k]_{q}!}=\frac{[n]_{q}!}{[k]_{q}!\cdot [n-k]_{q}!} \]

(in the ring \(\mathbb {Z}[[q]]\) or in the ring of rational functions over \(\mathbb {Q}\)).

theorem AlgebraicCombinatorics.qBinomial_eq_qFactorial_quot {R : Type u_2} [Field R] (n k : ) (hk : k n) (q : R) (hq : iFinset.range n, q ^ (i + 1) 1) :
qBinomial n k q = qFactorial n q / (qFactorial k q * qFactorial (n - k) q)
Proof

The first equality follows from Theorem 2.147 (b) by rewriting each factor \((1-q^m)/(1-q)\) as \([m]_q\) (using Lemma 2.149). The second equality follows from the splitting \([n]_q! = [n]_q[n{-}1]_q\cdots [n{-}k{+}1]_q \cdot [n{-}k]_q!\) (Lemma 2.151).

2.3.7 Symmetry

Helpers for Proposition 2.156

Lemma 2.154

Let \((f_0, f_1, \ldots , f_{k-1})\) be a weakly increasing tuple in \(\{ 0,1,\ldots ,m\} ^k\). Define the transpose \((g_0, g_1, \ldots , g_{m-1})\) with \(g_j = \# \{ i : f_i {\gt} m{-}1{-}j\} \). Then applying the transpose operation twice recovers the original tuple.

Proof

For each index \(i\), the number of \(j \in \{ 0,1,\ldots ,m{-}1\} \) with \(g_j {\gt} k{-}1{-}i\) equals the number of \(j\) with \(j \ge m - f_i\), which equals \(f_i\). The proof uses the complement counting identity and the characterization of the profile of \(f\) via the predicate \(f_{i'} \le m{-}1{-}j\).

Lemma 2.155

The transpose operation preserves the sum of values: \(\sum _{j} g(j) = \sum _{i} f(i)\).

theorem AlgebraicCombinatorics.sum_transposeMonotone (k m : ) (f : Fin kFin (m + 1)) :
j : Fin m, (AlgebraicCombinatorics.transposeMonotone✝ k m f j) = i : Fin k, (f i)
Proof

By swapping the order of summation in the double sum \(\sum _j \# \{ i : f(i) {\gt} m{-}1{-}j\} \) and using the identity \(\# \{ j : j \ge m - v\} = v\) for \(0 \le v \le m\).

Proposition 2.156

Let \(n,k\in \mathbb {N}\). Then,

\[ \binom {n}{k}_{q}=\binom {n}{n-k}_{q}. \]
theorem AlgebraicCombinatorics.qBinomial_symm {R : Type u_1} [CommSemiring R] (n k : ) (hk : k n) (q : R) :
qBinomial n k q = qBinomial n (n - k) q
Proof

We construct an explicit involution on weakly increasing tuples. Given a weakly increasing tuple \((f_0, f_1, \ldots , f_{k-1}) \in \{ 0,1,\ldots ,m\} ^k\) (where \(m = n-k\)), define the transpose \((g_0, g_1, \ldots , g_{m-1}) \in \{ 0,1,\ldots ,k\} ^m\) by

\[ g_j = \# \{ i : f_i {\gt} m - 1 - j\} . \]

This tuple is again weakly increasing. The transpose operation is an involution (applying it twice recovers the original tuple) and preserves the sum of values (\(\sum _j g_j = \sum _i f_i\)). It therefore gives a sum-preserving bijection between weakly increasing \(k\)-tuples in \(\{ 0,\ldots ,n{-}k\} \) and weakly increasing \((n{-}k)\)-tuples in \(\{ 0,\ldots ,k\} \), proving \(\binom {n}{k}_q = \binom {n}{n-k}_q\).