The areas / V30. Combinatorics
Mathlib.Combinatorics.Young.YoungDiagram
85 declarations. Mathlib docs · Source
Young diagrams
A Young diagram is a finite set of up-left justified boxes:
□□□□□
□□□
□□□
□
This Young diagram corresponds to the [5, 3, 3, 1] partition of 12.
We represent it as a lower set in ℕ × ℕ in the product partial order. We write (i, j) ∈ μ
to say that (i, j) (in matrix coordinates) is in the Young diagram μ.
Main definitions
YoungDiagram: Young diagramsYoungDiagram.card: the number of cells in a Young diagram (its cardinality)YoungDiagram.instDistribLatticeYoungDiagram: a distributive lattice instance for Young diagrams ordered by containment, with(⊥ : YoungDiagram)the empty diagram.YoungDiagram.rowandYoungDiagram.rowLen: rows of a Young diagram and their lengthsYoungDiagram.colandYoungDiagram.colLen: columns of a Young diagram and their lengths
Notation
In "English notation", a Young diagram is drawn so that (i1, j1) ≤ (i2, j2)
means (i1, j1) is weakly up-and-left of (i2, j2). This terminology is used
below, e.g. in YoungDiagram.up_left_mem.
Tags
Young diagram
References
https://en.wikipedia.org/wiki/Young_tableau
Rows and row lengths of Young diagrams.
This section defines μ.row and μ.rowLen, with the following API:
1. (i, j) ∈ μ ↔ j < μ.rowLen i
2. μ.row i = {i} ×ˢ (Finset.range (μ.rowLen i))
3. μ.rowLen i = (μ.row i).card
4. ∀ {i1 i2}, i1 ≤ i2 → μ.rowLen i2 ≤ μ.rowLen i1
Note: #3 is not convenient for defining μ.rowLen; instead, μ.rowLen is defined
as the smallest j such that (i, j) ∉ μ.
Columns and column lengths of Young diagrams.
This section has an identical API to the rows section.
The list of row lengths of a Young diagram
This section defines μ.rowLens : List ℕ, the list of row lengths of a Young diagram μ.
YoungDiagram.rowLens_sorted: It is weakly decreasing (List.SortedGE).YoungDiagram.rowLens_pos: It is strictly positive.
Equivalence between Young diagrams and lists of natural numbers
This section defines the equivalence between Young diagrams μ and weakly decreasing lists w
of positive natural numbers, corresponding to row lengths of the diagram:
YoungDiagram.equivListRowLens :
YoungDiagram ≃ {w : List ℕ // w.SortedGE ∧ ∀ x ∈ w, 0 < x}
The two directions are YoungDiagram.rowLens (defined above) and YoungDiagram.ofRowLens.
theorem YoungDiagram.ofRowLens.congr_simp E1 #
∀ (w w_1 : List ℕ) (e_w : w = w_1) (hw : w.SortedGE), YoungDiagram.ofRowLens w hw = YoungDiagram.ofRowLens w_1 ⋯
theorem YoungDiagram.mk.injEq E0 #
∀ (cells : Finset (ℕ × ℕ)) (isLowerSet : IsLowerSet ↑cells) (cells_1 : Finset (ℕ × ℕ))
(isLowerSet_1 : IsLowerSet ↑cells_1),
({ cells := cells, isLowerSet := isLowerSet } = { cells := cells_1, isLowerSet := isLowerSet_1 }) = (cells = cells_1)
theorem YoungDiagram.mk.congr_simp E1 #
∀ (cells cells_1 : Finset (ℕ × ℕ)) (e_cells : cells = cells_1) (isLowerSet : IsLowerSet ↑cells),
{ cells := cells, isLowerSet := isLowerSet } = { cells := cells_1, isLowerSet := ⋯ }
theorem YoungDiagram.cellsOfRowLens.match_1.congr_eq_2 E1 #
∀ (motive : List ℕ → Sort u_1) (x : List ℕ) (h_1 : Unit → motive []) (h_2 : (w : ℕ) → (ws : List ℕ) → motive (w :: ws))
(w : ℕ) (ws : List ℕ),
x = w :: ws →
(match x with
| [] => h_1 ()
| w :: ws => h_2 w ws) ≍
h_2 w ws
theorem YoungDiagram.cellsOfRowLens.match_1.congr_eq_1 E1 #
∀ (motive : List ℕ → Sort u_1) (x : List ℕ) (h_1 : Unit → motive []) (h_2 : (w : ℕ) → (ws : List ℕ) → motive (w :: ws)),
x = [] →
(match x with
| [] => h_1 ()
| w :: ws => h_2 w ws) ≍
h_1 ()
def YoungDiagram.ctorIdx E1 #
YoungDiagram → ℕ
theorem YoungDiagram.mk.inj E1 #
∀ {cells : Finset (ℕ × ℕ)} {isLowerSet : IsLowerSet ↑cells} {cells_1 : Finset (ℕ × ℕ)}
{isLowerSet_1 : IsLowerSet ↑cells_1},
{ cells := cells, isLowerSet := isLowerSet } = { cells := cells_1, isLowerSet := isLowerSet_1 } → cells = cells_1
structure YoungDiagram E3 #
Type
A Young diagram is a finite collection of cells on the ℕ × ℕ grid such that whenever
a cell is present, so are all the ones above and to the left of it. Like matrices, an (i, j) cell
is a cell in row i and column j, where rows are enumerated downward and columns rightward.
Young diagrams are modeled as finite sets in ℕ × ℕ that are lower sets with respect to the
standard order on products.
theorem YoungDiagram.ext E1 #
∀ {x y : YoungDiagram}, x.cells = y.cells → x = y
theorem YoungDiagram.ext_iff E0 #
∀ {x y : YoungDiagram}, x = y ↔ x.cells = y.cells
ctor YoungDiagram.mk E0 #
(cells : Finset (ℕ × ℕ)) → IsLowerSet ↑cells → YoungDiagram
abbrev YoungDiagram.cells E1 #
YoungDiagram → Finset (ℕ × ℕ)
A finite set which represents a finite collection of cells on the ℕ × ℕ grid.
theorem YoungDiagram.isLowerSet E1 #
∀ (self : YoungDiagram), IsLowerSet ↑self.cells
Cells are up-left justified, witnessed by the fact that cells is a lower set in ℕ × ℕ.
instance YoungDiagram.instSetLikeProdNat E0 #
SetLike YoungDiagram (ℕ × ℕ)
instance YoungDiagram.instPartialOrder E0 #
PartialOrder YoungDiagram
theorem YoungDiagram.mem_cells E0 #
∀ {μ : YoungDiagram} (c : ℕ × ℕ), c ∈ μ.cells ↔ c ∈ μ
theorem YoungDiagram.mem_mk E0 #
∀ (c : ℕ × ℕ) (cells : Finset (ℕ × ℕ)) (isLowerSet : IsLowerSet ↑cells),
c ∈ { cells := cells, isLowerSet := isLowerSet } ↔ c ∈ cells
instance YoungDiagram.decidableMem E0 #
(μ : YoungDiagram) → DecidablePred fun x ↦ x ∈ μ
theorem YoungDiagram.up_left_mem E1 #
∀ (μ : YoungDiagram) {i1 i2 j1 j2 : ℕ}, i1 ≤ i2 → j1 ≤ j2 → (i2, j2) ∈ μ → (i1, j1) ∈ μ
In "English notation", a Young diagram is drawn so that (i1, j1) ≤ (i2, j2) means (i1, j1) is weakly up-and-left of (i2, j2).
theorem YoungDiagram.cells_subset_iff E0 #
∀ {μ ν : YoungDiagram}, μ.cells ⊆ ν.cells ↔ μ ≤ ν
theorem YoungDiagram.cells_ssubset_iff E0 #
∀ {μ ν : YoungDiagram}, μ.cells ⊂ ν.cells ↔ μ < ν
instance YoungDiagram.instMax E0 #
Max YoungDiagram
theorem YoungDiagram.cells_sup E0 #
∀ (μ ν : YoungDiagram), (μ ⊔ ν).cells = μ.cells ∪ ν.cells
theorem YoungDiagram.coe_sup E0 #
∀ (μ ν : YoungDiagram), ↑(μ ⊔ ν) = ↑μ ∪ ↑ν
theorem YoungDiagram.mem_sup E0 #
∀ {μ ν : YoungDiagram} {x : ℕ × ℕ}, x ∈ μ ⊔ ν ↔ x ∈ μ ∨ x ∈ ν
instance YoungDiagram.instMin E0 #
Min YoungDiagram
theorem YoungDiagram.cells_inf E0 #
∀ (μ ν : YoungDiagram), (μ ⊓ ν).cells = μ.cells ∩ ν.cells
theorem YoungDiagram.coe_inf E0 #
∀ (μ ν : YoungDiagram), ↑(μ ⊓ ν) = ↑μ ∩ ↑ν
theorem YoungDiagram.mem_inf E0 #
∀ {μ ν : YoungDiagram} {x : ℕ × ℕ}, x ∈ μ ⊓ ν ↔ x ∈ μ ∧ x ∈ ν
instance YoungDiagram.instOrderBot E0 #
OrderBot YoungDiagram
The empty Young diagram is (⊥ : YoungDiagram).
theorem YoungDiagram.cells_bot E0 #
⊥.cells = ∅
theorem YoungDiagram.notMem_bot E0 #
∀ (x : ℕ × ℕ), x ∉ ⊥
theorem YoungDiagram.coe_bot E0 #
↑⊥ = ∅
instance YoungDiagram.instInhabited E0 #
Inhabited YoungDiagram
instance YoungDiagram.instDistribLattice E0 #
DistribLattice YoungDiagram
abbrev YoungDiagram.card E3 #
YoungDiagram → ℕ
Cardinality of a Young diagram
def YoungDiagram.transpose E1 #
YoungDiagram → YoungDiagram
The transpose of a Young diagram is obtained by swapping i's with j's.
theorem YoungDiagram.mem_transpose E0 #
∀ {μ : YoungDiagram} {c : ℕ × ℕ}, c ∈ μ.transpose ↔ c.swap ∈ μ
theorem YoungDiagram.transpose_transpose E0 #
∀ (μ : YoungDiagram), μ.transpose.transpose = μ
theorem YoungDiagram.transpose_eq_iff_eq_transpose E1 #
∀ {μ ν : YoungDiagram}, μ.transpose = ν ↔ μ = ν.transpose
theorem YoungDiagram.transpose_eq_iff E0 #
∀ {μ ν : YoungDiagram}, μ.transpose = ν.transpose ↔ μ = ν
theorem YoungDiagram.le_of_transpose_le E1 #
∀ {μ ν : YoungDiagram}, μ.transpose ≤ ν → μ ≤ ν.transpose
theorem YoungDiagram.transpose_le_iff E0 #
∀ {μ ν : YoungDiagram}, μ.transpose ≤ ν.transpose ↔ μ ≤ ν
theorem YoungDiagram.transpose_mono E1 #
∀ {μ ν : YoungDiagram}, μ ≤ ν → μ.transpose ≤ ν.transpose
def YoungDiagram.transposeOrderIso E1 #
YoungDiagram ≃o YoungDiagram
Transposing Young diagrams is an OrderIso.
theorem YoungDiagram.transposeOrderIso_symm_apply E0 #
∀ (μ : YoungDiagram), (RelIso.symm YoungDiagram.transposeOrderIso) μ = μ.transpose
theorem YoungDiagram.transposeOrderIso_apply E0 #
∀ (μ : YoungDiagram), YoungDiagram.transposeOrderIso μ = μ.transpose
theorem YoungDiagram.card_transpose E0 #
∀ (μ : YoungDiagram), μ.transpose.card = μ.card
def YoungDiagram.row E3 #
YoungDiagram → ℕ → Finset (ℕ × ℕ)
The i-th row of a Young diagram consists of the cells whose first coordinate is i.
theorem YoungDiagram.mem_row_iff E0 #
∀ {μ : YoungDiagram} {i : ℕ} {c : ℕ × ℕ}, c ∈ μ.row i ↔ c ∈ μ ∧ c.1 = i
theorem YoungDiagram.mk_mem_row_iff E0 #
∀ {μ : YoungDiagram} {i j : ℕ}, (i, j) ∈ μ.row i ↔ (i, j) ∈ μ
theorem YoungDiagram.exists_notMem_row E1 #
∀ (μ : YoungDiagram) (i : ℕ), ∃ j, (i, j) ∉ μ
def YoungDiagram.rowLen E3 #
YoungDiagram → ℕ → ℕ
Length of a row of a Young diagram
theorem YoungDiagram.mem_iff_lt_rowLen E0 #
∀ {μ : YoungDiagram} {i j : ℕ}, (i, j) ∈ μ ↔ j < μ.rowLen i
theorem YoungDiagram.row_eq_prod E1 #
∀ {μ : YoungDiagram} {i : ℕ}, μ.row i = {i} ×ˢ Finset.range (μ.rowLen i)
theorem YoungDiagram.rowLen_eq_card E1 #
∀ (μ : YoungDiagram) {i : ℕ}, μ.rowLen i = (μ.row i).card
theorem YoungDiagram.rowLen_anti E1 #
∀ (μ : YoungDiagram) (i1 i2 : ℕ), i1 ≤ i2 → μ.rowLen i2 ≤ μ.rowLen i1
def YoungDiagram.col E3 #
YoungDiagram → ℕ → Finset (ℕ × ℕ)
The j-th column of a Young diagram consists of the cells whose second coordinate is j.
theorem YoungDiagram.mem_col_iff E0 #
∀ {μ : YoungDiagram} {j : ℕ} {c : ℕ × ℕ}, c ∈ μ.col j ↔ c ∈ μ ∧ c.2 = j
theorem YoungDiagram.mk_mem_col_iff E0 #
∀ {μ : YoungDiagram} {i j : ℕ}, (i, j) ∈ μ.col j ↔ (i, j) ∈ μ
theorem YoungDiagram.exists_notMem_col E1 #
∀ (μ : YoungDiagram) (j : ℕ), ∃ i, (i, j) ∉ μ.cells
def YoungDiagram.colLen E3 #
YoungDiagram → ℕ → ℕ
Length of a column of a Young diagram
theorem YoungDiagram.colLen_transpose E0 #
∀ (μ : YoungDiagram) (j : ℕ), μ.transpose.colLen j = μ.rowLen j
theorem YoungDiagram.rowLen_transpose E0 #
∀ (μ : YoungDiagram) (i : ℕ), μ.transpose.rowLen i = μ.colLen i
theorem YoungDiagram.mem_iff_lt_colLen E0 #
∀ {μ : YoungDiagram} {i j : ℕ}, (i, j) ∈ μ ↔ i < μ.colLen j
theorem YoungDiagram.col_eq_prod E1 #
∀ {μ : YoungDiagram} {j : ℕ}, μ.col j = Finset.range (μ.colLen j) ×ˢ {j}
theorem YoungDiagram.colLen_eq_card E1 #
∀ (μ : YoungDiagram) {j : ℕ}, μ.colLen j = (μ.col j).card
theorem YoungDiagram.colLen_anti E1 #
∀ (μ : YoungDiagram) (j1 j2 : ℕ), j1 ≤ j2 → μ.colLen j2 ≤ μ.colLen j1
def YoungDiagram.rowLens E1 #
YoungDiagram → List ℕ
List of row lengths of a Young diagram
theorem YoungDiagram.get_rowLens E0 #
∀ {μ : YoungDiagram} {i : ℕ} {h : i < μ.rowLens.length}, μ.rowLens[i] = μ.rowLen i
theorem YoungDiagram.length_rowLens E0 #
∀ {μ : YoungDiagram}, μ.rowLens.length = μ.colLen 0
theorem YoungDiagram.rowLens_sorted E1 #
∀ (μ : YoungDiagram), μ.rowLens.SortedGE
theorem YoungDiagram.pos_of_mem_rowLens E1 #
∀ (μ : YoungDiagram), ∀ x ∈ μ.rowLens, 0 < x
theorem YoungDiagram.sum_rowLens_eq_card E0 #
∀ (μ : YoungDiagram), μ.rowLens.sum = μ.card
def YoungDiagram.cellsOfRowLens E1 #
List ℕ → Finset (ℕ × ℕ)
The cells making up a YoungDiagram from a list of row lengths
theorem YoungDiagram.mem_cellsOfRowLens E0 #
∀ {w : List ℕ} {c : ℕ × ℕ}, c ∈ YoungDiagram.cellsOfRowLens w ↔ ∃ (h : c.1 < w.length), c.2 < w[c.1]
def YoungDiagram.ofRowLens E1 #
(w : List ℕ) → w.SortedGE → YoungDiagram
Young diagram from a sorted list
theorem YoungDiagram.mem_ofRowLens E0 #
∀ {w : List ℕ} {hw : w.SortedGE} {c : ℕ × ℕ}, c ∈ YoungDiagram.ofRowLens w hw ↔ ∃ (h : c.1 < w.length), c.2 < w[c.1]
theorem YoungDiagram.rowLens_length_ofRowLens E1 #
∀ {w : List ℕ} {hw : w.SortedGE}, (∀ x ∈ w, 0 < x) → (YoungDiagram.ofRowLens w hw).rowLens.length = w.length
The number of rows in ofRowLens w hw is the length of w
theorem YoungDiagram.rowLen_ofRowLens E1 #
∀ {w : List ℕ} {hw : w.SortedGE} (i : Fin w.length), (YoungDiagram.ofRowLens w hw).rowLen ↑i = w[i]
The length of the ith row in ofRowLens w hw is the ith entry of w
theorem YoungDiagram.ofRowLens_to_rowLens_eq_self E1 #
∀ {μ : YoungDiagram}, YoungDiagram.ofRowLens μ.rowLens ⋯ = μ
The leftInv direction of the equivalence
theorem YoungDiagram.rowLens_ofRowLens_eq_self E1 #
∀ {w : List ℕ} {hw : w.SortedGE}, (∀ x ∈ w, 0 < x) → (YoungDiagram.ofRowLens w hw).rowLens = w
The rightInv direction of the equivalence
def YoungDiagram.equivListRowLens E1 #
YoungDiagram ≃ { w // w.SortedGE ∧ ∀ x ∈ w, 0 < x }
Equivalence between Young diagrams and weakly decreasing lists of positive natural numbers.
A Young diagram μ is equivalent to a list of row lengths.
theorem YoungDiagram.equivListRowLens_apply_coe E0 #
∀ (μ : YoungDiagram), ↑(YoungDiagram.equivListRowLens μ) = μ.rowLens
theorem YoungDiagram.equivListRowLens_symm_apply E0 #
∀ (ww : { w // w.SortedGE ∧ ∀ x ∈ w, 0 < x }), YoungDiagram.equivListRowLens.symm ww = YoungDiagram.ofRowLens ↑ww ⋯