N-Partitions #
This file provides the canonical definition of NPartition N, which represents
a weakly decreasing N-tuple of nonnegative integers (Definition def.sf.Npar in the source).
Main definitions #
IsNPartition- predicate for N-tuples that are weakly decreasingNPartition N- a weakly decreasing N-tuple of nonnegative integersNPartition.parts- the entries of the partition as a functionFin N → ℕNPartition.antitone- proof that the entries are weakly decreasingNPartition.size- the sum of all entriesNPartition.zero- the zero partition (0, 0, ..., 0)NPartition.add- component-wise addition of N-partitionsNPartition.youngDiagram- the Young diagram Y(λ) as aFinset (Fin N × ℕ)NPartition.skewYoungDiagram- the skew Young diagram Y(λ/μ) as aFinset (Fin N × ℕ)NPartition.instFintypeBounded-Fintypeinstance for partitions with bounded entriesNPartition.instFintypeSizeBounded-Fintypeinstance for partitions with bounded size
Design notes #
This file provides the canonical NPartition structure. We use antitone as the
field name since it matches Mathlib conventions.
The weakly decreasing condition means: if i ≤ j then parts j ≤ parts i.
This is equivalent to Antitone parts in Mathlib terminology.
Duplicate definitions #
For historical reasons, there is a local NPartition definition in:
PieriJacobiTrudi.lean(SymmetricFunctions.NPartition): UsesweaklyDecreasingfield name.
Both definitions are semantically equivalent (representing weakly decreasing N-tuples of natural numbers). The local definition is retained to avoid large refactoring of the extensive APIs built on top of it. Future work may consolidate these definitions.
Note: MonomialSymmetric.lean and SchurBasics.lean have been migrated to use
the canonical definition via abbrev or direct import.
Compatibility #
For backwards compatibility with code using other field names:
NPartition.monotoneis an alias forNPartition.antitoneNPartition.weaklyDecreasingis an alias forNPartition.antitone
Migration Guide #
The NPartition structure is defined in this file (canonical) and has one remaining
local definition:
| File | Namespace | Field name | Status |
|---|---|---|---|
NPartition.lean (this) | (top-level) | antitone | Canonical |
PieriJacobiTrudi.lean | SymmetricFunctions | weaklyDecreasing | Local (with bridge) |
MonomialSymmetric.lean | AlgebraicCombinatorics.SymmetricFunctions | (abbrev) | ✓ Migrated |
SchurBasics.lean | (top-level) | (import) | ✓ Migrated |
To migrate a file to use this shared definition:
- Add
import AlgebraicCombinatorics.SymmetricFunctions.NPartitionto imports - Remove the local
structure NPartitiondefinition - If in a namespace, use
open NPartitionor create a local alias - Replace field accesses:
.monotone→.antitoneor use themonotonealias theorem.weaklyDecreasing→.antitoneor use theweaklyDecreasingalias theorem
- For constructors, use
NPartition.mkwithantitonefield, or useNPartition.mk'which accepts the explicit predicate form
References #
- Source: AlgebraicCombinatorics/tex/SymmetricFunctions/MonomialSymmetric.tex (Definition def.sf.Npar)
IsNPartition predicate #
This predicate characterizes N-tuples that are weakly decreasing. It is equivalent
to Antitone for functions Fin N → ℕ.
IsNPartition is decidable since it's a finite conjunction of decidable inequalities.
Equations
- IsNPartition.instDecidable lam = inferInstanceAs (Decidable (∀ (i j : Fin N), i ≤ j → lam j ≤ lam i))
IsNPartition is equivalent to Antitone.
The zero tuple is an N-partition (trivially weakly decreasing).
The sum of two N-partitions is an N-partition.
An N-partition is a weakly decreasing N-tuple of nonnegative integers. (Definition def.sf.Npar)
This is represented as a function Fin N → ℕ that is antitone
(i.e., i ≤ j → parts j ≤ parts i).
The field is named antitone to match Mathlib conventions.
The entries of the N-partition as a function from
Fin NtoℕThe entries are weakly decreasing (antitone)
Instances For
Compatibility aliases for field names #
The antitone property as a function (for use in proofs).
An NPartition's parts satisfy the IsNPartition predicate. This connects the structure-based definition with the predicate-based definition.
Basic properties #
Two N-partitions are equal if and only if their parts are equal.
Extensionality in terms of pointwise equality.
Extensionality for pointwise equality (variant taking a proof for each index).
Extensionality in terms of parts equality.
Decidable equality for N-partitions.
Equations
- μ.instDecidableEq ν = decidable_of_iff (μ.parts = ν.parts) ⋯
The zero partition #
The zero N-partition (0, 0, ..., 0)
Equations
- NPartition.zero = { parts := fun (x : Fin N) => 0, antitone := ⋯ }
Instances For
Equations
- NPartition.instZero = { zero := NPartition.zero }
Equations
- NPartition.instInhabited = { default := 0 }
Size (weight) of a partition #
The size (or weight) of an N-partition is the sum of its entries. If μ = (μ₁, μ₂, ..., μ_N), then |μ| = μ₁ + μ₂ + ... + μ_N.
Instances For
Each entry of an N-partition is bounded by the size.
An N-partition with size 0 is the zero partition.
An N-partition has size 0 if and only if it is the zero partition.
A non-zero N-partition has positive size.
Addition of N-partitions #
Component-wise addition of N-partitions. Since both partitions are antitone (weakly decreasing), their component-wise sum is also antitone, so the result is a valid N-partition without needing to sort.
This is the canonical Add instance for NPartition, used by all files including
MonomialSymmetric.lean.
Component-wise addition of N-partitions. Since both partitions are antitone (weakly decreasing), their sum is also antitone.
Instances For
Equations
- NPartition.instAdd = { add := NPartition.add }
The size of a sum of N-partitions equals the sum of their sizes.
Addition of N-partitions is commutative.
Adding zero to an N-partition gives the same N-partition.
Adding an N-partition to zero gives the same N-partition.
Addition of N-partitions is associative.
NPartition N forms an AddCommMonoid under component-wise addition.
This enables using generic Mathlib lemmas about AddCommMonoid with NPartition.
Equations
- One or more equations did not get rendered due to their size.
Coercion to function #
Coercion to a function.
Equations
Partial order (containment) #
Containment of partitions: μ ≤ ν means μᵢ ≤ νᵢ for all i
Equations
- NPartition.instLE = { le := fun (μ ν : NPartition N) => ∀ (i : Fin N), μ.parts i ≤ ν.parts i }
Equations
- NPartition.instPreorder = { le := fun (x1 x2 : NPartition N) => x1 ≤ x2, le_refl := ⋯, le_trans := ⋯, lt_iff_le_not_ge := ⋯ }
Equations
- NPartition.instPartialOrder = { toPreorder := NPartition.instPreorder, le_antisymm := ⋯ }
Fintype instances for bounded partitions #
The set of N-partitions with entries bounded by M is finite. This is useful for cardinality arguments in symmetric function theory.
Equations
- One or more equations did not get rendered due to their size.
The set of N-partitions with size bounded by n is finite. This follows from the fact that if size ≤ n, then all entries are ≤ n. This is needed for counting SSYT of bounded content.
Equations
- NPartition.instFintypeSizeBounded n = Fintype.ofInjective (fun (x : { μ : NPartition N // μ.size ≤ n }) => match x with | ⟨μ, hμ⟩ => ⟨μ, ⋯⟩) ⋯
The set of N-partitions with exact size n is finite. This is a subtype of the bounded-size type.
Equations
- NPartition.instFintypeSizeEq n = Fintype.ofInjective (fun (x : { μ : NPartition N // μ.size = n }) => match x with | ⟨μ, hμ⟩ => ⟨μ, ⋯⟩) ⋯
The finite set of N-partitions with exact size n.
Equations
- NPartition.partitionsOfSize n = Finset.map { toFun := Subtype.val, inj' := ⋯ } Finset.univ
Instances For
Membership in partitionsOfSize is characterized by size.
Decidable instance for partition containment.
Equations
The zero N-partition is the minimum element
μ ≤ ν implies |μ| ≤ |ν|
Length of a partition #
An N-partition has length 0 if and only if it is the zero partition.
A nonzero N-partition has positive length.
Constructor with explicit predicate #
Construct an NPartition from a function and a proof that it satisfies the weakly decreasing predicate (in the explicit form used in SchurBasics.lean and PieriJacobiTrudi.lean).
Equations
- NPartition.mk' parts h = { parts := parts, antitone := h }
Instances For
Part accessor #
The i-th part of an N-partition (alias for parts i).
This matches the naming in SchurBasics.lean.
Instances For
Bijection with Nat.Partition (Proposition prop.sf.Npar-as-par) #
There is a bijection between partitions of length ≤ N and N-partitions.
This is formalized in MonomialSymmetric.lean as NPartition.equivPartition.
Here we provide the basic conversion functions.
Convert a partition (as a Nat.Partition) to an N-partition by padding with zeros.
Requires that the partition has at most N parts.
This corresponds to the map in Proposition prop.sf.Npar-as-par: (μ₁, μ₂, ..., μ_ℓ) ↦ (μ₁, μ₂, ..., μ_ℓ, 0, 0, ..., 0)
Equations
- One or more equations did not get rendered due to their size.
Instances For
Convert an N-partition to a partition by removing trailing zeros.
Equations
- μ.toPartition = { parts := Multiset.filter (fun (x : ℕ) => x ≠ 0) (Multiset.map μ.parts Finset.univ.val), parts_pos := ⋯, parts_sum := ⋯ }
Instances For
The number of non-zero parts of an N-partition is at most N. (Proposition prop.sf.Npar-as-par, boundedness)
Young Diagram (Definition def.sf.ydiag) #
The Young diagram Y(λ) of an N-partition λ is the set of cells (i, j) where i ∈ [N] and j ∈ [λ_i].
Note: Mathlib has YoungDiagram which is more general (infinite diagrams).
Here we define a version specific to N-partitions.
The Young diagram Y(λ) of an N-partition λ is the set of cells (i, j) where i ∈ Fin N and j < λ_i. Definition def.sf.ydiag in the source.
Note: Mathlib has YoungDiagram which is more general (infinite diagrams).
Here we define a version specific to N-partitions.
Equations
- μ.youngDiagram = Finset.univ.biUnion fun (i : Fin N) => Finset.map { toFun := fun (j : ℕ) => (i, j), inj' := ⋯ } (Finset.range (μ.parts i))
Instances For
Membership in a Young diagram: (i, j) ∈ Y(λ) iff j < λ_i. This is the 0-indexed version of the textbook condition j ∈ [λ_i]. Definition def.sf.ydiag in the source.
Alternative characterization: membership in terms of the row index
The Young diagram is empty iff the partition is zero. This follows from the definition: Y(λ) = {(i,j) | j < λ_i}, which is empty iff all λ_i = 0.
The Young diagram is nonempty iff the partition is nonzero
The row i of the Young diagram has exactly μ.parts i elements. This captures the definition that row i has λ_i boxes.
Cells in a Young diagram have bounded column indices
The Young diagram is bounded by the first row length (when N > 0). Since λ is weakly decreasing, all columns are at most λ_0.
Version of youngDiagram_subset_prod using [NeZero N] typeclass.
Useful for code that already has [NeZero N] in scope.
The cell (i, 0) is in the Young diagram iff μ_i > 0. This characterizes which rows are nonempty.
Decidability of membership in Young diagram
Equations
- μ.youngDiagram_decidableMem c = decidable_of_iff (c.2 < μ.parts c.1) ⋯
The total number of cells in the Young diagram equals the size of the partition.
The zero N-partition has empty Young diagram
μ ≤ ν is equivalent to Y(μ) ⊆ Y(ν). This is the key equivalence for partition containment.
Skew Young Diagram (Definition def.sf.skew-diag) #
This is the canonical Finset version of skew Young diagrams.
The skew Young diagram Y(λ/μ) of two N-partitions λ and μ (where μ ⊆ λ componentwise) is the set of cells in Y(λ) but not in Y(μ). In other words: Y(λ/μ) = {(i, j) | μ_i ≤ j < λ_i}
This uses 0-indexed columns (j starts from 0), following Mathlib/programming conventions.
Alternative definitions:
AlgebraicCombinatorics.skewYoungDiagramin LittlewoodRichardson.lean returns aSetand uses 1-indexed columns: {(i, j) | μ_i < j ≤ λ_i}. This matches textbook conventions.skewYoungDiagramin SchurBasics.lean is a duplicate that requires[NeZero N]. Prefer this canonical version when possible.
The two indexing conventions are equivalent via the bijection (i, j) ↔ (i, j+1).
See SchurBasics.skewYoungDiagram_equiv_LR for the equivalence proof.
The skew Young diagram Y(λ/μ) is the set difference Y(λ) \ Y(μ). This consists of cells (i, j) where μ_i ≤ j < λ_i. Definition def.sf.skew-diag in the source.
This is the canonical Finset version of skew Young diagrams.
Other versions exist for different use cases:
AlgebraicCombinatorics.skewYoungDiagramin LittlewoodRichardson.lean returns aSetand uses 1-indexed columns (textbook convention)skewYoungDiagramin SchurBasics.lean is a duplicate that requires[NeZero N](prefer this canonical version)
Indexing Convention: Uses 0-indexed columns (Mathlib convention).
- Here: (i, j) ∈ Y(λ/μ) iff μ_i ≤ j < λ_i
- LittlewoodRichardson: (i, j) ∈ Y(λ/μ) iff μ_i < j ≤ λ_i (1-indexed)
The bijection (i, j) ↔ (i, j+1) converts between conventions.
See SchurBasics.skewYoungDiagram_equiv_LR for the equivalence proof.
Equations
- lam.skewYoungDiagram mu = lam.youngDiagram \ mu.youngDiagram
Instances For
Membership in a skew Young diagram: (i, j) ∈ Y(λ/μ) iff μ_i ≤ j < λ_i. This is the 0-indexed version of the textbook condition μ_i < j ≤ λ_i.
Alternative characterization: membership in terms of row index
The skew diagram Y(λ/λ) is empty.
The skew diagram Y(λ/0) equals Y(λ).
The skew diagram is contained in the larger Young diagram.
Decidability of membership in skew Young diagram
Equations
- lam.skewYoungDiagram_decidableMem mu c = decidable_of_iff (mu.parts c.1 ≤ c.2 ∧ c.2 < lam.parts c.1) ⋯
The cardinality of a skew Young diagram.
The skew diagram is empty iff λ ≤ μ componentwise.
Row and Column Partitions #
Special partitions consisting of a single row or column, used in the Pieri rules and connections to symmetric functions. These are moved from PieriJacobiTrudi.lean as part of the consolidation effort.
The row partition (n, 0, 0, ..., 0) with n boxes in the first row. This is the partition corresponding to h_n (complete homogeneous symmetric polynomial). Requires N > 0 to have at least one row.
Equations
Instances For
The row partition has size n.
The first part of the row partition is n.
All other parts of the row partition are 0.
The cardinality of elements of Fin N with value less than n is n (when n ≤ N).
This is a specialized form of Fin.card_filter_val_lt for the case when n ≤ N.
Used for proving properties of colPartition.
The column partition (1, 1, ..., 1, 0, ..., 0) with n ones (n boxes in first column). This is the partition corresponding to e_n (elementary symmetric polynomial). Requires n ≤ N (can't have more rows than N).
Equations
Instances For
The column partition has size n.
The first n parts of the column partition are 1.
Parts beyond n in the column partition are 0.
Transpose of a partition #
The transpose of a partition λ is denoted λᵗ and satisfies: (λᵗ)ᵢ = |{j : λⱼ ≥ i+1}| for each i.
Since we work with fixed-length tuples, we define a predicate IsTranspose
that captures when two tuples represent transpose partitions.
The transpose of a partition. See Exercise exe.pars.transpose in the source. The transpose λᵗ satisfies: (λᵗ)ᵢ = |{j : λⱼ ≥ i+1}| for each i. The length of the transpose equals the first (largest) part of λ.
Equations
Instances For
Predicate asserting that lamt is the transpose of lam.
The transpose λᵗ of a partition λ satisfies:
(λᵗ)ᵢ = |{j : λⱼ ≥ i}| for each i.
Since we work with fixed-length tuples, this predicate captures when two tuples represent transpose partitions (possibly with trailing zeros).
Equations
Instances For
The zero partition is its own transpose.
Namespace aliases for migration #
NOTE: The aliases below are commented out because they conflict with existing local
NPartition definitions in MonomialSymmetric.lean and PieriJacobiTrudi.lean.
To migrate a file to use the shared definition:
- Import this file
- Remove the local
structure NPartitiondefinition - Uncomment the appropriate alias below, OR use
open _root_.NPartition
-- namespace AlgComb.SymmetricFunctions -- abbrev NPartition := root.NPartition -- end AlgComb.SymmetricFunctions
-- Note: We don't create a SymmetricFunctions.NPartition alias here because
-- PieriJacobiTrudi.lean already defines its own SymmetricFunctions.NPartition
-- structure. Migration of PieriJacobiTrudi.lean is tracked separately.