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

3.3 More about lengths and simples

Let us continue studying lengths of permutations.

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)) :
Proof

Recall that \(\ell (\sigma )\) is the number of inversions of \(\sigma \), while \(\ell (\sigma ^{-1})\) is the number of inversions of \(\sigma ^{-1}\).

An inversion of \(\sigma \) is a pair \((i,j) \in [n] \times [n]\) such that \(i {\lt} j\) and \(\sigma (i) {\gt} \sigma (j)\). Likewise, an inversion of \(\sigma ^{-1}\) is a pair \((u,v) \in [n] \times [n]\) such that \(u {\lt} v\) and \(\sigma ^{-1}(u) {\gt} \sigma ^{-1}(v)\).

Thus, if \((i,j)\) is an inversion of \(\sigma \), then \((\sigma (j), \sigma (i))\) is an inversion of \(\sigma ^{-1}\). Hence, we obtain a map

\begin{align*} \{ \text{inversions of } \sigma \} & \to \{ \text{inversions of } \sigma ^{-1}\} , \\ (i,j) & \mapsto (\sigma (j), \sigma (i)). \end{align*}

This map is bijective (indeed, it has an inverse map, which sends each \((u,v) \in \{ \text{inversions of } \sigma ^{-1}\} \) to \((\sigma ^{-1}(v), \sigma ^{-1}(u))\)). Thus, the bijection principle yields

\[ (\text{number of inversions of } \sigma ) = (\text{number of inversions of } \sigma ^{-1}). \]

In other words, \(\ell (\sigma ) = \ell (\sigma ^{-1})\). (See [ Grinbe15 , Exercise 5.2 (f) ] for details.)

Definition 3.55
#

The explicit bijection between inversions of \(\sigma \) and inversions of \(\sigma ^{-1}\), sending \((i,j)\) to \((\sigma (j), \sigma (i))\).

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) :
Proof

This combines parts (a) and (b).

Theorem 3.57

Part (a) of Lemma 3.56: When multiplying a permutation \(\sigma \) on the right by the simple transposition \(s_k\), we have \(\ell (\sigma s_k) = \ell (\sigma ) + 1\) if \(\sigma (k) {\lt} \sigma (k+1)\), and \(\ell (\sigma s_k) = \ell (\sigma ) - 1\) if \(\sigma (k) {\gt} \sigma (k+1)\).

theorem Equiv.Perm.length_mul_swap_right {n : } (σ : Perm (Fin n)) (k : Fin (n - 1)) (h : n > 1) :
Proof

The proof partitions the inversions of \(\sigma \) and \(\sigma s_k\) into two kinds. Call an inversion \((i,j)\) of a permutation \(\tau \) the key pair if \((i,j) = (k,k+1)\); all other inversions are non-key.

Key observation: There is a bijection between non-key inversions of \(\sigma \) and non-key inversions of \(\sigma s_k\), given by applying the swap \(k \leftrightarrow k+1\) to both coordinates. This bijection preserves the strict ordering of the pair coordinates because there is no element strictly between \(k\) and \(k+1\).

Thus

\[ (\text{non-key inversions of } \sigma s_k) = (\text{non-key inversions of } \sigma ). \]

For the key pair \((k,k+1)\): it is an inversion of \(\sigma \) if and only if \(\sigma (k+1) {\lt} \sigma (k)\), and it is an inversion of \(\sigma s_k\) if and only if \(\sigma (k) {\lt} \sigma (k+1)\). So the key pair’s inversion status flips when we pass from \(\sigma \) to \(\sigma s_k\).

Combining these two observations: the number of inversions changes by exactly \(\pm 1\), depending on whether the key pair is added or removed.

Theorem 3.58

Part (b) of Lemma 3.56: When multiplying a permutation \(\sigma \) on the left by the simple transposition \(s_k\), we have \(\ell (s_k \sigma ) = \ell (\sigma ) + 1\) if \(\sigma ^{-1}(k) {\lt} \sigma ^{-1}(k+1)\), and \(\ell (s_k \sigma ) = \ell (\sigma ) - 1\) if \(\sigma ^{-1}(k) {\gt} \sigma ^{-1}(k+1)\).

theorem Equiv.Perm.length_mul_swap_left {n : } (σ : Perm (Fin n)) (k : Fin (n - 1)) (h : n > 1) :
Proof

