Graded Posets and the Sperner Property #
This file formalizes Definition 4.1 and related notions from Chapter 4 of Algebraic Combinatorics by Richard Stanley.
Definitions #
Poset: A partially ordered set (Definition 4.1), defined as a finite set with a reflexive, antisymmetric, and transitive binary relation ≤. Formalized as a class bundlingPartialOrderandFintype.- Boolean algebra
B_n: The poset of all subsets of{1,...,n}ordered by inclusion, modeled asFinset (Fin n)with its natural partial order. - Graded poset: A finite poset with a rank function
ρ : P → ℕsuch that minimal elements have rank 0 and ifx ⋖ y(covers) thenρ(y) = ρ(x) + 1. Formalized using Mathlib'sGradeMinOrder ℕ α. GradedPoset: A class that records the maximum ranknof a finite poset already equipped with aGradeMinOrder ℕgrading, capturing the book's notion of a graded poset of rankn.- Rank-symmetric:
|P_i| = |P_{n-i}|for all0 ≤ i ≤ n. - Rank-unimodal: The sequence
|P_0|, ..., |P_n|is unimodal. - Antichain: A subset where no two elements are comparable, using Mathlib's
IsAntichain. - Sperner property: A graded poset has the Sperner property if the maximum antichain
size equals the maximum level size
max{|P_i| : 0 ≤ i ≤ n}.
Implementation notes #
The book's poset is finite by definition. We capture this with Fintype α.
Mathlib's GradeMinOrder ℕ α provides a rank function where minimal elements have
grade 0 and covers increase grade by 1. This matches the book's rank function ρ.
For B_n, we use Finset (Fin n) which already has instances for PartialOrder,
BoundedOrder, Fintype, and GradeMinOrder ℕ.
Posets #
Definition 4.1 (Poset). A poset (partially ordered set) is a finite set together
with a binary relation ≤ satisfying:
- (P1) Reflexivity:
x ≤ xfor allx ∈ P; - (P2) Antisymmetry: if
x ≤ yandy ≤ xthenx = y; - (P3) Transitivity: if
x ≤ yandy ≤ zthenx ≤ z.
In Lean/Mathlib, properties (P1)–(P3) are captured by the PartialOrder typeclass,
and finiteness by Fintype.
Instances
Any type with PartialOrder and Fintype instances is a Poset.
Graded Posets #
A graded poset of rank n is a finite partially ordered set equipped with an
ℕ-grading (rank function) where minimal elements have grade 0 and the maximum
grade attained is n. This formalizes Definition 4.1 from the book, specifically
the notion of a poset that is "graded of rank n".
We assume GradeMinOrder ℕ α is already available (so the grading is provided
externally, e.g., by Mathlib instances for Finset), and record only the
maximum rank and the boundedness condition.
- rank : ℕ
The rank of the graded poset (length of every maximal chain).
Every element has grade at most
rank.The maximum grade
rankis attained by some element.
Instances
Rank counting #
The number of elements of rank i in a graded poset.
This is p_i = |P_i| in the book's notation where P_i = ρ⁻¹(i).
Instances For
Rank-symmetric #
A graded poset of rank n is rank-symmetric if |P_i| = |P_{n-i}| for all
0 ≤ i ≤ n. (Definition 4.1, Stanley's Algebraic Combinatorics)
Instances For
Rank-unimodal #
A graded poset of rank n is rank-unimodal if there exists j with 0 ≤ j ≤ n
such that |P_0| ≤ |P_1| ≤ ... ≤ |P_j| ≥ |P_{j+1}| ≥ ... ≥ |P_n|.
(Definition 4.1, Stanley's Algebraic Combinatorics)
Instances For
Antichain #
An antichain in a poset P is a subset A of P such that no two distinct
elements of A are comparable, i.e., we never have x, y ∈ A with x < y.
This uses Mathlib's IsAntichain (· ≤ ·). (Definition 4.1, Stanley)
Instances For
Sperner Property #
The maximum rank count of a graded poset, i.e., max{|P_i| : 0 ≤ i ≤ n} where n
is the rank. This uses Finset.sup over Finset.range (rank + 1), which for ℕ
returns the maximum value (with ⊥ = 0 for the empty range, which cannot occur here
since rank + 1 > 0).
Instances For
A graded poset of rank n has the Sperner property if
max{|A| : A is an antichain of P} = max{|P_i| : 0 ≤ i ≤ n}.
Equivalently (as stated in the book, Definition 4.2), no antichain is larger than the
largest level P_i. Since each level P_i is itself an antichain, the maximum antichain
size is at least maxRankCount α; hence the Sperner property reduces to the upper bound.
(Definition 4.2, Stanley's Algebraic Combinatorics)
Instances For
Boolean Algebra B_n #
The Boolean algebra B_n is the poset of all subsets of [n] = {1,...,n} ordered
by inclusion. We model this as Finset (Fin n) with its natural subset ordering.
We use the name BooleanPoset to avoid conflict with Mathlib's BooleanAlgebra class.
(Definition 4.1, Stanley's Algebraic Combinatorics)
Instances For
The rank (grade) of a subset s in B_n is its cardinality.
B_n is a graded poset of rank n.
Order-Matchings #
An order-raising matching at rank i is a one-to-one function
φ : P_i → P_{i+1} satisfying x < φ(x) for all x ∈ P_i.
(Definition before Proposition 4.4, Stanley's Algebraic Combinatorics).
Formalized as the existence of a total function φ : α → α that is grade-raising,
order-raising, and injective when restricted to grade-i elements.
Instances For
An order-lowering matching at rank i is a one-to-one function
ψ : P_i → P_{i-1} satisfying ψ(x) < x for all x ∈ P_i.
(Definition before Proposition 4.4, Stanley's Algebraic Combinatorics).
Instances For
The hypothesis of Proposition 4.4: there exists a pivot j with 0 ≤ j ≤ n
and order-matchings P_0 → P_1 → ⋯ → P_j ← P_{j+1} ← ⋯ ← P_n.
Instances For
Iterated matching helpers #
If two raising-side elements map to the same rank-j element, the one with
smaller grade is ≤ the other. Key step for the antichain injectivity.
Uses bounded hypotheses: φ properties only required for i < j.
If two lowering-side elements map to the same rank-j element, the one with
larger grade is ≥ the other. Key step for the antichain injectivity.
Uses bounded hypotheses: ψ properties only required for j < i and i ≤ n.
Bounded raise_le: x ≤ raise φ start k x when φ properties hold for i < bound.
Bounded lower_le: lower ψ start k x ≤ x when ψ properties hold for j < i ≤ n.
Proposition 4.4 #
Proposition 4.4 (Rank-unimodal part). If a graded poset P of rank n
has order-matchings P_0 → P_1 → ⋯ → P_j ← P_{j+1} ← ⋯ ← P_n,
then P is rank-unimodal.
Proposition 4.4 (Sperner property part). If a graded poset P of rank n
has order-matchings P_0 → P_1 → ⋯ → P_j ← P_{j+1} ← ⋯ ← P_n,
then P has the Sperner property.
Proof: Define a graph G whose edges come from the matchings.
G decomposes into disjoint paths (chains in P), all passing through P_j.
Any antichain meets each chain at most once, so |A| ≤ p_j ≤ maxRankCount.
Transfer of Sperner property via order isomorphism #
If P has the Sperner property and e : P ≃o Q is an order isomorphism that
preserves grades, then Q also has the Sperner property.
The key idea: an order isomorphism maps antichains bijectively (preserving cardinality),
and if it preserves grades then rankCount and maxRankCount are the same on both sides.
A grade-preserving order isomorphism transfers rank-unimodality.
If e : P ≃o Q preserves grades and P is rank-unimodal, then so is Q.