Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Theorem 6.17 — Dilworth's Theorem

Proved
AppliedComb.Posets.dilworth

by mikedeng1 · Sep 28, 2026 · Mathlib 0df444a (Lean v4.33.1)

combinatoricsp2o-batch-books5p2o-gran-per-chapterp2o-plan-bookp2o-v1posets

Let P=(X,P)\mathbf P = (X, P)P=(X,P) be a finite poset and let w=width⁡(P)w = \operatorname{width}(\mathbf P)w=width(P) be the largest size of an antichain (a set of pairwise incomparable points). Then XXX can be partitioned into www chains,

X=C1∪C2∪⋯∪Cw,Ci a chain, Ci∩Cj=∅ (i≠j),X = C_1 \cup C_2 \cup \cdots \cup C_w, \qquad C_i \text{ a chain}, \ C_i \cap C_j = \emptyset \ (i \ne j),X=C1​∪C2​∪⋯∪Cw​,Ci​ a chain, Ci​∩Cj​=∅ (i=j),

and there is no partition of XXX into fewer than www chains.

Thus the least number of chains needed to cover a finite poset equals the size of its largest antichain. The theorem is equivalent to König's theorem on bipartite matchings and to Hall's marriage theorem, and it is the capstone of the chapter.

Formalization Note. Stated for a finite type α (the book defines width as a maximum, which presumes finiteness). Width is defined from antichains (AppliedComb.Posets.width), never as a minimum number of chains, so the statement is not true by definition. The partition is indexed by Fin (width α); the "no fewer" clause quantifies over every k and every chain partition indexed by Fin k, and concludes width α ≤ k. The empty poset (w=0w = 0w=0) is included.

Preamble
import Mathlib
import Definitions.Def_AppliedComb_Posets_width
import Definitions.Def_AppliedComb_Posets_chainPartition
Formal statement
namespace AppliedComb.Posets

/-- Theorem 6.17 (Dilworth's Theorem), Keller & Trotter p. 122: a finite poset of width `w`
has a partition into `w` chains, and every chain partition has at least `w` parts. -/
theorem dilworth (α : Type*) [PartialOrder α] [Fintype α] :
    (∃ C : Fin (width α) → Finset α, IsChainPartition C) ∧
    ∀ (k : ℕ) (C : Fin k → Finset α), IsChainPartition C → width α ≤ k := by sorry

end AppliedComb.Posets
Source
Keller & Trotter, Applied Combinatorics (2017 Edition), p. 122, Theorem 6.17
Read-back

What the Lean code literally says, in plain math · claude-opus-5-5

Let α\alphaα be any type with a partial order ≤\le≤ that has finitely many elements. The statement uses two notions that are imported from other files, and their definitions are not included in the code given to me:

  • width⁡(α)\operatorname{width}(\alpha)width(α), a natural number attached to the ordered type α\alphaα (it is a natural number because it is used both as the size of an index set and in a ≤\le≤ comparison with a natural number kkk);
  • IsChainPartition⁡(C)\operatorname{IsChainPartition}(C)IsChainPartition(C), a property of a family C=(Ci)i∈{0,…,k−1}C = (C_i)_{i \in \{0,\dots,k-1\}}C=(Ci​)i∈{0,…,k−1}​ of finite subsets of α\alphaα, indexed by the kkk elements of {0,…,k−1}\{0, \dots, k-1\}{0,…,k−1}.

This read-back cannot expand either definition. Their names suggest "the maximum size of an antichain" and "the sets CiC_iCi​ are chains that partition α\alphaα", but nothing in the code shown confirms this. What the statement means depends entirely on how those two definitions are written. In particular, the code shown does not settle whether empty parts Ci=∅C_i = \emptysetCi​=∅ are allowed, whether the CiC_iCi​ must be pairwise disjoint, or whether they must cover α\alphaα.

Under these assumptions, the statement asserts that both of the following hold:

  1. Existence. Let w=width⁡(α)w = \operatorname{width}(\alpha)w=width(α). There is a family C0,C1,…,Cw−1C_0, C_1, \dots, C_{w-1}C0​,C1​,…,Cw−1​ of exactly www finite subsets of α\alphaα such that
IsChainPartition⁡(C0,…,Cw−1)\operatorname{IsChainPartition}(C_0, \dots, C_{w-1})IsChainPartition(C0​,…,Cw−1​)

holds.

  1. Lower bound. For every natural number kkk and every family C0,…,Ck−1C_0, \dots, C_{k-1}C0​,…,Ck−1​ of finite subsets of α\alphaα,
IsChainPartition⁡(C0,…,Ck−1)  ⟹  width⁡(α)≤k.\operatorname{IsChainPartition}(C_0, \dots, C_{k-1}) \implies \operatorname{width}(\alpha) \le k.IsChainPartition(C0​,…,Ck−1​)⟹width(α)≤k.

Taken together, the two parts say that www is the smallest kkk for which some family indexed by {0,…,k−1}\{0,\dots,k-1\}{0,…,k−1} satisfies IsChainPartition⁡\operatorname{IsChainPartition}IsChainPartition. The inequality is non-strict (≤\le≤), and the family in part 1 has exactly www indices. Whether that means exactly www nonempty parts depends on whether IsChainPartition⁡\operatorname{IsChainPartition}IsChainPartition allows empty CiC_iCi​. There are no hypotheses beyond these three: α\alphaα is a type, it is partially ordered, and it is finite. The descriptive comment attached to the declaration is not part of what it asserts.

Degenerate cases. If α\alphaα is empty, then the value of width⁡(α)\operatorname{width}(\alpha)width(α) comes from the unseen definition; it is typically 000 for a maximum over an empty collection of antichains. If it is 000, part 1 asserts that the empty family (indexed by the empty set {0,…,−1}\{0,\dots,-1\}{0,…,−1}) satisfies IsChainPartition⁡\operatorname{IsChainPartition}IsChainPartition. Part 2 with k=0k = 0k=0 then asserts width⁡(α)≤0\operatorname{width}(\alpha) \le 0width(α)≤0, and it only has force if the empty family satisfies IsChainPartition⁡\operatorname{IsChainPartition}IsChainPartition. If α\alphaα has one element, both parts depend on the width that the unseen definition gives a single point. For any α\alphaα, part 2 with k=0k = 0k=0 says that if the empty family satisfies IsChainPartition⁡\operatorname{IsChainPartition}IsChainPartition, then the width is 000. If IsChainPartition⁡\operatorname{IsChainPartition}IsChainPartition allows empty parts, part 2 covers families padded with any number of empty sets. Part 1 then only needs some family of exactly www sets, some of which may be empty. The statement contains no division, natural-number subtraction, integrals or suprema, so no default ("junk") values appear in the code shown. Any such behaviour would sit inside the unseen definitions of width⁡\operatorname{width}width and IsChainPartition⁡\operatorname{IsChainPartition}IsChainPartition.

Human review
  • Endorsed by Shuze Chen · Oct 2, 2026

    Confirmed by the moderator at approval.

  • Endorsed by mikedeng1 · Oct 2, 2026

    Confirmed by the mission captain (proposal self-audit).

  • Endorsed by Community (Bot) · Oct 20, 2026

    Confirmed by the moderator at approval.

View graph

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions, with reuse governed by our licensing terms.

How Prove2Me worksResearch paperProve2Me Team
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me