We use the identity \(s_k \sigma = (\sigma ^{-1} s_k)^{-1}\) (since \(s_k\) is its own inverse) and then apply Proposition 3.54 and part (a).

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
Proof

This combines parts (a) and (b).

Definition 3.60
#

The set \(Q\) from Proposition 3.59: \(Q = \{ k \in \{ i+1, \ldots , j-1\} \mid \sigma (j) {\lt} \sigma (k) {\lt} \sigma (i)\} \).

def Equiv.Perm.setQ {n : } (σ : Perm (Fin n)) (i j : Fin n) :
Definition 3.61
#

The set \(R\) from Proposition 3.59: \(R = \{ k \in \{ i+1, \ldots , j-1\} \mid \sigma (i) {\lt} \sigma (k) {\lt} \sigma (j)\} \).

def Equiv.Perm.setR {n : } (σ : Perm (Fin n)) (i j : Fin n) :

3.3.1 Helpers for Proposition 3.59

Definition 3.62
#

The set \(A\) from the transposition length proof: \(A = \{ a {\lt} i \mid \sigma (j) {\lt} \sigma (a) {\lt} \sigma (i)\} \). These elements produce paired lost and gained inversions: \((a, j)\) is lost and \((a, i)\) is gained.

def Equiv.Perm.setA {n : } (σ : Perm (Fin n)) (i j : Fin n) :
Definition 3.63
#

The set \(B\) from the transposition length proof: \(B = \{ b {\gt} j \mid \sigma (j) {\lt} \sigma (b) {\lt} \sigma (i)\} \). These elements produce paired lost and gained inversions: \((i, b)\) is lost and \((j, b)\) is gained.

def Equiv.Perm.setB {n : } (σ : Perm (Fin n)) (i j : Fin n) :
Lemma 3.64

The set \(Q\) for \(\sigma \cdot t_{i,j}\) equals the set \(R\) for \(\sigma \). This key symmetry allows reducing the case \(\sigma (i) {\lt} \sigma (j)\) to the case \(\sigma (i) {\gt} \sigma (j)\) in the transposition length formula.

theorem Equiv.Perm.setQ_swap_eq_setR {n : } (σ : Perm (Fin n)) (i j : Fin n) :
(σ * swap i j).setQ i j = σ.setR i j
Proof

For \(k\) between \(i\) and \(j\) with \(k \neq i, j\), the swap \(t_{i,j}\) fixes \(k\), so \((\sigma \cdot t_{i,j})(k) = \sigma (k)\). The conditions \((\sigma t_{i,j})(j) {\lt} \sigma (k) {\lt} (\sigma t_{i,j})(i)\) become \(\sigma (i) {\lt} \sigma (k) {\lt} \sigma (j)\), which defines \(R\).

Lemma 3.65

When \(\sigma (j) {\lt} \sigma (i)\), the pair \((i,j)\) itself is a lost inversion: \((i,j) \in \operatorname {inv}(\sigma ) \setminus \operatorname {inv}(\sigma \cdot t_{i,j})\).

theorem Equiv.Perm.ij_lost {n : } (σ : Perm (Fin n)) (i j : Fin n) (hij : i < j) (h : σ j < σ i) :
Proof

Since \((\sigma t_{i,j})(i) = \sigma (j) {\lt} \sigma (i) = (\sigma t_{i,j})(j)\), the pair \((i,j)\) is no longer an inversion after applying \(t_{i,j}\).

Lemma 3.66

For \(k \in Q\): the pair \((i, k)\) is a lost inversion. Before the swap, \(\sigma (i) {\gt} \sigma (k)\) so \((i,k)\) is an inversion. After the swap, \((\sigma t_{i,j})(i) = \sigma (j) {\lt} \sigma (k)\), so it is not.

theorem Equiv.Perm.ik_lost_for_k_in_Q {n : } (σ : Perm (Fin n)) (i j k : Fin n) (hk : k σ.setQ i j) :
Proof

Direct verification using the definition of \(Q\) and the swap.

Lemma 3.67

For \(k \in Q\): the pair \((k, j)\) is a lost inversion. Before the swap, \(\sigma (k) {\gt} \sigma (j)\) so \((k,j)\) is an inversion. After the swap, \((\sigma t_{i,j})(j) = \sigma (i) {\gt} \sigma (k)\), so it is not.

