Counting the cells of a Young diagram by rows #
Mathlib's YoungDiagram.rowLens records the lengths of the rows of a Young diagram. This file
counts the cells of a diagram row by row: the first k row lengths sum to the number of cells
lying in the first k rows, whether those lengths are summed as
∑ i ∈ Finset.range k, μ.rowLen i or as (μ.rowLens.take k).sum. Since
the rows exhaust the cells, the row lengths also determine the diagram
(YoungDiagram.rowLen_injective). Cutting the same count column by column,
YoungDiagram.card_filter_fst_lt_filter_snd_eq counts the cells of the first k rows
lying in a fixed column; summing that count over the columns gives the counting core
YoungDiagram.card_filter_le_sum_take_rowLens, which bounds the elements of row less than k in
a finite type labelled by a row and injected into the cells, no two of them sharing both a row and
a column, by the cells of the first k rows. The same row-by-row reading applies to any property
of the cells, not only to counting them all: YoungDiagram.card_filter_cells counts the cells
satisfying a predicate one row at a time, and YoungDiagram.prod_cells_eq_prod_range reads a
product over the cells the same way.
The partial sums are the shape of every dominance statement about partitions, since dominance compares partial sums of decreasingly sorted parts, and the sorted parts of a partition are the row lengths of its Young diagram.
Reading the rows also describes containment: one diagram is contained in another exactly when
each of its rows is shorter (YoungDiagram.le_iff_forall_rowLen_le), from which a diagram
has only finitely many sub-diagrams (YoungDiagram.finite_Iic).
The file closes with the two degenerate shapes, at the bottom and at the top of the dominance
order. A diagram with at most one column has its cells described one row at a time by
YoungDiagram.mem_iff_of_rowLen_le_one and counted by
YoungDiagram.card_eq_colLen_of_rowLen_le_one; a diagram with at most one row is described
by YoungDiagram.mem_iff_of_colLen_le_one and counted by
YoungDiagram.card_eq_rowLen_of_colLen_le_one.
A row past the last one of a Young diagram is empty.
A Young diagram is determined by its row lengths.
Reading the length of a row off YoungDiagram.rowLens, with 0 for the rows past the last
one.
Sorting the row lengths of a Young diagram, as a multiset, recovers the row lengths: they are already decreasing.
The first k row lengths of a Young diagram count its cells in the first k rows.
The cells of a Young diagram, counted over any range of rows that contains all of them. This
is YoungDiagram.sum_rowLens_eq_card with the range of summation chosen by hand instead of being
the exact number of rows μ.colLen 0.
The cells of a Young diagram carrying a given property, counted row by row. The range of
summation is any range of rows containing all of them, as in
YoungDiagram.card_eq_sum_range_rowLen; a row past the last one contributes nothing, being
empty.
A product over the cells of a Young diagram, read row by row. The cells are fibred over
their row index by Prod.fst, and the fibre of i is the row YoungDiagram.row μ i, which is
{i} ×ˢ Finset.range (μ.rowLen i). The range of rows is any range containing all of them, as in
YoungDiagram.card_eq_sum_range_rowLen; a row past the last one contributes an empty product.
The first k entries of YoungDiagram.rowLens count the cells in the first k rows. This
is YoungDiagram.sum_range_rowLen_eq_card_filter_fst with the truncation taken on the
list of row lengths, the form in which partial sums enter the dominance order on partitions.
The counting core of the dominance lemma. Let the elements of a finite type α be
labelled by a row r a : ℕ and placed in the cells of a Young diagram lam by an injection
f, in such a way that the row of an element together with the column of its cell determines
the element. Then the elements of row less than k are no more numerous than the cells of lam
in its first k rows.
The hypothesis hcol is the condition that elements sharing a row occupy pairwise distinct
columns; it is what bounds by k the number of elements landing in any one column.
A row of a sub-diagram is no longer than the corresponding row.
A Young diagram is contained in another as soon as each of its rows is shorter.
Containment of Young diagrams is containment of rows.
A row of a Young diagram is at least as long as any initial segment of cells it contains.
A Young diagram has finitely many sub-diagrams, each being determined by its set of cells.
The cells of a Young diagram with at most one column. Every row is then either empty or
the single cell in column 0, so a cell is a cell of the first column, and the diagram reaches
exactly as far down as that column does.
The cells of a Young diagram with at most one column are exactly the cells (i, 0) with
i < μ.colLen 0: the whole of its first column, and nothing else.
A Young diagram with at most one column has one cell in each of its μ.colLen 0 rows.
The cells of a Young diagram with at most one row. Every column is then either empty or
the single cell in row 0, so a cell is a cell of the first row, and the diagram reaches exactly
as far right as that row does.
The cells of a Young diagram with at most one row are exactly the cells (0, j) with
j < μ.rowLen 0: the whole of its first row, and nothing else.
A Young diagram with at most one row has one cell in each of its μ.rowLen 0 columns.