Algebraic Combinatorics

A Lean 4 formalization of An Introduction to Algebraic Combinatorics by Darij Grinberg, built on Mathlib. Early chapters establish prerequisites (power series, generating functions, permutations); later chapters formalize important results including the Lindström–Gessel–Viennot lemma, q-binomial identities, and symmetric function theory.

This page shows all 344 formalization targets for quick side-by-side comparison of mathematical statements and their Lean proofs. For full details, see the Blueprint or the source on GitHub.

Citation:
@misc{{gloecke2025textbook,
  title         = {{Automatic Textbook Formalization}},
  author        = {{Fabian Gloecke and Ahmad Rammal and Charles Arnal and
                   Remi Munos and Vivien Cabannes and Gabriel Synnaeve and
                   Amaury Hayat}},
  year          = {{2025}},
  howpublished  = {{\url{{https://github.com/facebookresearch/repoprover}}}},
}}

Notations and elementary facts

blueprint
Definition 1.1

For any numbers \(n\) and \(k\), we set

\begin{equation} \binom {n}{k}=\begin{cases} \frac{n\left( n-1\right) \left( n-2\right) \cdots \left( n-k+1\right) }{k!}, & \text{if }k\in \mathbb {N};\\ 0, & \text{else.}\end{cases} \label{eq.def.binom.binom.eq}\end{equation}

Note that “numbers” is to be understood fairly liberally here. In particular, \(n\) can be any integer, rational, real or complex number (or, more generally, any element in a \(\mathbb {Q}\)-algebra), whereas \(k\) can be anything (although the only nonzero values of \(\binom {n}{k}\) will be achieved for \(k\in \mathbb {N}\), by the above definition).

blueprint
Proposition 1.5 Pascal’s identity, aka recurrence of the binomial coefficients

We have

\begin{equation} \binom {m}{n}=\binom {m-1}{n-1}+\binom {m-1}{n} \label{eq.binom.rec.m}\end{equation}

for any numbers \(m\) and \(n\).

theorem AlgebraicCombinatorics.FPS.pascal_identity_ring {R : Type u_1} [CommRing R] [BinomialRing R] [NatPowAssoc R] (m : R) (n : ) (hn : 0 < n) :
Ring.choose m n = Ring.choose (m - 1) (n - 1) + Ring.choose (m - 1) n
blueprint
Proposition 1.8

Let \(m,n\in \mathbb {N}\) satisfy \(m{\lt}n\). Then, \(\binom {m}{n}=0\).

blueprint
Theorem 1.9 Symmetry of the binomial coefficients

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

\[ \binom {n}{k}=\binom {n}{n-k}. \]
theorem AlgebraicCombinatorics.FPS.binom_symm {n k : } (h : k n) :
n.choose k = n.choose (n - k)

Definitions

Reminder: Commutative rings

blueprint
Definition 1.42

A commutative ring means a set \(K\) equipped with three maps

\begin{align*} \oplus & :K\times K\rightarrow K,\\ \ominus & :K\times K\rightarrow K,\\ \odot & :K\times K\rightarrow K \end{align*}

and two elements \(\mathbf{0}\in K\) and \(\mathbf{1}\in K\) satisfying the following axioms:

  1. Commutativity of addition: We have \(a\oplus b=b\oplus a\) for all \(a,b\in K\).

  2. Associativity of addition: We have \(a\oplus \left( b\oplus c\right) =\left( a\oplus b\right) \oplus c\) for all \(a,b,c\in K\).

  3. Neutrality of zero: We have \(a\oplus \mathbf{0}=\mathbf{0}\oplus a=a\) for all \(a\in K\).

  4. Subtraction undoes addition: Let \(a,b,c\in K\). We have \(a\oplus b=c\) if and only if \(a=c\ominus b\).

  5. Commutativity of multiplication: We have \(a\odot b=b\odot a\) for all \(a,b\in K\).

  6. Associativity of multiplication: We have \(a\odot \left( b\odot c\right) =\left( a\odot b\right) \odot c\) for all \(a,b,c\in K\).

  7. Distributivity: We have

    \[ a\odot \left( b\oplus c\right) =\left( a\odot b\right) \oplus \left( a\odot c\right) \ \ \ \ \ \ \ \ \ \ \text{and}\ \ \ \ \ \ \ \ \ \ \left( a\oplus b\right) \odot c=\left( a\odot c\right) \oplus \left( b\odot c\right) \]

    for all \(a,b,c\in K\).

  8. Neutrality of one: We have \(a\odot \mathbf{1}=\mathbf{1}\odot a=a\) for all \(a\in K\).

  9. Annihilation: We have \(a\odot \mathbf{0}=\mathbf{0}\odot a=\mathbf{0}\) for all \(a\in K\).

The operations \(\oplus \), \(\ominus \) and \(\odot \) are called the addition, the subtraction and the multiplication of the ring \(K\). When confusion is unlikely, we will denote these three operations \(\oplus \), \(\ominus \) and \(\odot \) by \(+\), \(-\) and \(\cdot \), respectively, and we will abbreviate \(a\odot b=a\cdot b\) by \(ab\).

The elements \(\mathbf{0}\) and \(\mathbf{1}\) are called the zero and the unity (or the one) of the ring \(K\). We will simply call these elements \(0\) and \(1\) when confusion with the corresponding numbers is unlikely.

We will use PEMDAS conventions for the three operations \(\oplus \), \(\ominus \) and \(\odot \). These imply that the operation \(\odot \) has higher precedence than \(\oplus \) and \(\ominus \), while the operations \(\oplus \) and \(\ominus \) are left-associative.

theorem AlgebraicCombinatorics.FPS.commRing_add_comm {K : Type u_1} [CommRing K] (a b : K) :
a + b = b + a
theorem AlgebraicCombinatorics.FPS.commRing_add_assoc {K : Type u_1} [CommRing K] (a b c : K) :
a + (b + c) = a + b + c
theorem AlgebraicCombinatorics.FPS.commRing_sub_iff_add {K : Type u_1} [CommRing K] (a b c : K) :
a + b = c a = c - b
theorem AlgebraicCombinatorics.FPS.commRing_mul_comm {K : Type u_1} [CommRing K] (a b : K) :
a * b = b * a
theorem AlgebraicCombinatorics.FPS.commRing_mul_assoc {K : Type u_1} [CommRing K] (a b c : K) :
a * (b * c) = a * b * c
theorem AlgebraicCombinatorics.FPS.commRing_left_distrib {K : Type u_1} [CommRing K] (a b c : K) :
a * (b + c) = a * b + a * c
theorem AlgebraicCombinatorics.FPS.commRing_mul_one {K : Type u_1} [CommRing K] (a : K) :
a * 1 = a
blueprint
Definition 1.57

Let \(K\) be a commutative ring.

A \(K\)-module means a set \(M\) equipped with three maps

\begin{align*} \oplus & :M\times M\rightarrow M,\\ \ominus & :M\times M\rightarrow M,\\ \rightharpoonup & :K\times M\rightarrow M \end{align*}

(notice that the third map has domain \(K\times M\), not \(M\times M\)) and an element \(\overrightarrow {0}\in M\) satisfying the following axioms:

  1. Commutativity of addition: We have \(a\oplus b=b\oplus a\) for all \(a,b\in M\).

  2. Associativity of addition: We have \(a\oplus \left( b\oplus c\right) =\left( a\oplus b\right) \oplus c\) for all \(a,b,c\in M\).

  3. Neutrality of zero: We have \(a\oplus \overrightarrow {0}=\overrightarrow {0}\oplus a=a\) for all \(a\in M\).

  4. Subtraction undoes addition: Let \(a,b,c\in M\). We have \(a\oplus b=c\) if and only if \(a=c\ominus b\).

  5. Associativity of scaling: We have \(u\rightharpoonup \left( v\rightharpoonup a\right) =\left( uv\right) \rightharpoonup a\) for all \(u,v\in K\) and \(a\in M\).

  6. Left distributivity: We have \(u\rightharpoonup \left( a\oplus b\right) =\left( u\rightharpoonup a\right) \oplus \left( u\rightharpoonup b\right) \) for all \(u\in K\) and \(a,b\in M\).

  7. Right distributivity: We have \(\left( u+v\right) \rightharpoonup a=\left( u\rightharpoonup a\right) \oplus \left( v\rightharpoonup a\right) \) for all \(u,v\in K\) and \(a\in M\).

  8. Neutrality of one: We have \(1\rightharpoonup a=a\) for all \(a\in M\).

  9. Left annihilation: We have \(0\rightharpoonup a=\overrightarrow {0}\) for all \(a\in M\).

  10. Right annihilation: We have \(u\rightharpoonup \overrightarrow {0}=\overrightarrow {0}\) for all \(u\in K\).

The operations \(\oplus \), \(\ominus \) and \(\rightharpoonup \) are called the addition, the subtraction and the scaling (or the \(K\)-action) of the \(K\)-module \(M\). When confusion is unlikely, we will denote these three operations \(\oplus \), \(\ominus \) and \(\rightharpoonup \) by \(+\), \(-\) and \(\cdot \), respectively, and we will abbreviate \(a\rightharpoonup b=a\cdot b\) by \(ab\).

The element \(\overrightarrow {0}\) is called the zero (or the zero vector) of the \(K\)-module \(M\). We will usually just call it \(0\).

When \(M\) is a \(K\)-module, the elements of \(M\) are called vectors, while the elements of \(K\) are called scalars.

We will use PEMDAS conventions for the three operations \(\oplus \), \(\ominus \) and \(\rightharpoonup \), with the operation \(\rightharpoonup \) having higher precedence than \(\oplus \) and \(\ominus \).

theorem AlgebraicCombinatorics.FPS.module_add_comm {M : Type u_2} [AddCommGroup M] (a b : M) :
a + b = b + a
theorem AlgebraicCombinatorics.FPS.module_add_assoc {M : Type u_2} [AddCommGroup M] (a b c : M) :
a + (b + c) = a + b + c
theorem AlgebraicCombinatorics.FPS.module_sub_iff_add {M : Type u_2} [AddCommGroup M] (a b c : M) :
a + b = c a = c - b
theorem AlgebraicCombinatorics.FPS.module_smul_assoc {K : Type u_1} [CommRing K] {M : Type u_2} [AddCommGroup M] [Module K M] (u v : K) (a : M) :
u v a = (u * v) a
theorem AlgebraicCombinatorics.FPS.module_smul_add {K : Type u_1} [CommRing K] {M : Type u_2} [AddCommGroup M] [Module K M] (u : K) (a b : M) :
u (a + b) = u a + u b
theorem AlgebraicCombinatorics.FPS.module_add_smul {K : Type u_1} [CommRing K] {M : Type u_2} [AddCommGroup M] [Module K M] (u v : K) (a : M) :
(u + v) a = u a + v a
theorem AlgebraicCombinatorics.FPS.module_one_smul {K : Type u_1} [CommRing K] {M : Type u_2} [AddCommGroup M] [Module K M] (a : M) :
1 a = a
theorem AlgebraicCombinatorics.FPS.module_zero_smul {K : Type u_1} [CommRing K] {M : Type u_2} [AddCommGroup M] [Module K M] (a : M) :
0 a = 0
theorem AlgebraicCombinatorics.FPS.module_smul_zero {K : Type u_1} [CommRing K] {M : Type u_2} [AddCommGroup M] [Module K M] (u : K) :
u 0 = 0

The definition of formal power series

blueprint
Definition 1.73

A formal power series (or, short, FPS) in \(1\) indeterminate over \(K\) means a sequence \(\left(a_{0},a_{1},a_{2},\ldots \right) = \left(a_{n}\right)_{n\in \mathbb {N}} \in K^{\mathbb {N}}\) of elements of \(K\).

noncomputable def AlgebraicCombinatorics.FPS.fpsEquivSeq {R : Type u_1} [CommRing R] :
PowerSeries R (R)
blueprint
Definition 1.74

(a) The sum of two FPSs \(\mathbf{a}=\left( a_{0},a_{1},a_{2},\ldots \right)\) and \(\mathbf{b}=\left(b_{0},b_{1},b_{2},\ldots \right)\) is defined to be the FPS

\[ \left(a_{0}+b_{0},\ \ a_{1}+b_{1},\ \ a_{2}+b_{2},\ \ \ldots \right). \]

It is denoted by \(\mathbf{a}+\mathbf{b}\).

(b) The difference of two FPSs \(\mathbf{a}=\left(a_{0},a_{1},a_{2},\ldots \right)\) and \(\mathbf{b}=\left(b_{0},b_{1},b_{2},\ldots \right)\) is defined to be the FPS

\[ \left(a_{0}-b_{0},\ \ a_{1}-b_{1},\ \ a_{2}-b_{2},\ \ \ldots \right). \]

It is denoted by \(\mathbf{a}-\mathbf{b}\).

(c) If \(\lambda \in K\) and if \(\mathbf{a}=\left(a_{0},a_{1},a_{2},\ldots \right)\) is an FPS, then we define an FPS

\[ \lambda \mathbf{a}:=\left(\lambda a_{0},\lambda a_{1},\lambda a_{2},\ldots \right). \]

(d) The product of two FPSs \(\mathbf{a}=\left(a_{0},a_{1},a_{2},\ldots \right)\) and \(\mathbf{b}=\left(b_{0},b_{1},b_{2},\ldots \right)\) is defined to be the FPS \(\left(c_{0},c_{1},c_{2},\ldots \right)\), where

\begin{align*} c_{n} & =\sum _{i=0}^{n}a_{i}b_{n-i}=\sum _{\substack {\left(i,j\right) \in \mathbb {N}^{2};\\ i+j=n }}a_{i}b_{j}\\ & =a_{0}b_{n}+a_{1}b_{n-1}+a_{2}b_{n-2}+\cdots +a_{n}b_{0}\ \ \ \ \ \ \ \ \ \ \text{for each }n\in \mathbb {N}. \end{align*}

This product is denoted by \(\mathbf{a}\cdot \mathbf{b}\) or just by \(\mathbf{ab}\).

(e) For each \(a\in K\), we define \(\underline{a}\) to be the FPS \(\left(a,0,0,0,\ldots \right)\). An FPS of the form \(\underline{a}\) for some \(a\in K\) (that is, an FPS \(\left(a_{0},a_{1},a_{2},\ldots \right)\) satisfying \(a_{1}=a_{2}=a_{3}=\cdots =0\)) is said to be constant.

(f) The set of all FPSs (in \(1\) indeterminate over \(K\)) is denoted \(K\left[\left[x\right]\right]\).

blueprint
Theorem 1.76

(a) The set \(K\left[\left[x\right]\right]\) is a commutative ring (with its operations \(+\), \(-\) and \(\cdot \) defined in Definition 1.74). Its zero and its unity are the FPSs \(\underline{0}=\left(0,0,0,\ldots \right)\) and \(\underline{1}=\left( 1,0,0,0,\ldots \right)\). This means, concretely, that the following facts hold:

  1. Commutativity of addition: We have \(\mathbf{a}+\mathbf{b}=\mathbf{b}+\mathbf{a}\) for all \(\mathbf{a},\mathbf{b}\in K\left[\left[ x\right]\right]\).

  2. Associativity of addition: We have \(\mathbf{a}+\left( \mathbf{b}+\mathbf{c}\right) =\left(\mathbf{a}+\mathbf{b}\right) +\mathbf{c}\) for all \(\mathbf{a},\mathbf{b},\mathbf{c}\in K\left[\left[ x\right]\right]\).

  3. Neutrality of zero: We have \(\mathbf{a}+\underline{0}=\underline{0}+\mathbf{a}=\mathbf{a}\) for all \(\mathbf{a}\in K\left[\left[ x\right]\right]\).

  4. Subtraction undoes addition: Let \(\mathbf{a},\mathbf{b},\mathbf{c}\in K\left[\left[x\right]\right]\). We have \(\mathbf{a}+\mathbf{b}=\mathbf{c}\) if and only if \(\mathbf{a}=\mathbf{c}-\mathbf{b}\).

  5. Commutativity of multiplication: We have \(\mathbf{ab}=\mathbf{ba}\) for all \(\mathbf{a},\mathbf{b}\in K\left[\left[x\right] \right]\).

  6. Associativity of multiplication: We have \(\mathbf{a}\left( \mathbf{bc}\right) =\left(\mathbf{ab}\right)\mathbf{c}\) for all \(\mathbf{a},\mathbf{b},\mathbf{c}\in K\left[\left[x\right]\right]\).

  7. Distributivity: We have

    \[ \mathbf{a}\left(\mathbf{b}+\mathbf{c}\right) =\mathbf{ab}+\mathbf{ac}\ \ \ \ \ \ \ \ \ \ \text{and}\ \ \ \ \ \ \ \ \ \ \left(\mathbf{a}+\mathbf{b}\right)\mathbf{c}=\mathbf{ac}+\mathbf{bc} \]

    for all \(\mathbf{a},\mathbf{b},\mathbf{c}\in K\left[\left[x\right] \right]\).

  8. Neutrality of one: We have \(\mathbf{a}\cdot \underline{1}=\underline{1}\cdot \mathbf{a}=\mathbf{a}\) for all \(\mathbf{a}\in K\left[ \left[x\right]\right]\).

  9. Annihilation: We have \(\mathbf{a}\cdot \underline{0}=\underline{0}\cdot \mathbf{a}=\underline{0}\) for all \(\mathbf{a}\in K\left[ \left[x\right]\right]\).

(b) Furthermore, \(K\left[\left[x\right]\right]\) is a \(K\)-module (with its scaling being the map that sends each \(\left( \lambda ,\mathbf{a}\right) \in K\times K\left[\left[x\right]\right]\) to the FPS \(\lambda \mathbf{a}\) defined in Definition 1.74 (c)). Its zero vector is \(\underline{0}\). Concretely, this means that:

  1. Associativity of scaling: We have \(\lambda \left( \mu \mathbf{a}\right) =\left( \lambda \mu \right) \mathbf{a}\) for all \(\lambda ,\mu \in K\) and \(\mathbf{a}\in K\left[\left[x\right]\right]\).

  2. Left distributivity: We have \(\lambda \left( \mathbf{a}+\mathbf{b}\right) =\lambda \mathbf{a}+\lambda \mathbf{b}\) for all \(\lambda \in K\) and \(\mathbf{a},\mathbf{b}\in K\left[\left[x\right]\right]\).

  3. Right distributivity: We have \(\left( \lambda +\mu \right) \mathbf{a}=\lambda \mathbf{a}+\mu \mathbf{a}\) for all \(\lambda ,\mu \in K\) and \(\mathbf{a}\in K\left[\left[x\right]\right]\).

  4. Neutrality of one: We have \(1\mathbf{a}=\mathbf{a}\) for all \(\mathbf{a}\in K\left[\left[x\right]\right]\).

  5. Left annihilation: We have \(0\mathbf{a}=\underline{0}\) for all \(\mathbf{a}\in K\left[\left[x\right]\right]\).

  6. Right annihilation: We have \(\lambda \underline{0}=\underline{0}\) for all \(\lambda \in K\).

(c) We have \(\lambda \left(\mathbf{a}\cdot \mathbf{b}\right) =\left(\lambda \mathbf{a}\right)\cdot \mathbf{b}=\mathbf{a}\cdot \left( \lambda \mathbf{b}\right)\) for all \(\lambda \in K\) and \(\mathbf{a},\mathbf{b}\in K\left[\left[x\right]\right]\).

(d) Finally, we have \(\lambda \mathbf{a}=\underline{\lambda }\cdot \mathbf{a}\) for all \(\lambda \in K\) and \(\mathbf{a}\in K\left[\left[ x\right]\right]\).

theorem AlgebraicCombinatorics.FPS.smul_mul_fps {R : Type u_1} [CommRing R] (c : R) (f g : PowerSeries R) :
c (f * g) = c f * g
blueprint
Definition 1.75

If \(n\in \mathbb {N}\), and if \(\mathbf{a}=\left( a_{0},a_{1},a_{2},\ldots \right) \in K\left[\left[x\right]\right]\) is an FPS, then we define an element \(\left[x^{n}\right]\mathbf{a}\in K\) by

\[ \left[x^{n}\right]\mathbf{a}:=a_{n}. \]

This is called the coefficient of \(x^{n}\) in \(\mathbf{a}\), or the \(n\)-th coefficient of \(\mathbf{a}\), or the \(x^{n}\)-coefficient of \(\mathbf{a}\).

blueprint
Definition 1.78

(a) A family \(\left(a_{i}\right)_{i\in I}\in K^{I}\) of elements of \(K\) is said to be essentially finite if all but finitely many \(i\in I\) satisfy \(a_{i}=0\) (in other words, if the set \(\left\{ i\in I\ \mid \ a_{i}\neq 0\right\} \) is finite).

(b) Let \(\left(a_{i}\right)_{i\in I}\in K^{I}\) be an essentially finite family of elements of \(K\). Then, the infinite sum \(\sum _{i\in I}a_{i}\) is defined to equal the finite sum \(\sum _{\substack {i\in I;\\ a_{i}\neq 0}}a_{i}\). Such an infinite sum is said to be essentially finite.

blueprint
Definition 1.79

A (possibly infinite) family \(\left(\mathbf{a}_{i}\right)_{i\in I}\) of FPSs is said to be summable (or entrywise essentially finite) if

\[ \text{for each }n\in \mathbb {N}\text{, all but finitely many }i\in I\text{ satisfy }\left[x^{n}\right]\mathbf{a}_{i}=0. \]

In this case, the sum \(\sum _{i\in I}\mathbf{a}_{i}\) is defined to be the FPS with

\[ \left[x^{n}\right]\left(\sum _{i\in I}\mathbf{a}_{i}\right) =\underbrace{\sum _{i\in I}\left[x^{n}\right]\mathbf{a}_{i}}_{\substack {\text{an essentially}\\ \text{finite sum}}} \ \ \ \ \ \ \ \ \ \ \text{for all }n\in \mathbb {N}\text{.} \]
blueprint
Proposition 1.80

Let \(\left(\mathbf{a}_{i}\right)_{i\in I}\) be a summable family of FPSs. Then, any subfamily of \(\left(\mathbf{a}_{i}\right)_{i\in I}\) is summable as well.

theorem AlgebraicCombinatorics.FPS.summableFPS_subfamily {R : Type u_1} [CommRing R] {ι : Type u_2} {f : ιPowerSeries R} (J : Set ι) (hf : SummableFPS f) :
SummableFPS fun (i : J) => f i
blueprint
Proposition 1.81

Sums of summable families of FPSs satisfy the usual rules for sums (such as the breaking-apart rule \(\sum _{i\in S}a_{s}=\sum _{i\in X}a_{s}+\sum _{i\in Y}a_{s}\) when a set \(S\) is the union of two disjoint sets \(X\) and \(Y\)). See [ 19s , Proposition 7.2.11 ] for details. Again, the only caveat is about interchange of summation signs: The equality

\[ \sum _{i\in I}\ \ \sum _{j\in J}\mathbf{a}_{i,j}=\sum _{j\in J}\ \ \sum _{i\in I}\mathbf{a}_{i,j} \]

holds when the family \(\left(\mathbf{a}_{i,j}\right)_{\left(i,j\right) \in I\times J}\) is summable (i.e., when for each \(n\in \mathbb {N}\), all but finitely many pairs \(\left(i,j\right) \in I\times J\) satisfy \(\left[x^{n}\right]\mathbf{a}_{i,j}=0\)); it does not generally hold if we merely assume that the sums \(\sum _{i\in I}\ \ \sum _{j\in J}\mathbf{a}_{i,j}\) and \(\sum _{j\in J}\ \ \sum _{i\in I}\mathbf{a}_{i,j}\) are summable.

theorem AlgebraicCombinatorics.FPS.summableFPS_fubini {R : Type u_1} [CommRing R] {ι : Type u_2} {κ : Type u_3} {f : ι × κPowerSeries R} (hf : SummableFPS f) :
(∀ (i : ι), SummableFPS fun (j : κ) => f (i, j)) ∀ (j : κ), SummableFPS fun (i : ι) => f (i, j)
blueprint
Definition 1.82

Let \(x\) denote the FPS \(\left(0,1,0,0,0,\ldots \right)\). In other words, let \(x\) denote the FPS with \(\left[x^{1}\right]x=1\) and \(\left[x^{i}\right]x=0\) for all \(i\neq 1\).

blueprint
Lemma 1.83

Let \(\mathbf{a}=\left(a_{0},a_{1},a_{2},\ldots \right)\) be an FPS. Then, \(x\cdot \mathbf{a}=\left(0,a_{0},a_{1},a_{2},\ldots \right)\).

blueprint
Proposition 1.84

We have

\[ x^{k}=\left(\underbrace{0,0,\ldots ,0}_{k\text{ times}},1,0,0,0,\ldots \right) \ \ \ \ \ \ \ \ \ \ \text{for each }k\in \mathbb {N}. \]
blueprint
Corollary 1.85

Any FPS \(\left(a_{0},a_{1},a_{2},\ldots \right) \in K\left[\left[x\right]\right]\) satisfies

\[ \left(a_{0},a_{1},a_{2},\ldots \right) = a_{0}+a_{1}x+a_{2}x^{2}+a_{3}x^{3}+\cdots = \sum _{n\in \mathbb {N}}a_{n}x^{n}. \]

In particular, the right hand side here is well-defined, i.e., the family \(\left(a_{n}x^{n}\right)_{n\in \mathbb {N}}\) is summable.

The Chu–Vandermonde identity

blueprint
Proposition 1.104

Let \(a,b\in \mathbb {N}\), and let \(n\in \mathbb {N}\). Then,

\[ \binom {a+b}{n}=\sum _{k=0}^{n}\binom {a}{k}\binom {b}{n-k}. \]
theorem AlgebraicCombinatorics.FPS.vandermonde_nat (a b n : ) :
(a + b).choose n = ijFinset.antidiagonal n, a.choose ij.1 * b.choose ij.2
blueprint
Theorem 1.106 Vandermonde convolution identity, aka Chu–Vandermonde identity

Let \(a,b\in \mathbb {C}\), and let \(n\in \mathbb {N}\). Then,

\[ \binom {a+b}{n}=\sum _{k=0}^{n}\binom {a}{k}\binom {b}{n-k}. \]
theorem AlgebraicCombinatorics.FPS.chuVandermonde {S : Type u_2} [CommRing S] [BinomialRing S] (a b : S) (n : ) :
Ring.choose (a + b) n = ijFinset.antidiagonal n, Ring.choose a ij.1 * Ring.choose b ij.2

Dividing FPSs

Inverses in commutative rings

blueprint
Definition 1.107

Let \(L\) be a commutative ring. Let \(a\in L\). Then:

(a) An inverse (or multiplicative inverse) of \(a\) means an element \(b\in L\) such that \(ab=ba=1\).

(b) We say that \(a\) is invertible in \(L\) (or a unit of \(L\)) if \(a\) has an inverse.

theorem AlgebraicCombinatorics.inverse_unique {L : Type u_2} [CommRing L] {a b c : L} (hb : a * b = 1) (hc : a * c = 1) :
b = c
blueprint
Theorem 1.108

Let \(L\) be a commutative ring. Let \(a\in L\). Then, there is at most one inverse of \(a\).

theorem AlgebraicCombinatorics.inverse_unique {L : Type u_2} [CommRing L] {a b c : L} (hb : a * b = 1) (hc : a * c = 1) :
b = c
blueprint
Definition 1.109

Let \(L\) be a commutative ring. Let \(a\in L\). Assume that \(a\) is invertible. Then:

(a) The inverse of \(a\) is called \(a^{-1}\).

(b) For any \(b\in L\), the product \(b\cdot a^{-1}\) is called \(\frac{b}{a}\) (or \(b/a\)).

(c) For any negative integer \(n\), we define \(a^{n}\) to be \(\left( a^{-1}\right)^{-n}\). Thus, the \(n\)-th power \(a^{n}\) is defined for each \(n\in \mathbb {Z}\).

blueprint
Proposition 1.110

Let \(L\) be a commutative ring. Then:

(a) Any invertible element \(a\in L\) satisfies \(a^{-1}=1/a\).

(b) For any invertible elements \(a,b\in L\), the element \(ab\) is invertible as well, and satisfies \(\left(ab\right)^{-1}=b^{-1}a^{-1}=a^{-1}b^{-1}\).

(c) If \(a\in L\) is invertible, and if \(n\in \mathbb {Z}\) is arbitrary, then \(a^{-n}=\left(a^{-1}\right)^{n}=\left(a^{n}\right)^{-1}\).

(d) Laws of exponents hold for negative exponents as well: If \(a\) and \(b\) are invertible elements of \(L\), then

\begin{align*} a^{n+m} & =a^{n}a^{m}\ \ \ \ \ \ \ \ \ \ \text{for all }n,m\in \mathbb {Z};\\ \left( ab\right) ^{n} & =a^{n}b^{n}\ \ \ \ \ \ \ \ \ \ \text{for all }n\in \mathbb {Z};\\ \left( a^{n}\right) ^{m} & =a^{nm}\ \ \ \ \ \ \ \ \ \ \text{for all }n,m\in \mathbb {Z}. \end{align*}

(e) Laws of fractions hold: If \(a\) and \(c\) are two invertible elements of \(L\), and if \(b\) and \(d\) are any two elements of \(L\), then

\[ \frac{b}{a}+\frac{d}{c}=\frac{bc+ad}{ac}\ \ \ \ \ \ \ \ \ \ \text{and}\ \ \ \ \ \ \ \ \ \ \frac{b}{a}\cdot \frac{d}{c}=\frac{bd}{ac}. \]

(f) Division undoes multiplication: If \(a,b,c\) are three elements of \(L\) with \(a\) being invertible, then the equality \(\frac{c}{a}=b\) is equivalent to \(c=ab\).

theorem AlgebraicCombinatorics.fracs1_isUnit_mul {L : Type u_2} [CommRing L] {a b : L} (ha : IsUnit a) (hb : IsUnit b) :
IsUnit (a * b)
theorem AlgebraicCombinatorics.fracs1_zpow_add {L : Type u_2} [CommRing L] (u : Lˣ) (n m : ) :
u ^ (n + m) = u ^ n * u ^ m
theorem AlgebraicCombinatorics.fracs1_mul_zpow {L : Type u_2} [CommRing L] (u v : Lˣ) (n : ) :
(u * v) ^ n = u ^ n * v ^ n
theorem AlgebraicCombinatorics.fracs1_zpow_mul {L : Type u_2} [CommRing L] (u : Lˣ) (n m : ) :
(u ^ n) ^ m = u ^ (n * m)
theorem AlgebraicCombinatorics.fracs1_div_add_div {L : Type u_2} [CommRing L] (a c : Lˣ) (b d : L) :
divByUnit b a + divByUnit d c = divByUnit (b * c + a * d) (a * c)
theorem AlgebraicCombinatorics.fracs1_div_mul_div {L : Type u_2} [CommRing L] (a c : Lˣ) (b d : L) :
divByUnit b a * divByUnit d c = divByUnit (b * d) (a * c)
theorem AlgebraicCombinatorics.fracs1_div_eq_iff {L : Type u_2} [CommRing L] (a : Lˣ) (b c : L) :
divByUnit c a = b c = a * b

Inverses in $K\left[ \left[ x\right] \right] $

blueprint
Proposition 1.111

Let \(a\in K[[x]]\). Then, the FPS \(a\) is invertible in \(K[[x]]\) if and only if its constant term \([x^{0}]a\) is invertible in \(K\).

blueprint
Corollary 1.112

Assume that \(K\) is a field. Let \(a\in K[[x]]\). Then, the FPS \(a\) is invertible in \(K[[x]]\) if and only if \([x^{0}]a\neq 0\).

Newton's binomial formula

blueprint
Proposition 1.118

The FPS \(1+x\in K[[x]]\) is invertible, and its inverse is

\[ \left(1+x\right)^{-1}=\sum _{n\in \mathbb {N}}\left(-1\right)^{n}x^{n}. \]
blueprint
Theorem 1.119

For each \(n\in \mathbb {Z}\), we have

\[ \left(1+x\right)^{n}=\sum _{k\in \mathbb {N}}\binom {n}{k}x^{k}. \]
blueprint
Theorem 1.120

Let \(n\in \mathbb {C}\) and \(k\in \mathbb {Z}\). Then,

\[ \binom {-n}{k}=\left(-1\right)^{k}\binom {k+n-1}{k}. \]
theorem AlgebraicCombinatorics.binomUpperNegation {R : Type u_2} [CommRing R] [BinomialRing R] [NatPowAssoc R] (r : R) (k : ) :
Ring.choose (-r) k = (-1) ^ k * Ring.choose (r + k - 1) k
theorem AlgebraicCombinatorics.binomUpperNegation_int (n : ) (k : ) :
Ring.choose (-n) k = (-1) ^ k * Ring.choose (k + n - 1) k
blueprint
Proposition 1.121

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

\[ \left(1+x\right)^{-n}=\sum _{k\in \mathbb {N}}\left(-1\right)^{k}\binom {n+k-1}{k}x^{k}. \]
theorem AlgebraicCombinatorics.fps_onePlusX_pow_neg {F : Type u_2} [Field F] [BinomialRing F] (n : ) :
(1 + PowerSeries.X)⁻¹ ^ n = PowerSeries.mk fun (k : ) => (-1) ^ k * (Ring.choose (n + k - 1) k)
blueprint
Corollary 1.122

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

\[ \left(1+x\right)^{-n}=\sum _{k\in \mathbb {N}}\binom {-n}{k}x^{k}. \]

Dividing by $x$

blueprint
Definition 1.123

Let \(a=\left(a_{0},a_{1},a_{2},\ldots \right)\) be an FPS whose constant term \(a_{0}\) is \(0\). Then, \(\frac{a}{x}\) is defined to be the FPS \(\left(a_{1},a_{2},a_{3},\ldots \right)\).

blueprint
Proposition 1.125

Let \(a,b\in K[[x]]\) be two FPSs. Then, \(a=xb\) if and only if \(\left[x^{0}\right]a=0\) and \(b=\frac{a}{x}\).

A few lemmas

blueprint
Lemma 1.128

Let \(a\in K[[x]]\) be an FPS with \(\left[x^{0}\right]a=0\). Then, there exists an \(h\in K[[x]]\) such that \(a=xh\).

blueprint
Lemma 1.129

Let \(k\in \mathbb {N}\). Let \(a\in K[[x]]\) be any FPS. Then, the first \(k\) coefficients of the FPS \(x^{k}a\) are \(0\).

blueprint
Lemma 1.130

Let \(k\in \mathbb {N}\). Let \(f\in K[[x]]\) be any FPS. Then, the first \(k\) coefficients of \(f\) are \(0\) if and only if \(f\) is a multiple of \(x^{k}\).

blueprint
Lemma 1.131

Let \(a,f,g\in K[[x]]\) be three FPSs. Let \(n\in \mathbb {N}\). Assume that \([x^{m}]f=[x^{m}]g\) for each \(m\in \{ 0,1,\ldots ,n\} \). Then, \([x^{m}](af)=[x^{m}](ag)\) for each \(m\in \{ 0,1,\ldots ,n\} \).

theorem AlgebraicCombinatorics.fps_coeff_mul_eq_of_coeff_eq {K : Type u_1} [CommRing K] (a f g : PowerSeries K) (n : ) (h : mn, (PowerSeries.coeff m) f = (PowerSeries.coeff m) g) (m : ) :
m n(PowerSeries.coeff m) (a * f) = (PowerSeries.coeff m) (a * g)
blueprint
Lemma 1.132

Let \(u,v\in K[[x]]\) be two FPSs such that \(v\) is a multiple of \(u\). Let \(n\in \mathbb {N}\). Assume \([x^{m}]u=0\) for each \(m\in \{ 0,1,\ldots ,n\} \). Then \([x^{m}]v=0\) for each \(m\in \{ 0,1,\ldots ,n\} \).

theorem AlgebraicCombinatorics.fps_coeff_zero_of_multiple {K : Type u_1} [CommRing K] (u v : PowerSeries K) (n : ) (hdvd : u v) (hu : mn, (PowerSeries.coeff m) u = 0) (m : ) :
m n(PowerSeries.coeff m) v = 0
blueprint
Lemma 1.346

If \(a\overset {x^n}{\equiv } b\) and \(c\overset {x^n}{\equiv } d\), then \(ac\overset {x^n}{\equiv } bd\). In other words, \(x^n\)-equivalence is preserved under multiplication.

theorem AlgebraicCombinatorics.fps_coeff_mul_eq_of_both_coeff_eq {K : Type u_1} [CommRing K] (a b c d : PowerSeries K) (n : ) (hab : mn, (PowerSeries.coeff m) a = (PowerSeries.coeff m) b) (hcd : mn, (PowerSeries.coeff m) c = (PowerSeries.coeff m) d) (m : ) :
m n(PowerSeries.coeff m) (a * c) = (PowerSeries.coeff m) (b * d)
theorem AlgebraicCombinatorics.FPS.xnEquiv_mul_of_coeff_eq {K : Type u_1} [CommRing K] {n : } {a b c d : PowerSeries K} (hab : mn, (PowerSeries.coeff m) a = (PowerSeries.coeff m) b) (hcd : mn, (PowerSeries.coeff m) c = (PowerSeries.coeff m) d) (m : ) :
m n(PowerSeries.coeff m) (a * c) = (PowerSeries.coeff m) (b * d)

Polynomials

Definition

blueprint
Definition 1.134

(a) An FPS \(a\in K\left[ \left[ x\right] \right] \) is said to be a polynomial if all but finitely many \(n\in \mathbb {N}\) satisfy \(\left[ x^{n}\right] a=0\) (that is, if all but finitely many coefficients of \(a\) are \(0\)).

(b) We let \(K\left[ x\right] \) be the set of all polynomials \(a\in K\left[ \left[ x\right] \right] \). This set \(K\left[ x\right] \) is a subring of \(K\left[ \left[ x\right] \right] \) (according to Theorem 1.148 below), and is called the univariate polynomial ring over \(K\).

blueprint
Theorem 1.148

The set \(K\left[ x\right] \) is a subring of \(K\left[ \left[ x\right] \right] \) (that is, it is closed under addition, subtraction and multiplication, and contains the zero \(\underline{0}\) and the unity \(\underline{1}\)) and is a \(K\)-submodule of \(K\left[ \left[ x\right] \right] \) (that is, it is closed under addition and scaling by elements of \(K\)).

Reminders on rings and $K$-algebras

blueprint
Definition 1.151

The notion of a ring (also known as a noncommutative ring) is defined in the exact same way as we defined the notion of a commutative ring in Definition 1.42, except that the “Commutativity of multiplication” axiom is removed.

theorem FPS.ring_add_assoc {R : Type u_2} [Ring R] (a b c : R) :
a + (b + c) = a + b + c
theorem FPS.ring_add_comm {R : Type u_2} [Ring R] (a b : R) :
a + b = b + a
theorem FPS.ring_add_zero {R : Type u_2} [Ring R] (a : R) :
a + 0 = a
theorem FPS.ring_zero_add {R : Type u_2} [Ring R] (a : R) :
0 + a = a
theorem FPS.ring_add_neg {R : Type u_2} [Ring R] (a : R) :
a + -a = 0
theorem FPS.ring_mul_assoc {R : Type u_2} [Ring R] (a b c : R) :
a * (b * c) = a * b * c
theorem FPS.ring_left_distrib {R : Type u_2} [Ring R] (a b c : R) :
a * (b + c) = a * b + a * c
theorem FPS.ring_right_distrib {R : Type u_2} [Ring R] (a b c : R) :
(a + b) * c = a * c + b * c
theorem FPS.ring_mul_one {R : Type u_2} [Ring R] (a : R) :
a * 1 = a
theorem FPS.ring_one_mul {R : Type u_2} [Ring R] (a : R) :
1 * a = a
theorem FPS.ring_mul_zero {R : Type u_2} [Ring R] (a : R) :
a * 0 = 0
theorem FPS.ring_zero_mul {R : Type u_2} [Ring R] (a : R) :
0 * a = 0
blueprint
Definition 1.152

A \(K\)-algebra is a set \(A\) equipped with four maps

\begin{align*} \oplus & :A\times A\rightarrow A,\\ \ominus & :A\times A\rightarrow A,\\ \odot & :A\times A\rightarrow A,\\ \rightharpoonup & :K\times A\rightarrow A \end{align*}

and two elements \(\overrightarrow {0}\in A\) and \(\overrightarrow {1}\in A\) satisfying the following properties:

  1. The set \(A\), equipped with the maps \(\oplus \), \(\ominus \) and \(\odot \) and the two elements \(\overrightarrow {0}\) and \(\overrightarrow {1}\), is a (noncommutative) ring.

  2. The set \(A\), equipped with the maps \(\oplus \), \(\ominus \) and \(\rightharpoonup \) and the element \(\overrightarrow {0}\), is a \(K\)-module.

  3. We have

    \begin{equation} \lambda \rightharpoonup \left( a\odot b\right) =\left( \lambda \rightharpoonup a\right) \odot b=a\odot \left( \lambda \rightharpoonup b\right) \label{eq.def.alg.Kalg.scaleinv}\end{equation}

    for all \(\lambda \in K\) and \(a,b\in A\).

(Thus, in a nutshell, a \(K\)-algebra is a set \(A\) that is simultaneously a ring and a \(K\)-module, with the property that the ring \(A\) and the \(K\)-module \(A\) have the same addition, the same subtraction and the same zero, and satisfy the additional compatibility property (14).)

theorem FPS.kalg_add_comm {A : Type u_2} [Ring A] (a b : A) :
a + b = b + a
theorem FPS.kalg_add_assoc {A : Type u_2} [Ring A] (a b c : A) :
a + (b + c) = a + b + c
theorem FPS.kalg_add_zero {A : Type u_2} [Ring A] (a : A) :
a + 0 = a
theorem FPS.kalg_mul_assoc {A : Type u_2} [Ring A] (a b c : A) :
a * (b * c) = a * b * c
theorem FPS.kalg_left_distrib {A : Type u_2} [Ring A] (a b c : A) :
a * (b + c) = a * b + a * c
theorem FPS.kalg_right_distrib {A : Type u_2} [Ring A] (a b c : A) :
(a + b) * c = a * c + b * c
theorem FPS.kalg_mul_one {A : Type u_2} [Ring A] (a : A) :
a * 1 = a
theorem FPS.kalg_one_mul {A : Type u_2} [Ring A] (a : A) :
1 * a = a
theorem FPS.kalg_smul_assoc {K : Type u_1} [CommRing K] {A : Type u_2} [Ring A] [Algebra K A] (u v : K) (a : A) :
u v a = (u * v) a
theorem FPS.kalg_smul_add {K : Type u_1} [CommRing K] {A : Type u_2} [Ring A] [Algebra K A] (u : K) (a b : A) :
u (a + b) = u a + u b
theorem FPS.kalg_add_smul {K : Type u_1} [CommRing K] {A : Type u_2} [Ring A] [Algebra K A] (u v : K) (a : A) :
(u + v) a = u a + v a
theorem FPS.kalg_one_smul {K : Type u_1} [CommRing K] {A : Type u_2} [Ring A] [Algebra K A] (a : A) :
1 a = a
theorem FPS.kalg_zero_smul {K : Type u_1} [CommRing K] {A : Type u_2} [Ring A] [Algebra K A] (a : A) :
0 a = 0
theorem FPS.kalg_smul_zero {K : Type u_1} [CommRing K] {A : Type u_2} [Ring A] [Algebra K A] (u : K) :
u 0 = 0
theorem FPS.kalg_smul_mul_assoc {K : Type u_1} [CommRing K] {A : Type u_2} [Ring A] [Algebra K A] (c : K) (a b : A) :
c (a * b) = c a * b
theorem FPS.kalg_mul_smul_comm {K : Type u_1} [CommRing K] {A : Type u_2} [Ring A] [Algebra K A] (c : K) (a b : A) :
c (a * b) = a * c b
theorem FPS.kalg_smul_mul_eq_mul_smul {K : Type u_1} [CommRing K] {A : Type u_2} [Ring A] [Algebra K A] (c : K) (a b : A) :
c a * b = a * c b

Evaluation aka substitution into polynomials

blueprint
Definition 1.153

Let \(f\in K\left[ x\right] \) be a polynomial. Let \(A\) be any \(K\)-algebra. Let \(a\in A\) be any element. We then define an element \(f\left[ a\right] \in A\) as follows:

Write \(f\) in the form \(f=\sum _{n\in \mathbb {N}}f_{n}x^{n}\) with \(f_{0},f_{1},f_{2},\ldots \in K\). (That is, \(f_{n}=\left[ x^{n}\right] f\) for each \(n\in \mathbb {N}\).) Then, set

\[ f\left[ a\right] :=\sum _{n\in \mathbb {N}}f_{n}a^{n}. \]

(This sum is essentially finite, since \(f\) is a polynomial.)

The element \(f\left[ a\right] \) is also denoted by \(f\circ a\) or by \(f\left( a\right) \), and is called the value of \(f\) at \(a\) (or the evaluation of \(f\) at \(a\), or the result of substituting \(a\) for \(x\) in \(f\)).

abbrev FPS.polyEval {K : Type u_1} [CommRing K] {A : Type u_2} [CommRing A] [Algebra K A] (f : Polynomial K) (a : A) :
A
blueprint
Theorem 1.157

Let \(A\) be a \(K\)-algebra. Let \(a\in A\). Then:

(a) Any \(f,g\in K\left[ x\right] \) satisfy

\[ \left( f+g\right) \left[ a\right] =f\left[ a\right] +g\left[ a\right] \ \ \ \ \ \ \ \ \ \ \text{and}\ \ \ \ \ \ \ \ \ \ \left( fg\right) \left[ a\right] =f\left[ a\right] \cdot g\left[ a\right] . \]

(b) Any \(\lambda \in K\) and \(f\in K\left[ x\right] \) satisfy

\[ \left( \lambda f\right) \left[ a\right] =\lambda \cdot f\left[ a\right] . \]

(c) Any \(\lambda \in K\) satisfies \(\underline{\lambda }\left[ a\right] =\lambda \cdot 1_{A}\), where \(1_{A}\) is the unity of the ring \(A\).

(d) We have \(x\left[ a\right] =a\).

(e) We have \(x^{i}\left[ a\right] =a^{i}\) for each \(i\in \mathbb {N}\).

(f) Any \(f,g\in K\left[ x\right] \) satisfy \(f\left[ g\left[ a\right] \right] =\left( f\left[ g\right] \right) \left[ a\right] \).

theorem FPS.eval_add' {K : Type u_1} [CommRing K] {A : Type u_2} [CommRing A] [Algebra K A] (f g : Polynomial K) (a : A) :
polyEval (f + g) a = polyEval f a + polyEval g a
theorem FPS.eval_mul' {K : Type u_1} [CommRing K] {A : Type u_2} [CommRing A] [Algebra K A] (f g : Polynomial K) (a : A) :
polyEval (f * g) a = polyEval f a * polyEval g a
theorem FPS.eval_smul' {K : Type u_1} [CommRing K] {A : Type u_2} [CommRing A] [Algebra K A] (f : Polynomial K) (c : K) (a : A) :
polyEval (c f) a = c polyEval f a
theorem FPS.eval_C' {K : Type u_1} [CommRing K] {A : Type u_2} [CommRing A] [Algebra K A] (c : K) (a : A) :
theorem FPS.eval_X' {K : Type u_1} [CommRing K] {A : Type u_2} [CommRing A] [Algebra K A] (a : A) :
theorem FPS.eval_X_pow' {K : Type u_1} [CommRing K] {A : Type u_2} [CommRing A] [Algebra K A] (a : A) (i : ) :
theorem FPS.eval_comp' {K : Type u_1} [CommRing K] {A : Type u_2} [CommRing A] [Algebra K A] (f g : Polynomial K) (a : A) :
polyEval f (polyEval g a) = polyEval (f.comp g) a

Substitution and evaluation of power series

Defining substitution

blueprint
Definition 1.161

Let \(f\) and \(g\) be two FPSs in \(K[[x]]\). Assume that \([x^0]g = 0\) (that is, \(g = g_1 x + g_2 x^2 + g_3 x^3 + \cdots \) for some \(g_1, g_2, g_3, \ldots \in K\)).

We then define an FPS \(f[g] \in K[[x]]\) as follows:

Write \(f\) in the form \(f = \sum _{n \in \mathbb {N}} f_n x^n\) with \(f_0, f_1, f_2, \ldots \in K\). (That is, \(f_n = [x^n]f\) for each \(n \in \mathbb {N}\).) Then, set

\[ f[g] := \sum _{n \in \mathbb {N}} f_n g^n. \]

(This sum is well-defined, as we will see in Proposition 1.163 (b) below.)

This FPS \(f[g]\) is also denoted by \(f \circ g\), and is called the composition of \(f\) with \(g\), or the result of substituting \(g\) for \(x\) in \(f\).

Equivalently, the \(n\)-th coefficient of \(f[g]\) is the finite sum

\[ [x^n](f[g]) = \sum _{d=0}^{n} f_d \cdot [x^n](g^d). \]
blueprint
Proposition 1.163

Let \(f\) and \(g\) be two FPSs in \(K[[x]]\). Assume that \([x^0]g = 0\). Write \(f\) in the form \(f = \sum _{n \in \mathbb {N}} f_n x^n\) with \(f_0, f_1, f_2, \ldots \in K\). Then:

(a) For each \(n \in \mathbb {N}\), the first \(n\) coefficients of the FPS \(g^n\) are \(0\).

(b) The sum \(\sum _{n \in \mathbb {N}} f_n g^n\) is well-defined, i.e., the family \((f_n g^n)_{n \in \mathbb {N}}\) is summable.

(c) We have \([x^0](\sum _{n \in \mathbb {N}} f_n g^n) = f_0\).

Laws of substitution

blueprint
Proposition 1.181

Composition of FPSs satisfies the rules you would expect it to satisfy:

(a) If \(f_1, f_2, g \in K[[x]]\) satisfy \([x^0]g = 0\), then \((f_1 + f_2) \circ g = f_1 \circ g + f_2 \circ g\).

(b) If \(f_1, f_2, g \in K[[x]]\) satisfy \([x^0]g = 0\), then \((f_1 \cdot f_2) \circ g = (f_1 \circ g) \cdot (f_2 \circ g)\).

(c) If \(f_1, f_2, g \in K[[x]]\) satisfy \([x^0]g = 0\), then \(\frac{f_1}{f_2} \circ g = \frac{f_1 \circ g}{f_2 \circ g}\), as long as \(f_2\) is invertible. (In particular, \(f_2 \circ g\) is automatically invertible under these assumptions.)

(d) If \(f, g \in K[[x]]\) satisfy \([x^0]g = 0\), then \(f^k \circ g = (f \circ g)^k\) for each \(k \in \mathbb {N}\).

(e) If \(f, g, h \in K[[x]]\) satisfy \([x^0]g = 0\) and \([x^0]h = 0\), then \([x^0](g \circ h) = 0\) and \((f \circ g) \circ h = f \circ (g \circ h)\).

(f) We have \(\underline{a} \circ g = \underline{a}\) for each \(a \in K\) and \(g \in K[[x]]\).

(g) We have \(x \circ g = g \circ x = g\) for each \(g \in K[[x]]\).

(h) If \((f_i)_{i \in I} \in K[[x]]^I\) is a summable family of FPSs, and if \(g \in K[[x]]\) is an FPS satisfying \([x^0]g = 0\), then the family \((f_i \circ g)_{i \in I} \in K[[x]]^I\) is summable as well and we have \((\sum _{i \in I} f_i) \circ g = \sum _{i \in I} f_i \circ g\).

theorem AlgebraicCombinatorics.fps_subs_sum {K : Type u_1} [CommRing K] {ι : Type u_2} (s : Finset ι) (f : ιPowerSeries K) (g : PowerSeries K) (hg : PowerSeries.constantCoeff g = 0) :
PowerSeries.subst g (∑ is, f i) = is, PowerSeries.subst g (f i)
theorem AlgebraicCombinatorics.fps_subs_summable {K : Type u_1} [CommRing K] {ι : Type u_2} (f : ιPowerSeries K) (g : PowerSeries K) (hg : PowerSeries.constantCoeff g = 0) (hf : FPS.SummableFPS f) :
FPS.SummableFPS fun (i : ι) => PowerSeries.subst g (f i)
blueprint
Lemma 1.166

Let \(f, g \in K[[x]]\) satisfy \([x^0]g = 0\). Let \(k \in \mathbb {N}\) be such that the first \(k\) coefficients of \(f\) are \(0\). Then, the first \(k\) coefficients of \(f \circ g\) are \(0\).

theorem AlgebraicCombinatorics.fps_fg_coeffs_zero {K : Type u_1} [CommRing K] (f g : PowerSeries K) (hg : PowerSeries.constantCoeff g = 0) (k : ) (hf : m < k, (PowerSeries.coeff m) f = 0) (m : ) :
blueprint
Definition 1.167

If \(i\) and \(j\) are any objects, then \(\delta _{i,j}\) means the element

\[ \delta _{i,j} = \begin{cases} 1, & \text{if } i = j; \\ 0, & \text{if } i \neq j \end{cases} \]

of \(K\).

Derivatives of FPSs

blueprint
Definition 1.184

Let \(f\in K\left[ \left[ x\right] \right] \) be an FPS. Then, the derivative \(f^{\prime }\) of \(f\) is an FPS defined as follows: Write \(f\) as \(f=\sum _{n\in \mathbb {N}}f_{n}x^{n}\) (with \(f_{0},f_{1},f_{2},\ldots \in K\)), and set

\[ f^{\prime }:=\sum _{n{\gt}0}nf_{n}x^{n-1}. \]
blueprint
Theorem 1.195

(a) We have \(\left( f+g\right) ^{\prime }=f^{\prime }+g^{\prime }\) for any \(f,g\in K\left[ \left[ x\right] \right] \).

(b) If \(\left( f_{i}\right) _{i\in I}\) is a summable family of FPSs, then the family \(\left( f_{i}^{\prime }\right) _{i\in I}\) is summable as well, and we have

\[ \left( \sum _{i\in I}f_{i}\right) ^{\prime }=\sum _{i\in I}f_{i}^{\prime }. \]

(c) We have \(\left( cf\right) ^{\prime }=cf^{\prime }\) for any \(c\in K\) and \(f\in K\left[ \left[ x\right] \right] \).

(d) We have \(\left( fg\right) ^{\prime }=f^{\prime }g+fg^{\prime }\) for any \(f,g\in K\left[ \left[ x\right] \right] \). (This is known as the Leibniz rule.)

(e) If \(f,g\in K\left[ \left[ x\right] \right] \) are two FPSs such that \(g\) is invertible, then

\[ \left( \frac{f}{g}\right) ^{\prime }=\frac{f^{\prime }g-fg^{\prime }}{g^{2}}. \]

(This is known as the quotient rule.)

(f) If \(g\in K\left[ \left[ x\right] \right] \) is an FPS, then \(\left( g^{n}\right) ^{\prime }=ng^{\prime }g^{n-1}\) for any \(n\in \mathbb {N}\) (where the expression \(ng^{\prime }g^{n-1}\) is to be understood as \(0\) if \(n=0\)).

(g) Given two FPSs \(f,g\in K\left[ \left[ x\right] \right] \), we have

\[ \left( f\circ g\right) ^{\prime }=\left( f^{\prime }\circ g\right) \cdot g^{\prime } \]

if \(f\) is a polynomial or if \(\left[ x^{0}\right] g=0\). (This is known as the chain rule.)

(h) If \(K\) is a \(\mathbb {Q}\)-algebra, and if two FPSs \(f,g\in K\left[ \left[ x\right] \right] \) satisfy \(f^{\prime }=g^{\prime }\), then \(f-g\) is constant.

theorem AlgebraicCombinatorics.FPS.derivative_sum {R : Type u_1} [CommSemiring R] {ι : Type u_2} (s : Finset ι) (f : ιPowerSeries R) :
(PowerSeries.derivative R) (∑ is, f i) = is, (PowerSeries.derivative R) (f i)
theorem AlgebraicCombinatorics.FPS.derivative_summableFPSSum {R' : Type u_2} [CommRing R'] {ι : Type u_3} (f : ιPowerSeries R') (hf : SummableFPS f) :
(PowerSeries.derivative R') (summableFPSSum f hf) = summableFPSSum (fun (i : ι) => (PowerSeries.derivative R') (f i))

Exponentials and logarithms

Definitions

blueprint
Definition 1.211

Define three FPS \(\exp \), \(\overline{\log }\) and \(\overline{\exp }\) in \(K\left[\left[x\right]\right]\) by

\begin{align*} \exp & :=\sum _{n\in \mathbb {N}}\frac{1}{n!}x^{n},\\ \overline{\log } & :=\sum _{n\geq 1}\frac{\left(-1\right)^{n-1}}{n}x^{n},\\ \overline{\exp } & :=\exp -1=\sum _{n\geq 1}\frac{1}{n!}x^{n}. \end{align*}

(The last equality sign here follows from \(\exp =\sum _{n\in \mathbb {N}}\frac{1}{n!}x^{n}=\underbrace{\frac{1}{0!}}_{=1}\underbrace{x^{0}}_{=1} +\sum _{n\geq 1}\frac{1}{n!}x^{n}=1+\sum _{n\geq 1}\frac{1}{n!}x^{n}\).)

noncomputable def PowerSeries.logbar (K : Type u_1) [CommRing K] [Algebra K] :

The exponential and the logarithm are inverse

blueprint
Proposition 1.216

Let \(g\in K\left[\left[x\right]\right]\) with \(\left[x^{0}\right]g=0\). Then:

(a) We have

\[ \left(\overline{\exp }\circ g\right)^{\prime }=\left(\exp \circ g\right) ^{\prime }=\left(\exp \circ g\right)\cdot g^{\prime }. \]

(b) We have

\[ \left(\overline{\log }\circ g\right)^{\prime }=\left(1+g\right) ^{-1}\cdot g^{\prime }. \]
theorem PowerSeries.derivative_exp_comp {K : Type u_1} [CommRing K] [Algebra K] {g : PowerSeries K} (hg : constantCoeff g = 0) :
(derivative K) (subst g (exp K)) = subst g (exp K) * (derivative K) g
theorem PowerSeries.derivative_expbar_comp {K : Type u_1} [CommRing K] [Algebra K] {g : PowerSeries K} (hg : constantCoeff g = 0) :
(derivative K) (subst g (expbar K)) = subst g (exp K) * (derivative K) g
theorem PowerSeries.derivative_logbar_comp {K : Type u_2} [Field K] [Algebra K] {g : PowerSeries K} (hg : constantCoeff g = 0) :
(derivative K) (subst g (logbar K)) = (1 + g)⁻¹ * (derivative K) g
blueprint
Lemma 1.220

Let \(f,g\in K\left[\left[x\right] \right]\) be two FPSs with \(\left[x^{0}\right]g=0\). Then, \(\left[ x^{0}\right]\left(f\circ g\right)=\left[x^{0}\right]f\).

blueprint
Theorem 1.221

We have

\[ \overline{\exp }\circ \overline{\log }=x\ \ \ \ \ \ \ \ \ \ \text{and}\ \ \ \ \ \ \ \ \ \ \overline{\log }\circ \overline{\exp }=x. \]

The exponential and the logarithm of an FPS

blueprint
Definition 1.222

(a) We let \(K\left[\left[x\right] \right]_{0}\) denote the set of all FPSs \(f\in K\left[\left[x\right] \right]\) with \(\left[x^{0}\right]f=0\).

(b) We let \(K\left[\left[x\right]\right]_{1}\) denote the set of all FPSs \(f\in K\left[\left[x\right]\right]\) with \(\left[ x^{0}\right]f=1\).

(c) We define two maps

\begin{align*} \operatorname {Exp}:K\left[\left[x\right]\right]_{0} & \rightarrow K\left[\left[x\right]\right]_{1},\\ g & \mapsto \exp \circ g \end{align*}

and

\begin{align*} \operatorname {Log}:K\left[\left[x\right]\right]_{1} & \rightarrow K\left[\left[x\right]\right]_{0},\\ f & \mapsto \overline{\log }\circ \left(f-1\right). \end{align*}

(These two maps are well-defined according to parts (c) and (d) of Lemma 1.223 below.)

blueprint
Lemma 1.223

(a) For any \(f,g\in K\left[\left[ x\right]\right]_{0}\), we have \(f\circ g\in K\left[\left[x\right] \right]_{0}\).

(b) For any \(f\in K\left[\left[x\right]\right]_{1}\) and \(g\in K\left[\left[x\right]\right]_{0}\), we have \(f\circ g\in K\left[ \left[x\right]\right]_{1}\).

(c) For any \(g\in K\left[\left[x\right]\right]_{0}\), we have \(\exp \circ g\in K\left[\left[x\right]\right]_{1}\).

(d) For any \(f\in K\left[\left[x\right]\right]_{1}\), we have \(f-1\in K\left[\left[x\right]\right]_{0}\) and \(\overline{\log } \circ \left(f-1\right)\in K\left[\left[x\right]\right]_{0}\).

blueprint
Lemma 1.224

The maps \(\operatorname {Exp}\) and \(\operatorname {Log}\) are mutually inverse bijections between \(K\left[ \left[x\right]\right]_{0}\) and \(K\left[\left[x\right]\right]_{1}\).

Addition to multiplication

blueprint
Lemma 1.228

(a) For any \(f,g\in K\left[\left[ x\right]\right]_{0}\), we have

\[ \operatorname {Exp}\left(f+g\right)=\operatorname {Exp}f\cdot \operatorname {Exp}g. \]

(b) For any \(f,g\in K\left[\left[x\right]\right]_{1}\), we have

\[ \operatorname {Log}\left(fg\right)=\operatorname {Log} f+\operatorname {Log}g. \]
theorem PowerSeries.Exp_add {K : Type u_2} [CommRing K] [Algebra K] (f g : PowerSeries₀) :
Exp f + g, = (Exp f) * (Exp g),
theorem PowerSeries.Log_mul {K : Type u_2} [CommRing K] [Algebra K] (f g : PowerSeries₁) :
Log f * g, = (Log f) + (Log g),
blueprint
Proposition 1.229

(a) The subset \(K\left[\left[ x\right]\right]_{0}\) of \(K\left[\left[x\right]\right]\) is closed under addition and subtraction and contains \(0\), and thus forms a group \(\left(K\left[\left[x\right]\right]_{0},+,0\right)\).

(b) The subset \(K\left[\left[x\right]\right]_{1}\) of \(K\left[\left[x\right]\right]\) is closed under multiplication and division and contains \(1\), and thus forms a group \(\left(K\left[\left[ x\right]\right]_{1},\cdot ,1\right)\).

blueprint
Theorem 1.230

The maps

\[ \operatorname {Exp}:\left(K\left[\left[x\right]\right]_{0} ,+,0\right)\rightarrow \left(K\left[\left[x\right]\right]_{1} ,\cdot ,1\right) \]

and

\[ \operatorname {Log}:\left(K\left[\left[x\right]\right]_{1} ,\cdot ,1\right)\rightarrow \left(K\left[\left[x\right]\right] _{0},+,0\right) \]

are mutually inverse group isomorphisms.

theorem PowerSeries.Exp_Log_groupIso {K : Type u_2} [CommRing K] [Algebra K] :
(Function.LeftInverse Log Exp Function.RightInverse Log Exp) (∀ (f g : PowerSeries₀), Exp f + g, = (Exp f) * (Exp g), ) Exp 0, = 1,

The logarithmic derivative

blueprint
Definition 1.233

In this definition, we do not use Convention 1.210; thus, \(K\) can be an arbitrary commutative ring. However, we set \(K\left[\left[x\right]\right]_{1}=\left\{ f\in K\left[\left[x\right]\right]\ \mid \ \left[x^{0}\right]f=1\right\} \).

For any FPS \(f\in K\left[\left[x\right]\right]_{1}\), we define the logarithmic derivative \(\operatorname {loder}f\in K\left[\left[ x\right]\right]\) to be the FPS \(\frac{f^{\prime }}{f}\). (This is well-defined, since \(f\) is easily seen to be invertible.)

noncomputable def PowerSeries.loder {R : Type u_2} [Field R] (f : PowerSeries R) :
blueprint
Proposition 1.236

Let \(K\) be a commutative \(\mathbb {Q}\)-algebra. Let \(f\in K\left[\left[x\right]\right]_{1}\) be an FPS. Then, \(\operatorname {loder}f=\left(\operatorname {Log}f\right)^{\prime }\).

theorem PowerSeries.loder_eq_derivative_Log {R : Type u_2} [Field R] [Algebra R] {f : PowerSeries R} (hf : constantCoeff f = 1) :
f.loder = (derivative R) (subst (f - 1) (logbar R))
blueprint
Proposition 1.237

Let \(f,g\in K\left[\left[x\right]\right] _{1}\) be two FPSs. Then, \(\operatorname {loder}\left(fg\right) =\operatorname {loder}f+\operatorname {loder}g\).

(Here, we do not use Convention 1.210; thus, \(K\) can be an arbitrary commutative ring.)

theorem PowerSeries.loder_mul {R : Type u_2} [Field R] {f g : PowerSeries R} (hf : constantCoeff f = 1) (hg : constantCoeff g = 1) :
(f * g).loder = f.loder + g.loder
blueprint
Corollary 1.238

Let \(f_{1},f_{2},\ldots ,f_{k}\) be any \(k\) FPSs in \(K\left[\left[x\right]\right]_{1}\). Then,

\[ \operatorname {loder}\left(f_{1}f_{2}\cdots f_{k}\right) =\operatorname {loder}\left(f_{1}\right)+\operatorname {loder}\left( f_{2}\right)+\cdots +\operatorname {loder}\left(f_{k}\right). \]

(Here, we do not use Convention 1.210; thus, \(K\) can be an arbitrary commutative ring.)

theorem PowerSeries.loder_prod {R : Type u_2} [Field R] {ι : Type u_3} (s : Finset ι) (f : ιPowerSeries R) (hf : is, constantCoeff (f i) = 1) :
(∏ is, f i).loder = is, (f i).loder
blueprint
Corollary 1.239

Let \(f\) be any FPS in \(K\left[\left[x\right] \right]_{1}\). Then, \(\operatorname {loder}\left(f^{-1}\right) =-\operatorname {loder}f\).

(Here, we do not use Convention 1.210; thus, \(K\) can be an arbitrary commutative ring.)

theorem PowerSeries.loder_inv {R : Type u_2} [Field R] {f : PowerSeries R} (hf : constantCoeff f = 1) :

Non-integer powers

Definition

blueprint
Definition 1.258

Assume that \(K\) is a commutative \(\mathbb {Q}\)-algebra. Let \(f\in K\left[ \left[ x\right] \right] _{1}\) and \(c\in K\). Then, we define an FPS

\[ f^{c}:=\operatorname {Exp}\left( c\operatorname {Log}f\right) \in K\left[ \left[ x\right] \right] _{1}. \]
blueprint
Theorem 1.262

Assume that \(K\) is a commutative \(\mathbb {Q}\)-algebra. For any \(a,b\in K\) and \(f,g\in K\left[ \left[ x\right] \right] _{1}\), we have

\[ f^{a+b}=f^{a}f^{b},\ \ \ \ \ \ \ \ \ \ \left( fg\right) ^{a}=f^{a}g^{a},\ \ \ \ \ \ \ \ \ \ \left( f^{a}\right) ^{b}=f^{ab}. \]
theorem AlgebraicCombinatorics.FPS.fpsPow_add {K : Type u_1} [CommRing K] [Algebra K] {f : PowerSeries K} (hf : HasConstantTermOne f) (a b : K) :
fpsPow f (a + b) = fpsPow f a * fpsPow f b
theorem AlgebraicCombinatorics.FPS.fpsPow_mul {K : Type u_1} [CommRing K] [Algebra K] {f g : PowerSeries K} (hf : HasConstantTermOne f) (hg : HasConstantTermOne g) (a : K) :
fpsPow (f * g) a = fpsPow f a * fpsPow g a
theorem AlgebraicCombinatorics.FPS.fpsPow_pow {K : Type u_1} [CommRing K] [Algebra K] {f : PowerSeries K} (hf : HasConstantTermOne f) (a b : K) :
fpsPow (fpsPow f a) b = fpsPow f (a * b)

The Newton binomial formula for arbitrary exponents

blueprint
Theorem 1.264 Generalized Newton binomial formula

Assume that \(K\) is a commutative \(\mathbb {Q}\)-algebra. Let \(c\in K\). Then,

\[ \left( 1+x\right) ^{c}=\sum _{k\in \mathbb {N}}\binom {c}{k}x^{k}. \]

Another application

blueprint
Proposition 1.271

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

\[ \sum _{i=0}^{k}\binom {n+i-1}{i}\binom {n}{k-2i}=\binom {n+k-1}{k}. \]
theorem AlgebraicCombinatorics.FPS.binomialIdentity {K : Type u_1} [CommRing K] [Algebra K] [BinomialRing K] [CharZero K] (n : K) (k : ) :
iFinset.range (k / 2 + 1), Ring.choose (n + i - 1) i * Ring.choose n (k - 2 * i) = Ring.choose (n + k - 1) k

Integer compositions

Compositions

blueprint
Definition 1.291

(a) An (integer) composition means a (finite) tuple of positive integers.

(b) The size of an integer composition \(\alpha =\left( \alpha _{1},\alpha _{2},\ldots ,\alpha _{m}\right) \) is defined to be the integer \(\alpha _{1}+\alpha _{2}+\cdots +\alpha _{m}\). It is written \(\left\vert \alpha \right\vert \).

(c) The length of an integer composition \(\alpha =\left( \alpha _{1},\alpha _{2},\ldots ,\alpha _{m}\right) \) is defined to be the integer \(m\). It is written \(\ell \left( \alpha \right) \).

(d) Let \(n\in \mathbb {N}\). A composition of \(n\) means a composition whose size is \(n\).

(e) Let \(n\in \mathbb {N}\) and \(k\in \mathbb {N}\). A composition of \(n\) into \(k\) parts is a composition whose size is \(n\) and whose length is \(k\).

blueprint
Theorem 1.304

Let \(n,k\in \mathbb {N}\). Then, the # of compositions of \(n\) into \(k\) parts is

\[ \binom {n-1}{n-k}=\begin{cases} \binom {n-1}{k-1}, & \text{if }n{\gt}0;\\ \delta _{k,0}, & \text{if }n=0. \end{cases} \]
blueprint
Theorem 1.305

Let \(n\in \mathbb {N}\). Then, the # of compositions of \(n\) is

\[ \begin{cases} 2^{n-1}, & \text{if }n{\gt}0;\\ 1, & \text{if }n=0. \end{cases} \]

Weak compositions

blueprint
Definition 1.306

(a) An (integer) weak composition means a (finite) tuple of nonnegative integers.

(b) The size of a weak composition \(\alpha =\left( \alpha _{1},\alpha _{2},\ldots ,\alpha _{m}\right) \) is defined to be the integer \(\alpha _{1}+\alpha _{2}+\cdots +\alpha _{m}\). It is written \(\left\vert \alpha \right\vert \).

(c) The length of a weak composition \(\alpha =\left( \alpha _{1},\alpha _{2},\ldots ,\alpha _{m}\right) \) is defined to be the integer \(m\). It is written \(\ell \left( \alpha \right) \).

(d) Let \(n\in \mathbb {N}\). A weak composition of \(n\) means a weak composition whose size is \(n\).

(e) Let \(n\in \mathbb {N}\) and \(k\in \mathbb {N}\). A weak composition of \(n\) into \(k\) parts is a weak composition whose size is \(n\) and whose length is \(k\).

blueprint
Theorem 1.311

Let \(n,k\in \mathbb {N}\). Then, the # of weak compositions of \(n\) into \(k\) parts is

\[ \binom {n+k-1}{n}=\begin{cases} \binom {n+k-1}{k-1}, & \text{if }k{\gt}0;\\ \delta _{n,0}, & \text{if }k=0. \end{cases} \]

Weak compositions with entries from $\left\{ 0,1,\ldots ,p-1\right\} $

blueprint
Theorem 1.319

Let \(n,k,p\in \mathbb {N}\). Then, the # of \(k\)-tuples \(\left( \alpha _{1},\alpha _{2},\ldots ,\alpha _{k}\right) \in \left\{ 0,1,\ldots ,p-1\right\} ^{k}\) satisfying \(\alpha _{1}+\alpha _{2}+\cdots +\alpha _{k}=n\) is

\[ \sum _{j=0}^{k}\left( -1\right) ^{j}\binom {k}{j}\binom {n-pj+k-1}{n-pj}. \]
theorem AlgebraicCombinatorics.BoundedWeakComposition.card (n k p : ) :
(Fintype.card (BoundedWeakComposition n k p)) = jFinset.range (k + 1) with p * j n, (-1) ^ j * (k.choose j) * ((n - p * j + k - 1).choose (n - p * j))
blueprint
Proposition 1.321

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

\[ \binom {k}{n}=\sum _{j=0}^{k}\left( -1\right) ^{j}\binom {k}{j}\binom {n-2j+k-1}{n-2j}. \]
theorem AlgebraicCombinatorics.binom_sum_identity (n k : ) :
(k.choose n) = jFinset.range (k + 1) with 2 * j n, (-1) ^ j * (k.choose j) * ((n - 2 * j + k - 1).choose (n - 2 * j))

$x^{n}$-equivalence

blueprint
Definition 1.322

Let \(n\in \mathbb {N}\). Let \(f,g\in K\left[\left[x\right]\right]\) be two FPSs. We write \(f\overset {x^{n}}{\equiv }g\) if and only if

\[ \text{each }m\in \left\{ 0,1,\ldots ,n\right\} \text{ satisfies } \left[x^{m}\right]f=\left[x^{m}\right]g. \]

Thus, we have defined a binary relation \(\overset {x^{n}}{\equiv }\) on the set \(K\left[\left[x\right]\right]\). We say that an FPS \(f\) is \(x^{n}\)-equivalent to an FPS \(g\) if and only if \(f\overset {x^{n}}{\equiv }g\).

def PowerSeries.XnEquiv {R : Type u_1} [CommSemiring R] (n : ) (f g : PowerSeries R) :
blueprint
Theorem 1.328

Let \(n\in \mathbb {N}\).

(a) The relation \(\overset {x^{n}}{\equiv }\) on \(K\left[\left[ x\right]\right]\) is an equivalence relation. In other words:

  • This relation is reflexive (i.e., we have \(f\overset {x^{n}}{\equiv }f\) for each \(f\in K\left[\left[x\right]\right]\)).

  • This relation is transitive (i.e., if three FPSs \(f,g,h\in K\left[ \left[x\right]\right]\) satisfy \(f\overset {x^{n}}{\equiv }g\) and \(g\overset {x^{n}}{\equiv }h\), then \(f\overset {x^{n}}{\equiv }h\)).

  • This relation is symmetric (i.e., if two FPSs \(f,g\in K\left[\left[ x\right]\right]\) satisfy \(f\overset {x^{n}}{\equiv }g\), then \(g\overset {x^{n}}{\equiv }f\)).

(b) If \(a,b,c,d\in K\left[\left[x\right]\right]\) are four FPSs satisfying \(a\overset {x^{n}}{\equiv }b\) and \(c\overset {x^{n}}{\equiv }d\), then we also have

\begin{align} & a+c\overset {x^{n}}{\equiv }b+d;\label{eq.thm.fps.xneq.props.b.+}\\ & a-c\overset {x^{n}}{\equiv }b-d;\label{eq.thm.fps.xneq.props.b.-}\\ & ac\overset {x^{n}}{\equiv }bd. \label{eq.thm.fps.xneq.props.b.*} \end{align}

(c) If \(a,b\in K\left[\left[x\right]\right]\) are two FPSs satisfying \(a\overset {x^{n}}{\equiv }b\), then \(\lambda a\overset {x^{n}}{\equiv }\lambda b\) for each \(\lambda \in K\).

(d) If \(a,b\in K\left[\left[x\right]\right]\) are two invertible FPSs satisfying \(a\overset {x^{n}}{\equiv }b\), then \(a^{-1} \overset {x^{n}}{\equiv }b^{-1}\).

(e) If \(a,b,c,d\in K\left[\left[x\right]\right]\) are four FPSs satisfying \(a\overset {x^{n}}{\equiv }b\) and \(c\overset {x^{n}}{\equiv }d\), and if the FPSs \(c\) and \(d\) are invertible, then we also have

\begin{equation} \frac{a}{c}\overset {x^{n}}{\equiv }\frac{b}{d}. \label{eq.thm.fps.xneq.props.e./} \end{equation}

(f) Let \(S\) be a finite set. Let \(\left(a_{s}\right)_{s\in S}\in K\left[\left[x\right]\right]^{S}\) and \(\left(b_{s}\right)_{s\in S}\in K\left[\left[x\right]\right]^{S}\) be two families of FPSs such that

\begin{equation} \text{each }s\in S\text{ satisfies }a_{s}\overset {x^{n}}{\equiv }b_{s}. \label{eq.thm.fps.xneq.props.e.ass} \end{equation}

Then, we have

\begin{align} & \sum _{s\in S}a_{s}\overset {x^{n}}{\equiv }\sum _{s\in S}b_{s} ;\label{eq.thm.fps.xneq.props.e.+}\\ & \prod _{s\in S}a_{s}\overset {x^{n}}{\equiv }\prod _{s\in S}b_{s}. \label{eq.thm.fps.xneq.props.e.*} \end{align}
theorem PowerSeries.XnEquiv.add {R : Type u_1} [CommSemiring R] {n : } {a b c d : PowerSeries R} (hab : a ≡[x^n] b) (hcd : c ≡[x^n] d) :
a + c ≡[x^n] b + d
theorem PowerSeries.XnEquiv.sub {R : Type u_2} [CommRing R] {n : } {a b c d : PowerSeries R} (hab : a ≡[x^n] b) (hcd : c ≡[x^n] d) :
a - c ≡[x^n] b - d
theorem PowerSeries.XnEquiv.mul {R : Type u_1} [CommSemiring R] {n : } {a b c d : PowerSeries R} (hab : a ≡[x^n] b) (hcd : c ≡[x^n] d) :
a * c ≡[x^n] b * d
theorem PowerSeries.XnEquiv.smul {R : Type u_1} [CommSemiring R] {n : } {a b : PowerSeries R} (hab : a ≡[x^n] b) (r : R) :
r a ≡[x^n] r b
theorem PowerSeries.XnEquiv.invOfUnit {R : Type u_2} [CommRing R] {n : } {a b : PowerSeries R} (ua ub : Rˣ) (ha : constantCoeff a = ua) (hb : constantCoeff b = ub) (hab : a ≡[x^n] b) :
theorem PowerSeries.XnEquiv.inv {K : Type u_2} [Field K] {n : } {a b : PowerSeries K} (ha : constantCoeff a 0) (hb : constantCoeff b 0) (hab : a ≡[x^n] b) :
theorem PowerSeries.XnEquiv.div {R : Type u_2} [CommRing R] {n : } {a b c d : PowerSeries R} (hab : a ≡[x^n] b) (hcd : c ≡[x^n] d) (u : Rˣ) (hu : constantCoeff c = u) (v : Rˣ) (hv : constantCoeff d = v) :
theorem PowerSeries.XnEquiv.sum {R : Type u_1} [CommSemiring R] {ι : Type u_2} [DecidableEq ι] {n : } {s : Finset ι} {a b : ιPowerSeries R} (h : is, a i ≡[x^n] b i) :
is, a i ≡[x^n] is, b i
theorem PowerSeries.XnEquiv.prod {R : Type u_1} [CommSemiring R] {ι : Type u_2} [DecidableEq ι] {n : } {s : Finset ι} {a b : ιPowerSeries R} (h : is, a i ≡[x^n] b i) :
is, a i ≡[x^n] is, b i
blueprint
Proposition 1.335

Let \(n\in \mathbb {N}\). Let \(f,g\in K\left[\left[x\right]\right]\) be two FPSs. Then, we have \(f\overset {x^{n}}{\equiv }g\) if and only if the FPS \(f-g\) is a multiple of \(x^{n+1}\).

theorem PowerSeries.xnEquiv_iff_dvd {R : Type u_3} [CommRing R] {n : } {f g : PowerSeries R} :
(f ≡[x^n] g) X ^ (n + 1) f - g
blueprint
Proposition 1.338

Let \(n\in \mathbb {N}\). Let \(a,b,c,d\in K\left[\left[x\right]\right]\) be four FPSs satisfying \(a\overset {x^{n}}{\equiv }b\) and \(c\overset {x^{n}}{\equiv }d\) and \([x^{0}]c=0\) and \([x^{0}]d=0\). Then,

\[ a\circ c\overset {x^{n}}{\equiv }b\circ d. \]
theorem PowerSeries.XnEquiv.comp {R : Type u_3} [CommRing R] {n : } {a b c d : PowerSeries R} (hab : a ≡[x^n] b) (hcd : c ≡[x^n] d) (hc : constantCoeff c = 0) (hd : constantCoeff d = 0) :

Infinite products

A rigorous definition

blueprint
Definition 1.340

Let \(\left(\mathbf{a}_{i}\right)_{i\in I}\in K\left[\left[x\right]\right]^{I}\) be a (possibly infinite) family of FPSs. Let \(n\in \mathbb {N}\). Let \(M\) be a finite subset of \(I\).

(a) We say that \(M\) determines the \(x^{n}\)-coefficient in the sum of \(\left(\mathbf{a}_{i}\right)_{i\in I}\) if every finite subset \(J\) of \(I\) satisfying \(M\subseteq J\subseteq I\) satisfies

\[ \left[x^{n}\right]\left(\sum _{i\in J}\mathbf{a}_{i}\right) =\left[x^{n}\right]\left(\sum _{i\in M}\mathbf{a}_{i}\right). \]

(b) We say that \(M\) determines the \(x^{n}\)-coefficient in the product of \(\left(\mathbf{a}_{i}\right)_{i\in I}\) if every finite subset \(J\) of \(I\) satisfying \(M\subseteq J\subseteq I\) satisfies

\[ \left[x^{n}\right]\left(\prod _{i\in J}\mathbf{a}_{i}\right) =\left[x^{n}\right]\left(\prod _{i\in M}\mathbf{a}_{i}\right). \]
def PowerSeries.DeterminesCoeffInProd {R : Type u_1} [CommRing R] {I : Type u_2} (a : IPowerSeries R) (M : Finset I) (n : ) :
blueprint
Definition 1.341

Let \(\left(\mathbf{a}_{i}\right)_{i\in I}\in K\left[\left[x\right]\right]^{I}\) be a (possibly infinite) family of FPSs. Let \(n\in \mathbb {N}\).

(a) We say that the \(x^{n}\)-coefficient in the sum of \(\left(\mathbf{a}_{i}\right)_{i\in I}\) is finitely determined if there is a finite subset \(M\) of \(I\) that determines the \(x^{n}\)-coefficient in the sum of \(\left(\mathbf{a}_{i}\right)_{i\in I}\).

(b) We say that the \(x^{n}\)-coefficient in the product of \(\left(\mathbf{a}_{i}\right)_{i\in I}\) is finitely determined if there is a finite subset \(M\) of \(I\) that determines the \(x^{n}\)-coefficient in the product of \(\left(\mathbf{a}_{i}\right)_{i\in I}\).

blueprint
Proposition 1.342

Let \(\left(\mathbf{a}_{i}\right)_{i\in I}\in K\left[\left[x\right]\right]^{I}\) be a (possibly infinite) family of FPSs. Then:

(a) The family \(\left(\mathbf{a}_{i}\right)_{i\in I}\) is summable if and only if each coefficient in its sum is finitely determined (i.e., for each \(n\in \mathbb {N}\), the \(x^{n}\)-coefficient in the sum of \(\left(\mathbf{a}_{i}\right)_{i\in I}\) is finitely determined).

(b) If the family \(\left(\mathbf{a}_{i}\right)_{i\in I}\) is summable, then its sum \(\sum _{i\in I}\mathbf{a}_{i}\) is the FPS whose \(x^{n}\)-coefficient (for any \(n\in \mathbb {N}\)) can be computed as follows: If \(n\in \mathbb {N}\), and if \(M\) is a finite subset of \(I\) that determines the \(x^{n}\)-coefficient in the sum of \(\left(\mathbf{a}_{i}\right)_{i\in I}\), then

\[ \left[x^{n}\right]\left(\sum _{i\in I}\mathbf{a}_{i}\right) =\left[x^{n}\right]\left(\sum _{i\in M}\mathbf{a}_{i}\right). \]
theorem PowerSeries.summable_iff_coeff_finitely_determined {R : Type u_1} [CommRing R] {I : Type u_2} (a : IPowerSeries R) :
(∀ (n : ), {i : I | (coeff n) (a i) 0}.Finite) ∀ (n : ), CoeffFinitelyDeterminedInSum a n
blueprint
Definition 1.343

Let \(\left(\mathbf{a}_{i}\right)_{i\in I}\) be a (possibly infinite) family of FPSs. Then:

(a) The family \(\left(\mathbf{a}_{i}\right)_{i\in I}\) is said to be multipliable if and only if each coefficient in its product is finitely determined.

(b) If the family \(\left(\mathbf{a}_{i}\right)_{i\in I}\) is multipliable, then its product \(\prod _{i\in I}\mathbf{a}_{i}\) is defined to be the FPS whose \(x^{n}\)-coefficient (for any \(n\in \mathbb {N}\)) can be computed as follows: If \(n\in \mathbb {N}\), and if \(M\) is a finite subset of \(I\) that determines the \(x^{n}\)-coefficient in the product of \(\left( \mathbf{a}_{i}\right)_{i\in I}\), then

\[ \left[x^{n}\right]\left(\prod _{i\in I}\mathbf{a}_{i}\right) =\left[x^{n}\right]\left(\prod _{i\in M}\mathbf{a}_{i}\right). \]
blueprint
Proposition 1.344

This definition of \(\prod _{i\in I}\mathbf{a}_{i}\) is well-defined – i.e., the coefficient \(\left[x^{n}\right]\left(\prod _{i\in M}\mathbf{a}_{i}\right)\) does not depend on \(M\) (as long as \(M\) is a finite subset of \(I\) that determines the \(x^{n}\)-coefficient in the product of \(\left(\mathbf{a}_{i}\right)_{i\in I}\)).

theorem PowerSeries.multipliable_coeff_eq_of_determines {R : Type u_1} [CommRing R] {I : Type u_2} {a : IPowerSeries R} {M₁ M₂ : Finset I} {n : } (h₁ : DeterminesCoeffInProd a M₁ n) (h₂ : DeterminesCoeffInProd a M₂ n) :
(coeff n) (∏ iM₁, a i) = (coeff n) (∏ iM₂, a i)
blueprint
Proposition 1.345

Let \(\left(\mathbf{a}_{i}\right)_{i\in I}\) be a finite family of FPSs. Then, the product \(\prod _{i\in I}\mathbf{a}_{i}\) defined according to Definition 1.343 (b) equals the finite product \(\prod _{i\in I}\mathbf{a}_{i}\) defined in the usual way (i.e., defined as in any commutative ring).

theorem PowerSeries.tprod_eq_finprod {R : Type u_1} [CommRing R] {I : Type u_2} [Fintype I] (a : IPowerSeries R) (ha : Multipliable a) :
tprod a ha = i : I, a i

A general criterion for multipliability

blueprint
Lemma 1.348

Let \(a,f\in K\left[\left[x\right]\right]\) be two FPSs. Let \(n\in \mathbb {N}\). Assume that

\[ \left[x^{m}\right]f=0 \qquad \text{for each }m\in \left\{ 0,1,\ldots ,n\right\} . \]

Then,

\[ \left[x^{m}\right]\left(a\left(1+f\right)\right)=\left[x^{m}\right]a \qquad \text{for each }m\in \left\{ 0,1,\ldots ,n\right\} . \]
theorem PowerSeries.coeff_mul_one_add_eq_of_coeff_zero {R : Type u_1} [CommRing R] {a f : PowerSeries R} {n : } (hf : mn, (coeff m) f = 0) (m : ) (hm : m n) :
(coeff m) (a * (1 + f)) = (coeff m) a
blueprint
Lemma 1.349

Let \(a\in K\left[\left[x\right]\right]\) be an FPS. Let \(\left(f_{i}\right)_{i\in J} \in K\left[\left[x\right]\right]^{J}\) be a finite family of FPSs. Let \(n\in \mathbb {N}\). Assume that each \(i\in J\) satisfies

\[ \left[x^{m}\right]\left(f_{i}\right)=0 \qquad \text{for each } m\in \left\{ 0,1,\ldots ,n\right\} . \]

Then,

\[ \left[x^{m}\right]\left(a\prod _{i\in J}\left(1+f_{i}\right)\right) =\left[x^{m}\right]a \qquad \text{for each }m\in \left\{ 0,1,\ldots ,n\right\} . \]
theorem PowerSeries.coeff_mul_prod_one_add_eq {R : Type u_1} [CommRing R] {I : Type u_2} {a : PowerSeries R} {J : Finset I} {f : IPowerSeries R} {n : } (hf : iJ, mn, (coeff m) (f i) = 0) (m : ) (hm : m n) :
(coeff m) (a * iJ, (1 + f i)) = (coeff m) a
blueprint
Theorem 1.350

Let \(\left(f_{i}\right)_{i\in I}\in K\left[\left[x\right]\right]^{I}\) be a (possibly infinite) summable family of FPSs. Then, the family \(\left(1+f_{i}\right)_{i\in I}\) is multipliable.

theorem PowerSeries.multipliable_one_add_of_summable {R : Type u_1} [CommRing R] {I : Type u_2} {f : IPowerSeries R} (hf : ∀ (n : ), {i : I | (coeff n) (f i) 0}.Finite) :
Multipliable fun (i : I) => 1 + f i
blueprint
Proposition 1.351

If all but finitely many entries of a family \(\left(\mathbf{a}_{i}\right)_{i\in I}\in K\left[\left[x\right]\right]^{I}\) equal \(1\) (that is, if all but finitely many \(i\in I\) satisfy \(\mathbf{a}_{i}=1\)), then this family is multipliable.

theorem PowerSeries.multipliable_of_finite_ne_one {R : Type u_1} [CommRing R] {I : Type u_2} (a : IPowerSeries R) (h : {i : I | a i 1}.Finite) :

$x^{n}$-approximators

blueprint
Definition 1.362

Let \(\left(\mathbf{a}_{i}\right)_{i\in I}\in K\left[\left[x\right]\right]^{I}\) be a family of FPSs. Let \(n\in \mathbb {N}\). An \(x^{n}\)-approximator for \(\left(\mathbf{a}_{i}\right)_{i\in I}\) means a finite subset \(M\) of \(I\) that determines the first \(n+1\) coefficients in the product of \(\left(\mathbf{a}_{i}\right)_{i\in I}\). (In other words, \(M\) has to determine the \(x^{m}\)-coefficient in the product of \(\left(\mathbf{a}_{i}\right)_{i\in I}\) for each \(m\in \left\{ 0,1,\ldots ,n\right\} \).)

blueprint
Lemma 1.363

Let \(\left(\mathbf{a}_{i}\right)_{i\in I}\in K\left[\left[x\right]\right]^{I}\) be a multipliable family of FPSs. Let \(n\in \mathbb {N}\). Then, there exists an \(x^{n}\)-approximator for \(\left(\mathbf{a}_{i}\right)_{i\in I}\).

theorem PowerSeries.exists_xn_approximator {R : Type u_1} [CommRing R] {I : Type u_2} [DecidableEq I] (a : IPowerSeries R) (ha : Multipliable a) (n : ) :
∃ (M : Finset I), IsXnApproximator a M n
theorem AlgebraicCombinatorics.FPS.multipliable_exists_approximator {K : Type u_1} [CommRing K] {ι : Type u_2} {a : ιPowerSeries K} (h : Multipliable a) (n : ) :
∃ (U : Finset ι), IsXnApproximator a n U
blueprint
Proposition 1.364

Let \(\left(\mathbf{a}_{i}\right)_{i\in I}\in K\left[\left[x\right]\right]^{I}\) be a family of FPSs. Let \(n\in \mathbb {N}\). Let \(M\) be an \(x^{n}\)-approximator for \(\left(\mathbf{a}_{i}\right)_{i\in I}\). Then:

(a) Every finite subset \(J\) of \(I\) satisfying \(M\subseteq J\subseteq I\) satisfies

\[ \prod _{i\in J}\mathbf{a}_{i}\overset {x^{n}}{\equiv }\prod _{i\in M}\mathbf{a}_{i}. \]

(b) If the family \(\left(\mathbf{a}_{i}\right)_{i\in I}\) is multipliable, then

\[ \prod _{i\in I}\mathbf{a}_{i}\overset {x^{n}}{\equiv }\prod _{i\in M}\mathbf{a}_{i}. \]
theorem PowerSeries.xn_approximator_superset_xnEquiv {R : Type u_1} [CommRing R] {I : Type u_2} {a : IPowerSeries R} {M : Finset I} {n : } (hM : IsXnApproximator a M n) {J : Finset I} (hMJ : M J) :
iJ, a i ≡[x^n] iM, a i
theorem PowerSeries.tprod_xnEquiv_approximator {R : Type u_1} [CommRing R] {I : Type u_2} {a : IPowerSeries R} (ha : Multipliable a) {M : Finset I} {n : } (hM : IsXnApproximator a M n) :
tprod a ha ≡[x^n] iM, a i

Properties of infinite products

blueprint
Proposition 1.365

Let \(\left(\mathbf{a}_{i}\right)_{i\in I}\in K\left[\left[x\right]\right]^{I}\) be a family of FPSs. Let \(J\) be a subset of \(I\). Assume that the subfamilies \(\left(\mathbf{a}_{i}\right)_{i\in J}\) and \(\left(\mathbf{a}_{i}\right)_{i\in I\setminus J}\) are multipliable. Then:

(a) The entire family \(\left(\mathbf{a}_{i}\right)_{i\in I}\) is multipliable.

(b) We have

\[ \prod _{i\in I}\mathbf{a}_{i}=\left(\prod _{i\in J}\mathbf{a}_{i}\right) \cdot \left(\prod _{i\in I\setminus J}\mathbf{a}_{i}\right). \]
theorem PowerSeries.multipliable_of_union {R : Type u_1} [CommRing R] {I : Type u_2} {a : IPowerSeries R} {J : Set I} (hJ : Multipliable fun (i : J) => a i) (hIJ : Multipliable fun (i : ↑(Set.univ \ J)) => a i) :
theorem PowerSeries.tprod_eq_tprod_mul_tprod {R : Type u_1} [CommRing R] {I : Type u_2} {a : IPowerSeries R} {J : Set I} (ha : Multipliable a) (hJ : Multipliable fun (i : J) => a i) (hIJ : Multipliable fun (i : ↑(Set.univ \ J)) => a i) :
tprod a ha = tprod (fun (i : J) => a i) hJ * tprod (fun (i : ↑(Set.univ \ J)) => a i) hIJ
blueprint
Proposition 1.366

Let \(\left(\mathbf{a}_{i}\right)_{i\in I}\in K\left[\left[x\right]\right]^{I}\) and \(\left(\mathbf{b}_{i}\right)_{i\in I}\in K\left[\left[x\right]\right]^{I}\) be two multipliable families of FPSs. Then:

(a) The family \(\left(\mathbf{a}_{i}\mathbf{b}_{i}\right)_{i\in I}\) is multipliable.

(b) We have

\[ \prod _{i\in I}\left(\mathbf{a}_{i}\mathbf{b}_{i}\right)=\left(\prod _{i\in I} \mathbf{a}_{i}\right)\cdot \left(\prod _{i\in I}\mathbf{b}_{i}\right). \]
theorem PowerSeries.multipliable_mul {R : Type u_1} [CommRing R] {I : Type u_2} {a b : IPowerSeries R} (ha : Multipliable a) (hb : Multipliable b) :
Multipliable fun (i : I) => a i * b i
theorem PowerSeries.tprod_mul_eq_mul_tprod {R : Type u_1} [CommRing R] {I : Type u_2} {a b : IPowerSeries R} (ha : Multipliable a) (hb : Multipliable b) (hab : Multipliable fun (i : I) => a i * b i := ) :
tprod (fun (i : I) => a i * b i) hab = tprod a ha * tprod b hb
blueprint
Proposition 1.367

Let \(\left(\mathbf{a}_{i}\right)_{i\in I}\in K\left[\left[x\right]\right]^{I}\) and \(\left(\mathbf{b}_{i}\right)_{i\in I}\in K\left[\left[x\right]\right]^{I}\) be two multipliable families of FPSs. Assume that the FPS \(\mathbf{b}_{i}\) is invertible for each \(i\in I\). Then:

(a) The family \(\left(\frac{\mathbf{a}_{i}}{\mathbf{b}_{i}}\right)_{i\in I}\) is multipliable.

(b) We have

\[ \prod _{i\in I}\frac{\mathbf{a}_{i}}{\mathbf{b}_{i}} =\frac{\prod _{i\in I}\mathbf{a}_{i}}{\prod _{i\in I}\mathbf{b}_{i}}. \]
theorem PowerSeries.multipliable_div {R : Type u_1} [CommRing R] {I : Type u_2} {a b : IPowerSeries R} (ha : Multipliable a) (hb : Multipliable b) (hb_inv : ∀ (i : I), IsUnit ((coeff 0) (b i))) :
Multipliable fun (i : I) => a i * Ring.inverse (b i)
theorem PowerSeries.tprod_div_eq_div_tprod {R : Type u_1} [CommRing R] {I : Type u_2} {a b : IPowerSeries R} (ha : Multipliable a) (hb : Multipliable b) (hb_inv : ∀ (i : I), IsUnit ((coeff 0) (b i))) (hab : Multipliable fun (i : I) => a i * Ring.inverse (b i) := ) :
tprod (fun (i : I) => a i * Ring.inverse (b i)) hab = tprod a ha * Ring.inverse (tprod b hb)
blueprint
Proposition 1.369

Let \(\left(\mathbf{a}_{i}\right)_{i\in I}\in K\left[\left[x\right]\right]^{I}\) be a multipliable family of invertible FPSs. Then, any subfamily of \(\left(\mathbf{a}_{i}\right)_{i\in I}\) is multipliable.

theorem PowerSeries.multipliable_subfamily {R : Type u_1} [CommRing R] {I : Type u_2} {a : IPowerSeries R} (ha : Multipliable a) (ha_inv : ∀ (i : I), IsUnit ((coeff 0) (a i))) (J : Set I) :
Multipliable fun (i : J) => a i
blueprint
Proposition 1.370

Let \(S\) and \(T\) be two sets. Let \(f:S\rightarrow T\) be a bijection. Let \(\left(\mathbf{a}_{t}\right)_{t\in T}\in K\left[\left[x\right]\right]^{T}\) be a multipliable family of FPSs. Then,

\[ \prod _{t\in T}\mathbf{a}_{t}=\prod _{s\in S}\mathbf{a}_{f\left(s\right)} \]

(and, in particular, the product on the right hand side is well-defined, i.e., the family \(\left(\mathbf{a}_{f\left(s\right)}\right)_{s\in S}\) is multipliable).

theorem PowerSeries.multipliable_reindex {R : Type u_1} [CommRing R] {S : Type u_3} {T : Type u_4} {f : ST} (hf : Function.Bijective f) {a : TPowerSeries R} (ha : Multipliable a) :
theorem PowerSeries.tprod_reindex {R : Type u_1} [CommRing R] {S : Type u_3} {T : Type u_4} {f : ST} (hf : Function.Bijective f) {a : TPowerSeries R} (ha : Multipliable a) (haf : Multipliable (a f) := ) :
tprod (a f) haf = tprod a ha
blueprint
Proposition 1.372

Let \(\left(\mathbf{a}_{s}\right)_{s\in S}\in K\left[\left[x\right]\right]^{S}\) be a multipliable family of FPSs. Let \(W\) be a set. Let \(f:S\rightarrow W\) be a map. Assume that for each \(w\in W\), the family \(\left(\mathbf{a}_{s}\right)_{s\in S,\; f(s)=w}\) is multipliable. Then,

\[ \prod _{s\in S}\mathbf{a}_{s}=\prod _{w\in W}\; \; \prod _{\substack {s\in S;\\ f(s)=w}}\mathbf{a}_{s}. \]

(In particular, the right hand side is well-defined – i.e., the family \(\left(\prod _{\substack {s\in S;\\ f(s)=w}}\mathbf{a}_{s}\right)_{w\in W}\) is multipliable.)

Note: The Lean formalization of this proposition (without sorry) requires the additional assumption that all FPSs are invertible (i.e., \([x^0]\mathbf{a}_s\) is a unit for each \(s\)), which is used through Proposition 1.369 to guarantee multipliability of subfamilies. The versions without this invertibility hypothesis are formalized with sorry.

theorem PowerSeries.multipliable_prod_fibers_inv {R : Type u_1} [CommRing R] {S : Type u_3} {W : Type u_4} {f : SW} {a : SPowerSeries R} (ha : Multipliable a) (ha_inv : ∀ (s : S), IsUnit ((coeff 0) (a s))) (ha_fibers : ∀ (w : W), Multipliable fun (s : { s : S // f s = w }) => a s := ) :
Multipliable fun (w : W) => tprod (fun (s : { s : S // f s = w }) => a s)
theorem PowerSeries.tprod_eq_tprod_fibers_inv {R : Type u_1} [CommRing R] {S : Type u_3} {W : Type u_4} {f : SW} {a : SPowerSeries R} (ha : Multipliable a) (ha_inv : ∀ (s : S), IsUnit ((coeff 0) (a s))) (ha_fibers : ∀ (w : W), Multipliable fun (s : { s : S // f s = w }) => a s := ) (ha_outer : Multipliable fun (w : W) => tprod (fun (s : { s : S // f s = w }) => a s) := ) :
tprod a ha = tprod (fun (w : W) => tprod (fun (s : { s : S // f s = w }) => a s) ) ha_outer
blueprint
Proposition 1.373 Fubini rule for infinite products of FPSs

Let \(I\) and \(J\) be two sets. Let \(\left(\mathbf{a}_{(i,j)}\right)_{(i,j)\in I\times J}\in K\left[\left[x\right]\right]^{I\times J}\) be a multipliable family of FPSs. Assume that for each \(i\in I\), the family \(\left(\mathbf{a}_{(i,j)}\right)_{j\in J}\) is multipliable. Assume that for each \(j\in J\), the family \(\left(\mathbf{a}_{(i,j)}\right)_{i\in I}\) is multipliable. Then,

\[ \prod _{i\in I}\; \; \prod _{j\in J}\mathbf{a}_{(i,j)} =\prod _{(i,j)\in I\times J}\mathbf{a}_{(i,j)} =\prod _{j\in J}\; \; \prod _{i\in I}\mathbf{a}_{(i,j)}. \]

(In particular, all the products appearing in this equality are well-defined.)

theorem PowerSeries.tprod_fubini {R : Type u_1} [CommRing R] {I : Type u_3} {J : Type u_4} {a : I × JPowerSeries R} (ha : Multipliable a) (ha_I : ∀ (i : I), Multipliable fun (j : J) => a (i, j)) (_ha_J : ∀ (j : J), Multipliable fun (i : I) => a (i, j)) (ha_outer_I : Multipliable fun (i : I) => tprod (fun (j : J) => a (i, j)) := ) :
tprod a ha = tprod (fun (i : I) => tprod (fun (j : J) => a (i, j)) ) ha_outer_I
theorem PowerSeries.tprod_fubini_J {R : Type u_1} [CommRing R] {I : Type u_3} {J : Type u_4} {a : I × JPowerSeries R} (ha : Multipliable a) (ha_J : ∀ (j : J), Multipliable fun (i : I) => a (i, j)) (ha_outer_J : Multipliable fun (j : J) => tprod (fun (i : I) => a (i, j)) := ) :
tprod a ha = tprod (fun (j : J) => tprod (fun (i : I) => a (i, j)) ) ha_outer_J
theorem PowerSeries.tprod_fubini_full {R : Type u_1} [CommRing R] {I : Type u_3} {J : Type u_4} {a : I × JPowerSeries R} (ha : Multipliable a) (ha_I : ∀ (i : I), Multipliable fun (j : J) => a (i, j)) (ha_J : ∀ (j : J), Multipliable fun (i : I) => a (i, j)) (ha_outer_I : Multipliable fun (i : I) => tprod (fun (j : J) => a (i, j)) := ) (ha_outer_J : Multipliable fun (j : J) => tprod (fun (i : I) => a (i, j)) := ) :
tprod (fun (i : I) => tprod (fun (j : J) => a (i, j)) ) ha_outer_I = tprod a ha tprod a ha = tprod (fun (j : J) => tprod (fun (i : I) => a (i, j)) ) ha_outer_J
theorem PowerSeries.multipliable_tprod_fubini {R : Type u_1} [CommRing R] {I : Type u_3} {J : Type u_4} {a : I × JPowerSeries R} (ha : Multipliable a) (ha_I : ∀ (i : I), Multipliable fun (j : J) => a (i, j)) :
Multipliable fun (i : I) => tprod (fun (j : J) => a (i, j))
theorem PowerSeries.multipliable_tprod_fubini_J {R : Type u_1} [CommRing R] {I : Type u_3} {J : Type u_4} {a : I × JPowerSeries R} (ha : Multipliable a) (ha_J : ∀ (j : J), Multipliable fun (i : I) => a (i, j)) :
Multipliable fun (j : J) => tprod (fun (i : I) => a (i, j))
blueprint
Proposition 1.374 Fubini rule for infinite products, invertible case

Let \(I\) and \(J\) be two sets. Let \(\left(\mathbf{a}_{(i,j)}\right)_{(i,j)\in I\times J}\in K\left[\left[x\right]\right]^{I\times J}\) be a multipliable family of invertible FPSs. Then,

\[ \prod _{i\in I}\; \; \prod _{j\in J}\mathbf{a}_{(i,j)} =\prod _{(i,j)\in I\times J}\mathbf{a}_{(i,j)} =\prod _{j\in J}\; \; \prod _{i\in I}\mathbf{a}_{(i,j)}. \]

(In particular, all the products appearing in this equality are well-defined.)

theorem PowerSeries.fubini_prod_invertible {R : Type u_1} [CommRing R] {I : Type u_3} {J : Type u_4} {a : I × JPowerSeries R} (ha : Multipliable a) (ha_inv : ∀ (p : I × J), IsUnit ((coeff 0) (a p))) :
(∀ (i : I), Multipliable fun (j : J) => a (i, j)) ∀ (j : J), Multipliable fun (i : I) => a (i, j)

Product rules (generalized distributive laws)

blueprint
Proposition 1.375

Let \(L\) be a commutative ring. For every \(n\in \mathbb {N}\), let \(\left[ n\right] \) denote the set \(\left\{ 1,2,\ldots ,n\right\} \).

Let \(n\in \mathbb {N}\). For every \(i\in \left[ n\right] \), let \(p_{i,1},p_{i,2},\ldots ,p_{i,m_{i}}\) be finitely many elements of \(L\). Then,

\begin{equation} \prod _{i=1}^{n}\ \ \sum _{k=1}^{m_{i}}p_{i,k}=\sum _{\left( k_{1},k_{2},\ldots ,k_{n}\right) \in \left[ m_{1}\right] \times \left[ m_{2}\right] \times \cdots \times \left[ m_{n}\right] }\ \ \prod _{i=1}^{n}p_{i,k_{i}}. \label{eq.lem.fps.prodrule-fin-fin.eq}\end{equation}

theorem prod_sum_eq_sum_prod_finset {L : Type u_2} [CommSemiring L] {n : } {m : Fin n} (p : (i : Fin n) → Fin (m i)L) :
i : Fin n, k : Fin (m i), p i k = f : (i : Fin n) → Fin (m i), i : Fin n, p i (f i)
blueprint
Proposition 1.376

For every \(n\in \mathbb {N}\), let \(\left[ n\right] \) denote the set \(\left\{ 1,2,\ldots ,n\right\} \).

Let \(n\in \mathbb {N}\). For every \(i\in \left[ n\right] \), let \(\left( p_{i,k}\right) _{k\in S_{i}}\) be a summable family of elements of \(K\left[ \left[ x\right] \right] \). Then,

\begin{equation} \prod _{i=1}^{n}\ \ \sum _{k\in S_{i}}p_{i,k}=\sum _{\left( k_{1},k_{2},\ldots ,k_{n}\right) \in S_{1}\times S_{2}\times \cdots \times S_{n}}\ \ \prod _{i=1}^{n}p_{i,k_{i}}. \label{eq.lem.fps.prodrule-fin-inf.eq}\end{equation}

In particular, the family \(\left( \prod _{i=1}^{n}p_{i,k_{i}}\right) _{\left( k_{1},k_{2},\ldots ,k_{n}\right) \in S_{1}\times S_{2}\times \cdots \times S_{n}}\) is summable.

theorem prod_tsum_eq_tsum_prod_finset {K : Type u_1} [CommRing K] [TopologicalSpace K] [IsTopologicalRing K] [T2Space K] [DiscreteTopology K] {n : } {S : Fin nType u_2} (p : (i : Fin n) → S iPowerSeries K) (hp : ∀ (i : Fin n), Summable (p i)) :
i : Fin n, ∑' (k : S i), p i k = ∑' (f : (i : Fin n) → S i), i : Fin n, p i (f i)
blueprint
Definition 1.380

(a) A sequence \(\left( k_{1},k_{2},k_{3},\ldots \right) \) is said to be essentially finite if all but finitely many \(i\in \left\{ 1,2,3,\ldots \right\} \) satisfy \(k_{i}=0\).

(b) A family \(\left( k_{i}\right) _{i\in I}\) is said to be essentially finite if all but finitely many \(i\in I\) satisfy \(k_{i}=0\).

def EssentiallyFinite {I : Type u_2} {M : Type u_3} [Zero M] (f : IM) :
blueprint
Proposition 1.381

Let \(S_{1},S_{2},S_{3},\ldots \) be infinitely many sets that all contain the number \(0\). Set

\[ \overline{S}=\left\{ \left( i,k\right) \ \mid \ i\in \left\{ 1,2,3,\ldots \right\} \text{ and }k\in S_{i}\text{ and }k\neq 0\right\} . \]

For any \(i\in \left\{ 1,2,3,\ldots \right\} \) and any \(k\in S_{i}\), let \(p_{i,k}\) be an element of \(K\left[ \left[ x\right] \right] \). Assume that

\begin{equation} p_{i,0}=1\ \ \ \ \ \ \ \ \ \ \text{for any }i\in \left\{ 1,2,3,\ldots \right\} . \label{eq.prop.fps.prodrule-inf-infN.pi0=1}\end{equation}

Assume further that the family \(\left( p_{i,k}\right) _{\left( i,k\right) \in \overline{S}}\) is summable. Then, the product \(\prod _{i=1}^{\infty }\ \ \sum _{k\in S_{i}}p_{i,k}\) is well-defined (i.e., the family \(\left( p_{i,k}\right) _{k\in S_{i}}\) is summable for each \(i\in \left\{ 1,2,3,\ldots \right\} \), and the family \(\left( \sum _{k\in S_{i}}p_{i,k}\right) _{i\in \left\{ 1,2,3,\ldots \right\} }\) is multipliable), and we have

\begin{equation} \prod _{i=1}^{\infty }\ \ \sum _{k\in S_{i}}p_{i,k}=\sum _{\substack {\left( k_{1},k_{2},k_{3},\ldots \right) \in S_{1}\times S_{2}\times S_{3}\times \cdots \\ \text{is essentially finite}}}\ \ \prod _{i=1}^{\infty }p_{i,k_{i}}. \label{eq.prop.fps.prodrule-inf-infN.eq}\end{equation}

In particular, the family \(\left( \prod _{i=1}^{\infty }p_{i,k_{i}}\right) _{\left( k_{1},k_{2},k_{3},\ldots \right) \in S_{1}\times S_{2}\times S_{3}\times \cdots \text{ is essentially finite}}\) is summable.

theorem tprod_tsum_eq_tsum_prod_essentiallyFinite_nat {K : Type u_1} [CommRing K] [TopologicalSpace K] [IsTopologicalRing K] [T2Space K] [DiscreteTopology K] {S : ℕ+Type u_2} [(i : ℕ+) → Zero (S i)] [(i : ℕ+) → DecidableEq (S i)] (p : (i : ℕ+) → S iPowerSeries K) (hp_zero : ∀ (i : ℕ+), p i 0 = 1) (hp_summable : Summable fun (ik : SBar S) => p ik.fst ik.snd) :
∏' (i : ℕ+), ∑' (k : S i), p i k = ∑' (f : { f : (i : ℕ+) → S i // ∀ᶠ (i : ℕ+) in Filter.cofinite, f i = 0 }), ∏' (i : ℕ+), p i (f i)
blueprint
Proposition 1.382

Let \(I\) be a set. For any \(i\in I\), let \(S_{i}\) be a set that contains the number \(0\). Set

\[ \overline{S}=\left\{ \left( i,k\right) \ \mid \ i\in I\text{ and }k\in S_{i}\text{ and }k\neq 0\right\} . \]

For any \(i\in I\) and any \(k\in S_{i}\), let \(p_{i,k}\) be an element of \(K\left[ \left[ x\right] \right] \). Assume that

\begin{equation} p_{i,0}=1\ \ \ \ \ \ \ \ \ \ \text{for any }i\in I. \label{eq.prop.fps.prodrule-inf-inf.pi0=1}\end{equation}

Assume further that the family \(\left( p_{i,k}\right) _{\left( i,k\right) \in \overline{S}}\) is summable. Then, the product \(\prod _{i\in I}\ \ \sum _{k\in S_{i}}p_{i,k}\) is well-defined (i.e., the family \(\left( p_{i,k}\right) _{k\in S_{i}}\) is summable for each \(i\in I\), and the family \(\left( \sum _{k\in S_{i}}p_{i,k}\right) _{i\in I}\) is multipliable), and we have

\begin{equation} \prod _{i\in I}\ \ \sum _{k\in S_{i}}p_{i,k}=\sum _{\substack {\left( k_{i}\right) _{i\in I}\in \prod _{i\in I}S_{i}\\ \text{is essentially finite}}}\ \ \prod _{i\in I}p_{i,k_{i}}. \label{eq.prop.fps.prodrule-inf-inf.eq}\end{equation}

In particular, the family \(\left( \prod _{i\in I}p_{i,k_{i}}\right) _{\left( k_{i}\right) _{i\in I}\in \prod _{i\in I}S_{i}\text{ is essentially finite}}\) is summable.

theorem tprod_tsum_eq_tsum_prod_essentiallyFinite {K : Type u_1} [CommRing K] [TopologicalSpace K] [IsTopologicalRing K] [T2Space K] [DiscreteTopology K] {I : Type u_2} {S : IType u_3} [(i : I) → Zero (S i)] [(i : I) → DecidableEq (S i)] (p : (i : I) → S iPowerSeries K) (hp_zero : ∀ (i : I), p i 0 = 1) (hp_summable : Summable fun (ik : (i : I) × { k : S i // k 0 }) => p ik.fst ik.snd) :
∏' (i : I), ∑' (k : S i), p i k = ∑' (f : { f : (i : I) → S i // ∀ᶠ (i : I) in Filter.cofinite, f i = 0 }), ∏' (i : I), p i (f i)
blueprint
Proposition 1.383

Let \(N\) be a finite set. For any \(i\in N\), let \(\left( p_{i,k}\right) _{k\in S_{i}}\) be a summable family of elements of \(K\left[ \left[ x\right] \right] \). Then,

\begin{equation} \prod _{i\in N}\ \ \sum _{k\in S_{i}}p_{i,k}=\sum _{\left( k_{i}\right) _{i\in N}\in \prod _{i\in N}S_{i}}\ \ \prod _{i\in N}p_{i,k_{i}}. \label{eq.lem.fps.prodrule-fin-infJ.eq}\end{equation}

In particular, the family \(\left( \prod _{i\in N}p_{i,k_{i}}\right) _{\left( k_{i}\right) _{i\in N}\in \prod _{i\in N}S_{i}}\) is summable.

theorem prod_tsum_eq_tsum_prod_finset'_discrete {K : Type u_1} [CommRing K] [TopologicalSpace K] [IsTopologicalRing K] [T2Space K] [DiscreteTopology K] {N : Type u_2} [Fintype N] [DecidableEq N] {S : NType u_3} (p : (i : N) → S iPowerSeries K) (hp : ∀ (i : N), Summable (p i)) :
i : N, ∑' (k : S i), p i k = ∑' (f : (i : N) → S i), i : N, p i (f i)
blueprint
Lemma 1.384

Let \(a\in K\left[ \left[ x\right] \right] \) be an FPS. Let \(\left( f_{i}\right) _{i\in J}\in K\left[ \left[ x\right] \right] ^{J}\) be a summable family of FPSs. Let \(n\in \mathbb {N}\). Assume that each \(i\in J\) satisfies

\begin{equation} \left[ x^{m}\right] \left( f_{i}\right) =0\ \ \ \ \ \ \ \ \ \ \text{for each }m\in \left\{ 0,1,\ldots ,n\right\} . \label{eq.lem.fps.prod.irlv.inf.ass}\end{equation}

Then,

\[ \left[ x^{m}\right] \left( a\prod _{i\in J}\left( 1+f_{i}\right) \right) =\left[ x^{m}\right] a\ \ \ \ \ \ \ \ \ \ \text{for each }m\in \left\{ 0,1,\ldots ,n\right\} . \]
theorem coeff_mul_tprod_one_add_eq_coeff {K : Type u_1} [CommRing K] [TopologicalSpace K] [T2Space K] {J : Type u_2} (a : PowerSeries K) (f : JPowerSeries K) (_hf_summable : Summable f) (n : ) (hf_order : ∀ (i : J), mn, (PowerSeries.coeff m) (f i) = 0) (m : ) :
m n(PowerSeries.coeff m) (a * ∏' (i : J), (1 + f i)) = (PowerSeries.coeff m) a

Another example

blueprint
Proposition 1.395 Euler

We have

\[ \prod _{i{\gt}0}\left( 1-x^{2i-1}\right) ^{-1}=\prod _{k{\gt}0}\left( 1+x^{k}\right) . \]
blueprint
Theorem 1.396 Euler

Let \(n\in \mathbb {N}\). Then, \(d_{n}=o_{n}\), where

  • \(d_{n}\) is the number of ways to write \(n\) as a sum of distinct positive integers, without regard to the order;

  • \(o_{n}\) is the number of ways to write \(n\) as a sum of (not necessarily distinct) odd positive integers, without regard to the order.

Infinite products and substitution

blueprint
Proposition 1.399

If \(\left( f_{i}\right) _{i\in I}\in K\left[ \left[ x\right] \right] ^{I}\) is a multipliable family of FPSs, and if \(g\in K\left[ \left[ x\right] \right] \) is an FPS satisfying \(\left[ x^{0}\right] g=0\), then the family \(\left( f_{i}\circ g\right) _{i\in I}\in K\left[ \left[ x\right] \right] ^{I}\) is multipliable as well and we have \(\left( \prod _{i\in I}f_{i}\right) \circ g=\prod _{i\in I}\left( f_{i}\circ g\right) \).

theorem tprod_rescale_substitution {K : Type u_1} [CommRing K] [TopologicalSpace K] [IsTopologicalRing K] [T2Space K] {I : Type u_2} (f : IPowerSeries K) (a : K) (hf : Multipliable f) :
(PowerSeries.rescale a) (∏' (i : I), f i) = ∏' (i : I), (PowerSeries.rescale a) (f i)

Exponentials, logarithms and infinite products

blueprint
Proposition 1.400

Assume that \(K\) is a commutative \(\mathbb {Q}\)-algebra. Let \(\left( f_{i}\right) _{i\in I}\in K\left[ \left[ x\right] \right] ^{I}\) be a summable family of FPSs in \(K\left[ \left[ x\right] \right] _{0}\). Then, \(\left( \operatorname {Exp}f_{i}\right) _{i\in I}\) is a multipliable family of FPS in \(K\left[ \left[ x\right] \right] _{1}\), and we have \(\sum _{i\in I}f_{i}\in K\left[ \left[ x\right] \right] _{0}\) and

\[ \operatorname {Exp}\left( \sum _{i\in I}f_{i}\right) =\prod _{i\in I}\left( \operatorname {Exp}f_{i}\right) . \]
theorem PowerSeries.Exp_sum {K : Type u_2} [CommRing K] [Algebra K] {I : Type u_3} (g : IPowerSeries₀) (hg : SummableFPS₀ g) (hg_mul : MultipliableFPS₁ fun (i : I) => Exp (g i) := ) :
Exp (summableFPS₀Sum g hg) = multipliableFPS₁Prod (fun (i : I) => Exp (g i)) hg_mul
theorem PowerSeries.Exp_multipliable_of_summable {K : Type u_2} [CommRing K] [Algebra K] {I : Type u_3} (g : IPowerSeries₀) (hg : SummableFPS₀ g) :
MultipliableFPS₁ fun (i : I) => Exp (g i)
blueprint
Proposition 1.401

Assume that \(K\) is a commutative \(\mathbb {Q}\)-algebra. Let \(\left( f_{i}\right) _{i\in I}\in K\left[ \left[ x\right] \right] ^{I}\) be a multipliable family of FPSs in \(K\left[ \left[ x\right] \right] _{1}\). Then, \(\left( \operatorname {Log}f_{i}\right) _{i\in I}\) is a summable family of FPS in \(K\left[ \left[ x\right] \right] _{0}\), and we have \(\prod \limits _{i\in I}f_{i}\in K\left[ \left[ x\right] \right] _{1}\) and

\[ \operatorname {Log}\left( \prod \limits _{i\in I}f_{i}\right) =\sum _{i\in I}\left( \operatorname {Log}f_{i}\right) . \]
theorem PowerSeries.Log_tprod {K : Type u_2} [CommRing K] [Algebra K] {I : Type u_3} (f : IPowerSeries₁) (hf : MultipliableFPS₁ f) (hf_sum : SummableFPS₀ fun (i : I) => Log (f i) := ) :
Log (multipliableFPS₁Prod f hf) = summableFPS₀Sum (fun (i : I) => Log (f i)) hf_sum
theorem PowerSeries.Log_summable_of_multipliable {K : Type u_2} [CommRing K] [Algebra K] {I : Type u_3} (f : IPowerSeries₁) (hf : MultipliableFPS₁ f) :
SummableFPS₀ fun (i : I) => Log (f i)

The generating function of a weighted set

The theory

blueprint
Definition 1.402

(a) A weighted set is a set \(A\) equipped with a function \(w:A\rightarrow \mathbb {N}\), which is called the weight function of this weighted set. For each \(a\in A\), the value \(w\left( a\right) \) is denoted \(\left\vert a\right\vert \) and is called the weight of \(a\) (in our weighted set).

Usually, instead of explicitly specifying the weight function \(w\) as a function, we will simply specify the weight \(\left\vert a\right\vert \) for each \(a\in A\). The weighted set consisting of the set \(A\) and the weight function \(w\) will be called \(\left( A,w\right) \) or simply \(A\) when the weight function \(w\) is clear from the context.

(b) A weighted set \(A\) is said to be finite-type if for each \(n\in \mathbb {N}\), there are only finitely many \(a\in A\) having weight \(\left\vert a\right\vert =n\).

(c) If \(A\) is a finite-type weighted set, then the weight generating function of \(A\) is defined to be the FPS

\[ \sum _{a\in A}x^{\left\vert a\right\vert }=\sum _{n\in \mathbb {N}}\left( \text{\# of }a\in A\text{ having weight }n\right) \cdot x^{n}\in \mathbb {Z}\left[ \left[ x\right] \right] . \]

This FPS is denoted by \(\overline{A}\).

(d) An isomorphism between two weighted sets \(A\) and \(B\) means a bijection \(\rho :A\rightarrow B\) that preserves the weight (i.e., each \(a\in A\) satisfies \(\left\vert \rho \left( a\right) \right\vert =\left\vert a\right\vert \)).

(e) We say that two weighted sets \(A\) and \(B\) are isomorphic (this is written \(A\cong B\)) if there exists an isomorphism between \(A\) and \(B\).

structure WeightedSet (α : Type u_2) :
Type u_2
  • weight : α

    The weight function assigning a natural number to each element

def WeightedSet.weightGenFun {R : Type u_1} [CommSemiring R] {α : Type u_2} (W : WeightedSet α) (hft : W.IsFiniteType) :
structure WeightedSet.Isomorphism {α : Type u_2} {β : Type u_3} (W₁ : WeightedSet α) (W₂ : WeightedSet β) :
Type (max u_2 u_3)
  • toEquiv : α β

    The underlying bijection

  • weight_eq (a : α) : W₂.weight (self.toEquiv a) = W₁.weight a

    The bijection preserves weights

def WeightedSet.AreIsomorphic {α : Type u_2} {β : Type u_3} (W₁ : WeightedSet α) (W₂ : WeightedSet β) :
blueprint
Proposition 1.403

Let \(A\) and \(B\) be two isomorphic finite-type weighted sets. Then, \(\overline{A}=\overline{B}\).

theorem WeightedSet.weightGenFun_eq_of_isomorphic {R : Type u_1} [CommSemiring R] {α : Type u_2} {β : Type u_3} (W₁ : WeightedSet α) (W₂ : WeightedSet β) (hft₁ : W₁.IsFiniteType) (hft₂ : W₂.IsFiniteType) (h : W₁ ≅ᵥ W₂) :
W₁.weightGenFun hft₁ = W₂.weightGenFun hft₂
blueprint
Definition 1.404

Let \(A\) and \(B\) be two weighted sets. Then, the weighted set \(A+B\) is defined to be the disjoint union of \(A\) and \(B\), with the weight function inherited from \(A\) and \(B\) (meaning that each element of \(A\) has the same weight that it had in \(A\), and each element of \(B\) has the same weight that it had in \(B\)). Formally speaking, this means that \(A+B\) is the set \(\left( \left\{ 0\right\} \times A\right) \cup \left( \left\{ 1\right\} \times B\right) \), with the weight function given by

\begin{equation} \left\vert \left( 0,a\right) \right\vert =\left\vert a\right\vert \ \ \ \ \ \ \ \ \ \ \text{for each }a\in A \label{eq.def.gf-ws.djun.wt0}\end{equation}

and

\begin{equation} \left\vert \left( 1,b\right) \right\vert =\left\vert b\right\vert \ \ \ \ \ \ \ \ \ \ \text{for each }b\in B. \label{eq.def.gf-ws.djun.wt1}\end{equation}

def WeightedSet.disjointUnion {α : Type u_2} {β : Type u_3} (W₁ : WeightedSet α) (W₂ : WeightedSet β) :
blueprint
Proposition 1.405

Let \(A\) and \(B\) be two finite-type weighted sets. Then, \(A+B\) is finite-type, too, and satisfies \(\overline{A+B}=\overline{A}+\overline{B}\).

theorem WeightedSet.disjointUnion_isFiniteType {α : Type u_2} {β : Type u_3} (W₁ : WeightedSet α) (W₂ : WeightedSet β) (hft₁ : W₁.IsFiniteType) (hft₂ : W₂.IsFiniteType) :
(W₁ +ᵥ W₂).IsFiniteType
theorem WeightedSet.weightGenFun_disjointUnion {R : Type u_1} [CommSemiring R] {α : Type u_2} {β : Type u_3} (W₁ : WeightedSet α) (W₂ : WeightedSet β) (hft₁ : W₁.IsFiniteType) (hft₂ : W₂.IsFiniteType) :
(W₁ +ᵥ W₂).weightGenFun = W₁.weightGenFun hft₁ + W₂.weightGenFun hft₂
blueprint
Definition 1.406

Let \(A\) and \(B\) be two weighted sets. Then, the weighted set \(A\times B\) is defined to be the Cartesian product of the sets \(A\) and \(B\) (that is, the set \(\left\{ \left( a,b\right) \ \mid \ a\in A\text{ and }b\in B\right\} \)), with the weight function defined as follows: For any \(\left( a,b\right) \in A\times B\), we set

\begin{equation} \left\vert \left( a,b\right) \right\vert =\left\vert a\right\vert +\left\vert b\right\vert . \label{eq.def.gf-ws.prod.wt}\end{equation}

def WeightedSet.prod {α : Type u_2} {β : Type u_3} (W₁ : WeightedSet α) (W₂ : WeightedSet β) :
WeightedSet (α × β)
blueprint
Definition 1.408

Let \(A\) be a weighted set. Then, \(A^{k}\) (for \(k\in \mathbb {N}\)) means the weighted set \(\underbrace{A\times A\times \cdots \times A}_{k\text{ times}}\).

theorem WeightedSet.prod_isFiniteType {α : Type u_2} {β : Type u_3} (W₁ : WeightedSet α) (W₂ : WeightedSet β) (hft₁ : W₁.IsFiniteType) (hft₂ : W₂.IsFiniteType) :
(W₁ ×ᵥ W₂).IsFiniteType
theorem WeightedSet.weightGenFun_prod {R : Type u_1} [CommSemiring R] {α : Type u_2} {β : Type u_3} [DecidableEq α] [DecidableEq β] (W₁ : WeightedSet α) (W₂ : WeightedSet β) (hft₁ : W₁.IsFiniteType) (hft₂ : W₂.IsFiniteType) :
(W₁ ×ᵥ W₂).weightGenFun = W₁.weightGenFun hft₁ * W₂.weightGenFun hft₂
blueprint
Proposition 1.409

Let \(A\) be a finite-type weighted set. Let \(k\in \mathbb {N}\). Then, \(A^{k}\) is finite-type, too, and satisfies \(\overline{A^{k}}=\overline{A}^{k}\).

theorem WeightedSet.pow_isFiniteType {α : Type u_2} (W : WeightedSet α) (hft : W.IsFiniteType) (k : ) :
theorem WeightedSet.weightGenFun_pow {R : Type u_1} [CommSemiring R] {α : Type u_2} (W : WeightedSet α) (hft : W.IsFiniteType) (k : ) :
(W.pow k).weightGenFun = W.weightGenFun hft ^ k

Domino tilings

blueprint
Definition 1.412

(a) A shape means a subset of \(\mathbb {Z}^{2}\).

We draw each \(\left( i,j\right) \in \mathbb {Z}^{2}\) as a unit square with center at the point \(\left( i,j\right) \) (in Cartesian coordinates); thus, a shape can be drawn as a cluster of squares.

(b) For any \(n,m\in \mathbb {N}\), the shape \(R_{n,m}\) (called the \(n\times m\)-rectangle) is defined to be

\[ \left\{ 1,2,\ldots ,n\right\} \times \left\{ 1,2,\ldots ,m\right\} =\left\{ \left( i,j\right) \in \mathbb {Z}^{2}\ \mid \ 1\leq i\leq n\text{ and }1\leq j\leq m\right\} . \]

(c) A domino means a size-\(2\) shape of the form

\begin{align*} & \left\{ \left( i,j\right) ,\ \left( i+1,j\right) \right\} \text{ (a ``\emph{horizontal domino}'')}\ \ \ \ \ \ \ \ \ \ \text{or}\\ & \left\{ \left( i,j\right) ,\ \left( i,j+1\right) \right\} \text{ (a ``\emph{vertical domino}'')}\end{align*}

for some \(\left( i,j\right) \in \mathbb {Z}^{2}\).

(d) A domino tiling of a shape \(S\) is a set partition of \(S\) into dominos (i.e., a set of disjoint dominos whose union is \(S\)).

(e) For any \(n,m\in \mathbb {N}\), let \(d_{n,m}\) be the # of domino tilings of \(R_{n,m}\).

blueprint
Lemma 1.413

Any domino tiling of a height-\(2\) rectangle can be decomposed uniquely into a tuple of faultfree tilings of (usually smaller) height-\(2\) rectangles, by cutting it along its faults. (If the original tiling was faultfree, then it decomposes into a \(1\)-tuple. If the original tiling was empty, then it decomposes into a \(0\)-tuple.)

Moreover, the sum of the weights of the faultfree tilings in the tuple is the weight of the original tiling. (In other words, if a tiling \(T\) decomposes into the tuple \(\left( T_{1},T_{2},\ldots ,T_{k}\right) \), then \(\left\vert T\right\vert =\left\vert T_{1}\right\vert +\left\vert T_{2}\right\vert +\cdots +\left\vert T_{k}\right\vert \).)

In the language of weighted sets, this yields an isomorphism

\[ D\cong F^{0}+F^{1}+F^{2}+F^{3}+\cdots , \]

and therefore, by the infinite analogue of Proposition 1.405,

\[ \overline{D} =\overline{F^{0}+F^{1}+F^{2}+F^{3}+\cdots }=\overline{F^{0}}+\overline{F^{1}}+\overline{F^{2}}+\overline{F^{3}}+\cdots . \]

By Proposition 1.409, this equals

\[ \overline{F}^{0}+\overline{F}^{1}+\overline{F}^{2}+\overline{F}^{3}+\cdots =\frac{1}{1-\overline{F}}. \]
  • One or more equations did not get rendered due to their size.

Limits of FPSs

Stabilization of scalars

blueprint
Definition 1.444

Let \(\left( a_{i}\right) _{i\in \mathbb {N}}=\left( a_{0},a_{1},a_{2},\ldots \right) \in K^{\mathbb {N}}\) be a sequence of elements of \(K\). Let \(a\in K\).

We say that the sequence \(\left( a_{i}\right) _{i\in \mathbb {N}}\) stabilizes to \(a\) if there exists some \(N\in \mathbb {N}\) such that

\[ \text{all integers }i\geq N\text{ satisfy }a_{i}=a. \]

If \(a_{i}\) stabilizes to \(a\) as \(i\rightarrow \infty \), then we write \(\lim \limits _{i\rightarrow \infty }a_{i}=a\) and say that \(a\) is the limit (or eventual value) of \(\left( a_{i}\right) _{i\in \mathbb {N}}\). This is legitimate, since \(a\) is uniquely determined by the sequence \(\left( a_{i}\right) _{i\in \mathbb {N}}\).

def Seq.StabilizesTo {K : Type u_1} (a : K) (lim : K) :

Coefficientwise stabilization of FPSs

blueprint
Definition 1.453

Let \(\left( f_{i}\right) _{i\in \mathbb {N}}\in K\left[ \left[ x\right] \right] ^{\mathbb {N}}\) be a sequence of FPSs over \(K\). Let \(f\in K\left[ \left[ x\right] \right] \) be an FPS.

We say that \(\left( f_{i}\right) _{i\in \mathbb {N}}\) coefficientwise stabilizes to \(f\) if for each \(n\in \mathbb {N}\),

\[ \text{the sequence }\left( \left[ x^{n}\right] f_{i}\right) _{i\in \mathbb {N}}\text{ stabilizes to }\left[ x^{n}\right] f. \]

If \(f_{i}\) coefficientwise stabilizes to \(f\) as \(i\rightarrow \infty \), then we write \(\lim \limits _{i\rightarrow \infty }f_{i}=f\) and say that \(f\) is the limit of \(\left( f_{i}\right) _{i\in \mathbb {N}}\). This is legitimate, because \(f\) is uniquely determined by the sequence \(\left( f_{i}\right) _{i\in \mathbb {N}}\).

Some properties of limits

blueprint
Theorem 1.461

Let \(\left( f_{i}\right) _{i\in \mathbb {N}}\in K\left[ \left[ x\right] \right] ^{\mathbb {N}}\) be a sequence of FPSs. Assume that for each \(n\in \mathbb {N}\), there exists some \(g_{n}\in K\) such that the sequence \(\left( \left[ x^{n}\right] f_{i}\right) _{i\in \mathbb {N}}\) stabilizes to \(g_{n}\). Then, the sequence \(\left( f_{i}\right) _{i\in \mathbb {N}}\) coefficientwise stabilizes to \(\sum _{n\in \mathbb {N}}g_{n}x^{n}\). (That is, \(\lim \limits _{i\rightarrow \infty }f_{i}=\sum _{n\in \mathbb {N}}g_{n}x^{n}\).)

theorem PowerSeries.coeffStabilizesTo_of_forall_coeff_stabilizes {K : Type u_1} [CommRing K] {f : PowerSeries K} {g : K} (h : ∀ (n : ), Seq.StabilizesTo (fun (i : ) => (coeff n) (f i)) (g n)) :
blueprint
Lemma 1.462

Assume that \(\left( f_{i}\right) _{i\in \mathbb {N}}\) is a sequence of FPSs, and that \(f\) is an FPS such that \(\lim \limits _{i\rightarrow \infty }f_{i}=f\). Then, for each \(n\in \mathbb {N}\), there exists some integer \(N\in \mathbb {N}\) such that

\[ \text{all integers }i\geq N\text{ satisfy }f_{i}\overset {x^{n}}{\equiv }f. \]
theorem PowerSeries.exists_xnEquiv_of_coeffStabilizesTo {K : Type u_1} [CommRing K] {f : PowerSeries K} {lim : PowerSeries K} (h : CoeffStabilizesTo f lim) (n : ) :
∃ (N : ), iN, f i ≡[x^n] lim
blueprint
Proposition 1.463

Assume that \(\left( f_{i}\right) _{i\in \mathbb {N}}\) and \(\left( g_{i}\right) _{i\in \mathbb {N}}\) are two sequences of FPSs, and that \(f\) and \(g\) are two FPSs such that

\[ \lim \limits _{i\rightarrow \infty }f_{i}=f\ \ \ \ \ \ \ \ \ \ \text{and}\ \ \ \ \ \ \ \ \ \ \lim \limits _{i\rightarrow \infty }g_{i}=g. \]

Then,

\[ \lim \limits _{i\rightarrow \infty }\left( f_{i}+g_{i}\right) =f+g\ \ \ \ \ \ \ \ \ \ \text{and}\ \ \ \ \ \ \ \ \ \ \lim \limits _{i\rightarrow \infty }\left( f_{i}g_{i}\right) =fg. \]
theorem PowerSeries.coeffStabilizesTo_add {K : Type u_1} [CommRing K] {f g : PowerSeries K} {lf lg : PowerSeries K} (hf : CoeffStabilizesTo f lf) (hg : CoeffStabilizesTo g lg) :
CoeffStabilizesTo (fun (i : ) => f i + g i) (lf + lg)
theorem PowerSeries.coeffStabilizesTo_mul {K : Type u_1} [CommRing K] {f g : PowerSeries K} {lf lg : PowerSeries K} (hf : CoeffStabilizesTo f lf) (hg : CoeffStabilizesTo g lg) :
CoeffStabilizesTo (fun (i : ) => f i * g i) (lf * lg)
blueprint
Corollary 1.466

Let \(k\in \mathbb {N}\). For each \(i\in \left\{ 1,2,\ldots ,k\right\} \), let \(f_{i}\) be an FPS, and let \(\left( f_{i,n}\right) _{n\in \mathbb {N}}\) be a sequence of FPSs such that

\[ \lim \limits _{n\rightarrow \infty }\left( f_{i,n}\right) =f_{i} \]

(note that it is \(n\), not \(i\), that goes to \(\infty \) here!). Then,

\[ \lim \limits _{n\rightarrow \infty }\sum _{i=1}^{k}f_{i,n}=\sum _{i=1}^{k}f_{i}\ \ \ \ \ \ \ \ \ \ \text{and}\ \ \ \ \ \ \ \ \ \ \lim \limits _{n\rightarrow \infty }\prod _{i=1}^{k}f_{i,n}=\prod _{i=1}^{k}f_{i}. \]
theorem PowerSeries.coeffStabilizesTo_finset_sum {K : Type u_1} [CommRing K] {ι : Type u_2} (s : Finset ι) {f : ιPowerSeries K} {lf : ιPowerSeries K} (h : is, CoeffStabilizesTo (f i) (lf i)) :
CoeffStabilizesTo (fun (n : ) => is, f i n) (∑ is, lf i)
theorem PowerSeries.coeffStabilizesTo_finset_prod {K : Type u_1} [CommRing K] {ι : Type u_2} (s : Finset ι) {f : ιPowerSeries K} {lf : ιPowerSeries K} (h : is, CoeffStabilizesTo (f i) (lf i)) :
CoeffStabilizesTo (fun (n : ) => is, f i n) (∏ is, lf i)
blueprint
Proposition 1.468

Assume that \(\left( f_{i}\right) _{i\in \mathbb {N}}\) and \(\left( g_{i}\right) _{i\in \mathbb {N}}\) are two sequences of FPSs, and that \(f\) and \(g\) are two FPSs such that

\[ \lim \limits _{i\rightarrow \infty }f_{i}=f\ \ \ \ \ \ \ \ \ \ \text{and}\ \ \ \ \ \ \ \ \ \ \lim \limits _{i\rightarrow \infty }g_{i}=g. \]

Assume that each FPS \(g_{i}\) is invertible. Then, \(g\) is also invertible, and we have

\[ \lim \limits _{i\rightarrow \infty }\frac{f_{i}}{g_{i}}=\frac{f}{g}. \]
theorem PowerSeries.coeffStabilizesTo_mul_inv {K : Type u_1} [CommRing K] {f g : PowerSeries K} {lf lg : PowerSeries K} (hf : CoeffStabilizesTo f lf) (hg : CoeffStabilizesTo g lg) (hunit : ∀ (i : ), IsUnit (constantCoeff (g i))) :
CoeffStabilizesTo (fun (i : ) => f i * (g i).invOfUnit .unit) (lf * lg.invOfUnit .unit)
blueprint
Proposition 1.469

Assume that \(\left( f_{i}\right) _{i\in \mathbb {N}}\) and \(\left( g_{i}\right) _{i\in \mathbb {N}}\) are two sequences of FPSs, and that \(f\) and \(g\) are two FPSs such that

\[ \lim \limits _{i\rightarrow \infty }f_{i}=f\ \ \ \ \ \ \ \ \ \ \text{and}\ \ \ \ \ \ \ \ \ \ \lim \limits _{i\rightarrow \infty }g_{i}=g. \]

Assume that \(\left[ x^{0}\right] g_{i}=0\) for each \(i\in \mathbb {N}\). Then, \(\left[ x^{0}\right] g=0\) and

\[ \lim \limits _{i\rightarrow \infty }\left( f_{i}\circ g_{i}\right) =f\circ g. \]
theorem PowerSeries.coeffStabilizesTo_subst {K : Type u_1} [CommRing K] {f g : PowerSeries K} {lf lg : PowerSeries K} (hf : CoeffStabilizesTo f lf) (hg : CoeffStabilizesTo g lg) (hconst : ∀ (i : ), constantCoeff (g i) = 0) :
CoeffStabilizesTo (fun (i : ) => subst (g i) (f i)) (subst lg lf)
blueprint
Proposition 1.470

Let \(\left( f_{n}\right) _{n\in \mathbb {N}}\) be a sequence of FPSs, and let \(f\) be an FPS such that

\[ \lim \limits _{i\rightarrow \infty }f_{i}=f. \]

Then,

\[ \lim \limits _{i\rightarrow \infty }f_{i}^{\prime }=f^{\prime }. \]
blueprint
Theorem 1.475

Let \(\left( f_{n}\right) _{n\in \mathbb {N}}\) be a summable sequence of FPSs. Then,

\[ \lim \limits _{i\rightarrow \infty }\sum _{n=0}^{i}f_{n}=\sum _{n\in \mathbb {N}}f_{n}. \]

In other words, the infinite sum \(\sum _{n\in \mathbb {N}}f_{n}\) is the limit of the finite partial sums \(\sum _{n=0}^{i}f_{n}\).

theorem PowerSeries.coeffStabilizesTo_partial_sum {K : Type u_1} [CommRing K] {f : PowerSeries K} (hf : IsSummable f) :
CoeffStabilizesTo (fun (i : ) => jFinset.range (i + 1), f j) (tsum' f hf)
blueprint
Theorem 1.476

Let \(\left( f_{n}\right) _{n\in \mathbb {N}}\) be a multipliable sequence of FPSs. Then,

\[ \lim \limits _{i\rightarrow \infty }\prod _{n=0}^{i}f_{n}=\prod _{n\in \mathbb {N}}f_{n}. \]

In other words, the infinite product \(\prod _{n\in \mathbb {N}}f_{n}\) is the limit of the finite partial products \(\prod _{n=0}^{i}f_{n}\).

theorem PowerSeries.coeffStabilizesTo_partial_prod {K : Type u_1} [CommRing K] {f : PowerSeries K} (hf : IsMultipliable f) :
CoeffStabilizesTo (fun (i : ) => jFinset.range (i + 1), f j) (tprod' f hf)
blueprint
Corollary 1.477

Each FPS is a limit of a sequence of polynomials. Indeed, if \(a=\sum _{n\in \mathbb {N}}a_{n}x^{n}\) (with \(a_{n}\in K\)), then

\[ a=\lim \limits _{i\rightarrow \infty }\sum _{n=0}^{i}a_{n}x^{n}. \]

More precisely, the sequence of truncations \((\operatorname {trunc}_{i+1}(a))_{i \in \mathbb {N}}\) coefficientwise stabilizes to \(a\).

theorem PowerSeries.coeffStabilizesTo_trunc {K : Type u_1} [CommRing K] (a : PowerSeries K) :
CoeffStabilizesTo (fun (i : ) => ((trunc (i + 1)) a)) a
blueprint
Theorem 1.478

Let \(\left( f_{0},f_{1},f_{2},\ldots \right) \) be a sequence of FPSs such that \(\lim \limits _{i\rightarrow \infty }\sum _{n=0}^{i}f_{n}\) exists. Then, the family \(\left( f_{n}\right) _{n\in \mathbb {N}}\) is summable, and satisfies

\[ \sum _{n\in \mathbb {N}}f_{n}=\lim \limits _{i\rightarrow \infty }\sum _{n=0}^{i}f_{n}. \]
theorem PowerSeries.isSummable_of_coeffStabilizesTo_partial_sum {K : Type u_1} [CommRing K] {f : PowerSeries K} {lim : PowerSeries K} (h : CoeffStabilizesTo (fun (i : ) => jFinset.range (i + 1), f j) lim) :
theorem PowerSeries.tsum'_eq_of_coeffStabilizesTo_partial_sum {K : Type u_1} [CommRing K] {f : PowerSeries K} {lim : PowerSeries K} (h : CoeffStabilizesTo (fun (i : ) => jFinset.range (i + 1), f j) lim) :
tsum' f = lim
blueprint
Theorem 1.479

Let \(\left( f_{0},f_{1},f_{2},\ldots \right) \) be a sequence of FPSs such that \(\lim \limits _{i\rightarrow \infty }\prod _{n=0}^{i}f_{n}\) exists. Then, the family \(\left( f_{n}\right) _{n\in \mathbb {N}}\) is multipliable, and satisfies

\[ \prod _{n\in \mathbb {N}}f_{n}=\lim \limits _{i\rightarrow \infty }\prod _{n=0}^{i}f_{n}. \]
theorem PowerSeries.isMultipliable_of_coeffStabilizesTo_partial_prod {K : Type u_1} [CommRing K] {f : PowerSeries K} {lim : PowerSeries K} (h : CoeffStabilizesTo (fun (i : ) => jFinset.range (i + 1), f j) lim) (hconst : ∀ (i : ), constantCoeff (f i) = 1) :
theorem PowerSeries.tprod'_eq_of_coeffStabilizesTo_partial_prod {K : Type u_1} [CommRing K] {f : PowerSeries K} {lim : PowerSeries K} (h : CoeffStabilizesTo (fun (i : ) => jFinset.range (i + 1), f j) lim) (hconst : ∀ (i : ), constantCoeff (f i) = 1) :
tprod' f = lim

Laurent power series

Motivation

The space $K\left[ \left[ x^{\pm}\right] \right] $

blueprint
Definition 1.494

Let \(K\left[ \left[ x^{\pm }\right] \right] \) be the \(K\)-module \(K^{\mathbb {Z}}\) of all families \(\left( a_{n}\right) _{n\in \mathbb {Z}}=\left( \ldots ,a_{-2},a_{-1},a_{0},a_{1},a_{2},\ldots \right) \) of elements of \(K\). Its addition and its scaling are defined entrywise:

\begin{align*} \left( a_{n}\right) _{n\in \mathbb {Z}}+\left( b_{n}\right) _{n\in \mathbb {Z}} & =\left( a_{n}+b_{n}\right) _{n\in \mathbb {Z}};\\ \lambda \left( a_{n}\right) _{n\in \mathbb {Z}} & =\left( \lambda a_{n}\right) _{n\in \mathbb {Z}}\ \ \ \ \ \ \ \ \ \ \text{for each }\lambda \in K. \end{align*}

An element of \(K\left[ \left[ x^{\pm }\right] \right] \) will be called a doubly infinite power series. We use the notation \(\sum _{n\in \mathbb {Z}}a_{n}x^{n}\) for a family \(\left( a_{n}\right) _{n\in \mathbb {Z}}\in K\left[ \left[ x^{\pm }\right] \right] \).

Laurent polynomials

blueprint
Definition 1.497

Let \(K\left[ x^{\pm }\right] \) be the \(K\)-submodule of \(K\left[ \left[ x^{\pm }\right] \right] \) consisting of all essentially finite families \(\left( a_{n}\right) _{n\in \mathbb {Z}}\). The elements of \(K\left[ x^{\pm }\right] \) are called Laurent polynomials in the indeterminate \(x\) over \(K\).

We define a multiplication on \(K\left[ x^{\pm }\right] \) by setting

\[ \left( a_{n}\right) _{n\in \mathbb {Z}}\cdot \left( b_{n}\right) _{n\in \mathbb {Z}}=\left( c_{n}\right) _{n\in \mathbb {Z}},\ \ \ \ \ \ \ \ \ \ \text{where}\ \ \ \ \ \ \ \ \ \ c_{n}=\sum _{i\in \mathbb {Z}}a_{i}b_{n-i}. \]

The sum \(\sum _{i\in \mathbb {Z}}a_{i}b_{n-i}\) is well-defined because it is essentially finite.

We define an element \(x\in K\left[ x^{\pm }\right] \) by

\[ x=\left( \delta _{i,1}\right) _{i\in \mathbb {Z}}. \]

In Mathlib, Laurent polynomials are represented as finitely supported functions \(\mathbb {Z} \to K\) (the group algebra of \(\mathbb {Z}\) over \(K\)).

blueprint
Proposition 1.505

Any doubly infinite power series \(a=\left( a_{i}\right) _{i\in \mathbb {Z}}\in K\left[ \left[ x^{\pm }\right] \right] \) satisfies

\[ a=\sum _{i\in \mathbb {Z}}a_{i}x^{i}. \]

Here, the powers \(x^{i}\) are taken in the Laurent polynomial ring \(K\left[ x^{\pm }\right] \), but the infinite sum \(\sum _{i\in \mathbb {Z}}a_{i}x^{i}\) is taken in the \(K\)-module \(K\left[ \left[ x^{\pm }\right] \right] \).

For Laurent polynomials, the sum is finite and the identity holds in \(K[x^{\pm }]\) itself. For Laurent series, the identity is formalized using a summable family construction.

Laurent series

blueprint
Definition 1.506

We let \(K\left( \left( x\right) \right) \) be the subset of \(K\left[ \left[ x^{\pm }\right] \right] \) consisting of all families \(\left( a_{i}\right) _{i\in \mathbb {Z}}\in K\left[ \left[ x^{\pm }\right] \right] \) such that the sequence \(\left( a_{-1},a_{-2},a_{-3},\ldots \right) \) is essentially finite – i.e., such that all sufficiently low \(i\in \mathbb {Z}\) satisfy \(a_{i}=0\).

The elements of \(K\left( \left( x\right) \right) \) are called Laurent series in one indeterminate \(x\) over \(K\).

In Mathlib, Laurent series are implemented as Hahn series over \(\mathbb {Z}\) with coefficients in \(K\), which are functions \(\mathbb {Z} \to K\) whose support is well-founded (equivalently, bounded below). The formalization also provides a predicate on doubly infinite power series that captures this textbook definition.

blueprint
Theorem 1.509

The subset \(K\left( \left( x\right) \right) \) is a \(K\)-submodule of \(K\left[ \left[ x^{\pm }\right] \right] \). It has a multiplication given by the same convolution rule as \(K\left[ x^{\pm }\right] \): namely,

\[ \left( a_{n}\right) _{n\in \mathbb {Z}}\cdot \left( b_{n}\right) _{n\in \mathbb {Z}}=\left( c_{n}\right) _{n\in \mathbb {Z}},\ \ \ \ \ \ \ \ \ \ \text{where}\ \ \ \ \ \ \ \ \ \ c_{n}=\sum _{i\in \mathbb {Z}}a_{i}b_{n-i}. \]

The sum \(\sum _{i\in \mathbb {Z}}a_{i}b_{n-i}\) is well-defined because for sufficiently low \(i\) we have \(a_i = 0\), and for sufficiently high \(i\) we have \(b_{n-i} = 0\).

Equipped with this multiplication, \(K\left( \left( x\right) \right) \) is a commutative \(K\)-algebra with unity \(\left( \delta _{i,0}\right) _{i\in \mathbb {Z}}\). The element \(x\) is invertible in this algebra.

Multivariate FPSs

blueprint
Proposition 1.525

Let \(f_{0},f_{1},f_{2},\ldots \) and \(g_{0},g_{1},g_{2},\ldots \) be FPSs in a single variable \(x\) such that

\begin{equation} \sum _{k\in \mathbb {N}}f_{k}y^{k}=\sum _{k\in \mathbb {N}}g_{k}y^{k}\ \ \ \ \ \ \ \ \ \ \text{in }K\left[ \left[ x,y\right] \right] . \label{eq.prop.fps.mulvar.comp-y-coeff.ass} \end{equation}

Then, \(f_{k}=g_{k}\) for each \(k\in \mathbb {N}\).

Partition basics

Definitions

blueprint
Definition 2.1

(a) An (integer) partition means a (finite) weakly decreasing tuple of positive integers – i.e., a finite tuple \(\left( \lambda _{1},\lambda _{2},\ldots ,\lambda _{m}\right) \) of positive integers such that \(\lambda _{1}\geq \lambda _{2}\geq \cdots \geq \lambda _{m}\).

Thus, partitions are the same as weakly decreasing compositions. Hence, the notions of size and length of a partition are automatically defined, since we have defined them for compositions (in Definition 1.291).

(b) The parts of a partition \(\left( \lambda _{1},\lambda _{2},\ldots ,\lambda _{m}\right) \) are simply its entries \(\lambda _{1},\lambda _{2},\ldots ,\lambda _{m}\).

(c) Let \(n\in \mathbb {Z}\). A partition of \(n\) means a partition whose size is \(n\).

(d) Let \(n\in \mathbb {Z}\) and \(k\in \mathbb {N}\). A partition of \(n\) into \(k\) parts is a partition whose size is \(n\) and whose length is \(k\).

structure Nat.Partition (n : ) :
theorem Nat.Partition.size_eq {n : } (p : n.Partition) :
p.parts.sum = n
theorem Nat.Partition.parts_pos' {n : } (p : n.Partition) (i : ) (hi : i p.parts) :
0 < i
def Nat.Partition.ofList' {n : } (l : List ) (hl_pos : il, 0 < i) (hl_sum : l.sum = n) :
theorem Nat.Partition.eq_iff_parts_eq {n : } (p q : n.Partition) :
p = q p.parts = q.parts
blueprint
Definition 2.10

(a) Let \(n\in \mathbb {Z}\) and \(k\in \mathbb {N}\). Then, we set

\[ p_{k}\left( n\right) :=\left( \text{\# of partitions of }n\text{ into }k\text{ parts}\right) . \]

(b) Let \(n\in \mathbb {Z}\). Then, we set

\[ p\left( n\right) :=\left( \text{\# of partitions of }n\right) . \]

This is called the \(n\)-th partition number.

Simple properties of partition numbers

blueprint
Definition 2.11

We will use the Iverson bracket notation: If \(\mathcal{A}\) is a logical statement, then \(\left[ \mathcal{A} \right]\) means the truth value of \(\mathcal{A}\); this is the integer \(\begin{cases} 1, & \text{if }\mathcal{A}\text{ is true};\\ 0, & \text{if }\mathcal{A}\text{ is false}. \end{cases} \)

Note that the Kronecker delta notation is a particular case of the Iverson bracket: We have

\[ \delta _{i,j}=\left[ i=j \right]\ \ \ \ \ \ \ \ \ \ \text{for any objects }i\text{ and }j. \]
abbrev IversonBracket.iverson (P : Prop) [Decidable P] {α : Type u_1} [Zero α] [One α] :
α
theorem IversonBracket.iverson_true {α : Type u_1} [Zero α] [One α] {P : Prop} [Decidable P] (h : P) :
theorem IversonBracket.iverson_false {α : Type u_1} [Zero α] [One α] {P : Prop} [Decidable P] (h : ¬P) :
theorem IversonBracket.kronecker_eq_iverson {α : Type u_1} [DecidableEq α] {R : Type u_2} [Zero R] [One R] (i j : α) :
(if i = j then 1 else 0) = iverson (i = j)
blueprint
Convention 2.17

We agree to say that the largest part of the empty partition \(\left( {}\right) \) is \(0\) (even though this partition has no parts).

theorem FloorCeiling.floor_def (a : ) (n : ) :
n a n a
theorem FloorCeiling.ceil_def (a : ) (n : ) :
a n a n
theorem FloorCeiling.nat_div_eq_floor (n m : ) (_hm : m 0) :
n / m = n / m⌋₊
blueprint
Proposition 2.22

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

(a) We have \(p_{k}\left( n\right) =0\) whenever \(n{\lt}0\) and \(k\in \mathbb {N}\).

(b) We have \(p_{k}\left( n\right) =0\) whenever \(k{\gt}n\).

(c) We have \(p_{0}\left( n\right) =\left[ n=0 \right]\).

(d) We have \(p_{1}\left( n\right) =\left[ n{\gt}0 \right]\).

(e) We have \(p_{k}\left( n\right) =p_{k}\left( n-k\right) +p_{k-1}\left( n-1\right) \) whenever \(k{\gt}0\).

(f) We have \(p_{2}\left( n\right) =\left\lfloor n/2\right\rfloor \) whenever \(n\in \mathbb {N}\).

(g) We have \(p\left( n\right) =p_{0}\left( n\right) +p_{1}\left( n\right) +\cdots +p_{n}\left( n\right) \) whenever \(n\in \mathbb {N}\).

(h) We have \(p\left( n\right) =0\) whenever \(n{\lt}0\).

theorem Nat.Partition.partsCount_of_gt {k n : } (h : k > n) :
theorem Nat.Partition.partsCount_recurrence {k n : } (hk : k > 0) (hn : n > 0) :
partsCount k n = partsCount k (n - k) + partsCount (k - 1) (n - 1)

The generating function

blueprint
Theorem 2.30

In the FPS ring \(\mathbb {Z}\left[ \left[ x\right] \right] \), we have

\[ \sum _{n\in \mathbb {N}}p\left( n\right) x^{n}=\prod _{k=1}^{\infty }\frac{1}{1-x^{k}}. \]

(The product on the right hand side is well-defined, since multiplying a FPS by \(\frac{1}{1-x^{k}}\) does not affect its first \(k\) coefficients.)

blueprint
Theorem 2.31

Let \(m\in \mathbb {N}\). For each \(n\in \mathbb {N}\), let \(p_{\operatorname {parts}\leq m}\left( n\right) \) be the # of partitions \(\lambda \) of \(n\) such that all parts of \(\lambda \) are \(\leq m\). Then,

\[ \sum _{n\in \mathbb {N}}p_{\operatorname {parts}\leq m}\left( n\right) x^{n}=\prod _{k=1}^{m}\frac{1}{1-x^{k}}. \]
blueprint
Theorem 2.32

Let \(I\) be a subset of \(\left\{ 1,2,3,\ldots \right\} \). For each \(n\in \mathbb {N}\), let \(p_{I}\left( n\right) \) be the # of partitions \(\lambda \) of \(n\) such that all parts of \(\lambda \) belong to \(I\). Then,

\[ \sum _{n\in \mathbb {N}}p_{I}\left( n\right) x^{n}=\prod _{k\in I}\frac{1}{1-x^{k}}. \]
theorem Nat.Partition.partitionCount_genFun_partsIn {R : Type u_1} [CommSemiring R] [TopologicalSpace R] [T2Space R] [IsTopologicalSemiring R] (I : Set ) [DecidablePred fun (x : ) => x I] :
HasProd (fun (k : ) => if k + 1 I then ∑' (j : ), PowerSeries.X ^ ((k + 1) * j) else 1) (PowerSeries.mk fun (n : ) => (partsInCount I n))

Odd parts and distinct parts

blueprint
Definition 2.33

Let \(n\in \mathbb {Z}\).

(a) A partition of \(n\) into odd parts means a partition of \(n\) whose all parts are odd.

(b) A partition of \(n\) into distinct parts means a partition of \(n\) whose parts are distinct.

(c) Let

\begin{align*} p_{\operatorname {odd}}\left( n\right) & :=\left( \text{\# of partitions of }n\text{ into odd parts}\right) \ \ \ \ \ \ \ \ \ \ \text{and}\\ p_{\operatorname {dist}}\left( n\right) & :=\left( \text{\# of partitions of }n\text{ into distinct parts}\right) . \end{align*}
blueprint
Theorem 2.37 Euler’s odd-distinct identity

We have \(p_{\operatorname {odd}}\left( n\right) =p_{\operatorname {dist}}\left( n\right) \) for each \(n\in \mathbb {N}\).

Partitions with a given largest part

blueprint
Proposition 2.46

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

\[ p_{k}\left( n\right) =\left( \text{\# of partitions of }n\text{ whose largest part is }k\right) . \]
blueprint
Corollary 2.47

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

\begin{align*} & p_{0}\left( n\right) +p_{1}\left( n\right) +\cdots +p_{k}\left( n\right) \\ & =\left( \text{\# of partitions of }n\text{ whose largest part is }\leq k\right) . \end{align*}
blueprint
Theorem 2.49

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

\[ \sum _{n\in \mathbb {N}}\left( p_{0}\left( n\right) +p_{1}\left( n\right) +\cdots +p_{m}\left( n\right) \right) x^{n}=\prod _{k=1}^{m}\frac{1}{1-x^{k}}. \]
theorem Nat.Partition.partsCountSum_genFun {R : Type u_1} [CommSemiring R] [TopologicalSpace R] [T2Space R] [IsTopologicalSemiring R] (m : ) :
(PowerSeries.mk fun (n : ) => kFinset.range (m + 1), (partsCount k n)) = kFinset.range m, ∑' (j : ), PowerSeries.X ^ ((k + 1) * j)

Partition number vs. sums of divisors

blueprint
Theorem 2.61

For any positive integer \(n\), let \(\sigma \left( n\right) \) denote the sum of all positive divisors of \(n\). (For example, \(\sigma \left( 6\right) =1+2+3+6=12\) and \(\sigma \left( 7\right) =1+7=8\).)

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

\[ np\left( n\right) =\sum _{k=1}^{n}\sigma \left( k\right) p\left( n-k\right) . \]
blueprint
Theorem 2.60

Let \(I\) be a subset of \(\left\{ 1,2,3,\ldots \right\} \). For each \(n\in \mathbb {N}\), let \(p_{I}\left( n\right) \) be the # of partitions \(\lambda \) of \(n\) such that all parts of \(\lambda \) belong to \(I\).

For any positive integer \(n\), let \(\sigma _{I}\left( n\right) \) denote the sum of all positive divisors of \(n\) that belong to \(I\).

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

\[ np_{I}\left( n\right) =\sum _{k=1}^{n}\sigma _{I}\left( k\right) p_{I}\left( n-k\right) . \]
theorem Nat.Partition.partitionCount_divisorSum_restricted (I : Set ) [DecidablePred fun (x : ) => x I] (hI : iI, i > 0) (n : ) :
n * (restricted n fun (x : ) => x I).card = kFinset.range n, (∑ d(k + 1).divisors with d I, d) * (restricted (n - k - 1) fun (x : ) => x I).card

Euler's pentagonal number theorem

blueprint
Definition 2.67

For any \(k\in \mathbb {Z}\), define a nonnegative integer \(w_{k}\in \mathbb {N}\) by

\[ w_{k}=\frac{\left( 3k-1\right) k}{2}. \]

This is called the \(k\)-th pentagonal number.

blueprint
Theorem 2.68 Euler’s pentagonal number theorem

We have

\[ \prod _{k=1}^{\infty }\left( 1-x^{k}\right) =\sum _{k\in \mathbb {Z}}\left( -1\right) ^{k}x^{w_{k}}. \]
blueprint
Corollary 2.79

For each positive integer \(n\), we have

\begin{align*} p\left( n\right) & =\sum _{\substack {k\in \mathbb {Z};\\ k\neq 0 }}\left( -1\right) ^{k-1}p\left( n-w_{k}\right) \\ & =p\left( n-1\right) +p\left( n-2\right) -p\left( n-5\right) -p\left( n-7\right) \\ & \ \ \ \ \ \ \ \ \ \ +p\left( n-12\right) +p\left( n-15\right) -p\left( n-22\right) -p\left( n-26\right) \pm \cdots . \end{align*}
theorem AlgebraicCombinatorics.partition_recursive (n : ) (hn : n > 0) :
(partitionCount n) = ∑' (k : { k : // k 0 pentagonalNumber k n }), (if (↑k).natAbs % 2 = 1 then 1 else -1) * (partitionCount (n - pentagonalNumber k))

The identity

blueprint
Theorem 2.80 Jacobi’s triple product identity, take 1

In the ring \(\left( \mathbb {Z}\left[ z^{\pm }\right] \right) \left[ \left[ q\right] \right] \), we have

\[ \prod _{n{\gt}0}\left( \left( 1+q^{2n-1}z\right) \left( 1+q^{2n-1} z^{-1}\right) \left( 1-q^{2n}\right) \right) =\sum _{\ell \in \mathbb {Z} }q^{\ell ^{2}}z^{\ell }. \]
blueprint
Theorem 2.81 Jacobi’s triple product identity, take 2

Let \(a\) and \(b\) be two integers such that \(a{\gt}0\) and \(a\geq \left\vert b\right\vert \). Let \(u,v\in \mathbb {Q}\) be rational numbers with \(v\neq 0\). In the ring \(\mathbb {Q}\left[\left[ x\right]\right] \), set \(q=ux^{a}\) and \(z=vx^{b}\). Then,

\[ \prod _{n{\gt}0}\left( \left( 1+q^{2n-1}z\right) \left( 1+q^{2n-1} z^{-1}\right) \left( 1-q^{2n}\right) \right) =\sum _{\ell \in \mathbb {Z} }q^{\ell ^{2}}z^{\ell }. \]
theorem AlgebraicCombinatorics.jacobi_triple_product (a b : ) (ha : a > 0) (hab : a |b|) (u v : ) (hv : v 0) :
jacobiLHSEval a b u v = jacobiRHSEval a b u v

Jacobi implies Euler

blueprint
Lemma 2.119

Let \(K\) be a commutative ring. Let \(f\) and \(g\) be two FPSs in \(K[[x]]\). Assume that \(f[x^{2}]=g[x^{2}]\). Then, \(f=g\).

Application: A recursion for the sum of divisors

blueprint
Theorem 2.130

For any positive integer \(n\), let \(\sigma (n)\) denote the sum of all positive divisors of \(n\).

Then, for each positive integer \(n\), we have

\[ \sum _{\substack {k\in \mathbb {Z};\\ w_{k}{\lt}n}}\left( -1\right) ^{k}\sigma \left( n-w_{k}\right) = \begin{cases} \left( -1\right) ^{k-1}n, & \text{if }n=w_{k}\text{ for some }k\in \mathbb {Z};\\ 0, & \text{if not.} \end{cases} \]

(Here, \(w_{k}\) is the \(k\)-th pentagonal number, defined in Definition 2.67.)

theorem AlgebraicCombinatorics.euler_sum_divisors_recursive (n : ) (_hn : n > 0) :
∑' (k : { k : // pentagonalNumber k < n }), (-1) ^ (↑k).natAbs * ((ArithmeticFunction.sigma 1) (n - pentagonalNumber k)) = match pentagonalNumberInverse n with | some k => (-1) ^ (k.natAbs + 1) * n | none => 0

$q$-binomial coefficients

Motivation

blueprint
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 Nat.Partition.partsAndLargestCountTotal_eq (k : ) (hk : k 1) (hℓ : 1) :
partsAndLargestCountTotal k = (k + - 2).choose (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)

Definition

blueprint
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{ is a partition}\\ \text{with largest part }\leq n-k\\ \text{and length }\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{ is a partition}\\ \text{with largest part }\leq n-k\\ \text{and length }\leq k}}a^{|\lambda |}\in A. \]
noncomputable def AlgebraicCombinatorics.qBinomial {R : Type u_1} [CommSemiring R] (n k : ) (q : R) :
R

Basic properties

blueprint
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)
blueprint
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
blueprint
Convention 2.143

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

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
blueprint
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
blueprint
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))
blueprint
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}\).

blueprint
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)
blueprint
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

$q$-binomial formulas

blueprint
Theorem 2.167 1st \(q\)-binomial theorem

Let \(K\) be a commutative ring. Let \(a,b\in K\) and \(n\in \mathbb {N}\). In the polynomial ring \(K\left[ q\right] \), we have

\[ \left( aq^{0}+b\right) \left( aq^{1}+b\right) \cdots \left( aq^{n-1}+b\right) =\sum _{k=0}^{n}q^{k\left( k-1\right) /2}\binom {n}{k}_{q}a^{k}b^{n-k}. \]
theorem AlgebraicCombinatorics.QBinomialRec.qBinomial_first_theorem {K : Type u_1} [CommRing K] (a b q : K) (n : ) :
iFinset.range n, (a * q ^ i + b) = kFinset.range (n + 1), q ^ (k * (k - 1) / 2) * qBinomial q n k * a ^ k * b ^ (n - k)
blueprint
Lemma 2.164

Let \(L\) be a commutative ring. Let \(n\in \mathbb {N}\). Let \(\left[ n\right] \) denote the set \(\left\{ 1,2,\ldots ,n\right\} \). Let \(a_{1},a_{2},\ldots ,a_{n}\) be \(n\) elements of \(L\). Let \(b_{1},b_{2},\ldots ,b_{n}\) be \(n\) further elements of \(L\). Then,

\begin{equation} \prod _{i=1}^{n}\left( a_{i}+b_{i}\right) =\sum _{S\subseteq \left[ n\right] }\left( \prod _{i\in S}a_{i}\right) \left( \prod _{i\in \left[ n\right] \setminus S}b_{i}\right) . \label{eq.lem.prodrule.sum-ai-plus-bi.eq} \end{equation}

theorem AlgebraicCombinatorics.QBinomialRec.prod_add_eq_sum_over_subsets {L : Type u_1} [CommRing L] {n : } (a b : Fin nL) :
i : Fin n, (a i + b i) = S : Finset (Fin n), (∏ iS, a i) * iS, b i
blueprint
Theorem 2.170 2nd \(q\)-binomial theorem, aka Potter’s binomial theorem

Let \(L\) be a commutative ring. Let \(\omega \in L\). Let \(A\) be a noncommutative \(L\)-algebra. Let \(a,b\in A\) be such that \(ba=\omega ab\). Then,

\[ \left( a+b\right) ^{n}=\sum _{k=0}^{n}\binom {n}{k}_{\omega }a^{k}b^{n-k}. \]
theorem AlgebraicCombinatorics.QBinomialRec.qBinomial_second_theorem {L : Type u_1} [CommRing L] {A : Type u_2} [Ring A] [Algebra L A] (ω : L) (a b : A) (hab : b * a = ω (a * b)) (n : ) :
(a + b) ^ n = kFinset.range (n + 1), qBinomial ω n k (a ^ k * b ^ (n - k))

Counting subspaces of vector spaces

blueprint
Theorem 2.176

Let \(F\) be a finite field. Let \(n,k\in \mathbb {N}\). Let \(V\) be an \(n\)-dimensional \(F\)-vector space. Then,

\[ \binom {n}{k}_{\left\vert F\right\vert }=\left( \text{\# of }k\text{-dimensional vector subspaces of }V\right) . \]
theorem AlgebraicCombinatorics.QBinomialRec.qBinomial_subspace_count {F : Type u_1} [Field F] [Fintype F] {V : Type u_2} [AddCommGroup V] [Module F V] [Module.Finite F V] (n k : ) (hn : Module.finrank F V = n) :
qBinomial (↑(Fintype.card F)) n k = (Nat.card { W : Submodule F V // Module.finrank F W = k })
blueprint
Lemma 2.173

Let \(F\) be a field. Let \(V\) be an \(F\)-vector space. Let \(\left( v_{1},v_{2},\ldots ,v_{k}\right) \) be a \(k\)-tuple of vectors in \(V\). Then, \(\left( v_{1},v_{2},\ldots ,v_{k}\right) \) is linearly independent if and only if each \(i\in \left\{ 1,2,\ldots ,k\right\} \) satisfies \(v_{i}\notin \operatorname {span}\left( v_{1},v_{2},\ldots ,v_{i-1}\right) \) (where the span \(\operatorname {span}\left( {}\right) \) of an empty list is understood to be the set \(\left\{ \mathbf{0}\right\} \) consisting only of the zero vector \(\mathbf{0}\)). In other words, \(\left( v_{1},v_{2},\ldots ,v_{k}\right) \) is linearly independent if and only if we have

\begin{align*} v_{1} & \notin \underbrace{\operatorname {span}\left( {}\right) }_{=\left\{ \mathbf{0}\right\} }\ \ \ \ \ \ \ \ \ \ \text{and}\\ v_{2} & \notin \operatorname {span}\left( v_{1}\right) \ \ \ \ \ \ \ \ \ \ \text{and}\\ v_{3} & \notin \operatorname {span}\left( v_{1},v_{2}\right) \ \ \ \ \ \ \ \ \ \ \text{and}\\ & \cdots \ \ \ \ \ \ \ \ \ \ \text{and}\\ v_{k} & \notin \operatorname {span}\left( v_{1},v_{2},\ldots ,v_{k-1}\right) . \end{align*}
theorem AlgebraicCombinatorics.QBinomialRec.linearIndependent_iff_not_mem_span_of_lt {F : Type u_1} [Field F] {V : Type u_2} [AddCommGroup V] [Module F V] {k : } (v : Fin kV) :
LinearIndependent F v ∀ (i : Fin k), v iSubmodule.span F (v '' {j : Fin k | j < i})
blueprint
Lemma 2.174

Let \(F\) be a finite field. Let \(n,k\in \mathbb {N}\). Let \(V\) be an \(n\)-dimensional \(F\)-vector space. Then,

\begin{align*} & \left( \text{\# of linearly independent }k\text{-tuples of vectors in }V\right) \\ & =\left( \left\vert F\right\vert ^{n}-\left\vert F\right\vert ^{0}\right) \left( \left\vert F\right\vert ^{n}-\left\vert F\right\vert ^{1}\right) \cdots \left( \left\vert F\right\vert ^{n}-\left\vert F\right\vert ^{k-1}\right) =\prod _{i=0}^{k-1}\left( \left\vert F\right\vert ^{n}-\left\vert F\right\vert ^{i}\right) . \end{align*}
blueprint
Lemma 2.175 Multijection principle

Let \(A\) and \(B\) be two finite sets. Let \(m\in \mathbb {N}\). Let \(f:A\rightarrow B\) be any map. Assume that each \(b\in B\) has exactly \(m\) preimages under \(f\) (that is, for each \(b\in B\), there are exactly \(m\) many elements \(a\in A\) such that \(f\left( a\right) =b\)). Then,

\[ \left\vert A\right\vert =m\cdot \left\vert B\right\vert . \]
theorem AlgebraicCombinatorics.QBinomialRec.card_eq_mul_of_fibers {A : Type u_3} {B : Type u_4} [Fintype A] [Fintype B] [DecidableEq B] (f : AB) (m : ) (hf : ∀ (b : B), Fintype.card { a : A // f a = b } = m) :

Limits of $q$-binomial coefficients

blueprint
Proposition 2.182

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

\[ \lim _{n\rightarrow \infty }\binom {n}{k}_{q}=\sum _{n\in \mathbb {N}}\left( p_{0}\left( n\right) +p_{1}\left( n\right) +\cdots +p_{k}\left( n\right) \right) q^{n}=\prod _{i=1}^{k}\frac{1}{1-q^{i}}. \]

(See Definition 2.10 (a) for the meaning of \(p_{i}\left( n\right) \).)

Basic definitions

blueprint
Definition 3.2

Let \(X\) be a set.

(a) A permutation of \(X\) means a bijection from \(X\) to \(X\).

(b) It is known that the set of all permutations of \(X\) is a group under composition. This group is called the symmetric group of \(X\), and is denoted by \(S_X\). Its neutral element is the identity map \(\operatorname {id}_X : X \to X\). Its size is \(|X|!\) when \(X\) is finite.

(c) As usual in group theory, we will write \(\alpha \beta \) for the composition \(\alpha \circ \beta \) when \(\alpha , \beta \in S_X\). This is the map that sends each \(x \in X\) to \(\alpha (\beta (x))\).

(d) If \(\alpha \in S_X\) and \(i \in \mathbb {Z}\), then \(\alpha ^i\) shall denote the \(i\)-th power of \(\alpha \) in the group \(S_X\). Note that \(\alpha ^i = \underbrace{\alpha \circ \alpha \circ \cdots \circ \alpha }_{i\text{ times}}\) if \(i \ge 0\). Also, \(\alpha ^0 = \operatorname {id}_X\). Also, \(\alpha ^{-1}\) is the inverse of \(\alpha \) in the group \(S_X\), that is, the inverse of the map \(\alpha \).

blueprint
Definition 3.3

Let \(n \in \mathbb {Z}\). Then, \([n]\) shall mean the set \(\{ 1, 2, \ldots , n\} \). This is an \(n\)-element set if \(n \ge 0\), and is an empty set if \(n \le 0\).

The symmetric group \(S_{[n]}\) (consisting of all permutations of \([n]\)) will be denoted \(S_n\) and called the \(n\)-th symmetric group. Its size is \(n!\) (when \(n \ge 0\)).

blueprint
Proposition 3.4

Let \(X\) and \(Y\) be two sets, and let \(f : X \to Y\) be a bijection. Then, for each permutation \(\sigma \) of \(X\), the map \(f \circ \sigma \circ f^{-1} : Y \to Y\) is a permutation of \(Y\). Furthermore, the map

\begin{align*} S_f : S_X & \to S_Y, \\ \sigma & \mapsto f \circ \sigma \circ f^{-1} \end{align*}

is a group isomorphism; thus, we obtain \(S_X \cong S_Y\).

blueprint
Definition 3.5

Let \(n \in \mathbb {N}\) and \(\sigma \in S_n\). We introduce three notations for \(\sigma \):

(a) A two-line notation of \(\sigma \) means a \(2 \times n\)-array

\[ \begin{pmatrix} p_1 & p_2 & \cdots & p_n \\ \sigma (p_1) & \sigma (p_2) & \cdots & \sigma (p_n) \end{pmatrix}, \]

where the entries \(p_1, p_2, \ldots , p_n\) of the top row are the \(n\) elements of \([n]\) in some order. Commonly, we pick \(p_i = i\).

(b) The one-line notation (short, OLN) of \(\sigma \) means the \(n\)-tuple \((\sigma (1), \sigma (2), \ldots , \sigma (n))\).

(c) The cycle digraph of \(\sigma \) is the directed graph with vertices \(1, 2, \ldots , n\) and arcs \(i \to \sigma (i)\) for all \(i \in [n]\).

Transpositions

blueprint
Definition 3.7

Let \(i\) and \(j\) be two distinct elements of a set \(X\).

Then, the transposition \(t_{i,j}\) is the permutation of \(X\) that sends \(i\) to \(j\), sends \(j\) to \(i\), and leaves all other elements of \(X\) unchanged.

blueprint
Definition 3.12

Let \(n \in \mathbb {N}\) and \(i \in [n-1]\). Then, the simple transposition \(s_i\) is defined by

\[ s_i := t_{i, i+1} \in S_n. \]
blueprint
Proposition 3.17

Let \(n \in \mathbb {N}\).

(a) We have \(s_i^2 = \operatorname {id}\) for all \(i \in [n-1]\). In other words, we have \(s_i = s_i^{-1}\) for all \(i \in [n-1]\).

(b) We have \(s_i s_j = s_j s_i\) for any \(i, j \in [n-1]\) with \(|i - j| {\gt} 1\).

(c) We have \(s_i s_{i+1} s_i = s_{i+1} s_i s_{i+1}\) for any \(i \in [n-2]\).

Cycles

blueprint
Definition 3.18

Let \(X\) be a set. Let \(i_1, i_2, \ldots , i_k\) be \(k\) distinct elements of \(X\). Then,

\[ \operatorname {cyc}_{i_1, i_2, \ldots , i_k} \]

means the permutation of \(X\) that sends

\begin{align*} & i_1 \text{ to } i_2, \\ & i_2 \text{ to } i_3, \\ & \ldots , \\ & i_{k-1} \text{ to } i_k, \\ & i_k \text{ to } i_1 \end{align*}

and leaves all other elements of \(X\) unchanged. In other words, \(\operatorname {cyc}_{i_1, i_2, \ldots , i_k}\) means the permutation of \(X\) that satisfies

\[ \operatorname {cyc}_{i_1, \ldots , i_k}(p) = \begin{cases} i_{j+1}, & \text{if } p = i_j \text{ for some } j \in \{ 1, 2, \ldots , k\} ;\\ p, & \text{otherwise} \end{cases} \]

for every \(p \in X\), where \(i_{k+1}\) means \(i_1\).

This permutation is called a \(k\)-cycle.

theorem AlgebraicCombinatorics.cyc_apply_getElem {X : Type u_1} [DecidableEq X] {l : List X} (hl : l.Nodup) (j : ) (hj : j < l.length) :
(cyc l) l[j] = l[(j + 1) % l.length]
theorem AlgebraicCombinatorics.cyc_apply_of_not_mem {X : Type u_1} [DecidableEq X] {l : List X} {x : X} (h : xl) :
(cyc l) x = x

Involutions

blueprint
Definition 3.27

Let \(X\) be a set. An involution of \(X\) means a map \(f : X \to X\) that satisfies \(f \circ f = \operatorname {id}\). Clearly, an involution is always a permutation, and equals its own inverse.

Inversions, length and Lehmer codes

Inversions and lengths

blueprint
Definition 3.35

Let \(n\in \mathbb {N}\) and \(\sigma \in S_{n}\).

(a) An inversion of \(\sigma \) means a pair \(\left(i,j\right)\) of elements of \(\left[n\right]\) such that \(i{\lt}j\) and \(\sigma \left(i\right) {\gt}\sigma \left(j\right)\).

(b) The length (also known as the Coxeter length) of \(\sigma \) is the # of inversions of \(\sigma \). It is called \(\ell \left( \sigma \right)\).

blueprint
Proposition 3.37

Let \(n\in \mathbb {N}\).

(a) For any \(\sigma \in S_{n}\), we have \(\ell \left(\sigma \right) \in \left\{ 0,1,\ldots ,\binom {n}{2}\right\} \).

(b) We have

\[ \left(\text{\# of }\sigma \in S_{n}\text{ with }\ell \left(\sigma \right) =0\right) = 1. \]

Indeed, the only permutation \(\sigma \in S_{n}\) with \(\ell \left( \sigma \right)=0\) is the identity map \(\operatorname {id}\).

(c) We have

\[ \left(\text{\# of }\sigma \in S_{n}\text{ with }\ell \left(\sigma \right) =\binom {n}{2}\right) = 1. \]

Indeed, the only permutation \(\sigma \in S_{n}\) with \(\ell \left( \sigma \right)=\binom {n}{2}\) is the permutation with OLN \(n\left( n-1\right)\left(n-2\right)\cdots 21\), often called \(w_{0}\).

(d) If \(n\geq 1\), then

\[ \left(\text{\# of }\sigma \in S_{n}\text{ with }\ell \left(\sigma \right) =1\right) = n-1. \]

Indeed, the only permutations \(\sigma \in S_{n}\) with \(\ell \left( \sigma \right)=1\) are the simple transpositions \(s_{i}\) with \(i\in \left[ n-1\right]\).

(e) If \(n\geq 2\), then

\[ \left(\text{\# of }\sigma \in S_{n}\text{ with }\ell \left(\sigma \right) =2\right) = \frac{\left(n-2\right)\left(n+1\right)}{2}. \]

Indeed, the only permutations \(\sigma \in S_{n}\) with \(\ell \left( \sigma \right)=2\) are the products \(s_{i}s_{j}\) with \(1\leq i{\lt}j{\lt}n\) as well as the products \(s_{i}s_{i-1}\) with \(i\in \left\{ 2,3,\ldots ,n-1\right\} \). If \(n\geq 2\), then there are \(\frac{\left(n-2\right)\left(n+1\right)}{2}\) such products (and they are all distinct).

(f) For any \(k\in \mathbb {Z}\), we have

\[ \left(\text{\# of }\sigma \in S_{n}\text{ with }\ell \left(\sigma \right) =k\right) = \left(\text{\# of }\sigma \in S_{n}\text{ with }\ell \left( \sigma \right)=\binom {n}{2}-k\right). \]
theorem AlgebraicCombinatorics.Perm.card_invCount_symm {n : } (k : ) :
{σ : Equiv.Perm (Fin n) | (invCount σ) = k}.card = {σ : Equiv.Perm (Fin n) | (invCount σ) = (n.choose 2) - k}.card
blueprint
Proposition 3.53

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

\begin{align*} \sum _{\sigma \in S_{n}} x^{\ell \left(\sigma \right)} & = \prod _{i=1}^{n-1}\left(1+x+x^{2}+\cdots +x^{i}\right) \\ & = \left(1+x\right)\left(1+x+x^{2}\right)\left(1+x+x^{2}+x^{3}\right) \cdots \left(1+x+x^{2}+\cdots +x^{n-1}\right) \\ & = \left[n\right]_{x}!. \end{align*}
theorem AlgebraicCombinatorics.length_generating_function (n x : ) :
σ : Equiv.Perm (Fin n), x ^ Perm.invCount σ = iFinset.range n, jFinset.range (i + 1), x ^ j

Lehmer codes

blueprint
Definition 3.45

Let \(n\in \mathbb {N}\).

(a) For each \(\sigma \in S_{n}\) and \(i\in \left[n\right]\), we set

\begin{align*} \ell _{i}\left(\sigma \right) := & \left(\text{\# of all }j\in \left[n\right] \text{ satisfying }i{\lt}j\text{ and }\sigma \left(i\right) {\gt}\sigma \left(j\right)\right) \\ = & \left(\text{\# of all }j\in \left\{ i+1,i+2,\ldots ,n\right\} \text{ such that }\sigma \left(i\right){\gt}\sigma \left(j\right)\right). \end{align*}

(b) For each \(m\in \mathbb {Z}\), we let \(\left[m\right]_{0}\) denote the set \(\left\{ 0,1,\ldots ,m\right\} \). (This is an empty set when \(m{\lt}0\).)

(c) We let \(H_{n}\) denote the set

\begin{align*} & \left[n-1\right]_{0}\times \left[n-2\right]_{0}\times \cdots \times \left[n-n\right]_{0}\\ & = \left\{ \left(j_{1},j_{2},\ldots ,j_{n}\right)\in \mathbb {N}^{n} \ \mid \ j_{i}\leq n-i\text{ for each }i\in \left[n\right]\right\} . \end{align*}

This set \(H_{n}\) has size \(n!\).

(d) Each \(\sigma \in S_n\) and each \(i\in [n]\) satisfy \(\ell _i(\sigma ) \in \{ 0,1,\ldots ,n-i\} = [n-i]_0\).

(e) We define the map

\begin{align*} L:S_{n} & \rightarrow H_{n},\\ \sigma & \mapsto \left(\ell _{1}\left(\sigma \right),\ell _{2}\left( \sigma \right),\ldots ,\ell _{n}\left(\sigma \right)\right). \end{align*}

If \(\sigma \in S_{n}\) is a permutation, then the \(n\)-tuple \(L\left(\sigma \right)\) is called the Lehmer code (or just the code) of \(\sigma \).

blueprint
Proposition 3.46

Let \(n\in \mathbb {N}\) and \(\sigma \in S_{n}\). Then, \(\ell \left(\sigma \right)=\ell _{1}\left(\sigma \right)+\ell _{2}\left( \sigma \right)+\cdots +\ell _{n}\left(\sigma \right)\).

blueprint
Theorem 3.47

Let \(n\in \mathbb {N}\). Then, the map \(L:S_{n}\rightarrow H_{n}\) is a bijection.

blueprint
Definition 3.50

Let \(\left(a_{1},a_{2},\ldots ,a_{n}\right)\) and \(\left(b_{1},b_{2},\ldots ,b_{n}\right)\) be two \(n\)-tuples of integers. We say that

\[ \left(a_{1},a_{2},\ldots ,a_{n}\right) {\lt}_{\operatorname {lex}}\left( b_{1},b_{2},\ldots ,b_{n}\right) \]

if and only if

  • there exists some \(k\in \left[n\right]\) such that \(a_{k}\neq b_{k}\), and

  • the smallest such \(k\) satisfies \(a_{k}{\lt}b_{k}\).

The relation \({\lt}_{\operatorname {lex}}\) is a strict total order on \(\mathbb {Z}^n\) (the lexicographic order).

theorem AlgebraicCombinatorics.lexLt_trans {n : } {a b c : Fin n} (hab : lexLt a b) (hbc : lexLt b c) :
lexLt a c
theorem AlgebraicCombinatorics.lexLt_asymm {n : } {a b : Fin n} (hab : lexLt a b) :
theorem AlgebraicCombinatorics.lexLt_strictTotalOrder {n : } (a b : Fin n) :
a = b ¬lexLt a b ¬lexLt b a a b lexLt a b ¬lexLt b a a b ¬lexLt a b lexLt b a
blueprint
Proposition 3.51

If \(\mathbf{a}\) and \(\mathbf{b}\) are two distinct \(n\)-tuples of integers, then we have either \(\mathbf{a} {\lt}_{\operatorname {lex}}\mathbf{b}\) or \(\mathbf{b}{\lt}_{\operatorname {lex}} \mathbf{a}\).

theorem AlgebraicCombinatorics.lexLt_trichotomous {n : } (a b : Fin n) (hab : a b) :
lexLt a b lexLt b a
blueprint
Proposition 3.52

Let \(\sigma \in S_{n}\) and \(\tau \in S_{n}\) be such that

\[ \left(\sigma \left(1\right),\sigma \left(2\right),\ldots ,\sigma \left( n\right)\right) {\lt}_{\operatorname {lex}}\left(\tau \left(1\right) ,\tau \left(2\right),\ldots ,\tau \left(n\right)\right). \]

Then,

\[ \left(\ell _{1}\left(\sigma \right),\ell _{2}\left(\sigma \right) ,\ldots ,\ell _{n}\left(\sigma \right)\right) {\lt}_{\operatorname {lex}}\left( \ell _{1}\left(\tau \right),\ell _{2}\left(\tau \right),\ldots ,\ell _{n}\left(\tau \right)\right). \]

(In other words, \(L\left(\sigma \right) {\lt}_{\operatorname {lex}} L\left( \tau \right)\).)

theorem AlgebraicCombinatorics.Perm.lehmerCode_preserves_lexLt {n : } (σ τ : Equiv.Perm (Fin n)) (h : lexLt (fun (i : Fin n) => (σ i)) fun (i : Fin n) => (τ i)) :
lexLt (fun (i : Fin n) => (lehmerEntry σ i)) fun (i : Fin n) => (lehmerEntry τ i)

More about lengths and simples

blueprint
Proposition 3.54

Let \(n \in \mathbb {N}\) and \(\sigma \in S_n\). Then, \(\ell (\sigma ^{-1}) = \ell (\sigma )\).

theorem Equiv.Perm.length_inv {n : } (σ : Perm (Fin n)) :
blueprint
Lemma 3.56 Single swap lemma

Let \(n \in \mathbb {N}\), \(\sigma \in S_n\) and \(k \in [n-1]\). Then:

(a) We have

\[ \ell (\sigma s_k) = \begin{cases} \ell (\sigma ) + 1, & \text{if } \sigma (k) {\lt} \sigma (k+1); \\ \ell (\sigma ) - 1, & \text{if } \sigma (k) {\gt} \sigma (k+1). \end{cases} \]

(b) We have

\[ \ell (s_k \sigma ) = \begin{cases} \ell (\sigma ) + 1, & \text{if } \sigma ^{-1}(k) {\lt} \sigma ^{-1}(k+1); \\ \ell (\sigma ) - 1, & \text{if } \sigma ^{-1}(k) {\gt} \sigma ^{-1}(k+1). \end{cases} \]
theorem Equiv.Perm.length_mul_swap_right {n : } (σ : Perm (Fin n)) (k : Fin (n - 1)) (h : n > 1) :
theorem Equiv.Perm.length_mul_swap_left {n : } (σ : Perm (Fin n)) (k : Fin (n - 1)) (h : n > 1) :
blueprint
Proposition 3.59

Let \(n \in \mathbb {N}\) and \(\sigma \in S_n\). Let \(i\) and \(j\) be two elements of \([n]\) such that \(i {\lt} j\). Then:

(a) We have \(\ell (\sigma t_{i,j}) {\lt} \ell (\sigma )\) if \(\sigma (i) {\gt} \sigma (j)\). We have \(\ell (\sigma t_{i,j}) {\gt} \ell (\sigma )\) if \(\sigma (i) {\lt} \sigma (j)\).

(b) We have

\[ \ell (\sigma t_{i,j}) = \begin{cases} \ell (\sigma ) - 2|Q| - 1, & \text{if } \sigma (i) {\gt} \sigma (j); \\ \ell (\sigma ) + 2|R| + 1, & \text{if } \sigma (i) {\lt} \sigma (j), \end{cases} \]

where

\begin{align*} Q & = \{ k \in \{ i+1, i+2, \ldots , j-1\} \mid \sigma (i) {\gt} \sigma (k) {\gt} \sigma (j)\} \quad \text{and} \\ R & = \{ k \in \{ i+1, i+2, \ldots , j-1\} \mid \sigma (i) {\lt} \sigma (k) {\lt} \sigma (j)\} . \end{align*}
theorem Equiv.Perm.length_mul_transposition_compare {n : } (σ : Perm (Fin n)) (i j : Fin n) (hij : i < j) :
(σ j < σ i(σ * swap i j).length < σ.length) (σ i < σ jσ.length < (σ * swap i j).length)
theorem Equiv.Perm.length_mul_transposition {n : } (σ : Perm (Fin n)) (i j : Fin n) (hij : i < j) :
(σ * swap i j).length = if σ j < σ i then σ.length - 2 * (σ.setQ i j).card - 1 else σ.length + 2 * (σ.setR i j).card + 1
blueprint
Theorem 3.81 First reduced word theorem for the symmetric group

Let \(n \in \mathbb {N}\) and \(\sigma \in S_n\). Then:

(a) We can write \(\sigma \) as a composition (i.e., product) of \(\ell (\sigma )\) simples.

(b) The number \(\ell (\sigma )\) is the smallest \(p \in \mathbb {N}\) such that we can write \(\sigma \) as a composition of \(p\) simples.

Keep in mind: The composition of \(0\) simples is \(\mathrm{id}\), since \(\mathrm{id}\) is the neutral element of the group \(S_n\).

blueprint
Corollary 3.85

Let \(n \in \mathbb {N}\).

(a) We have \(\ell (\sigma \tau ) \equiv \ell (\sigma ) + \ell (\tau ) \pmod{2}\) for all \(\sigma , \tau \in S_n\).

(b) We have \(\ell (\sigma \tau ) \leq \ell (\sigma ) + \ell (\tau )\) for all \(\sigma , \tau \in S_n\).

(c) Let \(k_1, k_2, \ldots , k_q \in [n-1]\), and let \(\sigma = s_{k_1} s_{k_2} \cdots s_{k_q}\). Then \(q \geq \ell (\sigma )\) and \(q \equiv \ell (\sigma ) \pmod{2}\).

theorem Equiv.Perm.length_mul_mod_two {n : } (σ τ : Perm (Fin n)) :
(σ * τ).length % 2 = (σ.length + τ.length) % 2
theorem Equiv.Perm.length_mul_le {n : } (σ τ : Perm (Fin n)) :
(σ * τ).length σ.length + τ.length
blueprint
Corollary 3.89

Let \(n \in \mathbb {N}\). Then, the group \(S_n\) is generated by the simples \(s_0, s_1, \ldots , s_{n-2}\).

blueprint
Proposition 3.107

Let \(n \in \mathbb {N}\) and \(\sigma \in S_n\). For each \(i \in [n]\), set

\[ a_i := s_{i'-1} s_{i'-2} \cdots s_i, \]

where \(i' = i + \ell _i(\sigma )\). Then \(\sigma = a_0 a_1 \cdots a_{n-1}\).

In other words, the product of the canonical reduced word equals \(\sigma \).

Signs of permutations

blueprint
Definition 3.109

Let \(n \in \mathbb {N}\). The sign of a permutation \(\sigma \in S_n\) is defined to be the integer \((-1)^{\ell (\sigma )}\).

It is denoted by \((-1)^{\sigma }\) or \(\operatorname {sgn}(\sigma )\) or \(\operatorname {sign}(\sigma )\) or \(\varepsilon (\sigma )\). It is also known as the signature of \(\sigma \).

blueprint
Proposition 3.110

Let \(n \in \mathbb {N}\).

(a) The sign of the identity permutation \(\operatorname {id} \in S_n\) is \((-1)^{\operatorname {id}} = 1\).

(b) For any two distinct elements \(i\) and \(j\) of \([n]\), the transposition \(t_{i,j} \in S_n\) has sign \((-1)^{t_{i,j}} = -1\).

(c) For any positive integer \(k\) and any distinct elements \(i_1, i_2, \ldots , i_k \in [n]\), the \(k\)-cycle \(\operatorname {cyc}_{i_1, i_2, \ldots , i_k}\) has sign \((-1)^{\operatorname {cyc}_{i_1, i_2, \ldots , i_k}} = (-1)^{k-1}\).

(d) We have \((-1)^{\sigma \tau } = (-1)^{\sigma } \cdot (-1)^{\tau }\) for any \(\sigma \in S_n\) and \(\tau \in S_n\).

(e) We have \((-1)^{\sigma _1 \sigma _2 \cdots \sigma _p} = (-1)^{\sigma _1} (-1)^{\sigma _2} \cdots (-1)^{\sigma _p}\) for any \(\sigma _1, \sigma _2, \ldots , \sigma _p \in S_n\).

(f) We have \((-1)^{\sigma ^{-1}} = (-1)^{\sigma }\) for any \(\sigma \in S_n\). (The left hand side here has to be understood as \((-1)^{(\sigma ^{-1})}\).)

(g) We have

\[ (-1)^{\sigma } = \prod _{1 \leq i {\lt} j \leq n} \frac{\sigma (i) - \sigma (j)}{i - j} \qquad \text{for each } \sigma \in S_n. \]

(The product sign “\(\prod _{1 \leq i {\lt} j \leq n}\)” means a product over all pairs \((i,j)\) of integers satisfying \(1 \leq i {\lt} j \leq n\). There are \(\binom {n}{2}\) such pairs.)

(h) If \(x_1, x_2, \ldots , x_n\) are any elements of some commutative ring, and if \(\sigma \in S_n\), then

\[ \prod _{1 \leq i {\lt} j \leq n} \left( x_{\sigma (i)} - x_{\sigma (j)} \right) = (-1)^{\sigma } \prod _{1 \leq i {\lt} j \leq n} \left( x_i - x_j \right). \]
theorem Equiv.Perm.sign_id {α : Type u_1} [DecidableEq α] [Fintype α] :
sign 1 = 1
theorem Equiv.Perm.sign_transposition {α : Type u_1} [DecidableEq α] [Fintype α] {x y : α} (hxy : x y) :
sign (swap x y) = -1
theorem Equiv.Perm.sign_isCycle {α : Type u_1} [DecidableEq α] [Fintype α] {σ : Perm α} ( : σ.IsCycle) :
sign σ = -(-1) ^ σ.support.card
theorem Equiv.Perm.sign_mul' {α : Type u_1} [DecidableEq α] [Fintype α] (σ τ : Perm α) :
sign (σ * τ) = sign σ * sign τ
theorem Equiv.Perm.sign_prod_list {α : Type u_1} [DecidableEq α] [Fintype α] (l : List (Perm α)) :
theorem Equiv.Perm.sign_inv' {α : Type u_1} [DecidableEq α] [Fintype α] (σ : Perm α) :
theorem Equiv.Perm.sign_eq_prod_pairs {n : } (σ : Perm (Fin n)) :
sign σ = i : Fin n, jFinset.Ioi i, if σ i < σ j then 1 else -1
theorem Equiv.Perm.prod_diff_comp_perm {n : } {R : Type u_2} [CommRing R] (σ : Perm (Fin n)) (x : Fin nR) :
i : Fin n, jFinset.Ioi i, (x (σ i) - x (σ j)) = (sign σ) * i : Fin n, jFinset.Ioi i, (x i - x j)
blueprint
Corollary 3.111

Let \(n \in \mathbb {N}\). The map

\begin{align*} S_n & \to \{ 1, -1\} , \\ \sigma & \mapsto (-1)^{\sigma } \end{align*}

is a group homomorphism from the symmetric group \(S_n\) to the order-\(2\) group \(\{ 1, -1\} \). (Of course, \(\{ 1, -1\} \) is a group with respect to multiplication.)

theorem Equiv.Perm.sign_hom_mul {α : Type u_1} [DecidableEq α] [Fintype α] (σ τ : Perm α) :
sign (σ * τ) = sign σ * sign τ
blueprint
Definition 3.112

Let \(n \in \mathbb {N}\). A permutation \(\sigma \in S_n\) is said to be

  • even if \((-1)^{\sigma } = 1\) (that is, if \(\ell (\sigma )\) is even);

  • odd if \((-1)^{\sigma } = -1\) (that is, if \(\ell (\sigma )\) is odd).

def Equiv.Perm.IsEven {α : Type u_1} [DecidableEq α] [Fintype α] (σ : Perm α) :
def Equiv.Perm.IsOdd {α : Type u_1} [DecidableEq α] [Fintype α] (σ : Perm α) :
blueprint
Corollary 3.119

Let \(n \in \mathbb {N}\). The set of all even permutations in \(S_n\) is a normal subgroup of \(S_n\).

blueprint
Corollary 3.120

Let \(n \geq 2\). Then,

\[ \left(\text{\# of even permutations } \sigma \in S_n \right) = \left(\text{\# of odd permutations } \sigma \in S_n \right) = n!/2. \]
theorem Equiv.Perm.card_odd_eq_card_even {α : Type u_1} [DecidableEq α] [Fintype α] [Nontrivial α] :
{σ : Perm α | sign σ = -1}.card = {σ : Perm α | sign σ = 1}.card
blueprint
Proposition 3.122

Let \(X\) be a finite set. We want to define the sign of any permutation of \(X\).

Fix a bijection \(\phi : X \to [n]\) for some \(n \in \mathbb {N}\). (Such a bijection always exists, since \(X\) is finite.) For every permutation \(\sigma \) of \(X\), set

\[ (-1)_{\phi }^{\sigma } := (-1)^{\phi \circ \sigma \circ \phi ^{-1}}. \]

Here, the right hand side is well-defined, since \(\phi \circ \sigma \circ \phi ^{-1}\) is a permutation of \([n]\). Now:

(a) This number \((-1)_{\phi }^{\sigma }\) depends only on the permutation \(\sigma \), but not on the bijection \(\phi \). (In other words, if \(\phi _1\) and \(\phi _2\) are two bijections from \(X\) to \([n]\), then \((-1)_{\phi _1}^{\sigma } = (-1)_{\phi _2}^{\sigma }\).)

Thus, we shall denote \((-1)_{\phi }^{\sigma }\) by \((-1)^{\sigma }\) from now on. We refer to this number \((-1)^{\sigma }\) as the sign of the permutation \(\sigma \in S_X\). (When \(X = [n]\), this notation does not clash with Definition 3.109, since we can pick the bijection \(\phi = \operatorname {id}\) and obtain \((-1)_{\phi }^{\sigma } = (-1)^{\operatorname {id} \circ \sigma \circ \operatorname {id}^{-1}} = (-1)^{\sigma }\).)

(b) The identity permutation \(\operatorname {id} : X \to X\) satisfies \((-1)^{\operatorname {id}} = 1\).

(c) We have \((-1)^{\sigma \tau } = (-1)^{\sigma } \cdot (-1)^{\tau }\) for any two permutations \(\sigma \) and \(\tau \) of \(X\).

theorem Equiv.Perm.sign_conj_eq {α : Type u_1} [DecidableEq α] [Fintype α] {β : Type u_2} [DecidableEq β] [Fintype β] (σ : Perm α) (e : α β) :
sign ((e.symm.trans σ).trans e) = sign σ
theorem Equiv.Perm.sign_mul_finiteSet {α : Type u_1} [DecidableEq α] [Fintype α] (σ τ : Perm α) :
sign (σ * τ) = sign σ * sign τ

The cycle decomposition

blueprint
Theorem 3.123 disjoint cycle decomposition of permutations

Let \(X\) be a finite set. Let \(\sigma \) be a permutation of \(X\). Then:

(a) There is a list

\begin{align*} & \Big(\left( a_{1,1},a_{1,2},\ldots ,a_{1,n_{1}}\right) ,\\ & \ \ \ \left( a_{2,1},a_{2,2},\ldots ,a_{2,n_{2}}\right) ,\\ & \ \ \ \ldots ,\\ & \ \ \ \left( a_{k,1},a_{k,2},\ldots ,a_{k,n_{k}}\right) \Big) \end{align*}

of nonempty lists of elements of \(X\) such that:

  • each element of \(X\) appears exactly once in the composite list

    \begin{align*} & (a_{1,1},a_{1,2},\ldots ,a_{1,n_{1}},\\ & \ \ \ a_{2,1},a_{2,2},\ldots ,a_{2,n_{2}},\\ & \ \ \ \ldots ,\\ & \ \ \ a_{k,1},a_{k,2},\ldots ,a_{k,n_{k}}), \end{align*}

    and

  • we have

    \[ \sigma =\operatorname *{cyc}\nolimits _{a_{1,1},a_{1,2},\ldots ,a_{1,n_{1}}}\circ \operatorname *{cyc}\nolimits _{a_{2,1},a_{2,2},\ldots ,a_{2,n_{2}}}\circ \cdots \circ \operatorname *{cyc}\nolimits _{a_{k,1},a_{k,2},\ldots ,a_{k,n_{k}}}. \]

Such a list is called a disjoint cycle decomposition (or short DCD) of \(\sigma \). Its entries (which themselves are lists of elements of \(X\)) are called the cycles of \(\sigma \).

(b) Any two DCDs of \(\sigma \) can be obtained from each other by (repeatedly) swapping the cycles with each other, and rotating each cycle (i.e., replacing \(\left( a_{i,1},a_{i,2},\ldots ,a_{i,n_{i}}\right) \) by \(\left( a_{i,2},a_{i,3},\ldots ,a_{i,n_{i}},a_{i,1}\right) \)).

(c) Now assume that \(X\) is a set of integers (or, more generally, any totally ordered finite set). Then, there is a unique DCD

\begin{align*} & \Big(\left( a_{1,1},a_{1,2},\ldots ,a_{1,n_{1}}\right) ,\\ & \ \ \ \left( a_{2,1},a_{2,2},\ldots ,a_{2,n_{2}}\right) ,\\ & \ \ \ \ldots ,\\ & \ \ \ \left( a_{k,1},a_{k,2},\ldots ,a_{k,n_{k}}\right) \Big) \end{align*}

of \(\sigma \) that satisfies the additional requirements that

  • we have \(a_{i,1}\leq a_{i,p}\) for each \(i\in \left[ k\right] \) and each \(p\in \left[ n_{i}\right] \) (that is, each cycle in this DCD is written with its smallest entry first), and

  • we have \(a_{1,1}{\gt}a_{2,1}{\gt}\cdots {\gt}a_{k,1}\) (that is, the cycles appear in this DCD in the order of decreasing first entries).

theorem AlgebraicCombinatorics.CycleDecomposition.exists_dcd {α : Type u_1} [DecidableEq α] [Fintype α] (σ : Equiv.Perm α) :
∃ (cycs : Finset (Equiv.Perm α)), (∀ ccycs, c.IsCycle) (↑cycs).Pairwise Equiv.Perm.Disjoint ∃ (h : (↑cycs).Pairwise Commute), cycs.noncommProd id h = σ
theorem AlgebraicCombinatorics.CycleDecomposition.dcd_unique_cycleType {α : Type u_1} [DecidableEq α] [Fintype α] (σ : Equiv.Perm α) (cycs : Finset (Equiv.Perm α)) :
(∀ ccycs, c.IsCycle)(↑cycs).Pairwise Equiv.Perm.Disjoint(∃ (h : (↑cycs).Pairwise Commute), cycs.noncommProd id h = σ)Multiset.map (fun (c : Equiv.Perm α) => c.support.card) cycs.val = σ.cycleType
theorem AlgebraicCombinatorics.CycleDecomposition.canonicalDcd_exists_unique {α : Type u_1} [DecidableEq α] [Fintype α] [LinearOrder α] [Inhabited α] (σ : Equiv.Perm α) :
∃! cycleReps : List (List α), (∀ lcycleReps, l []) cycleReps.flatten.Nodup (∀ (x : α), x cycleReps.flatten) (∀ lcycleReps, xl, l.head! x) List.Pairwise (fun (l1 l2 : List α) => l1.head! > l2.head!) cycleReps dcdListToPerm cycleReps = σ
blueprint
Definition 3.124

Let \(X\) be a finite set. Let \(\sigma \) be a permutation of \(X\).

(a) The cycles of \(\sigma \) are defined to be the cycles in the DCD of \(\sigma \) (as defined in Theorem 3.123 (a)). (This includes \(1\)-cycles, if there are any in the DCD of \(\sigma \).)

We shall equate a cycle of \(\sigma \) with any of its cyclic rotations; thus, for example, \(\left( 3,1,4\right) \) and \(\left( 1,4,3\right) \) shall be regarded as being the same cycle (but \(\left( 3,1,4\right) \) and \(\left( 3,4,1\right) \) shall not).

(b) The cycle lengths partition of \(\sigma \) shall denote the partition of \(\left\vert X\right\vert \) obtained by writing down the lengths of the cycles of \(\sigma \) in weakly decreasing order.

blueprint
Proposition 3.135

Let \(X\) be a finite set. Let \(i,j\in X\). Let \(\sigma \) be a permutation of \(X\). Then, we have the following chain of equivalences:

\begin{align*} \ & \left( i\text{ and }j\text{ belong to the same cycle of }\sigma \right) \\ \Longleftrightarrow \ & \left( i=\sigma ^{p}\left( j\right) \text{ for some }p\in \mathbb {N}\right) \\ \Longleftrightarrow \ & \left( j=\sigma ^{p}\left( i\right) \text{ for some }p\in \mathbb {N}\right) . \end{align*}
theorem AlgebraicCombinatorics.CycleDecomposition.sameCycle_iff_exists_pow {α : Type u_1} [Fintype α] (f : Equiv.Perm α) (i j : α) :
f.SameCycle i j ∃ (p : ), (f ^ p) i = j
blueprint
Proposition 3.139

Let \(n\in \mathbb {N}\). Let \(\sigma \in S_{n}\). Let \(k\in \mathbb {N}\) be such that \(\sigma \) has exactly \(k\) cycles (including the \(1\)-cycles). Then, \(\left( -1\right) ^{\sigma }=\left( -1\right) ^{n-k}\).

Cancellations in alternating sums

blueprint
Proposition 4.6 Negative hockey-stick identity

Let \(n\in \mathbb {C}\) and \(m\in \mathbb {N}\). Then,

\[ \sum _{k=0}^{m} (-1)^{k} \binom {n}{k} = (-1)^{m} \binom {n-1}{m}. \]
theorem AlgebraicCombinatorics.SignedCounting.negHockeyStick (n m : ) (hn : 0 < n) :
kFinset.range (m + 1), (-1) ^ k * (n.choose k) = (-1) ^ m * ((n - 1).choose m)
blueprint
Lemma 4.9 Cancellation principle, take 1

Let \(\mathcal{A}\) be a finite set. Let \(\mathcal{X}\) be a subset of \(\mathcal{A}\).

For each \(I \in \mathcal{A}\), let \(\operatorname {sign} I\) be an element of an additive abelian group \(R\) with no \(2\)-torsion (i.e., \(2a = 0\) implies \(a = 0\)). Let \(f : \mathcal{X} \to \mathcal{X}\) be a bijection with the property that

\[ \operatorname {sign}(f(I)) = -\operatorname {sign} I \qquad \text{for all } I \in \mathcal{X}. \]

(Such a bijection \(f\) is called sign-reversing.) Then,

\[ \sum _{I \in \mathcal{A}} \operatorname {sign} I = \sum _{I \in \mathcal{A} \setminus \mathcal{X}} \operatorname {sign} I. \]
theorem AlgebraicCombinatorics.SignedCounting.sign_cancel1 {α : Type u_1} [DecidableEq α] {R : Type u_2} [AddCommGroup R] [NoZeroSMulDivisors R] (A X : Finset α) (hXA : X A) (sign : αR) (f : XX) (hf_bij : Function.Bijective f) (hf_sign : ∀ (I : X), sign (f I) = -sign I) :
IA, sign I = IA \ X, sign I
blueprint
Lemma 4.10 Cancellation principle, take 2

Let \(\mathcal{A}\) be a finite set. Let \(\mathcal{X}\) be a subset of \(\mathcal{A}\).

For each \(I \in \mathcal{A}\), let \(\operatorname {sign} I\) be an element of some additive abelian group. Let \(f : \mathcal{X} \to \mathcal{X}\) be an involution (i.e., a map satisfying \(f \circ f = \operatorname {id}\)) that has no fixed points. Assume that

\[ \operatorname {sign}(f(I)) = -\operatorname {sign} I \qquad \text{for all } I \in \mathcal{X}. \]

Then,

\[ \sum _{I \in \mathcal{A}} \operatorname {sign} I = \sum _{I \in \mathcal{A} \setminus \mathcal{X}} \operatorname {sign} I. \]
theorem AlgebraicCombinatorics.SignedCounting.sign_cancel2 {α : Type u_1} [DecidableEq α] {R : Type u_2} [AddCommGroup R] (A X : Finset α) (hXA : X A) (sign : αR) (f : XX) (hf_invol : ∀ (I : X), f (f I) = I) (hf_no_fixed : ∀ (I : X), f I I) (hf_sign : ∀ (I : X), sign (f I) = -sign I) :
IA, sign I = IA \ X, sign I
blueprint
Lemma 4.11 Cancellation principle, take 3

Let \(\mathcal{A}\) be a finite set. Let \(\mathcal{X}\) be a subset of \(\mathcal{A}\).

For each \(I \in \mathcal{A}\), let \(\operatorname {sign} I\) be an element of some additive abelian group. Let \(f : \mathcal{X} \to \mathcal{X}\) be an involution (i.e., a map satisfying \(f \circ f = \operatorname {id}\)). Assume that

\[ \operatorname {sign}(f(I)) = -\operatorname {sign} I \qquad \text{for all } I \in \mathcal{X}. \]

Assume furthermore that

\[ \operatorname {sign} I = 0 \qquad \text{for all } I \in \mathcal{X} \text{ satisfying } f(I) = I. \]

Then,

\[ \sum _{I \in \mathcal{A}} \operatorname {sign} I = \sum _{I \in \mathcal{A} \setminus \mathcal{X}} \operatorname {sign} I. \]
theorem AlgebraicCombinatorics.SignedCounting.sign_cancel3 {α : Type u_1} [DecidableEq α] {R : Type u_2} [AddCommGroup R] (A X : Finset α) (hXA : X A) (sign : αR) (f : XX) (hf_invol : ∀ (I : X), f (f I) = I) (hf_sign : ∀ (I : X), sign (f I) = -sign I) (hf_fixed_zero : ∀ (I : X), f I = Isign I = 0) :
IA, sign I = IA \ X, sign I
blueprint
Definition 4.15

Let \(K\) be a field. Let \(d\) be a positive integer.

(a) A \(d\)-th root of unity in \(K\) means an element \(\omega \) of \(K\) satisfying \(\omega ^d = 1\).

(b) A primitive \(d\)-th root of unity in \(K\) means an element \(\omega \) of \(K\) satisfying \(\omega ^d = 1\) but \(\omega ^i \neq 1\) for each \(i \in \{ 1, 2, \ldots , d-1\} \). In other words, a primitive \(d\)-th root of unity in \(K\) means an element of the multiplicative group \(K^{\times }\) whose order is \(d\).

structure IsPrimitiveRoot {M : Type u_1} [CommMonoid M] (ζ : M) (k : ) :
  • pow_eq_one : ζ ^ k = 1
  • dvd_of_pow_eq_one (l : ) : ζ ^ l = 1k l
blueprint
Theorem 4.28 \(q\)-Lucas theorem

Let \(K\) be a field. Let \(d\) be a positive integer. Let \(\omega \) be a primitive \(d\)-th root of unity in \(K\). Let \(n, k \in \mathbb {N}\). Let \(q\) and \(u\) be the quotients obtained when dividing \(n\) and \(k\) by \(d\) with remainder, and let \(r\) and \(v\) be the respective remainders. Then,

\[ \binom {n}{k}_{\omega } = \binom {q}{u} \cdot \binom {r}{v}_{\omega }. \]
theorem AlgebraicCombinatorics.SignedCounting.qLucas {K : Type u_1} [Field K] (d : ) (hd : 0 < d) (ω : K) ( : IsPrimitiveRoot ω d) (n k : ) :
(Polynomial.aeval ω) (qBinomial n k) = ((n / d).choose (k / d)) * (Polynomial.aeval ω) (qBinomial (n % d) (k % d))

The principles of inclusion and exclusion

The size version

blueprint
Theorem 4.43 Size version of the PIE

Let \(n \in \mathbb {N}\). Let \(U\) be a finite set. Let \(A_1, A_2, \ldots , A_n\) be \(n\) subsets of \(U\). Then,

\[ \left(\text{\# of } u \in U \text{ that satisfy } u \notin A_i \text{ for all } i \in [n]\right) = \sum _{I \subseteq [n]} (-1)^{|I|} \left(\text{\# of } u \in U \text{ that satisfy } u \in A_i \text{ for all } i \in I\right). \]

Equivalently,

\[ \left| U \setminus (A_1 \cup A_2 \cup \cdots \cup A_n) \right| = \sum _{I \subseteq [n]} (-1)^{|I|} \left| \bigcap _{i \in I} A_i \right|, \]

where \(\bigcap _{i \in I} A_i\) denotes \(\{ u \in U \mid u \in A_i \text{ for all } i \in I\} \) (so that \(\bigcap _{i \in \varnothing } A_i = U\)).

theorem AlgebraicCombinatorics.InclusionExclusion.pie_size_version {α : Type u_1} {ι : Type u_2} [DecidableEq α] [Fintype α] (s : Finset ι) (A : ιFinset α) :
(s.inf fun (i : ι) => (A i)).card = Is.powerset, (-1) ^ I.card * (I.inf A).card

Examples

blueprint
Theorem 4.48

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

\[ \left(\text{\# of surjective maps } f\colon [m] \to [n]\right) = \sum _{k=0}^{n} (-1)^k \binom {n}{k} (n-k)^m. \]
theorem AlgebraicCombinatorics.InclusionExclusion.numSurj_formula (m n : ) :
(numSurj m n) = kFinset.range (n + 1), (-1) ^ k * (n.choose k) * (n - k) ^ m
blueprint
Corollary 4.51

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

(a) We have \(\sum _{k=0}^{n} (-1)^k \binom {n}{k} (n-k)^m = 0\) for any \(m \in \mathbb {N}\) satisfying \(m {\lt} n\).

(b) We have \(\sum _{k=0}^{n} (-1)^k \binom {n}{k} (n-k)^n = n!\).

(c) We have \(\sum _{k=0}^{n} (-1)^k \binom {n}{k} (n-k)^m \geq 0\) for each \(m \in \mathbb {N}\).

(d) We have \(n! \mid \sum _{k=0}^{n} (-1)^k \binom {n}{k} (n-k)^m\) for each \(m \in \mathbb {N}\).

theorem AlgebraicCombinatorics.InclusionExclusion.surjOn_alternating_sum_eq_zero (n m : ) (h : m < n) :
kFinset.range (n + 1), (-1) ^ k * (n.choose k) * (n - k) ^ m = 0
theorem AlgebraicCombinatorics.InclusionExclusion.surjOn_alternating_sum_nonneg (m n : ) :
0 kFinset.range (n + 1), (-1) ^ k * (n.choose k) * (n - k) ^ m
blueprint
Definition 4.56

A derangement of a set \(X\) means a permutation of \(X\) that has no fixed points.

blueprint
Theorem 4.62

Let \(n \in \mathbb {N}\). Then, the number of derangements of \([n]\) is

\[ D_n = \sum _{k=0}^{n} (-1)^k \binom {n}{k} (n-k)! = n! \cdot \sum _{k=0}^{n} \frac{(-1)^k}{k!}. \]
blueprint
Theorem 4.64

Let \(c\) be a positive integer with prime factorization \(p_1^{a_1} p_2^{a_2} \cdots p_n^{a_n}\), where \(p_1, p_2, \ldots , p_n\) are distinct primes and \(a_1, a_2, \ldots , a_n\) are positive integers. Then,

\[ \left(\text{\# of all } u \in [c] \text{ that are coprime to } c\right) = c \cdot \prod _{i=1}^{n} \left(1 - \frac{1}{p_i}\right) = \prod _{i=1}^{n} \left(p_i^{a_i} - p_i^{a_i - 1}\right). \]
theorem AlgebraicCombinatorics.InclusionExclusion.totient_eq_prod_one_sub_inv (c : ) (_hc : 0 < c) :
c.totient = c * pc.primeFactors, (1 - 1 / p)

The weighted version

blueprint
Theorem 4.65 Weighted version of the PIE

Let \(n \in \mathbb {N}\), and let \(U\) be a finite set. Let \(A_1, A_2, \ldots , A_n\) be \(n\) subsets of \(U\). Let \(G\) be any additive abelian group. Let \(w\colon U \to G\) be any map. Then,

\[ \sum _{\substack {u \in U \\ u \notin A_i \text{ for all } i \in [n]}} w(u) = \sum _{I \subseteq [n]} (-1)^{|I|} \sum _{\substack {u \in U \\ u \in A_i \text{ for all } i \in I}} w(u). \]
theorem AlgebraicCombinatorics.InclusionExclusion.weighted_pie {ι : Type u_1} {U : Type u_2} {G : Type u_3} [Fintype ι] [DecidableEq ι] [Fintype U] [DecidableEq U] [AddCommGroup G] (A : ιFinset U) (w : UG) :
uFinset.univ.inf fun (i : ι) => (A i), w u = IFinset.univ.powerset, (-1) ^ I.card uI.inf A, w u

Boolean Möbius inversion

blueprint
Theorem 4.70 Boolean Möbius inversion

Let \(S\) be a finite set. Let \(A\) be any additive abelian group.

For each subset \(I\) of \(S\), let \(a_{I}\) and \(b_{I}\) be two elements of \(A\).

Assume that

\begin{equation} b_{I}=\sum _{J\subseteq I}a_{J}\ \ \ \ \ \ \ \ \ \ \text{for all }I\subseteq S. \label{eq.thm.pie.moeb.ass} \end{equation}

Then, we also have

\begin{equation} a_{I}=\sum _{J\subseteq I}\left( -1\right) ^{\left\vert I\setminus J\right\vert }b_{J}\ \ \ \ \ \ \ \ \ \ \text{for all }I\subseteq S. \label{eq.thm.pie.moeb.claim} \end{equation}

theorem BooleanMobius.booleanMobiusInversion {α : Type u_1} [DecidableEq α] {S : Finset α} {A : Type u_2} [AddCommGroup A] (a b : Finset αA) (hab : IS, b I = JI.powerset, a J) (I : Finset α) :
I Sa I = JI.powerset, (-1) ^ (I \ J).card b J
blueprint
Lemma 4.68 Alternating sum over supersets

Let \(P \subseteq Q\) be two finite sets.

(a) We have

\begin{equation} \sum _{\substack {I\subseteq Q;\\ P\subseteq I}}\left( -1\right) ^{\left\vert I\right\vert }=\left( -1\right) ^{\left\vert P\right\vert }\left[ P=Q\right] . \label{eq.lem.pie.two-sets-altsum.a} \end{equation}

(b) We have

\begin{equation} \sum _{\substack {I\subseteq Q;\\ P\subseteq I}}\left( -1\right) ^{\left\vert Q\setminus I\right\vert }=\left[ P=Q\right] . \label{eq.lem.pie.two-sets-altsum.b} \end{equation}

theorem BooleanMobius.alternatingSum_superset_eq_iverson_a {α : Type u_1} [DecidableEq α] {P Q : Finset α} (hPQ : P Q) :
IQ.powerset with P I, (-1) ^ I.card = (-1) ^ P.card * if P = Q then 1 else 0
theorem BooleanMobius.alternatingSum_superset_eq_iverson_b {α : Type u_1} [DecidableEq α] {P Q : Finset α} (hPQ : P Q) :
IQ.powerset with P I, (-1) ^ (Q \ I).card = if P = Q then 1 else 0

More subtractive methods

Sums with varying signs

blueprint
Theorem 4.78

Let \(n\in \mathbb {N}\) and \(d\in \mathbb {N}\). Then, the number of all all-even \(n\)-tuples \(\left( x_{1},x_{2},\ldots ,x_{n}\right) \in \left[ d\right] ^{n}\) is

\[ \frac{1}{2^{d}}\sum _{k=0}^{d}\binom {d}{k}\left( d-2k\right) ^{n}. \]

More precisely (avoiding division), the number of all-even \(n\)-tuples multiplied by \(2^d\) equals \(\sum _{k=0}^{d}\binom {d}{k}(d-2k)^n\).

theorem AlgebraicCombinatorics.SubtractiveMethods.allEven_count_formula (n d : ) :
(allEvenTuples n d).card * 2 ^ d = kFinset.range (d + 1), (d.choose k) * (d - 2 * k) ^ n
blueprint
Lemma 4.80

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

\begin{align*} & \sum _{\left( e_{1},e_{2},\ldots ,e_{d}\right) \in \left\{ 1,-1\right\} ^{d}}\left( e_{1}+e_{2}+\cdots +e_{d}\right) ^{n}\\ & =\sum _{\left( x_{1},x_{2},\ldots ,x_{n}\right) \in \left[ d\right] ^{n}}\ \ \sum _{\left( e_{1},e_{2},\ldots ,e_{d}\right) \in \left\{ 1,-1\right\} ^{d}}e_{x_{1}}e_{x_{2}}\cdots e_{x_{n}}. \end{align*}
theorem AlgebraicCombinatorics.SubtractiveMethods.sum_signSum_pow_eq_sum_signProduct (n d : ) :
e : Fin dZMod 2, signSum e ^ n = x : Fin nFin d, e : Fin dZMod 2, signProduct e x
blueprint
Lemma 4.81

Let \(n,d\in \mathbb {N}\). Let \(\left( x_{1},x_{2},\ldots ,x_{n}\right) \in \left[ d\right] ^{n}\).

(a) If the \(n\)-tuple \(\left( x_{1},x_{2},\ldots ,x_{n}\right)\) is not all-even, then \(\sum _{\left( e_{1},\ldots ,e_{d}\right) \in \left\{ 1,-1\right\} ^{d}} e_{x_{1}}e_{x_{2}}\cdots e_{x_{n}}=0\).

(b) If the \(n\)-tuple \(\left( x_{1},x_{2},\ldots ,x_{n}\right)\) is all-even, then \(\sum _{\left( e_{1},\ldots ,e_{d}\right) \in \left\{ 1,-1\right\} ^{d}} e_{x_{1}}e_{x_{2}}\cdots e_{x_{n}}=2^{d}\).

Determinants

Definition

blueprint
Definition 5.3

Let \(n \in \mathbb {N}\). Let \(A \in K^{n \times n}\) be an \(n \times n\)-matrix. The determinant \(\det A\) of \(A\) is defined to be the element

\[ \sum _{\sigma \in S_n} (-1)^{\sigma } \underbrace{A_{1,\sigma (1)} A_{2,\sigma (2)} \cdots A_{n,\sigma (n)}}_{ = \prod _{i=1}^{n} A_{i,\sigma (i)}} \]

of \(K\). Here:

  • we let \(S_n\) denote the \(n\)-th symmetric group (i.e., the group of permutations of \([n] = \{ 1, 2, \ldots , n\} \));

  • we let \((-1)^{\sigma }\) denote the sign of the permutation \(\sigma \) (as defined in Definition 3.109).

theorem AlgebraicCombinatorics.Det.det_eq_sum_sign_prod_textbook {K : Type u_1} [CommRing K] {n : } (A : Matrix (Fin n) (Fin n) K) :
A.det = σ : Equiv.Perm (Fin n), Equiv.Perm.sign σ i : Fin n, A i (σ i)
blueprint
Proposition 5.12

Let \(n \in \mathbb {N}\) be such that \(n \geq 2\). Let \(x_1, x_2, \ldots , x_n \in K\) and \(y_1, y_2, \ldots , y_n \in K\). Then,

\[ \det \left( \left( x_i y_j \right)_{1 \leq i \leq n,\; 1 \leq j \leq n} \right) = 0. \]
theorem AlgebraicCombinatorics.Det.det_outerProduct_eq_zero {K : Type u_1} [CommRing K] {n : } (x y : Fin nK) (hn : 2 n) :
blueprint
Proposition 5.17

Let \(n \in \mathbb {N}\) be such that \(n \geq 3\). Let \(x_1, x_2, \ldots , x_n \in K\) and \(y_1, y_2, \ldots , y_n \in K\). Then,

\[ \det \left( \left( x_i + y_j \right)_{1 \leq i \leq n,\; 1 \leq j \leq n} \right) = 0. \]
theorem AlgebraicCombinatorics.Det.det_sumMatrix_eq_zero {K : Type u_1} [CommRing K] {n : } (x y : Fin nK) (hn : 3 n) :
(sumMatrix x y).det = 0

Basic properties

blueprint
Theorem 5.18 Transposes preserve determinants

Let \(n \in \mathbb {N}\). If \(A \in K^{n \times n}\) is any \(n \times n\)-matrix, then \(\det (A^T) = \det A\).

theorem AlgebraicCombinatorics.Det.det_transpose' {K : Type u_1} [CommRing K] {n : } (A : Matrix (Fin n) (Fin n) K) :
blueprint
Theorem 5.19 Determinants of triangular matrices

Let \(n \in \mathbb {N}\). Let \(A \in K^{n \times n}\) be a triangular (i.e., lower-triangular or upper-triangular) \(n \times n\)-matrix. Then, the determinant of the matrix \(A\) is the product of its diagonal entries. That is,

\[ \det A = A_{1,1} A_{2,2} \cdots A_{n,n}. \]
theorem AlgebraicCombinatorics.Det.det_upperTriangular {K : Type u_1} [CommRing K] {n : } (A : Matrix (Fin n) (Fin n) K) (hA : ∀ (i j : Fin n), j < iA i j = 0) :
A.det = i : Fin n, A i i
theorem AlgebraicCombinatorics.Det.det_lowerTriangular {K : Type u_1} [CommRing K] {n : } (A : Matrix (Fin n) (Fin n) K) (hA : ∀ (i j : Fin n), i < jA i j = 0) :
A.det = i : Fin n, A i i
blueprint
Theorem 5.20 Row operation properties

Let \(n \in \mathbb {N}\). Let \(A \in K^{n \times n}\) be an \(n \times n\)-matrix. Then:

(a) If we swap two rows of \(A\), then \(\det A\) gets multiplied by \(-1\).

(b) If \(A\) has a zero row (i.e., a row that consists entirely of zeroes), then \(\det A = 0\).

(c) If \(A\) has two equal rows, then \(\det A = 0\).

(d) Let \(\lambda \in K\). If we multiply a row of \(A\) by \(\lambda \) (that is, we multiply all entries of this one row by \(\lambda \), while leaving all other entries of \(A\) unchanged), then \(\det A\) gets multiplied by \(\lambda \).

(e) If we add a row of \(A\) to another row of \(A\) (that is, we add each entry of the former row to the corresponding entry of the latter), then \(\det A\) stays unchanged.

(f) Let \(\lambda \in K\). If we add \(\lambda \) times a row of \(A\) to another row of \(A\) (that is, we add \(\lambda \) times each entry of the former row to the corresponding entry of the latter), then \(\det A\) stays unchanged.

(g) Let \(B, C \in K^{n \times n}\) be two further \(n \times n\)-matrices. Let \(k \in [n]\). Assume that

\[ (\text{the } k\text{-th row of } C) = (\text{the } k\text{-th row of } A) + (\text{the } k\text{-th row of } B), \]

whereas each \(i \neq k\) satisfies

\[ (\text{the } i\text{-th row of } C) = (\text{the } i\text{-th row of } A) = (\text{the } i\text{-th row of } B). \]

Then,

\[ \det C = \det A + \det B. \]
theorem AlgebraicCombinatorics.Det.det_swap_rows {K : Type u_1} [CommRing K] {n : } (A : Matrix (Fin n) (Fin n) K) (i j : Fin n) (hij : i j) :
(Matrix.of (A (Equiv.swap i j))).det = -A.det
theorem AlgebraicCombinatorics.Det.det_zero_row {K : Type u_1} [CommRing K] {n : } (A : Matrix (Fin n) (Fin n) K) (i : Fin n) (hi : ∀ (j : Fin n), A i j = 0) :
A.det = 0
theorem AlgebraicCombinatorics.Det.det_eq_rows {K : Type u_1} [CommRing K] {n : } (A : Matrix (Fin n) (Fin n) K) (i j : Fin n) (hij : i j) (hrows : A i = A j) :
A.det = 0
theorem AlgebraicCombinatorics.Det.det_scale_row {K : Type u_1} [CommRing K] {n : } (A : Matrix (Fin n) (Fin n) K) (i : Fin n) (c : K) :
(A.updateRow i (c A i)).det = c * A.det
theorem AlgebraicCombinatorics.Det.det_add_row {K : Type u_1} [CommRing K] {n : } (A : Matrix (Fin n) (Fin n) K) (i j : Fin n) (hij : i j) :
(A.updateRow i (A i + A j)).det = A.det
theorem AlgebraicCombinatorics.Det.det_add_smul_row {K : Type u_1} [CommRing K] {n : } (A : Matrix (Fin n) (Fin n) K) (i j : Fin n) (hij : i j) (c : K) :
(A.updateRow i (A i + c A j)).det = A.det
theorem AlgebraicCombinatorics.Det.det_row_add {K : Type u_1} [CommRing K] {n : } (A B C : Matrix (Fin n) (Fin n) K) (k : Fin n) (hk : C k = A k + B k) (hother : ∀ (i : Fin n), i kC i = A i A i = B i) :
C.det = A.det + B.det
blueprint
Theorem 5.21 Column operation properties

Theorem 5.20 also holds if we replace “row” by “column” throughout it.

theorem AlgebraicCombinatorics.Det.det_swap_cols {K : Type u_1} [CommRing K] {n : } (A : Matrix (Fin n) (Fin n) K) (i j : Fin n) (hij : i j) :
(A.submatrix id (Equiv.swap i j)).det = -A.det
theorem AlgebraicCombinatorics.Det.det_zero_col {K : Type u_1} [CommRing K] {n : } (A : Matrix (Fin n) (Fin n) K) (j : Fin n) (hj : ∀ (i : Fin n), A i j = 0) :
A.det = 0
theorem AlgebraicCombinatorics.Det.det_eq_cols {K : Type u_1} [CommRing K] {n : } (A : Matrix (Fin n) (Fin n) K) (i j : Fin n) (hij : i j) (hcols : ∀ (k : Fin n), A k i = A k j) :
A.det = 0
theorem AlgebraicCombinatorics.Det.det_scale_col {K : Type u_1} [CommRing K] {n : } (A : Matrix (Fin n) (Fin n) K) (j : Fin n) (c : K) :
(Matrix.of fun (i k : Fin n) => if k = j then c * A i k else A i k).det = c * A.det
theorem AlgebraicCombinatorics.Det.det_add_col {K : Type u_1} [CommRing K] {n : } (A : Matrix (Fin n) (Fin n) K) (i j : Fin n) (hij : i j) :
(A.updateCol i fun (k : Fin n) => A k i + A k j).det = A.det
theorem AlgebraicCombinatorics.Det.det_add_smul_col {K : Type u_1} [CommRing K] {n : } (A : Matrix (Fin n) (Fin n) K) (i j : Fin n) (hij : i j) (c : K) :
(A.updateCol i fun (k : Fin n) => A k i + c * A k j).det = A.det
theorem AlgebraicCombinatorics.Det.det_col_add {K : Type u_1} [CommRing K] {n : } (A B C : Matrix (Fin n) (Fin n) K) (k : Fin n) (hk : ∀ (i : Fin n), C i k = A i k + B i k) (hother : ∀ (i j : Fin n), j kC i j = A i j A i j = B i j) :
C.det = A.det + B.det
blueprint
Corollary 5.22

Let \(n \in \mathbb {N}\). Let \(A \in K^{n \times n}\) and \(\tau \in S_n\). Then,

\begin{equation} \det \left( \left( A_{\tau (i), j} \right)_{1 \leq i \leq n,\; 1 \leq j \leq n} \right) = (-1)^{\tau } \cdot \det A \label{eq.cor.det.sig-row-col.row} \end{equation}

and

\begin{equation} \det \left( \left( A_{i, \tau (j)} \right)_{1 \leq i \leq n,\; 1 \leq j \leq n} \right) = (-1)^{\tau } \cdot \det A. \label{eq.cor.det.sig-row-col.col} \end{equation}

theorem AlgebraicCombinatorics.Det.det_permute_rows {K : Type u_1} [CommRing K] {n : } (A : Matrix (Fin n) (Fin n) K) (τ : Equiv.Perm (Fin n)) :
(A.submatrix (⇑τ) id).det = (Equiv.Perm.sign τ) * A.det
theorem AlgebraicCombinatorics.Det.det_permute_cols {K : Type u_1} [CommRing K] {n : } (A : Matrix (Fin n) (Fin n) K) (τ : Equiv.Perm (Fin n)) :
(A.submatrix id τ).det = (Equiv.Perm.sign τ) * A.det
blueprint
Theorem 5.23 Multiplicativity of the determinant

Let \(n \in \mathbb {N}\). Let \(A, B \in K^{n \times n}\) be two \(n \times n\)-matrices. Then,

\[ \det (AB) = \det A \cdot \det B. \]
theorem AlgebraicCombinatorics.Det.det_mul' {K : Type u_1} [CommRing K] {n : } (A B : Matrix (Fin n) (Fin n) K) :
(A * B).det = A.det * B.det
blueprint
Corollary 5.24

Let \(n \in \mathbb {N}\). Let \(A \in K^{n \times n}\) and \(d_1, d_2, \ldots , d_n \in K\). Then,

\begin{equation} \det \left( \left( d_i A_{i,j} \right)_{1 \leq i \leq n,\; 1 \leq j \leq n} \right) = d_1 d_2 \cdots d_n \cdot \det A \label{eq.cor.det.scale-row-col.row} \end{equation}

and

\begin{equation} \det \left( \left( d_j A_{i,j} \right)_{1 \leq i \leq n,\; 1 \leq j \leq n} \right) = d_1 d_2 \cdots d_n \cdot \det A. \label{eq.cor.det.scale-row-col.col} \end{equation}

theorem AlgebraicCombinatorics.Det.det_scale_rows {K : Type u_1} [CommRing K] {n : } (A : Matrix (Fin n) (Fin n) K) (d : Fin nK) :
(Matrix.of fun (i j : Fin n) => d i * A i j).det = (∏ i : Fin n, d i) * A.det
theorem AlgebraicCombinatorics.Det.det_scale_cols {K : Type u_1} [CommRing K] {n : } (A : Matrix (Fin n) (Fin n) K) (d : Fin nK) :
(Matrix.of fun (i j : Fin n) => d j * A i j).det = (∏ j : Fin n, d j) * A.det

Cauchy–Binet

blueprint
Theorem 5.39 Cauchy–Binet formula

Let \(n,m\in \mathbb {N}\). Let \(A\in K^{n\times m}\) be an \(n\times m\)-matrix, and let \(B\in K^{m\times n}\) be an \(m\times n\)-matrix. Then,

\[ \det (AB) = \sum _{\substack {(g_1,g_2,\ldots ,g_n)\in [m]^n;\\ g_1{\lt}g_2{\lt}\cdots {\lt}g_n}} \det (\operatorname {cols}_{g_1,g_2,\ldots ,g_n} A) \cdot \det (\operatorname {rows}_{g_1,g_2,\ldots ,g_n} B). \]

Here, \(\operatorname {cols}_{g_1,\ldots ,g_n} A\) is the \(n\times n\)-matrix obtained from \(A\) by keeping only columns \(g_1,g_2,\ldots ,g_n\), and \(\operatorname {rows}_{g_1,\ldots ,g_n} B\) is the \(n\times n\)-matrix obtained from \(B\) by keeping only rows \(g_1,g_2,\ldots ,g_n\).

Equivalently, the sum runs over all \(n\)-element subsets \(S\) of \([m]\):

\[ \det (AB) = \sum _{\substack {S \subseteq [m] \\ |S|=n}} \det (\operatorname {cols}_S A) \cdot \det (\operatorname {rows}_S B). \]
theorem AlgebraicCombinatorics.CauchyBinet.cauchyBinet {R : Type u_1} [CommRing R] {n m : } (A : Matrix (Fin n) (Fin m) R) (B : Matrix (Fin m) (Fin n) R) :
(A * B).det = SFinset.powersetCard n Finset.univ, if h : S.card = n then (colsSubmatrix A S h).det * (rowsSubmatrix B S h).det else 0

$\det\left( A+B\right) $

blueprint
Definition 5.35

Let \(n,m\in \mathbb {N}\). Let \(A\) be an \(n\times m\)-matrix.

Let \(U\) be a subset of \([n]\). Let \(V\) be a subset of \([m]\).

Writing the two sets \(U\) and \(V\) as

\[ U=\{ u_1,u_2,\ldots ,u_p\} \quad \text{and}\quad V=\{ v_1,v_2,\ldots ,v_q\} \]

with

\[ u_1{\lt}u_2{\lt}\cdots {\lt}u_p \quad \text{and}\quad v_1{\lt}v_2{\lt}\cdots {\lt}v_q, \]

we set

\[ \operatorname {sub}_U^V A:=\left(A_{u_i,v_j}\right)_{1\le i\le p,\ 1\le j\le q}. \]

Roughly speaking, \(\operatorname {sub}_U^V A\) is the matrix obtained from \(A\) by focusing only on the \(i\)-th rows for \(i\in U\) (that is, removing all the other rows) and only on the \(j\)-th columns for \(j\in V\) (that is, removing all the other columns).

This matrix \(\operatorname {sub}_U^V A\) is called the submatrix of \(A\) obtained by restricting to the \(U\)-rows and the \(V\)-columns. If this matrix is square (i.e., if \(|U|=|V|\)), then its determinant \(\det (\operatorname {sub}_U^V A)\) is called a minor of \(A\).

blueprint
Theorem 5.61

Let \(n\in \mathbb {N}\). For any subset \(I\) of \([n]\), let \(\widetilde{I} = [n]\setminus I\) denote its complement.

Let \(A\) and \(B\) be two \(n\times n\)-matrices in \(K^{n\times n}\). Then,

\[ \det (A+B) = \sum _{P\subseteq [n]}\; \; \sum _{\substack {Q\subseteq [n];\\ |P|=|Q|}} (-1)^{\operatorname {sum} P + \operatorname {sum} Q} \det (\operatorname {sub}_P^Q A) \cdot \det (\operatorname {sub}_{\widetilde{P}}^{\widetilde{Q}} B). \]
theorem AlgebraicCombinatorics.CauchyBinet.det_add_sum {R : Type u_1} [CommRing R] {n : } (A B : Matrix (Fin n) (Fin n) R) :
(A + B).det = P : Finset (Fin n), Q : Finset (Fin n), if h : Q.card = P.card then (-1) ^ (finsetSumFin P + finsetSumFin Q) * submatrixDet A Q P h * submatrixDet B Q P else 0
blueprint
Lemma 5.62

Let \(n\in \mathbb {N}\). Let \(d_1,d_2,\ldots ,d_n\in K\). Let

\[ D:=\operatorname {diag}(d_1,d_2,\ldots ,d_n) =\begin{pmatrix} d_1 & 0 & \cdots & 0 \\ 0 & d_2 & \cdots & 0 \\ \vdots & \vdots & \ddots & \vdots \\ 0 & 0 & \cdots & d_n \end{pmatrix}\in K^{n\times n}. \]

(a) We have \(\det (\operatorname {sub}_P^P D) = \prod _{i\in P} d_i\) for any subset \(P\) of \([n]\).

(b) Let \(P\) and \(Q\) be two distinct subsets of \([n]\) satisfying \(|P|=|Q|\). Then, \(\det (\operatorname {sub}_P^Q D) = 0\).

theorem AlgebraicCombinatorics.CauchyBinet.det_diagonal_submatrix_eq {R : Type u_1} [CommRing R] {n : } (d : Fin nR) (P : Finset (Fin n)) :
((Matrix.diagonal d).submatrix (P.orderEmbOfFin ) (P.orderEmbOfFin )).det = iP, d i
theorem AlgebraicCombinatorics.CauchyBinet.det_diagonal_submatrix_off_diag {R : Type u_1} [CommRing R] {n : } (d : Fin nR) (P Q : Finset (Fin n)) (hcard : P.card = Q.card) (hne : P Q) :
blueprint
Theorem 5.63

Let \(n\in \mathbb {N}\). Let \(A\) and \(D\) be two \(n\times n\)-matrices in \(K^{n\times n}\) such that the matrix \(D\) is diagonal. Let \(d_1,d_2,\ldots ,d_n\) be the diagonal entries of the diagonal matrix \(D\). Then,

\[ \det (A+D) = \sum _{P\subseteq [n]} \det (\operatorname {sub}_P^P A) \cdot \prod _{i\in [n]\setminus P} d_i. \]

The minors \(\det (\operatorname {sub}_P^P A)\) are called the principal minors of \(A\).

theorem AlgebraicCombinatorics.CauchyBinet.det_add_diagonal {R : Type u_1} [CommRing R] {n : } (A : Matrix (Fin n) (Fin n) R) (d : Fin nR) :
(A + Matrix.diagonal d).det = P : Finset (Fin n), (A.submatrix (P.orderEmbOfFin ) (P.orderEmbOfFin )).det * iP, d i
blueprint
Proposition 5.67

Let \(n\in \mathbb {N}\). Let \(d_1,d_2,\ldots ,d_n\in K\) and \(x\in K\). Let \(F\) be the \(n\times n\)-matrix

\[ \begin{pmatrix} x+d_1 & x & \cdots & x \\ x & x+d_2 & \cdots & x \\ \vdots & \vdots & \ddots & \vdots \\ x & x & \cdots & x+d_n \end{pmatrix}\in K^{n\times n}. \]

Then,

\[ \det F = d_1 d_2 \cdots d_n + x \sum _{i=1}^n d_1 d_2 \cdots \widehat{d_i} \cdots d_n, \]

where the hat over “\(d_i\)” means “omit the \(d_i\) factor.”

theorem AlgebraicCombinatorics.CauchyBinet.det_const_add_diagonal {R : Type u_1} [CommRing R] {n : } (x : R) (d : Fin nR) :
(constPlusDiagMatrix x d).det = i : Fin n, d i + x * i : Fin n, jFinset.univ.erase i, d j
blueprint
Proposition 5.68

Let \(n\in \mathbb {N}\). Let \(A\in K^{n\times n}\) be an \(n\times n\)-matrix. Let \(x\in K\). Let \(I_n\) denote the \(n\times n\) identity matrix. Then,

\[ \det (A + x I_n) = \sum _{P\subseteq [n]} \det (\operatorname {sub}_P^P A) \cdot x^{n-|P|} = \sum _{k=0}^{n} \biggl(\sum _{\substack {P\subseteq [n];\\ |P|=n-k}} \det (\operatorname {sub}_P^P A)\biggr) x^k. \]
theorem AlgebraicCombinatorics.CauchyBinet.det_charPoly_coeff {R : Type u_1} [CommRing R] {n : } (A : Matrix (Fin n) (Fin n) R) (x : R) :
(A + x 1).det = P : Finset (Fin n), (A.submatrix (P.orderEmbOfFin ) (P.orderEmbOfFin )).det * x ^ (n - P.card)
theorem AlgebraicCombinatorics.CauchyBinet.det_charPoly_coeff' {R : Type u_1} [CommRing R] {n : } (A : Matrix (Fin n) (Fin n) R) (x : R) :
(A + x 1).det = kFinset.range (n + 1), (∑ P : Finset (Fin n) with P.card = n - k, (A.submatrix (P.orderEmbOfFin ) (P.orderEmbOfFin )).det) * x ^ k

Factoring the matrix

blueprint
Proposition 5.74

Let \(n\in \mathbb {N}\). Let \(A\) be the \(n\times n\)-matrix

\[ \Bigl(\binom {i+j-2}{i-1}\Bigr)_{1\le i\le n,\ 1\le j\le n} = \begin{pmatrix} \binom {0}{0} & \binom {1}{0} & \cdots & \binom {n-1}{0} \\ \binom {1}{1} & \binom {2}{1} & \cdots & \binom {n}{1} \\ \vdots & \vdots & \ddots & \vdots \\ \binom {n-1}{n-1} & \binom {n}{n-1} & \cdots & \binom {2n-2}{n-1} \end{pmatrix}. \]

Then \(\det A = 1\).

Factor hunting

blueprint
Theorem 5.75 Vandermonde determinant

Let \(n \in \mathbb {N}\). Let \(a_1, a_2, \ldots , a_n\) be \(n\) elements of \(K\). Then:

(a) We have

\[ \det \left( \left( a_i^{n-j} \right)_{1 \leq i \leq n,\; 1 \leq j \leq n} \right) = \prod _{1 \leq i {\lt} j \leq n} (a_i - a_j). \]

(b) We have

\[ \det \left( \left( a_j^{n-i} \right)_{1 \leq i \leq n,\; 1 \leq j \leq n} \right) = \prod _{1 \leq i {\lt} j \leq n} (a_i - a_j). \]

(c) We have

\[ \det \left( \left( a_i^{j-1} \right)_{1 \leq i \leq n,\; 1 \leq j \leq n} \right) = \prod _{1 \leq j {\lt} i \leq n} (a_i - a_j). \]

(d) We have

\[ \det \left( \left( a_j^{i-1} \right)_{1 \leq i \leq n,\; 1 \leq j \leq n} \right) = \prod _{1 \leq j {\lt} i \leq n} (a_i - a_j). \]
theorem AlgebraicCombinatorics.Determinants.vandermonde_det_a {R : Type u_1} [CommRing R] {n : } (a : Fin nR) :
(vandermondeMat a).det = i : Fin n, jFinset.Ioi i, (a i - a j)
theorem AlgebraicCombinatorics.Determinants.vandermonde_det_b {R : Type u_1} [CommRing R] {n : } (a : Fin nR) :
(vandermondeMat a).transpose.det = i : Fin n, jFinset.Ioi i, (a i - a j)
theorem AlgebraicCombinatorics.Determinants.vandermonde_det_c {R : Type u_1} [CommRing R] {n : } (a : Fin nR) :
(vandermondeMat' a).det = i : Fin n, jFinset.Iio i, (a i - a j)
theorem AlgebraicCombinatorics.Determinants.vandermonde_det_d {R : Type u_1} [CommRing R] {n : } (a : Fin nR) :
(vandermondeMat' a).transpose.det = i : Fin n, jFinset.Iio i, (a i - a j)
blueprint
Lemma 5.76

Let \(n \in \mathbb {N}\). Consider the polynomial ring \(\mathbb {Z}[x_1, x_2, \ldots , x_n]\) in \(n\) indeterminates \(x_1, x_2, \ldots , x_n\) with integer coefficients. In this ring, we have

\begin{equation} \det \left( \left( x_i^{n-j} \right)_{1 \leq i \leq n,\; 1 \leq j \leq n} \right) = \prod _{1 \leq i {\lt} j \leq n} (x_i - x_j). \label{eq.lem.det.vander.a.pol.1} \end{equation}

blueprint
Convention 5.78

Let \(n \in \mathbb {N}\). Let \(A\) be an \(n \times n\)-matrix. Let \(i, j \in [n]\). Then, we set

\[ A_{\sim i, \sim j} := \operatorname {sub}_{[n] \setminus \{ i\} }^{[n] \setminus \{ j\} } A. \]

This is the \((n-1) \times (n-1)\)-matrix obtained from \(A\) by removing its \(i\)-th row and its \(j\)-th column.

theorem AlgebraicCombinatorics.Determinants.det_sum_pow {R : Type u_1} [CommRing R] {n : } (x y : Fin nR) :
(sumPowMat x y).det = ((∏ k : Fin n, (n - 1).choose k) * i : Fin n, jFinset.Ioi i, (x i - x j)) * i : Fin n, jFinset.Ioi i, (y j - y i)

Laplace expansion

blueprint
Theorem 5.79 Laplace expansion

Let \(n \in \mathbb {N}\). Let \(A \in K^{n \times n}\) be an \(n \times n\)-matrix.

(a) For every \(p \in [n]\), we have

\[ \det A = \sum _{q=1}^{n} (-1)^{p+q} A_{p,q} \det (A_{\sim p, \sim q}). \]

(b) For every \(q \in [n]\), we have

\[ \det A = \sum _{p=1}^{n} (-1)^{p+q} A_{p,q} \det (A_{\sim p, \sim q}). \]
theorem AlgebraicCombinatorics.Determinants.det_laplace_row {R : Type u_1} [CommRing R] {m : } (A : Matrix (Fin (m + 1)) (Fin (m + 1)) R) (p : Fin (m + 1)) :
A.det = q : Fin (m + 1), (-1) ^ (p + q) * A p q * (submatrixRemove A p q).det
theorem AlgebraicCombinatorics.Determinants.det_laplace_col {R : Type u_1} [CommRing R] {m : } (A : Matrix (Fin (m + 1)) (Fin (m + 1)) R) (q : Fin (m + 1)) :
A.det = p : Fin (m + 1), (-1) ^ (p + q) * A p q * (submatrixRemove A p q).det
blueprint
Proposition 5.80

Let \(n \in \mathbb {N}\). Let \(A \in K^{n \times n}\) be an \(n \times n\)-matrix. Let \(r \in [n]\).

(a) For every \(p \in [n]\) satisfying \(p \neq r\), we have

\[ 0 = \sum _{q=1}^{n} (-1)^{p+q} A_{r,q} \det (A_{\sim p, \sim q}). \]

(b) For every \(q \in [n]\) satisfying \(q \neq r\), we have

\[ 0 = \sum _{p=1}^{n} (-1)^{p+q} A_{p,r} \det (A_{\sim p, \sim q}). \]
theorem AlgebraicCombinatorics.Determinants.det_laplace_row_zero {R : Type u_1} [CommRing R] {m : } (A : Matrix (Fin (m + 1)) (Fin (m + 1)) R) (p r : Fin (m + 1)) (hpr : p r) :
q : Fin (m + 1), (-1) ^ (p + q) * A r q * (submatrixRemove A p q).det = 0
theorem AlgebraicCombinatorics.Determinants.det_laplace_col_zero {R : Type u_1} [CommRing R] {m : } (A : Matrix (Fin (m + 1)) (Fin (m + 1)) R) (q r : Fin (m + 1)) (hqr : q r) :
p : Fin (m + 1), (-1) ^ (p + q) * A p r * (submatrixRemove A p q).det = 0
blueprint
Definition 5.81 Adjugate matrix

Let \(n \in \mathbb {N}\). Let \(A \in K^{n \times n}\) be an \(n \times n\)-matrix. We define a new \(n \times n\)-matrix \(\operatorname {adj} A \in K^{n \times n}\) by

\[ \operatorname {adj} A = \left( (-1)^{i+j} \det (A_{\sim j, \sim i}) \right)_{1 \leq i \leq n,\; 1 \leq j \leq n}. \]

This matrix \(\operatorname {adj} A\) is called the adjugate (or classical adjoint) of the matrix \(A\). Note the index swap: the \((i,j)\) entry involves removing row \(j\) and column \(i\).

The formalization shows that this definition equals Mathlib’s Matrix.adjugate, which is defined via \((\operatorname {adj} A)_{i,j} = \det (A')\) where \(A'\) is the matrix \(A\) with row \(j\) replaced by the \(i\)-th standard basis vector.

blueprint
Convention 5.83

For any subset \(I\) of \([n]\), we write \(\widetilde{I} = [n] \setminus I\) for its complement, and \(\operatorname {sum} S = \sum _{s \in S} s\) for any finite set \(S\) of integers.

blueprint
Theorem 5.84 Laplace expansion along multiple rows/columns

Let \(n \in \mathbb {N}\). Let \(A \in K^{n \times n}\) be an \(n \times n\)-matrix.

(a) For every subset \(P\) of \([n]\), we have

\[ \det A = \sum _{\substack {Q \subseteq [n] \\ |Q| = |P|}} (-1)^{\operatorname {sum} P + \operatorname {sum} Q} \det \left( \operatorname {sub}_P^Q A \right) \det \left( \operatorname {sub}_{\widetilde{P}}^{\widetilde{Q}} A \right). \]

(b) For every subset \(Q\) of \([n]\), we have

\[ \det A = \sum _{\substack {P \subseteq [n] \\ |P| = |Q|}} (-1)^{\operatorname {sum} P + \operatorname {sum} Q} \det \left( \operatorname {sub}_P^Q A \right) \det \left( \operatorname {sub}_{\widetilde{P}}^{\widetilde{Q}} A \right). \]
theorem AlgebraicCombinatorics.Determinants.det_laplace_multi_row {R : Type u_1} [CommRing R] {m : } (A : Matrix (Fin m) (Fin m) R) (P : Finset (Fin m)) :
A.det = QsameCardSubsets m P, (-1) ^ (P.sum Fin.val + Q.sum Fin.val) * submatrixDet A P Q * submatrixDet A P Q
theorem AlgebraicCombinatorics.Determinants.det_laplace_multi_col {R : Type u_1} [CommRing R] {m : } (A : Matrix (Fin m) (Fin m) R) (Q : Finset (Fin m)) :
A.det = PsameCardSubsets m Q, (-1) ^ (P.sum Fin.val + Q.sum Fin.val) * submatrixDet A P Q * submatrixDet A P Q

Desnanot–Jacobi and Dodgson condensation

blueprint
Theorem 5.85 Desnanot–Jacobi formula, take 1

Let \(n \in \mathbb {N}\) be such that \(n \geq 2\). Let \(A \in K^{n \times n}\) be an \(n \times n\)-matrix.

Let \(A'\) be the \((n-2) \times (n-2)\)-matrix

\[ \operatorname {sub}_{\{ 2, 3, \ldots , n-1\} }^{\{ 2, 3, \ldots , n-1\} } A = \left( A_{i+1, j+1} \right)_{1 \leq i \leq n-2,\; 1 \leq j \leq n-2}. \]

(This is what remains of \(A\) when we remove the first row, the last row, the first column and the last column.) Then,

\begin{align*} \det A \cdot \det (A’) & = \det (A_{\sim 1, \sim 1}) \cdot \det (A_{\sim n, \sim n}) - \det (A_{\sim 1, \sim n}) \cdot \det (A_{\sim n, \sim 1}) \\ & = \det \begin{pmatrix} \det (A_{\sim 1, \sim 1}) & \det (A_{\sim 1, \sim n}) \\ \det (A_{\sim n, \sim 1}) & \det (A_{\sim n, \sim n}) \end{pmatrix}. \end{align*}
theorem AlgebraicCombinatorics.Determinants.desnanot_jacobi {R : Type u_1} [CommRing R] {m : } (A : Matrix (Fin (m + 2)) (Fin (m + 2)) R) :
theorem AlgebraicCombinatorics.Determinants.desnanot_jacobi_det2 {R : Type u_1} [CommRing R] {m : } (A : Matrix (Fin (m + 2)) (Fin (m + 2)) R) :
A.det * (innerSubmatrix A).det = !![(submatrixRemove A 0 0).det, (submatrixRemove A 0 (Fin.last (m + 1))).det; (submatrixRemove A (Fin.last (m + 1)) 0).det, (submatrixRemove A (Fin.last (m + 1)) (Fin.last (m + 1))).det].det
blueprint
Theorem 5.88

Let \(n \in \mathbb {N}\) be such that \(n \geq 2\). Let \(p, q, u, v\) be four elements of \([n]\) such that \(p {\lt} q\) and \(u {\lt} v\). Let \(A\) be an \(n \times n\)-matrix. Then,

\begin{align*} & \det A \cdot \det \left( \operatorname {sub}_{[n] \setminus \{ p, q\} }^{[n] \setminus \{ u, v\} } A \right) \\ & = \det (A_{\sim p, \sim u}) \cdot \det (A_{\sim q, \sim v}) - \det (A_{\sim p, \sim v}) \cdot \det (A_{\sim q, \sim u}). \end{align*}
theorem AlgebraicCombinatorics.Determinants.desnanot_jacobi_general {R : Type u_1} [CommRing R] {m : } (A : Matrix (Fin (m + 2)) (Fin (m + 2)) R) (p q u v : Fin (m + 2)) (hpq : p < q) (huv : u < v) :
A.det * (submatrixRemove2 A p q u v hpq huv).det = (submatrixRemove A p u).det * (submatrixRemove A q v).det - (submatrixRemove A p v).det * (submatrixRemove A q u).det
blueprint
Theorem 5.89 Jacobi’s complementary minor theorem for adjugates

Let \(n \in \mathbb {N}\). For any subset \(I\) of \([n]\), let \(\widetilde{I}\) denote the complement \([n] \setminus I\). Set \(\operatorname {sum} S = \sum _{s \in S} s\) for any finite set \(S\) of integers.

Let \(A \in K^{n \times n}\) be an \(n \times n\)-matrix. Let \(P\) and \(Q\) be two subsets of \([n]\) such that \(|P| = |Q| \geq 1\). Then,

\[ \det \left( \operatorname {sub}_P^Q (\operatorname {adj} A) \right) = (-1)^{\operatorname {sum} P + \operatorname {sum} Q} (\det A)^{|Q| - 1} \det \left( \operatorname {sub}_{\widetilde{Q}}^{\widetilde{P}} A \right). \]
theorem AlgebraicCombinatorics.Determinants.jacobi_complementary_minor {R : Type u_1} [CommRing R] {m : } (A : Matrix (Fin m) (Fin m) R) (P Q : Finset (Fin m)) (hPQ : P.card = Q.card) (_hP : P.card 1) :

The Lindström–Gessel–Viennot lemma

Definitions

blueprint
Definition 5.120

We consider the infinite simple digraph with vertex set \(\mathbb {Z}^{2}\) (so the vertices are pairs of integers) and arcs

\[ \left( i,j\right) \rightarrow \left( i+1,j\right) \ \ \ \ \ \ \ \ \ \ \text{for all }\left( i,j\right) \in \mathbb {Z}^{2} \]

and

\[ \left( i,j\right) \rightarrow \left( i,j+1\right) \ \ \ \ \ \ \ \ \ \ \text{for all }\left( i,j\right) \in \mathbb {Z}^{2}. \]

The arcs of the first form are called east-steps or right-steps; the arcs of the second form are called north-steps or up-steps.

The vertices of this digraph will be called lattice points or grid points or simply points.

The entire digraph will be denoted by \(\mathbb {Z}^{2}\) and called the integer lattice or integer grid.

Any path is uniquely determined by its starting point and its step sequence.

Counting paths from $\left( a,b\right) $ to $\left( c,d\right) $

blueprint
Proposition 5.129

Let \(\left( a,b\right) \in \mathbb {Z}^{2}\) and \(\left( c,d\right) \in \mathbb {Z}^{2}\) be two points. Then,

\[ \left( \text{\# of paths from }\left( a,b\right) \text{ to }\left( c,d\right) \right) =\begin{cases} \binom {c+d-a-b}{c-a}, & \text{if }c+d\geq a+b;\\ 0, & \text{if }c+d{\lt}a+b. \end{cases} \]

Path tuples, nipats and ipats

blueprint
Definition 5.130

Let \(k\in \mathbb {N}\).

(a) A \(k\)-vertex means a \(k\)-tuple of lattice points.

(b) If \(\mathbf{A}=\left( A_{1},A_{2},\ldots ,A_{k}\right) \) is a \(k\)-vertex, and if \(\sigma \in S_{k}\) is a permutation, then \(\sigma \left( \mathbf{A}\right) \) shall denote the \(k\)-vertex \(\left( A_{\sigma \left( 1\right) },A_{\sigma \left( 2\right) },\ldots ,A_{\sigma \left( k\right) }\right) \).

(c) If \(\mathbf{A}=\left( A_{1},A_{2},\ldots ,A_{k}\right) \) and \(\mathbf{B}=\left( B_{1},B_{2},\ldots ,B_{k}\right) \) are two \(k\)-vertices, then a path tuple from \(\mathbf{A}\) to \(\mathbf{B}\) means a \(k\)-tuple \(\left( p_{1},p_{2},\ldots ,p_{k}\right) \), where each \(p_{i}\) is a path from \(A_{i}\) to \(B_{i}\).

(d) A path tuple \(\left( p_{1},p_{2},\ldots ,p_{k}\right) \) is said to be non-intersecting if no two of the paths \(p_{1},p_{2},\ldots ,p_{k}\) have any vertex in common. We abbreviate “non-intersecting path tuple” as nipat.

(e) A path tuple \(\left( p_{1},p_{2},\ldots ,p_{k}\right) \) is said to be intersecting if it is not non-intersecting (i.e., if two of its paths have a vertex in common). We abbreviate “intersecting path tuple” as ipat.

def LGV1.kVertex.permute {k : } (v : kVertex k) (σ : Equiv.Perm (Fin k)) :
structure LGV1.PathTuple (k : ) (A B : kVertex k) :
def LGV1.PathTuple.isNonIntersecting {k : } {A B : kVertex k} (pt : PathTuple k A B) :

The LGV lemma for two paths

blueprint
Proposition 5.145 LGV lemma for two paths

Let \(\left( A,A^{\prime }\right) \) and \(\left( B,B^{\prime }\right) \) be two \(2\)-vertices (i.e., let \(A,A^{\prime },B,B^{\prime }\) be four lattice points). Then,

\begin{align*} & \det \left( \begin{array}[c]{cc}\left( \text{\# of paths from }A\text{ to }B\right) & \left( \text{\# of paths from }A\text{ to }B^{\prime }\right) \\ \left( \text{\# of paths from }A^{\prime }\text{ to }B\right) & \left( \text{\# of paths from }A^{\prime }\text{ to }B^{\prime }\right) \end{array} \right) \\ & =\left( \text{\# of nipats from }\left( A,A^{\prime }\right) \text{ to }\left( B,B^{\prime }\right) \right) \\ & \ \ \ \ \ \ \ \ \ \ -\left( \text{\# of nipats from }\left( A,A^{\prime }\right) \text{ to }\left( B^{\prime },B\right) \right) . \end{align*}
theorem LGV1.lgv_two_paths (A A' B B' : LatticePoint) :
(pathMatrix2 A A' B B').det = (numNipats2 A A' B B') - (numNipats2 A A' B' B)
blueprint
Proposition 5.146 baby Jordan curve theorem

Let \(A\), \(B\), \(A^{\prime }\) and \(B^{\prime }\) be four lattice points satisfying

\begin{align*} \operatorname {x}\left( A^{\prime }\right) & \leq \operatorname {x}\left( A\right) ,\ \ \ \ \ \ \ \ \ \ \operatorname {y}\left( A^{\prime }\right) \geq \operatorname {y}\left( A\right) ,\\ \operatorname {x}\left( B^{\prime }\right) & \leq \operatorname {x}\left( B\right) ,\ \ \ \ \ \ \ \ \ \ \operatorname {y}\left( B^{\prime }\right) \geq \operatorname {y}\left( B\right) . \end{align*}

(That is, \(A'\) is weakly northwest of \(A\), and \(B'\) is weakly northwest of \(B\).)

Let \(p\) be any path from \(A\) to \(B^{\prime }\). Let \(p^{\prime }\) be any path from \(A^{\prime }\) to \(B\). Then, \(p\) and \(p^{\prime }\) have a vertex in common.

In particular, there are no nipats from \((A, A')\) to \((B', B)\).

theorem LGV1.baby_jordan_curve (A A' B B' : LatticePoint) (hA : isWeaklyNorthwestOf A' A) (hB : isWeaklyNorthwestOf B' B) (p p' : LatticePath) (hp : p.isPathFromTo A B') (hp' : p'.isPathFromTo A' B) :
vp.vertices A, v p'.vertices A'
theorem LGV1.no_nipats_under_nw (A A' B B' : LatticePoint) (hA : isWeaklyNorthwestOf A' A) (hB : isWeaklyNorthwestOf B' B) :
numNipats2 A A' B' B = 0
blueprint
Corollary 5.147

Let \(n,k\in \mathbb {N}\). Then, \(\binom {n}{k}^{2}\geq \binom {n}{k-1}\cdot \binom {n}{k+1}\).

theorem LGV1.binom_log_concave (n k : ) (hk : 1 k) :
n.choose k * n.choose k n.choose (k - 1) * n.choose (k + 1)

The LGV lemma for $k$ paths

blueprint
Proposition 5.153 LGV lemma, lattice counting version

Let \(k\in \mathbb {N}\). Let \(\mathbf{A}=\left( A_{1},A_{2},\ldots ,A_{k}\right) \) and \(\mathbf{B}=\left( B_{1},B_{2},\ldots ,B_{k}\right) \) be two \(k\)-vertices. Then,

\begin{align*} & \det \left( \left( \text{\# of paths from }A_{i}\text{ to }B_{j}\right) _{1\leq i\leq k,\ 1\leq j\leq k}\right) \\ & =\sum _{\sigma \in S_{k}}\left( -1\right) ^{\sigma }\left( \text{\# of nipats from }\mathbf{A}\text{ to }\sigma \left( \mathbf{B}\right) \right) . \end{align*}
theorem LGV1.lgv_k_paths {k : } (A B : kVertex k) :
(pathMatrixK A B).det = σ : Equiv.Perm (Fin k), (Equiv.Perm.sign σ) * (numNipatsK A B σ)

The weighted version

blueprint
Theorem 5.154 LGV lemma, lattice weight version

Let \(K\) be a commutative ring.

For each arc \(a\) of the digraph \(\mathbb {Z}^{2}\), let \(w(a)\) be an element of \(K\). We call \(w(a)\) the weight of \(a\).

For each path \(p\) of \(\mathbb {Z}^{2}\), define the weight \(w(p)\) of \(p\) by

\[ w(p) := \prod _{a \text{ is an arc of } p} w(a). \]

For each path tuple \(\mathbf{p} = (p_1, p_2, \ldots , p_k)\), define the weight \(w(\mathbf{p})\) of \(\mathbf{p}\) by

\[ w(\mathbf{p}) := w(p_1)\, w(p_2) \cdots w(p_k). \]

Let \(k \in \mathbb {N}\). Let \(\mathbf{A} = (A_1, A_2, \ldots , A_k)\) and \(\mathbf{B} = (B_1, B_2, \ldots , B_k)\) be two \(k\)-vertices. Then,

\[ \det \! \left(\left(\sum _{p : A_i \to B_j} w(p)\right)_{1 \le i \le k,\; 1 \le j \le k}\right) = \sum _{\sigma \in S_k} (-1)^{\sigma } \sum _{\substack {\mathbf{p} \text{ is a nipat} \\ \text{from } \mathbf{A} \text{ to } \sigma (\mathbf{B})}} w(\mathbf{p}). \]

Here, “\(p : A_i \to B_j\)” means “\(p\) is a path from \(A_i\) to \(B_j\)”.

Generalization to acyclic digraphs

blueprint
Theorem 5.155 LGV lemma, digraph weight version

Let \(K\) be a commutative ring.

Let \(D\) be a path-finite (but possibly infinite) acyclic digraph.

For each arc \(a\) of \(D\), let \(w(a) \in K\). For each path \(p\) of \(D\), define \(w(p) := \prod _{a \text{ is an arc of } p} w(a)\). For each path tuple \(\mathbf{p} = (p_1, \ldots , p_k)\), define \(w(\mathbf{p}) := w(p_1) \cdots w(p_k)\).

Let \(k \in \mathbb {N}\). Let \(\mathbf{A} = (A_1, \ldots , A_k)\) and \(\mathbf{B} = (B_1, \ldots , B_k)\) be two \(k\)-tuples of vertices of \(D\). Then,

\[ \det \! \left(\left(\sum _{p : A_i \to B_j} w(p)\right)_{1 \le i \le k,\; 1 \le j \le k}\right) = \sum _{\sigma \in S_k} (-1)^{\sigma } \sum _{\substack {\mathbf{p} \text{ is a nipat} \\ \text{from } \mathbf{A} \text{ to } \sigma (\mathbf{B})}} w(\mathbf{p}). \]
theorem LGV.lgv_weighted_digraph {K : Type u_2} [CommRing K] {V : Type u_4} [DecidableEq V] {D : SimpleDigraph V} (hpf : D.IsPathFinite) (hac : D.IsAcyclic) {k : } (w : ArcWeight D K) (A B : kVertex V k) :
(pathWeightMatrix hpf w A B).det = σ : Equiv.Perm (Fin k), Equiv.Perm.sign σ nipatWeightSum hpf w A (permuteKVertex σ B) σ

The nonpermutable case

blueprint
Corollary 5.175 LGV lemma, nonpermutable lattice weight version

Consider the setting of Theorem 5.154, but additionally assume that

\begin{align} \operatorname {x}(A_1) & \ge \operatorname {x}(A_2) \ge \cdots \ge \operatorname {x}(A_k); \label{eq.cor.lgv.kpaths.wt-np.xA} \\ \operatorname {y}(A_1) & \le \operatorname {y}(A_2) \le \cdots \le \operatorname {y}(A_k); \label{eq.cor.lgv.kpaths.wt-np.yA} \\ \operatorname {x}(B_1) & \ge \operatorname {x}(B_2) \ge \cdots \ge \operatorname {x}(B_k); \label{eq.cor.lgv.kpaths.wt-np.xB} \\ \operatorname {y}(B_1) & \le \operatorname {y}(B_2) \le \cdots \le \operatorname {y}(B_k). \label{eq.cor.lgv.kpaths.wt-np.yB} \end{align}

Here, \(\operatorname {x}(P)\) and \(\operatorname {y}(P)\) denote the two coordinates of any point \(P \in \mathbb {Z}^2\).

Then, there are no nipats from \(\mathbf{A}\) to \(\sigma (\mathbf{B})\) when \(\sigma \in S_k\) is not the identity permutation \(\operatorname {id} \in S_k\). Therefore, the claim of Theorem 5.154 simplifies to

\begin{equation} \det \! \left(\left(\sum _{p : A_i \to B_j} w(p)\right)_{1 \le i \le k,\; 1 \le j \le k}\right) = \sum _{\substack {\mathbf{p} \text{ is a nipat} \\ \text{from } \mathbf{A} \text{ to } \mathbf{B}}} w(\mathbf{p}). \label{eq.cor.lgv.kpaths.wt-np.claim} \end{equation}

blueprint
Corollary 5.181

Let \(k \in \mathbb {N}\). Let \(a_1, a_2, \ldots , a_k\) and \(b_1, b_2, \ldots , b_k\) be nonnegative integers such that

\[ a_1 \ge a_2 \ge \cdots \ge a_k \qquad \text{and} \qquad b_1 \ge b_2 \ge \cdots \ge b_k. \]

Then,

\[ \det \! \left(\left(\binom {a_i}{b_j}\right)_{1 \le i \le k,\; 1 \le j \le k}\right) \ge 0. \]
theorem LGV.binom_det_nonneg {k : } (a b : Fin k) (ha : ∀ (i j : Fin k), i ja j a i) (hb : ∀ (i j : Fin k), i jb j b i) :
0 (Matrix.of fun (i j : Fin k) => ((a i).choose (b j))).det

Definitions and examples of symmetric polynomials

blueprint
Definition 6.2

(a) Let \(\mathcal{P}\) be the polynomial ring \(K[x_1, x_2, \ldots , x_N]\) in \(N\) variables over \(K\). This is not just a ring; it is a commutative \(K\)-algebra.

(b) The symmetric group \(S_N\) acts on the set \(\mathcal{P}\) according to the formula

\[ \sigma \cdot f = f[x_{\sigma (1)}, x_{\sigma (2)}, \ldots , x_{\sigma (N)}] \quad \text{for any } \sigma \in S_N \text{ and any } f \in \mathcal{P}. \]

Here, \(f[a_1, a_2, \ldots , a_N]\) means the result of substituting \(a_1, a_2, \ldots , a_N\) for the indeterminates \(x_1, x_2, \ldots , x_N\) in a polynomial \(f \in \mathcal{P}\).

Roughly speaking, the group \(S_N\) is thus acting on \(\mathcal{P}\) by permuting variables: A permutation \(\sigma \in S_N\) transforms a polynomial \(f\) by substituting \(x_{\sigma (i)}\) for each \(x_i\).

Note that this action of \(S_N\) on \(\mathcal{P}\) is a well-defined group action (as we will see in Proposition 6.3 below).

(c) A polynomial \(f \in \mathcal{P}\) is said to be symmetric if it satisfies

\[ \sigma \cdot f = f \quad \text{for all } \sigma \in S_N. \]

(d) We let \(\mathcal{S}\) be the set of all symmetric polynomials \(f \in \mathcal{P}\).

blueprint
Proposition 6.3

The action of \(S_N\) on \(\mathcal{P}\) is a well-defined group action. In other words, the following holds:

(a) We have \(\operatorname {id}_{[N]} \cdot f = f\) for every \(f \in \mathcal{P}\).

(b) We have \((\sigma \tau ) \cdot f = \sigma \cdot (\tau \cdot f)\) for every \(\sigma , \tau \in S_N\) and \(f \in \mathcal{P}\).

blueprint
Proposition 6.4

The group \(S_N\) acts on \(\mathcal{P}\) by \(K\)-algebra automorphisms. In other words, for each \(\sigma \in S_N\), the map

\begin{align*} \mathcal{P} & \to \mathcal{P}, \\ f & \mapsto \sigma \cdot f \end{align*}

is a \(K\)-algebra automorphism of \(\mathcal{P}\).

  • One or more equations did not get rendered due to their size.
blueprint
Definition 6.6

The \(K\)-subalgebra \(\mathcal{S}\) of \(\mathcal{P}\) is called the ring of symmetric polynomials in \(N\) variables over \(K\).

blueprint
Definition 6.7

(a) A monomial is an expression of the form \(x_1^{a_1} x_2^{a_2} \cdots x_N^{a_N}\) with \(a_1, a_2, \ldots , a_N \in \mathbb {N}\).

(b) The degree \(\deg \mathfrak {m}\) of a monomial \(\mathfrak {m} = x_1^{a_1} x_2^{a_2} \cdots x_N^{a_N}\) is defined to be \(a_1 + a_2 + \cdots + a_N \in \mathbb {N}\).

(c) A monomial \(\mathfrak {m} = x_1^{a_1} x_2^{a_2} \cdots x_N^{a_N}\) is said to be squarefree if \(a_1, a_2, \ldots , a_N \in \{ 0,1\} \). (This is saying that no square or higher power of an indeterminate appears in \(\mathfrak {m}\); thus the name “squarefree”.)

(d) A monomial \(\mathfrak {m} = x_1^{a_1} x_2^{a_2} \cdots x_N^{a_N}\) is said to be primal if there is at most one \(i \in [N]\) satisfying \(a_i {\gt} 0\). (This is saying that the monomial \(\mathfrak {m}\) contains no two distinct indeterminates. Thus, a primal monomial is just \(1\) or a power of an indeterminate.)

blueprint
Definition 6.8

(a) For each \(n \in \mathbb {Z}\), define a symmetric polynomial \(e_n \in \mathcal{S}\) by

\[ e_n = \sum _{\substack {(i_1, i_2, \ldots , i_n) \in [N]^n; \\ i_1 {\lt} i_2 {\lt} \cdots {\lt} i_n}} x_{i_1} x_{i_2} \cdots x_{i_n} = (\text{sum of all squarefree monomials of degree } n). \]

This \(e_n\) is called the \(n\)-th elementary symmetric polynomial in \(x_1, x_2, \ldots , x_N\).

(b) For each \(n \in \mathbb {Z}\), define a symmetric polynomial \(h_n \in \mathcal{S}\) by

\[ h_n = \sum _{\substack {(i_1, i_2, \ldots , i_n) \in [N]^n; \\ i_1 \leq i_2 \leq \cdots \leq i_n}} x_{i_1} x_{i_2} \cdots x_{i_n} = (\text{sum of all monomials of degree } n). \]

This \(h_n\) is called the \(n\)-th complete homogeneous symmetric polynomial in \(x_1, x_2, \ldots , x_N\).

(c) For each \(n \in \mathbb {Z}\), define a symmetric polynomial \(p_n \in \mathcal{S}\) by

\begin{align*} p_n & = \begin{cases} x_1^n + x_2^n + \cdots + x_N^n, & \text{if } n {\gt} 0; \\ 1, & \text{if } n = 0; \\ 0, & \text{if } n {\lt} 0 \end{cases}\\ & = (\text{sum of all primal monomials of degree } n). \end{align*}

This \(p_n\) is called the \(n\)-th power sum in \(x_1, x_2, \ldots , x_N\).

blueprint
Proposition 6.9

For each integer \(n {\gt} N\), we have \(e_n = 0\).

blueprint
Theorem 6.12 Newton–Girard formulas

For any positive integer \(n\), we have

\begin{align} \sum _{j=0}^{n} (-1)^j e_j h_{n-j} & = 0; \label{eq.thm.sf.NG.eh} \\ \sum _{j=1}^{n} (-1)^{j-1} e_{n-j} p_j & = n e_n; \label{eq.thm.sf.NG.ep} \\ \sum _{j=1}^{n} h_{n-j} p_j & = n h_n. \label{eq.thm.sf.NG.hp} \end{align}
theorem AlgebraicCombinatorics.SymmetricPolynomials.newtonGirard_eh {K : Type u_1} [CommRing K] {N : } [DecidableEq (Fin N)] (n : ) (hn : 0 < n) :
jFinset.range (n + 1), (-1) ^ j * e j * h (n - j) = 0
theorem AlgebraicCombinatorics.SymmetricPolynomials.newtonGirard_hp {K : Type u_1} [CommRing K] {N : } [DecidableEq (Fin N)] (n : ) (_hn : 0 < n) :
jFinset.range n, h (n - 1 - j) * p (j + 1) = n * h n
theorem AlgebraicCombinatorics.SymmetricPolynomials.newtonGirard_esymm {K : Type u_1} [CommRing K] {N : } (k : ) :
k * e k = (-1) ^ (k + 1) * aFinset.antidiagonal k with a.1 < k, (-1) ^ a.1 * e a.1 * p a.2
blueprint
Proposition 6.10

(a) In the polynomial ring \(\mathcal{P}[t]\), we have

\[ \prod _{i=1}^{N} (1 - t x_i) = \sum _{n \in \mathbb {N}} (-1)^n t^n e_n. \]

(b) In the polynomial ring \(\mathcal{P}[u,v]\), we have

\[ \prod _{i=1}^{N} (u - v x_i) = \sum _{n=0}^{N} (-1)^n u^{N-n} v^n e_n. \]

(c) In the FPS ring \(\mathcal{P}[[t]]\), we have

\[ \prod _{i=1}^{N} \frac{1}{1 - t x_i} = \sum _{n \in \mathbb {N}} t^n h_n. \]
blueprint
Theorem 6.13 Fundamental Theorem of Symmetric Polynomials

(a) The elementary symmetric polynomials \(e_1, e_2, \ldots , e_N\) are algebraically independent (over \(K\)) and generate the \(K\)-algebra \(\mathcal{S}\).

In other words, each \(f \in \mathcal{S}\) can be uniquely written as a polynomial in \(e_1, e_2, \ldots , e_N\).

In yet other words, the map

\begin{align*} K[y_1, y_2, \ldots , y_N] & \to \mathcal{S}, \\ g & \mapsto g[e_1, e_2, \ldots , e_N] \end{align*}

is a \(K\)-algebra isomorphism.

(b) The complete homogeneous symmetric polynomials \(h_1, h_2, \ldots , h_N\) are algebraically independent (over \(K\)) and generate the \(K\)-algebra \(\mathcal{S}\).

In other words, each \(f \in \mathcal{S}\) can be uniquely written as a polynomial in \(h_1, h_2, \ldots , h_N\).

In yet other words, the map

\begin{align*} K[y_1, y_2, \ldots , y_N] & \to \mathcal{S}, \\ g & \mapsto g[h_1, h_2, \ldots , h_N] \end{align*}

is a \(K\)-algebra isomorphism.

(c) Now assume that \(K\) is a commutative \(\mathbb {Q}\)-algebra (e.g., a field of characteristic \(0\)). Then, the power sums \(p_1, p_2, \ldots , p_N\) are algebraically independent (over \(K\)) and generate the \(K\)-algebra \(\mathcal{S}\).

In other words, each \(f \in \mathcal{S}\) can be uniquely written as a polynomial in \(p_1, p_2, \ldots , p_N\).

In yet other words, the map

\begin{align*} K[y_1, y_2, \ldots , y_N] & \to \mathcal{S}, \\ g & \mapsto g[p_1, p_2, \ldots , p_N] \end{align*}

is a \(K\)-algebra isomorphism.

theorem AlgebraicCombinatorics.SymmetricPolynomials.hsymm_generates_symmetric {K : Type u_1} [CommRing K] {N : } [DecidableEq (Fin N)] [IsDomain K] (f : (S K N)) :
∃! g : MvPolynomial (Fin N) K, (MvPolynomial.aeval fun (i : Fin N) => MvPolynomial.hsymm (Fin N) K (i + 1)) g = f
theorem AlgebraicCombinatorics.SymmetricPolynomials.psum_generates_symmetric {K : Type u_1} [CommRing K] {N : } [Algebra K] [IsDomain K] (f : (S K N)) :
∃! g : MvPolynomial (Fin N) K, (MvPolynomial.aeval fun (i : Fin N) => MvPolynomial.psum (Fin N) K (i + 1)) g = f
blueprint
Lemma 6.14

For each \(i \in [N-1]\), let \(s_i \in S_N\) denote the simple transposition that swaps \(i\) and \(i+1\).

Let \(f \in \mathcal{P}\). Assume that

\begin{equation} s_k \cdot f = f \quad \text{for each } k \in [N-1]. \label{eq.lem.sf.simples-enough.ass} \end{equation}

Then, the polynomial \(f\) is symmetric.

$N$-partitions and monomial symmetric polynomials

blueprint
Definition 6.30

An \(N\)-partition will mean a weakly decreasing \(N\)-tuple of nonnegative integers. In other words, an \(N\)-partition means an \(N\)-tuple \(\left( \lambda _{1},\lambda _{2},\ldots ,\lambda _{N}\right) \in \mathbb {N}^{N}\) with \(\lambda _{1}\geq \lambda _{2}\geq \cdots \geq \lambda _{N}\).

The size (or weight) of an \(N\)-partition \(\lambda = (\lambda _1, \lambda _2, \ldots , \lambda _N)\) is defined to be \(|\lambda | := \lambda _1 + \lambda _2 + \cdots + \lambda _N\).

blueprint
Proposition 6.31

There is a bijection

\begin{align*} \left\{ \text{partitions of length }\leq N\right\} & \rightarrow \left\{ N\text{-partitions}\right\} ,\\ \left( \lambda _{1},\lambda _{2},\ldots ,\lambda _{\ell }\right) & \mapsto \left( \lambda _{1},\lambda _{2},\ldots ,\lambda _{\ell },\underbrace{0,0,\ldots ,0}_{N-\ell \text{ zeroes}}\right) . \end{align*}
  • One or more equations did not get rendered due to their size.
blueprint
Definition 6.44

Let \(a=\left( a_{1},a_{2},\ldots ,a_{N}\right) \in \mathbb {N}^{N}\). Then:

(a) We let \(x^{a}\) denote the monomial \(x_{1}^{a_{1}}x_{2}^{a_{2}}\cdots x_{N}^{a_{N}}\).

(b) We let \(\operatorname *{sort}a\) mean the \(N\)-partition obtained from \(a\) by sorting the entries of \(a\) in weakly decreasing order.

  • One or more equations did not get rendered due to their size.
blueprint
Definition 6.58

Let \(\lambda \) be any \(N\)-partition. Then, we define a symmetric polynomial \(m_{\lambda }\in \mathcal{S}\) by

\[ m_{\lambda }:=\sum _{\substack {a\in \mathbb {N}^{N};\\ \operatorname *{sort}a=\lambda }}x^{a}. \]

This is called the monomial symmetric polynomial corresponding to \(\lambda \).

blueprint
Proposition 6.63

(a) For each \(n\in \left\{ 0,1,\ldots ,N\right\} \), we have

\[ e_{n}=m_{\left( 1,1,\ldots ,1,0,0,\ldots ,0\right) }, \]

where \(\left( 1,1,\ldots ,1,0,0,\ldots ,0\right) \) is the \(N\)-tuple that begins with \(n\) many \(1\)’s and ends with \(N-n\) many \(0\)’s.

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

\[ h_{n}=\sum _{\substack {\lambda \text{ is an }N\text{-partition;}\\ \left\vert \lambda \right\vert =n}}m_{\lambda }, \]

where the size \(\left\vert \lambda \right\vert \) of an \(N\)-partition \(\lambda \) is defined to be the sum of its entries (i.e., if \(\lambda =\left( \lambda _{1},\lambda _{2},\ldots ,\lambda _{N}\right) \), then \(\left\vert \lambda \right\vert :=\lambda _{1}+\lambda _{2}+\cdots +\lambda _{N}\)).

(c) Assume that \(N{\gt}0\). For each \(n\in \mathbb {N}\), we have

\[ p_{n}=m_{\left( n,0,0,\ldots ,0\right) }, \]

where \(\left( n,0,0,\ldots ,0\right) \) is the \(N\)-tuple that begins with an \(n\) and ends with \(N-1\) zeroes.

blueprint
Theorem 6.78

(a) The family \(\left( m_{\lambda }\right) _{\lambda \text{ is an }N\text{-partition}}\) is a basis of the \(K\)-module \(\mathcal{S}\).

(b) Each symmetric polynomial \(f\in \mathcal{S}\) satisfies

\[ f=\sum _{\substack {\lambda =\left( \lambda _{1},\lambda _{2},\ldots ,\lambda _{N}\right) \\ \text{is an }N\text{-partition}}}\left( \left[ x_{1}^{\lambda _{1}}x_{2}^{\lambda _{2}}\cdots x_{N}^{\lambda _{N}}\right] f\right) m_{\lambda }. \]

(c) Let \(n\in \mathbb {N}\). Let

\[ \mathcal{S}_{n}:=\left\{ \text{homogeneous symmetric polynomials }f\in \mathcal{P}\text{ of degree }n\right\} \]

(where we understand the zero polynomial \(0\in \mathcal{P}\) to be homogeneous of every degree). Then, \(\mathcal{S}_{n}\) is a \(K\)-submodule of \(\mathcal{S}\).

(d) The family \(\left( m_{\lambda }\right) _{\lambda \text{ is an }N\text{-partition of size }n}\) is a basis of the \(K\)-module \(\mathcal{S}_{n}\).

blueprint
Proposition 6.72

Let \(\sigma \in S_{N}\) and \(f\in \mathcal{P}\). Then,

\[ \left[ x_{1}^{a_{1}}x_{2}^{a_{2}}\cdots x_{N}^{a_{N}}\right] \left( \sigma \cdot f\right) =\left[ x_{1}^{a_{\sigma \left( 1\right) }}x_{2}^{a_{\sigma \left( 2\right) }}\cdots x_{N}^{a_{\sigma \left( N\right) }}\right] f \]

for any \(\left( a_{1},a_{2},\ldots ,a_{N}\right) \in \mathbb {N}^{N}\).

Schur polynomials

Alternants

blueprint
Definition 6.85

(a) We let \(\rho \) be the \(N\)-tuple \(\left( N-1,N-2,\ldots ,N-N\right) \in \mathbb {N}^{N}\).

(b) For any \(N\)-tuple \(\alpha =\left( \alpha _{1},\alpha _{2},\ldots ,\alpha _{N}\right) \in \mathbb {N}^{N}\), we define

\[ a_{\alpha }:=\det \left( \underbrace{\left( x_{i}^{\alpha _{j}}\right) _{1\leq i\leq N,\ 1\leq j\leq N}}_{\in \mathcal{P}^{N\times N}}\right) \in \mathcal{P}. \]

This is called the \(\alpha \)-alternant (of \(x_{1},x_{2},\ldots ,x_{N}\)).

noncomputable abbrev alternant {R : Type u_1} [CommRing R] (N : ) (α : Fin N) :

Young diagrams and Schur polynomials

blueprint
Definition 6.91

Let \(\lambda \) be an \(N\)-partition.

The Young diagram of \(\lambda \) is defined as the set

\[ \left\{ \left( i,j\right) \ \mid \ i\in \left[ N\right] \text{ and }j\in \left[ \lambda _{i}\right] \right\} \subseteq \left\{ 1,2,3,\ldots \right\} ^{2}. \]

We visually represent each element \(\left( i,j\right) \) of this Young diagram as a box in row \(i\) and column \(j\).

We denote the Young diagram of \(\lambda \) by \(Y\left( \lambda \right) \).

blueprint
Definition 6.93

Let \(\lambda \) be an \(N\)-partition.

A Young tableau of shape \(\lambda \) means a way of filling the boxes of \(Y\left( \lambda \right) \) with elements of \(\left[ N\right] \) (one element per box). Formally speaking, it is defined as a map \(T:Y\left( \lambda \right) \rightarrow \left[ N\right] \).

structure YoungTableau {N : } [NeZero N] (lam : NPartition N) :
blueprint
Definition 6.94

Let \(\lambda \) be an \(N\)-partition.

A Young tableau \(T\) of shape \(\lambda \) is said to be semistandard if its entries

  • increase weakly along each row (from left to right);

  • increase strictly down each column (from top to bottom).

Formally speaking, this means that a Young tableau \(T:Y\left( \lambda \right) \rightarrow \left[ N\right] \) is semistandard if and only if

  • we have \(T\left( i,j\right) \leq T\left( i,j+1\right) \) for any \(\left( i,j\right) \in Y\left( \lambda \right) \) satisfying \(\left( i,j+1\right) \in Y\left( \lambda \right) \);

  • we have \(T\left( i,j\right) {\lt}T\left( i+1,j\right) \) for any \(\left( i,j\right) \in Y\left( \lambda \right) \) satisfying \(\left( i+1,j\right) \in Y\left( \lambda \right) \).

We let \(\operatorname *{SSYT}\left( \lambda \right) \) denote the set of all semistandard Young tableaux of shape \(\lambda \).

structure SSYT {N : } [NeZero N] (lam : NPartition N) extends YoungTableau lam :
blueprint
Definition 6.101

Let \(\lambda \) be an \(N\)-partition. If \(T\) is any Young tableau of shape \(\lambda \), then we define the corresponding monomial

\[ x_{T}:=\prod _{c\text{ is a box of }Y\left( \lambda \right) }x_{T\left( c\right) }=\prod _{\left( i,j\right) \in Y\left( \lambda \right) }x_{T\left( i,j\right) }=\prod _{k=1}^{N}x_{k}^{\left( \text{\# of times }k\text{ appears in }T\right) }. \]
blueprint
Definition 6.103

Let \(\lambda \) be an \(N\)-partition. We define the Schur polynomial \(s_{\lambda }\in \mathcal{P}\) by

\[ s_{\lambda }:=\sum _{T\in \operatorname *{SSYT}\left( \lambda \right) }x_{T}. \]
blueprint
Theorem 6.107

Let \(\lambda \) be an \(N\)-partition. Then:

(a) The polynomial \(s_{\lambda }\) is symmetric.

(b) We have

\[ a_{\lambda +\rho }=a_{\rho }\cdot s_{\lambda }. \]

Here, the addition on \(\mathbb {N}^{N}\) is defined entrywise.

theorem schurPoly_isSymmetric {N : } [NeZero N] (lam : NPartition N) (σ : Equiv.Perm (Fin N)) :
theorem alternant_eq_rho_mul_schur {N : } [NeZero N] (lam : NPartition N) :
(alternant N fun (i : Fin N) => lam.parts i + rhoVector N i) = alternant N (rhoVector N) * schurPoly lam

Skew Young diagrams and skew Schur polynomials

blueprint
Definition 6.108

Let \(\lambda \) and \(\mu \) be two \(N\)-partitions.

We say that \(\mu \subseteq \lambda \) if and only if \(Y\left( \mu \right) \subseteq Y\left( \lambda \right) \). Equivalently, \(\mu \subseteq \lambda \) if and only if

\[ \text{each }i\in \left[ N\right] \text{ satisfies }\mu _{i}\leq \lambda _{i}. \]

Thus we have defined a partial order \(\subseteq \) on the set of all \(N\)-partitions.

instance NPartition.instLE {N : } :
blueprint
Definition 6.110

Let \(\lambda \) and \(\mu \) be two \(N\)-partitions such that \(\mu \subseteq \lambda \). Then, we define the skew Young diagram \(Y\left( \lambda /\mu \right) \) to be the set difference

\begin{align*} Y\left( \lambda \right) \setminus Y\left( \mu \right) & =\left\{ \left( i,j\right) \ \mid \ i\in \left[ N\right] \text{ and }j\in \left[ \lambda _{i}\right] \setminus \left[ \mu _{i}\right] \right\} \\ & =\left\{ \left( i,j\right) \ \mid \ i\in \left[ N\right] \text{ and }j\in \mathbb {Z}\text{ and }\mu _{i}{\lt}j\leq \lambda _{i}\right\} . \end{align*}
blueprint
Lemma 6.113 Convexity of skew Young diagrams

Let \(\lambda \) and \(\mu \) be two \(N\)-partitions such that \(\mu \subseteq \lambda \). Let \(\left( a,b\right) \) and \(\left( e,f\right) \) be two elements of \(Y\left( \lambda /\mu \right) \). Let \(\left( c,d\right) \in \mathbb {Z}^{2}\) satisfy \(a\leq c\leq e\) and \(b\leq d\leq f\). Then, \(\left( c,d\right) \in Y\left( \lambda /\mu \right) \).

theorem skewYoungDiagram_convex {N : } [NeZero N] {lam mu : NPartition N} {a e : Fin N} {b f : } (hab : (a, b) skewYoungDiagram lam mu) (hef : (e, f) skewYoungDiagram lam mu) {c : Fin N} {d : } (hac : a c) (hce : c e) (hbd : b d) (hdf : d f) :
blueprint
Definition 6.114

Let \(\lambda \) and \(\mu \) be two \(N\)-partitions such that \(\mu \subseteq \lambda \). A Young tableau of shape \(\lambda /\mu \) means a way of filling the boxes of \(Y\left( \lambda /\mu \right) \) with elements of \(\left[ N\right] \) (one element per box). Formally speaking, it is defined as a map \(T:Y\left( \lambda /\mu \right) \rightarrow \left[ N\right] \).

Young tableaux of shape \(\lambda /\mu \) are often called skew Young tableaux.

If we don’t have \(\mu \subseteq \lambda \), then we agree that there are no Young tableaux of shape \(\lambda /\mu \).

structure SkewYoungTableau {N : } [NeZero N] (lam mu : NPartition N) :
  • entry : Fin N × Fin N

    The filling function T : Y(λ/μ) → [N]

  • support (c : Fin N × ) : cskewYoungDiagram lam muself.entry c = 0

    The entry is only meaningful for cells in the skew diagram

blueprint
Definition 6.115

Let \(\lambda \) and \(\mu \) be two \(N\)-partitions.

A Young tableau \(T\) of shape \(\lambda /\mu \) is said to be semistandard if its entries

  • increase weakly along each row (from left to right);

  • increase strictly down each column (from top to bottom).

Formally speaking, this means that a Young tableau \(T:Y\left( \lambda /\mu \right) \rightarrow \left[ N\right] \) is semistandard if and only if

  • we have \(T\left( i,j\right) \leq T\left( i,j+1\right) \) for any \(\left( i,j\right) \in Y\left( \lambda /\mu \right) \) satisfying \(\left( i,j+1\right) \in Y\left( \lambda /\mu \right) \);

  • we have \(T\left( i,j\right) {\lt}T\left( i+1,j\right) \) for any \(\left( i,j\right) \in Y\left( \lambda /\mu \right) \) satisfying \(\left( i+1,j\right) \in Y\left( \lambda /\mu \right) \).

We let \(\operatorname *{SSYT}\left( \lambda /\mu \right) \) denote the set of all semistandard Young tableaux of shape \(\lambda /\mu \).

structure SkewSSYT {N : } [NeZero N] (lam mu : NPartition N) extends SkewYoungTableau lam mu :
blueprint
Lemma 6.116

Let \(\lambda \) and \(\mu \) be two \(N\)-partitions. Let \(T\) be a semistandard Young tableau of shape \(\lambda /\mu \). Then:

(a) If \(\left( i,j_{1}\right) \) and \(\left( i,j_{2}\right) \) are two elements of \(Y\left( \lambda /\mu \right) \) satisfying \(j_{1}\leq j_{2}\), then \(T\left( i,j_{1}\right) \leq T\left( i,j_{2}\right) \).

(b) If \(\left( i_{1},j\right) \) and \(\left( i_{2},j\right) \) are two elements of \(Y\left( \lambda /\mu \right) \) satisfying \(i_{1}\leq i_{2}\), then \(T\left( i_{1},j\right) \leq T\left( i_{2},j\right) \).

(c) If \(\left( i_{1},j\right) \) and \(\left( i_{2},j\right) \) are two elements of \(Y\left( \lambda /\mu \right) \) satisfying \(i_{1}{\lt}i_{2}\), then \(T\left( i_{1},j\right) {\lt}T\left( i_{2},j\right) \).

(d) If \(\left( i_{1},j_{1}\right) \) and \(\left( i_{2},j_{2}\right) \) are two elements of \(Y\left( \lambda /\mu \right) \) satisfying \(i_{1}\leq i_{2}\) and \(j_{1}\leq j_{2}\), then \(T\left( i_{1},j_{1}\right) \leq T\left( i_{2},j_{2}\right) \).

(e) If \(\left( i_{1},j_{1}\right) \) and \(\left( i_{2},j_{2}\right) \) are two elements of \(Y\left( \lambda /\mu \right) \) satisfying \(i_{1}{\lt}i_{2}\) and \(j_{1}\leq j_{2}\), then \(T\left( i_{1},j_{1}\right) {\lt}T\left( i_{2},j_{2}\right) \).

theorem SkewSSYT.row_weak_of_le {N : } [NeZero N] {lam mu : NPartition N} (T : SkewSSYT lam mu) {i : Fin N} {j₁ j₂ : } (h1 : (i, j₁) skewYoungDiagram lam mu) (h2 : (i, j₂) skewYoungDiagram lam mu) (hle : j₁ j₂) :
T.entry (i, j₁) T.entry (i, j₂)
theorem SkewSSYT.col_weak {N : } [NeZero N] {lam mu : NPartition N} (T : SkewSSYT lam mu) {i₁ i₂ : Fin N} {j : } (h1 : (i₁, j) skewYoungDiagram lam mu) (h2 : (i₂, j) skewYoungDiagram lam mu) (hle : i₁ i₂) :
T.entry (i₁, j) T.entry (i₂, j)
theorem SkewSSYT.col_strict_of_lt {N : } [NeZero N] {lam mu : NPartition N} (T : SkewSSYT lam mu) {i₁ i₂ : Fin N} {j : } (h1 : (i₁, j) skewYoungDiagram lam mu) (h2 : (i₂, j) skewYoungDiagram lam mu) (hlt : i₁ < i₂) :
T.entry (i₁, j) < T.entry (i₂, j)
theorem SkewSSYT.monotone {N : } [NeZero N] {lam mu : NPartition N} (T : SkewSSYT lam mu) {i₁ i₂ : Fin N} {j₁ j₂ : } (h1 : (i₁, j₁) skewYoungDiagram lam mu) (h2 : (i₂, j₂) skewYoungDiagram lam mu) (hi : i₁ i₂) (hj : j₁ j₂) :
T.entry (i₁, j₁) T.entry (i₂, j₂)
theorem SkewSSYT.strict_monotone {N : } [NeZero N] {lam mu : NPartition N} (T : SkewSSYT lam mu) {i₁ i₂ : Fin N} {j₁ j₂ : } (h1 : (i₁, j₁) skewYoungDiagram lam mu) (h2 : (i₂, j₂) skewYoungDiagram lam mu) (hi : i₁ < i₂) (hj : j₁ j₂) :
T.entry (i₁, j₁) < T.entry (i₂, j₂)
blueprint
Definition 6.117

Let \(\lambda \) and \(\mu \) be two \(N\)-partitions. If \(T\) is any Young tableau of shape \(\lambda /\mu \), then we define the corresponding monomial

\[ x_{T}:=\prod _{c\text{ is a box of }Y\left( \lambda /\mu \right) }x_{T\left( c\right) }=\prod _{\left( i,j\right) \in Y\left( \lambda /\mu \right) }x_{T\left( i,j\right) }=\prod _{k=1}^{N}x_{k}^{\left( \text{\# of times }k\text{ appears in }T\right) }. \]
blueprint
Definition 6.125

Let \(\lambda \) and \(\mu \) be two \(N\)-partitions. We define the skew Schur polynomial \(s_{\lambda /\mu }\in \mathcal{P}\) by

\[ s_{\lambda /\mu }:=\sum _{T\in \operatorname *{SSYT}\left( \lambda /\mu \right) }x_{T}. \]
def skewSchurPoly {N : } [NeZero N] (lam mu : NPartition N) :
blueprint
Theorem 6.127

Let \(\lambda \) and \(\mu \) be any two \(N\)-partitions. Then, the polynomial \(s_{\lambda /\mu }\) is symmetric.

theorem skewSchurPoly_isSymmetric {N : } [NeZero N] (lam mu : NPartition N) (σ : Equiv.Perm (Fin N)) :

The Littlewood–Richardson rule

blueprint
Definition 6.144

(a) We let \(\mathbf{0}\) denote the \(N\)-tuple \(\left( 0,0,\ldots ,0\right) \in \mathbb {N}^{N}\).

(b) Let \(\alpha =\left( \alpha _{1},\alpha _{2},\ldots ,\alpha _{N}\right) \) and \(\beta =\left( \beta _{1},\beta _{2},\ldots ,\beta _{N}\right) \) be two \(N\)-tuples in \(\mathbb {N}^{N}\). Then, we set

\begin{align*} \alpha +\beta & :=\left( \alpha _{1}+\beta _{1},\alpha _{2}+\beta _{2},\ldots ,\alpha _{N}+\beta _{N}\right) \ \ \ \ \ \ \ \ \ \ \text{and}\\ \alpha -\beta & :=\left( \alpha _{1}-\beta _{1},\alpha _{2}-\beta _{2},\ldots ,\alpha _{N}-\beta _{N}\right) . \end{align*}

Note that \(\alpha +\beta \in \mathbb {N}^{N}\), whereas \(\alpha -\beta \in \mathbb {Z}^{N}\).

blueprint
Definition 6.145

Let \(\lambda \) and \(\mu \) be two \(N\)-partitions. Let \(T\) be a tableau of shape \(\lambda /\mu \). We define the content of \(T\) to be the \(N\)-tuple \(\left( a_{1},a_{2},\ldots ,a_{N}\right) \), where

\[ a_{i}:=\left( \text{\# of }i\text{'s in }T\right) =\left( \text{\# of boxes }c\text{ of }T\text{ such that }T\left( c\right) =i\right) . \]

We denote this \(N\)-tuple by \(\operatorname *{cont}T\).

blueprint
Definition 6.146

Let \(\lambda \) and \(\mu \) be two \(N\)-partitions. Let \(T\) be a tableau of shape \(\lambda /\mu \). Let \(j\) be a positive integer. Then, \(\operatorname {col}_{\geq j}T\) means the restriction of \(T\) to columns \(j,j+1,j+2,\ldots \) (that is, the result of removing the first \(j-1\) columns from \(T\)). Formally speaking, this means the restriction of the map \(T\) to the set \(\left\{ \left( u,v\right) \in Y\left( \lambda /\mu \right) \ \mid \ v\geq j\right\} \).

def AlgebraicCombinatorics.colGeq {N : } {lam mu : Fin N} (T : Tableau lam mu) (j : ) :
{ c : Fin N × // c skewYoungDiagram lam mu c.2 j }Fin N
blueprint
Definition 6.147

Let \(\lambda ,\mu ,\nu \) be three \(N\)-partitions. A semistandard tableau \(T\) of shape \(\lambda /\mu \) is said to be \(\nu \)-Yamanouchi (this is an adjective) if for each positive integer \(j\), the \(N\)-tuple \(\nu +\operatorname *{cont}\left( \operatorname {col}_{\geq j}T\right) \in \mathbb {N}^{N}\) is an \(N\)-partition (i.e., weakly decreasing).

blueprint
Theorem 6.196 Zelevinsky’s generalized Littlewood–Richardson rule, in Yamanouchi form

Let \(\lambda ,\mu ,\nu \) be three \(N\)-partitions. Then,

\begin{equation} s_{\nu }\cdot s_{\lambda /\mu }=\sum _{\substack {T\text{ is a }\nu \text{-Yamanouchi}\\ \text{semistandard tableau}\\ \text{of shape }\lambda /\mu }}s_{\nu +\operatorname *{cont}T}. \label{eq.thm.sf.lr-zy.eq}\end{equation}

theorem AlgebraicCombinatorics.littlewoodRichardson {R : Type u_1} [CommRing R] {N : } [IsDomain R] (lam mu nu : Fin N) (hlam : IsNPartition lam) (hmu : IsNPartition mu) (hnu : IsNPartition nu) :
schurPoly nu * skewSchurPoly lam mu = T : { T : Tableau lam mu // IsYamanouchi nu T }, schurPoly (nu + contentTableau T)
blueprint
Lemma 6.188 Stembridge’s Lemma

Let \(\lambda ,\mu ,\nu \) be three \(N\)-partitions. Then,

\[ a_{\nu +\rho }\cdot s_{\lambda /\mu }=\sum _{\substack {T\text{ is a }\nu \text{-Yamanouchi}\\ \text{semistandard tableau}\\ \text{of shape }\lambda /\mu }}a_{\nu +\operatorname *{cont}T+\rho }. \]
theorem AlgebraicCombinatorics.stembridgeLemma {R : Type u_1} [CommRing R] {N : } (lam mu nu : Fin N) (hlam : IsNPartition lam) (hmu : IsNPartition mu) (hnu : IsNPartition nu) :
alternant (nu + rho N) * skewSchurPoly lam mu = T : { T : Tableau lam mu // IsYamanouchi nu T }, alternant (nu + contentTableau T + rho N)
blueprint
Lemma 6.189

Let \(\lambda \) be any \(N\)-partition. Let \(T\) be a semistandard tableau of shape \(\lambda \). Then, \(T\left( i,j\right) \geq i\) for each \(\left( i,j\right) \in Y\left( \lambda \right) \).

theorem AlgebraicCombinatorics.tableau_entry_ge_row {N : } {lam : Fin N} (hlam : IsNPartition lam) (T : Tableau lam zeroTuple) (hT : IsSemistandard T) (c : { c : Fin N × // c skewYoungDiagram lam zeroTuple }) :
(↑c).1 T c
blueprint
Definition 6.153

Let \(L\) be a commutative ring. Let \(a\in L\). The element \(a\) of \(L\) is said to be regular if and only if every \(x\in L\) satisfying \(ax=0\) satisfies \(x=0\).

blueprint
Lemma 6.154

Let \(L\) be a commutative ring. Let \(a,u,v\in L\) be such that \(a\) is regular. Assume that \(au=av\). Then, \(u=v\).

theorem AlgebraicCombinatorics.IsRegularElement.cancel {L : Type u_2} [CommRing L] {a u v : L} (ha : IsRegularElement a) (h : a * u = a * v) :
u = v
blueprint
Lemma 6.155

The element \(a_{\rho }\) of the polynomial ring \(\mathcal{P}\) is regular.

blueprint
Lemma 6.90

Let \(\alpha \in \mathbb {N}^{N}\).

(a) If the \(N\)-tuple \(\alpha \) has two equal entries, then \(a_{\alpha }=0\).

(b) Let \(\beta \in \mathbb {N}^{N}\) be an \(N\)-tuple obtained from \(\alpha \) by swapping two entries. Then, \(a_{\beta }=-a_{\alpha }\).

theorem alternant_zero_of_eq (N : ) {R : Type u_2} [CommRing R] {α : Fin N} (i j : Fin N) (hij : i j) (heq : α i = α j) :
alternant N α = 0
theorem alternant_swap (N : ) {R : Type u_2} [CommRing R] {α : Fin N} (i j : Fin N) (hij : i j) :
alternant N (α (Equiv.swap i j)) = -alternant N α

The Pieri rules

blueprint
Definition 6.197

Let \(\lambda \) and \(\mu \) be two \(N\)-partitions.

(a) We write \(\lambda /\mu \) for the pair \(\left( \mu ,\lambda \right) \). Such a pair is called a skew partition.

(b) We say that \(\lambda /\mu \) is a horizontal strip if we have \(\mu \subseteq \lambda \) and the Young diagram \(Y\left( \lambda /\mu \right) \) has no two boxes lying in the same column.

(c) We say that \(\lambda /\mu \) is a vertical strip if we have \(\mu \subseteq \lambda \) and the Young diagram \(Y\left( \lambda /\mu \right) \) has no two boxes lying in the same row.

Now, let \(n\in \mathbb {N}\).

(d) We say that \(\lambda /\mu \) is a horizontal \(n\)-strip if \(\lambda /\mu \) is a horizontal strip and satisfies \(\left\vert Y\left( \lambda /\mu \right) \right\vert =n\).

(e) We say that \(\lambda /\mu \) is a vertical \(n\)-strip if \(\lambda /\mu \) is a vertical strip and satisfies \(\left\vert Y\left( \lambda /\mu \right) \right\vert =n\).

blueprint
Proposition 6.198

Let \(\lambda =\left( \lambda _{1},\lambda _{2},\ldots ,\lambda _{N}\right) \) and \(\mu =\left( \mu _{1},\mu _{2},\ldots ,\mu _{N}\right) \) be two \(N\)-partitions.

(a) The skew partition \(\lambda /\mu \) is a horizontal strip if and only if we have

\[ \lambda _{1}\geq \mu _{1}\geq \lambda _{2}\geq \mu _{2}\geq \cdots \geq \lambda _{N}\geq \mu _{N}. \]

(b) The skew partition \(\lambda /\mu \) is a vertical strip if and only if we have

\[ \mu _{i}\leq \lambda _{i}\leq \mu _{i}+1\ \ \ \ \ \ \ \ \ \ \text{for each }i\in \left[ N\right] . \]

The Jacobi–Trudi identities

blueprint
Theorem 6.257 First Jacobi–Trudi formula

Let \(M\in \mathbb {N}\). Let \(\lambda =\left( \lambda _{1},\lambda _{2},\ldots ,\lambda _{M}\right) \) and \(\mu =\left( \mu _{1},\mu _{2},\ldots ,\mu _{M}\right) \) be two \(M\)-partitions (i.e., weakly decreasing \(M\)-tuples of nonnegative integers). Then,

\[ s_{\lambda /\mu }=\det \left( \left( h_{\lambda _{i}-\mu _{j}-i+j}\right) _{1\leq i\leq M,\ 1\leq j\leq M}\right) . \]
theorem SymmetricFunctions.jacobiTrudi_h {N : } {R : Type u_1} [CommRing R] (lam mu : Fin N) (hlam : ∀ (i j : Fin N), i jlam j lam i) (hmu : ∀ (i j : Fin N), i jmu j mu i) (hcontained : ∀ (i : Fin N), mu i lam i) :
skewSchur { outer := { parts := lam, weaklyDecreasing := hlam }, inner := { parts := mu, weaklyDecreasing := hmu }, contained := } = (jacobiTrudiMatrixH lam mu).det

Details: Infinite products (part 1)

blueprint
Lemma 1.347

If \(a\overset {x^n}{\equiv } b\) and \(c\overset {x^n}{\equiv } d\) with \(c\) and \(d\) invertible (i.e., \([x^0]c\) and \([x^0]d\) are units), then \(a/c \overset {x^n}{\equiv } b/d\).

theorem AlgebraicCombinatorics.FPS.xnEquiv_div {K : Type u_1} [CommRing K] {n : } {a b c d : PowerSeries K} (hab : a ≡[x^n] b) (hcd : c ≡[x^n] d) (hc : IsUnit (PowerSeries.constantCoeff c)) (hd : IsUnit (PowerSeries.constantCoeff d)) :
blueprint
Lemma 1.368

Let \(\left(\mathbf{a}_{i}\right)_{i\in I}\) be a family of invertible FPSs. Let \(U\) be an \(x^n\)-approximator for \(\left(\mathbf{a}_{i}\right)_{i\in I}\). Let \(J\subseteq I\). Then \(U\cap J\) (viewed as a subset of \(J\)) is an \(x^n\)-approximator for the subfamily \(\left(\mathbf{a}_{i}\right)_{i\in J}\).

theorem AlgebraicCombinatorics.FPS.xnApproximator_inter {K : Type u_1} [CommRing K] {ι : Type u_2} [DecidableEq ι] {a : ιPowerSeries K} {n : } {U J : Finset ι} (hU : IsXnApproximator a n U) (hinv : ∀ (i : ι), IsUnit (PowerSeries.constantCoeff (a i))) :
∃ (M : Finset J), IsXnApproximator (fun (i : J) => a i) n M
blueprint
Lemma 1.371

Let \(n\in \mathbb {N}\) and let \(V\) be a finite set. Let \(c,d : V \to K[[x]]\) be two families of FPSs such that \(c_v \overset {x^n}{\equiv } d_v\) for each \(v\in V\). Then

\[ \prod _{v\in V} c_v \overset {x^n}{\equiv } \prod _{v\in V} d_v. \]
theorem AlgebraicCombinatorics.FPS.xnEquiv_finprod {K : Type u_1} [CommRing K] {ι : Type u_2} {n : } {V : Finset ι} {c d : ιPowerSeries K} (h : vV, c v ≡[x^n] d v) :
vV, c v ≡[x^n] vV, d v

Details: Infinite products (part 2)

blueprint
Lemma A.43

Let \(I\) be a finite set. If \(\left( f_{i}\right) _{i\in I}\in K\left[ \left[ x\right] \right] ^{I}\) is a family of FPSs, and if \(g\in K\left[ \left[ x\right] \right] \) is an FPS satisfying \(\left[ x^{0}\right] g=0\), then \(\left( \prod _{i\in I}f_{i}\right) \circ g=\prod _{i\in I}\left( f_{i}\circ g\right) \).

theorem PowerSeries.comp_prod_finite {K : Type u_1} [CommRing K] {ι : Type u_2} [DecidableEq ι] (s : Finset ι) (f : ιPowerSeries K) (g : PowerSeries K) (hg : constantCoeff g = 0) :
subst g (∏ is, f i) = is, subst g (f i)

Domino tilings

blueprint
Definition A.44

(a) For each even positive integer \(n\), we let \(A_{n}\) be the domino tiling of \(R_{n,3}\) consisting of the following dominos:

  • the horizontal dominos \(\left\{ \left( 2i-1,\ 1\right) ,\ \left( 2i,\ 1\right) \right\} \) for all \(i\in \left[ n/2\right] \), which fill the bottom row of \(R_{n,3}\), and which we call the basement dominos;

  • the vertical domino \(\left\{ \left( 1,2\right) ,\ \left( 1,3\right) \right\} \) in the first column, which we call the left wall;

  • the vertical domino \(\left\{ \left( n,2\right) ,\ \left( n,3\right) \right\} \) in the last column, which we call the right wall;

  • the horizontal dominos \(\left\{ \left( 2i,\ 2\right) ,\ \left( 2i+1,\ 2\right) \right\} \) for all \(i\in \left[ n/2-1\right] \), which fill the middle row of \(R_{n,3}\) (except for the first and last columns), and which we call the middle dominos;

  • the horizontal dominos \(\left\{ \left( 2i,\ 3\right) ,\ \left( 2i+1,\ 3\right) \right\} \) for all \(i\in \left[ n/2-1\right] \), which fill the top row of \(R_{n,3}\) (except for the first and last columns), and which we call the top dominos.

(b) For each even positive integer \(n\), we let \(B_{n}\) be the domino tiling of \(R_{n,3}\) obtained by reflecting \(A_{n}\) across the horizontal axis of symmetry of \(R_{n,3}\) (swapping row \(1\) with row \(3\) and fixing row \(2\)).

(c) We let \(C\) denote the domino tiling of \(R_{2,3}\) consisting of three horizontal dominos: \(\left\{ (1,1),(2,1)\right\} \), \(\left\{ (1,2),(2,2)\right\} \), and \(\left\{ (1,3),(2,3)\right\} \).

def DominoTilings.TilingA (n : ) (hn : Even n) (hn_ge : n 2) :
  • One or more equations did not get rendered due to their size.
def DominoTilings.TilingB (n : ) (hn : Even n) (hn_ge : n 2) :
  • One or more equations did not get rendered due to their size.
  • One or more equations did not get rendered due to their size.
blueprint
Proposition A.64

The faultfree domino tilings of height-\(3\) rectangles are precisely the tilings

\[ A_{2},A_{4},A_{6},A_{8},\ldots ,\ \ \ \ \ \ \ \ \ \ B_{2},B_{4},B_{6},B_{8},\ldots ,\ \ \ \ \ \ \ \ \ \ C. \]

More concretely:

(a) The faultfree domino tilings of a height-\(3\) rectangle that contain a vertical domino in the top two squares of the first column are \(A_{2},A_{4},A_{6},A_{8},\ldots \).

(b) The faultfree domino tilings of a height-\(3\) rectangle that contain a vertical domino in the bottom two squares of the first column are \(B_{2},B_{4},B_{6},B_{8},\ldots \).

(c) The only faultfree domino tiling of a height-\(3\) rectangle that contains no vertical domino in the first column is \(C\).

theorem DominoTilings.faultfree_classification (n : ) (T : DominoTiling n 3) (hfree : T.isFaultfree) (hn : n 1) :
(∃ (hn : Even n) (hn_ge : n 2), T.TilingEquiv (TilingA n hn hn_ge)) (∃ (hn : Even n) (hn_ge : n 2), T.TilingEquiv (TilingB n hn hn_ge)) n = 2 ¬T.hasVerticalInCol 1 ∃ (h : n = 2), (h T).TilingEquiv TilingC

Limits of FPSs

blueprint
Lemma A.85

Let \((f_i)_{i\in \mathbb {N}}\) be a sequence of FPSs that coefficientwise stabilizes to an FPS \(f\), and let \(n\in \mathbb {N}\). Then there exists an integer \(K\in \mathbb {N}\) such that

\[ \text{all integers } i\geq K \text{ satisfy } f_i \overset {x^n}{\equiv } f. \]
theorem PowerSeries.exists_xnEquiv_K {K : Type u_1} [CommRing K] {f : PowerSeries K} {lf : PowerSeries K} (hf : CoeffStabilizesTo f lf) (n : ) :
∃ (K_1 : ), iK_1, f i ≡[x^n] lf
blueprint
Lemma A.86

Let \((g_i)_{i\in \mathbb {N}}\) be a sequence of FPSs that coefficientwise stabilizes to an FPS \(g\), and let \(n\in \mathbb {N}\). Then there exists an integer \(L\in \mathbb {N}\) such that

\[ \text{all integers } i\geq L \text{ satisfy } g_i \overset {x^n}{\equiv } g. \]
theorem PowerSeries.exists_xnEquiv_L {K : Type u_1} [CommRing K] {g : PowerSeries K} {lg : PowerSeries K} (hg : CoeffStabilizesTo g lg) (n : ) :
∃ (L : ), iL, g i ≡[x^n] lg

Laurent power series

blueprint
Lemma A.109 Multiplication by \(x\) and \(x^{-1}\) shifts coefficients

Let \(\mathbf{a} = \left(a_n\right)_{n \in \mathbb {Z}}\) be a Laurent polynomial in \(K\left[x^{\pm }\right]\). Then,

\[ x \cdot \mathbf{a} = \left(a_{n-1}\right)_{n \in \mathbb {Z}} \qquad \text{and} \qquad x^{-1} \cdot \mathbf{a} = \left(a_{n+1}\right)_{n \in \mathbb {Z}}. \]
blueprint
Proposition A.113 \(x^k = (\delta _{i,k})_{i \in \mathbb {Z}}\) for all \(k \in \mathbb {Z}\)

We have

\[ x^k = \left(\delta _{i,k}\right)_{i \in \mathbb {Z}} \qquad \text{for each } k \in \mathbb {Z}. \]