theorem Equiv.Perm.kj_lost_for_k_in_Q {n : } (σ : Perm (Fin n)) (i j k : Fin n) (hk : k σ.setQ i j) :
Proof

Direct verification using the definition of \(Q\) and the swap.

Lemma 3.68

For \(a \in A\): the pair \((a, j)\) is a lost inversion. Before the swap, \(\sigma (a) {\gt} \sigma (j)\). After the swap, \((\sigma t_{i,j})(j) = \sigma (i) {\gt} \sigma (a)\), so \((a,j)\) is no longer an inversion.

theorem Equiv.Perm.aj_lost_for_a_in_A {n : } (σ : Perm (Fin n)) (i j a : Fin n) (hij : i < j) (_h : σ j < σ i) (ha : a σ.setA i j) :
Proof

Direct verification.

Lemma 3.69

For \(b \in B\): the pair \((i, b)\) is a lost inversion. Before the swap, \(\sigma (i) {\gt} \sigma (b)\). After the swap, \((\sigma t_{i,j})(i) = \sigma (j) {\lt} \sigma (b)\), so \((i,b)\) is no longer an inversion.

theorem Equiv.Perm.ib_lost_for_b_in_B {n : } (σ : Perm (Fin n)) (i j b : Fin n) (hij : i < j) (_h : σ j < σ i) (hb : b σ.setB i j) :
Proof

Direct verification.

Lemma 3.70

For \(a \in A\): the pair \((a, i)\) is a gained inversion. Before the swap, \(\sigma (a) {\lt} \sigma (i)\) so \((a,i)\) is not an inversion. After the swap, \((\sigma t_{i,j})(i) = \sigma (j) {\lt} \sigma (a)\), so it becomes one.

theorem Equiv.Perm.ai_gained_for_a_in_A {n : } (σ : Perm (Fin n)) (i j a : Fin n) (hij : i < j) (ha : a σ.setA i j) :
Proof

Direct verification.

Lemma 3.71

For \(b \in B\): the pair \((j, b)\) is a gained inversion. Before the swap, \(\sigma (j) {\lt} \sigma (b)\) so \((j,b)\) is not an inversion. After the swap, \((\sigma t_{i,j})(j) = \sigma (i) {\gt} \sigma (b)\), so it becomes one.

theorem Equiv.Perm.jb_gained_for_b_in_B {n : } (σ : Perm (Fin n)) (i j b : Fin n) (hij : i < j) (hb : b σ.setB i j) :
Proof

Direct verification.

Lemma 3.72

Completeness of the lost inversion classification: every lost inversion \((a,b) \in \operatorname {inv}(\sigma ) \setminus \operatorname {inv}(\sigma \cdot t_{i,j})\) (with \(\sigma (j) {\lt} \sigma (i)\)) is one of five types:

  1. \((a,b) = (i,j)\),

  2. \(a \in A\) and \(b = j\),

  3. \(a = i\) and \(b \in B\),

  4. \(a = i\) and \(b \in Q\),

  5. \(a \in Q\) and \(b = j\).

theorem Equiv.Perm.lost_inversion_complete {n : } (σ : Perm (Fin n)) (i j a b : Fin n) (hij : i < j) (h : σ j < σ i) (hmem : (a, b) σ.inversions \ (σ * swap i j).inversions) :
a = i b = j a σ.setA i j b = j a = i b σ.setB i j a = i b σ.setQ i j a σ.setQ i j b = j
Proof

By case analysis on whether \(a\) or \(b\) equals \(i\) or \(j\), and using the fact that the swap only changes the values at positions \(i\) and \(j\).

Lemma 3.73

Completeness of the gained inversion classification: every gained inversion \((a,b) \in \operatorname {inv}(\sigma \cdot t_{i,j}) \setminus \operatorname {inv}(\sigma )\) (with \(\sigma (j) {\lt} \sigma (i)\)) is one of two types:

  1. \(a \in A\) and \(b = i\),

  2. \(a = j\) and \(b \in B\).

theorem Equiv.Perm.gained_inversion_complete {n : } (σ : Perm (Fin n)) (i j a b : Fin n) (hij : i < j) (h : σ j < σ i) (hmem : (a, b) (σ * swap i j).inversions \ σ.inversions) :
a σ.setA i j b = i a = j b σ.setB i j
Proof

By case analysis, similar to the lost inversion completeness.

Lemma 3.74

Let \(\sigma \in S_n\) and \(i {\lt} j\) with \(\sigma (j) {\lt} \sigma (i)\). Then the number of “lost” inversions (inversions of \(\sigma \) that are not inversions of \(\sigma \cdot t_{i,j}\)) exceeds the number of “gained” inversions (inversions of \(\sigma \cdot t_{i,j}\) that are not inversions of \(\sigma \)) by exactly \(2|Q| + 1\).

The proof partitions lost inversions into five disjoint types: the pair \((i,j)\) itself; pairs \((a,j)\) and \((i,b)\) for \(a \in A\), \(b \in B\); and pairs \((i,k)\) and \((k,j)\) for \(k \in Q\). Gained inversions are pairs \((a,i)\) for \(a \in A\) and \((j,b)\) for \(b \in B\). The sets \(A\) and \(B\) cancel, leaving \(2|Q|+1\).

theorem Equiv.Perm.lost_minus_gained_eq {n : } (σ : Perm (Fin n)) (i j : Fin n) (hij : i < j) (h : σ j < σ i) :
(σ.inversions \ (σ * swap i j).inversions).card = ((σ * swap i j).inversions \ σ.inversions).card + 2 * (σ.setQ i j).card + 1
Proof

By explicit enumeration and counting of the five types of lost inversions and two types of gained inversions.

Theorem 3.75

Part (b) of Proposition 3.59: The exact formula for length change when multiplying by an arbitrary transposition \(t_{i,j}\).

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
Proof

Case \(\sigma (i) {\gt} \sigma (j)\): This is [ Grinbe15 , Exercise 5.20 ] . Apply Lemma 3.74 directly. The symmetric difference formula \(|\mathrm{inv}(\sigma t_{i,j})| + |\mathrm{lost}| = |\mathrm{inv}(\sigma )| + |\mathrm{gained}|\) together with \(|\mathrm{lost}| = |\mathrm{gained}| + 2|Q| + 1\) gives \(\ell (\sigma t_{i,j}) = \ell (\sigma ) - 2|Q| - 1\).

Case \(\sigma (i) {\lt} \sigma (j)\): Apply the previous case to \(\sigma t_{i,j}\) instead of \(\sigma \). Since \((\sigma t_{i,j})(i) = \sigma (j) {\gt} \sigma (i) = (\sigma t_{i,j})(j)\), and \(\sigma t_{i,j} t_{i,j} = \sigma \), and the sets \(Q\) and \(R\) trade places when we replace \(\sigma \) by \(\sigma t_{i,j}\), we obtain \(\ell (\sigma ) = \ell (\sigma t_{i,j}) - 2|R| - 1\), hence \(\ell (\sigma t_{i,j}) = \ell (\sigma ) + 2|R| + 1\).

Theorem 3.76

Part (a) of Proposition 3.59: The length decreases if \((i,j)\) was an inversion, and increases if it was not.

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

This follows immediately from part (b): when \(\sigma (i) {\gt} \sigma (j)\), the formula gives \(\ell (\sigma t_{i,j}) = \ell (\sigma ) - 2|Q| - 1 {\lt} \ell (\sigma )\), and when \(\sigma (i) {\lt} \sigma (j)\), the formula gives \(\ell (\sigma t_{i,j}) = \ell (\sigma ) + 2|R| + 1 {\gt} \ell (\sigma )\).

Convention 3.77
#

A simple transposition in \(S_n\) means one of the \(n-1\) transpositions \(s_0, s_1, \ldots , s_{n-2}\). We shall occasionally abbreviate “simple transposition” as “simple”.

Definition 3.78
#

A word (of length \(q\)) in \(S_n\) is a finite sequence \((k_1, k_2, \ldots , k_q)\) where each \(k_i \in \{ 0, 1, \ldots , n-2\} \) is an index of a simple transposition.

Definition 3.79
#

The product of a word \(w = (k_1, \ldots , k_q)\) is the permutation \(s_{k_1} s_{k_2} \cdots s_{k_q}\).

Definition 3.80
#

A word \(w = (k_1, \ldots , k_q)\) is reduced if its length \(q\) equals \(\ell (s_{k_1} \cdots s_{k_q})\).

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

Proof

This combines parts (a) and (b).

Theorem 3.82

Part (a) of Theorem 3.81: Every permutation \(\sigma \in S_n\) can be written as a composition of \(\ell (\sigma )\) simple transpositions. Equivalently, there exists a reduced word \(w\) whose product \(s_{k_1} \cdots s_{k_q} = \sigma \).

theorem Equiv.Perm.exists_reduced_word {n : } (σ : Perm (Fin n)) :
∃ (w : Word n), IsReduced w wordProd w = σ
Proof

(See [ Grinbe15 , Exercise 5.2 (e) ] for details.)

We proceed by strong induction on \(\ell (\sigma )\).

Base case: If \(\ell (\sigma ) = 0\), then \(\sigma = \mathrm{id}\) (a permutation with no inversions is the identity), so the empty word works.

Induction step: If \(\ell (\sigma ) = h + 1 {\gt} 0\), then \(\sigma \) has at least one inversion, so there exists \(k \in [n-1]\) with \(\sigma (k) {\gt} \sigma (k+1)\). By Lemma 3.56 (a), \(\ell (\sigma s_k) = \ell (\sigma ) - 1 = h\). By the induction hypothesis, \(\sigma s_k\) has a reduced word \(w\) of length \(h\). Then \(w \mathbin {+\! +} [k]\) is a reduced word of length \(h+1\) for \(\sigma s_k \cdot s_k = \sigma \).

Theorem 3.83

Part (b) of Theorem 3.81: For any word \(w = (k_1, \ldots , k_q)\), we have \(\ell (s_{k_1} \cdots s_{k_q}) \leq q\). In other words, \(\ell (\sigma )\) is the minimum word length.

Proof

(See [ Grinbe15 , Exercise 5.2 (g) ] for details.)

We prove \(\ell (s_{k_1} s_{k_2} \cdots s_{k_g}) \leq g\) by induction on \(g\). The base case \(g = 0\) gives \(\ell (\mathrm{id}) = 0\). For the induction step, Lemma 3.56 (b) gives \(\ell (s_k \cdot \tau ) \leq \ell (\tau ) + 1\) for any \(\tau \) and \(k\), so \(\ell (s_{k_1} \cdots s_{k_g}) \leq \ell (s_{k_2} \cdots s_{k_g}) + 1 \leq (g-1) + 1 = g\).

Theorem 3.84

Combining parts (a) and (b): \(\ell (\sigma )\) is exactly the minimum word length for \(\sigma \).

Proof

Immediate from parts (a) and (b).

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
Proof

This combines parts (a), (b), and (c).

Theorem 3.86

Part (a) of Corollary 3.85: The length of a product has the same parity as the sum of lengths.

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

(See [ Grinbe15 , Exercise 5.2 (b) ] for details.)

Write \(\tau = s_{k_1} s_{k_2} \cdots s_{k_q}\) with \(q = \ell (\tau )\) (using Theorem 3.81 (a)). Then

\begin{align*} \ell (\sigma \tau ) & = \ell (\sigma s_{k_1} s_{k_2} \cdots s_{k_q}) \\ & \equiv \ell (\sigma s_{k_1} \cdots s_{k_{q-1}}) + 1 \\ & \equiv \cdots \\ & \equiv \ell (\sigma ) + q = \ell (\sigma ) + \ell (\tau ) \pmod{2}. \end{align*}
Theorem 3.87

Part (b) of Corollary 3.85: The triangle inequality \(\ell (\sigma \tau ) \leq \ell (\sigma ) + \ell (\tau )\).

theorem Equiv.Perm.length_mul_le {n : } (σ τ : Perm (Fin n)) :
(σ * τ).length σ.length + τ.length
Proof

(See [ Grinbe15 , Exercise 5.2 (c) ] for details.)

Get reduced words \(w_1, w_2\) for \(\sigma , \tau \). Then \(w_1 \mathbin {+\! +} w_2\) represents \(\sigma \tau \), so \(\ell (\sigma \tau ) \leq |w_1 \mathbin {+\! +} w_2| = |w_1| + |w_2| = \ell (\sigma ) + \ell (\tau )\) by Theorem 3.81 (b).

Theorem 3.88

Part (c) of Corollary 3.85: For any word representing \(\sigma \), the word length is at least \(\ell (\sigma )\) and has the same parity as \(\ell (\sigma )\).

Proof

The inequality \(q \geq \ell (\sigma )\) is Theorem 3.81 (b). The parity claim \(q \equiv \ell (\sigma ) \pmod{2}\) is proved by the same telescoping argument as part (a), starting from \(\ell (\sigma ) = \ell (s_{k_1} \cdots s_{k_q})\) and peeling off one simple at a time.

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

Proof

This follows directly from Theorem 3.81 (a): every \(\sigma \in S_n\) can be written as a product of simple transpositions, so every \(\sigma \) lies in the subgroup generated by the simples.

3.3.2 Rothe diagram and Lehmer entry properties

Definition 3.90
#

A cell \((i, j)\) is in the Rothe diagram of \(\sigma \) if \(j {\lt} \sigma (i)\) and \(i {\lt} \sigma ^{-1}(j)\). These are the cells that are not “hit” by either the row or column of a permutation matrix entry.

def Equiv.Perm.inRotheDiagram {n : } (σ : Perm (Fin n)) (i j : Fin n) :
Lemma 3.91

The number of cells in the Rothe diagram of \(\sigma \) equals \(\ell (\sigma )\). The bijection sends \((i, j)\) in the Rothe diagram to the inversion \((i, \sigma ^{-1}(j))\).

theorem Equiv.Perm.rotheDiagram_card_eq_length {n : } (σ : Perm (Fin n)) :
{p : Fin n × Fin n | σ.inRotheDiagram p.1 p.2}.card = σ.length
Proof

The map \((i,j) \mapsto (i, \sigma ^{-1}(j))\) is a bijection from Rothe diagram cells to inversions: the condition \(j {\lt} \sigma (i)\) becomes \(\sigma (\sigma ^{-1}(j)) {\lt} \sigma (i)\), which is \(\sigma (k) {\lt} \sigma (i)\) with \(k = \sigma ^{-1}(j) {\gt} i\).

Lemma 3.92

For \(\sigma \in S_n\) and \(i \in [n]\), we have \(\ell _i(\sigma ) {\lt} n - i\). This strict bound holds because \(\ell _i(\sigma )\) counts elements among \(\{ i+1, \ldots , n-1\} \) where \(\sigma (j) {\lt} \sigma (i)\), and there are only \(n - 1 - i\) such elements.

theorem Equiv.Perm.lehmerEntry_lt {n : } (σ : Perm (Fin n)) (i : Fin n) :
σ.lehmerEntry i < n - i
Proof

The set counted by \(\ell _i(\sigma )\) is a subset of \(\{ j : j {\gt} i\} \), which has cardinality \(n - 1 - i {\lt} n - i\).

Lemma 3.93

For \(\sigma \in S_n\) with \(n {\gt} 0\), we have \(\sigma (0) = \ell _0(\sigma )\). This is because \(\ell _0(\sigma )\) counts how many elements among \(\sigma (1), \ldots , \sigma (n-1)\) are less than \(\sigma (0)\), and since \(\sigma \) is a bijection onto \(\{ 0, \ldots , n-1\} \), this count equals \(\sigma (0)\).

theorem Equiv.Perm.sigma_zero_eq_lehmerEntry {n : } (σ : Perm (Fin n)) (hn : n > 0) :
(σ 0, hn) = σ.lehmerEntry 0, hn
Proof

The elements \(j {\gt} 0\) with \(\sigma (j) {\lt} \sigma (0)\) are in bijection (via \(j \mapsto \sigma (j)\)) with elements \(v {\lt} \sigma (0)\). Since \(\sigma \) is a bijection, there are exactly \(\sigma (0)\) such elements.

Lemma 3.94

For \(\sigma \in S_n\) and \(i\) with \(i + 1 {\lt} n\), let \(i' = i + 1\). Then

\[ \ell _i(\sigma ) \geq \ell _{i'}(\sigma ) + 1 \iff \sigma (i) {\gt} \sigma (i'). \]

This characterizes when consecutive Lehmer entries differ by at least 1, which is crucial for determining when a Lehmer block shifts a position.

theorem Equiv.Perm.lehmerEntry_diff_iff_inversion {n : } (σ : Perm (Fin n)) (i : Fin n) (hi : i + 1 < n) :
have i' := i + 1, hi; σ.lehmerEntry i σ.lehmerEntry i' + 1 σ i > σ i'
Proof

The Lehmer entry \(\ell _i(\sigma )\) counts \(j {\gt} i\) with \(\sigma (j) {\lt} \sigma (i)\). We split this count by whether \(j = i'\) or \(j {\gt} i'\): \(\ell _i(\sigma ) = [[\sigma (i') {\lt} \sigma (i)]] + |\{ j {\gt} i' : \sigma (j) {\lt} \sigma (i)\} |\). The set \(\{ j {\gt} i' : \sigma (j) {\lt} \sigma (i)\} \) contains \(\{ j {\gt} i' : \sigma (j) {\lt} \sigma (i')\} \) (counted by \(\ell _{i'}(\sigma )\)) when \(\sigma (i') {\lt} \sigma (i)\), from which the equivalence follows.

Lemma 3.95

Two permutations \(\sigma , \tau \in S_n\) with the same inversions are equal: if for all \(i {\lt} j\) we have \(\sigma (j) {\lt} \sigma (i) \iff \tau (j) {\lt} \tau (i)\), then \(\sigma = \tau \).

theorem Equiv.Perm.eq_of_inversions_eq {n : } (σ τ : Perm (Fin n)) (h : ∀ (i j : Fin n), i < j → (σ j < σ i τ j < τ i)) :
σ = τ
Proof

For each \(i\), the value \(\sigma (i)\) equals \(|\{ j : \sigma (j) {\lt} \sigma (i)\} |\) (since \(\sigma \) is a bijection onto \(\{ 0, \ldots , n-1\} \)). The hypothesis implies \(\{ j : \sigma (j) {\lt} \sigma (i)\} = \{ j : \tau (j) {\lt} \tau (i)\} \) for each \(i\), so \(\sigma (i) = \tau (i)\).

3.3.3 The Lehmer code representation

Definition 3.96
#

For each \(i \in [n]\), we define the Lehmer block \(a_i\) as

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

where \(i' = i + \ell _i(\sigma )\) and \(\ell _i(\sigma )\) is the Lehmer entry at position \(i\). If \(\ell _i(\sigma ) = 0\), then \(a_i = \mathrm{id}\) (the empty product). The product \(a_i\) equals the cycle \((i', i'-1, \ldots , i)\).

def Equiv.Perm.lehmerBlock {n : } (σ : Perm (Fin n)) (i : Fin n) :
Lemma 3.97

The length of the Lehmer block \(a_i\) (as a word) equals the Lehmer entry \(\ell _i(\sigma )\).

theorem Equiv.Perm.lehmerBlock_length {n : } (σ : Perm (Fin n)) (i : Fin n) :
Proof

The block consists of \(\ell _i(\sigma )\) simple transpositions by construction.

Definition 3.98
#

The canonical reduced word for \(\sigma \) is the concatenation of Lehmer blocks:

\[ w(\sigma ) = a_0 \mathbin {+\! +} a_1 \mathbin {+\! +} \cdots \mathbin {+\! +} a_{n-1}. \]
Lemma 3.99

The length of the canonical reduced word equals \(\ell (\sigma )\). This follows from \(\sum _{i} \ell _i(\sigma ) = \ell (\sigma )\).

Proof

Each block \(a_i\) has length \(\ell _i(\sigma )\), and the total length is \(\sum _i \ell _i(\sigma ) = \ell (\sigma )\) (since each inversion contributes to exactly one Lehmer entry).

Lemma 3.100

The sum of Lehmer entries equals the length: \(\sum _{i \in [n]} \ell _i(\sigma ) = \ell (\sigma )\).

theorem Equiv.Perm.sum_lehmerEntry_eq_length {n : } (σ : Perm (Fin n)) :
i : Fin n, σ.lehmerEntry i = σ.length
Proof

By a bijection between the set of pairs \(\{ (i, j) : i \in [n],\ j \text{ such that } (i,j) \text{ is an inversion}\} \) and the set of all inversions.

3.3.4 Helpers for Proposition 3.107

Definition 3.101
#

For \(\sigma \in S_n\) and \(i \in [n]\), define \(s(\sigma , i) = |\{ j {\lt} i : \sigma (j) {\lt} \sigma (i)\} |\). This counts positions before \(i\) with smaller values.

def Equiv.Perm.smallerBefore {n : } (σ : Perm (Fin n)) (i : Fin n) :
Definition 3.102
#

For \(\sigma \in S_n\) and \(i \in [n]\), define \(g(\sigma , i) = |\{ j {\lt} i : \sigma (j) {\gt} \sigma (i)\} |\). This counts inversions with \(i\) as the second element.

def Equiv.Perm.largerBefore {n : } (σ : Perm (Fin n)) (i : Fin n) :
Lemma 3.103

For \(\sigma \in S_n\) and \(i \in [n]\):

\[ s(\sigma , i) + g(\sigma , i) = i. \]

This is because the elements \(j {\lt} i\) are partitioned into those with \(\sigma (j) {\lt} \sigma (i)\) and those with \(\sigma (j) {\gt} \sigma (i)\) (equality is impossible since \(\sigma \) is injective).

theorem Equiv.Perm.smallerBefore_add_largerBefore {n : } (σ : Perm (Fin n)) (i : Fin n) :
σ.smallerBefore i + σ.largerBefore i = i
Proof

The set \(\{ j : j {\lt} i\} \) has cardinality \(i\) and splits into \(\{ j {\lt} i : \sigma (j) {\lt} \sigma (i)\} \) and \(\{ j {\lt} i : \sigma (j) {\gt} \sigma (i)\} \), which are disjoint (since \(\sigma \) is injective, \(\sigma (j) \neq \sigma (i)\) for \(j \neq i\)).

Lemma 3.104

For each \(i \in [n]\), we have \(\sigma (i) = s(\sigma , i) + \ell _i(\sigma )\).

theorem Equiv.Perm.sigma_eq_smallerBefore_add_lehmerEntry {n : } (σ : Perm (Fin n)) (i : Fin n) :
(σ i) = σ.smallerBefore i + σ.lehmerEntry i
Proof

The elements \(j\) with \(\sigma (j) {\lt} \sigma (i)\) partition into those with \(j {\lt} i\) (counted by \(s(\sigma , i)\)) and those with \(j {\gt} i\) (counted by \(\ell _i\)). Their total count is \(\sigma (i)\).

Lemma 3.105

For \(\sigma \in S_n\) and \(p \in [n]\):

\[ p + \ell _p(\sigma ) - g(\sigma , p) = \sigma (p). \]

This key formula shows that the final position after applying all Lehmer blocks to position \(p\) equals \(\sigma (p)\).

theorem Equiv.Perm.final_position_formula {n : } (σ : Perm (Fin n)) (p : Fin n) :
p + σ.lehmerEntry p - σ.largerBefore p = (σ p)
Proof

From \(\sigma (p) = s(\sigma , p) + \ell _p(\sigma )\) and \(p = s(\sigma , p) + g(\sigma , p)\), we get \(p + \ell _p(\sigma ) - g(\sigma , p) = \sigma (p)\).

Lemma 3.106

For \(\sigma \in S_n\) and \(i \in [n]\):

\[ i + \ell _i(\sigma ) = \sigma (i) + g(\sigma , i). \]

This gives the upper bound of block \(i\)’s range in terms of the permutation value and the count of larger elements before position \(i\).

theorem Equiv.Perm.lehmerEntry_range_upper {n : } (σ : Perm (Fin n)) (i : Fin n) :
i + σ.lehmerEntry i = (σ i) + σ.largerBefore i
Proof

Follows from the formulas \(\sigma (i) = s(\sigma , i) + \ell _i(\sigma )\) and \(i = s(\sigma , i) + g(\sigma , i)\).

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

Proof

We refer to [ Grinbe15 , Exercise 5.21 parts (b) and (c) ] for a detailed proof.

We prove by extensionality: for each position \(p\), we track where it ends up after applying all blocks.

By tracking position \(p\) through all blocks, the final position is

\[ p + \ell _p(\sigma ) - g(\sigma , p). \]

Since \(p = s(\sigma , p) + g(\sigma , p)\) and \(\sigma (p) = s(\sigma , p) + \ell _p(\sigma )\) (Lemma 3.104), we get

\[ p + \ell _p(\sigma ) - g(\sigma , p) = \sigma (p). \]
Theorem 3.108

The canonical reduced word is indeed reduced: it is a word of length \(\ell (\sigma )\) whose product is \(\sigma \).

Proof

Combine Proposition 3.107 (the product of the canonical reduced word equals \(\sigma \)) with the length equality from Lemma 3.99 (\(|w(\sigma )| = \ell (\sigma )\)).