Chains and Zorn's lemmas #
This file defines chains for an arbitrary relation and proves several formulations of Zorn's Lemma, along with Hausdorff's Maximality Principle.
Main declarations #
chain c
: A chainc
is a set of comparable elements.max_chain_spec
: Hausdorff's Maximality Principle.exists_maximal_of_chains_bounded
: Zorn's Lemma. Many variants are offered.
Variants #
The primary statement of Zorn's lemma is exists_maximal_of_chains_bounded
. Then it is specialized
to particular relations:
(≤)
withzorn_partial_order
(⊆)
withzorn_subset
(⊇)
withzorn_superset
Lemma names carry modifiers:
₀
: Quantifies over a set, as opposed to over a type._nonempty
: Doesn't ask to prove that the empty chain is bounded and lets you give an element that will be smaller than the maximal element found (the maximal element is no smaller than any other element, but it can also be incomparable to some).
How-to #
This file comes across as confusing to those who haven't yet used it, so here is a detailed walkthrough:
- Know what relation on which type/set you're looking for. See Variants above. You can discharge
some conditions to Zorn's lemma directly using a
_nonempty
variant. - Write down the definition of your type/set, put a
suffices : ∃ m, ∀ a, m ≺ a → a ≺ m, { ... },
(or whatever you actually need) followed by aapply some_version_of_zorn
. - Fill in the details. This is where you start talking about chains.
A typical proof using Zorn could look like this
lemma zorny_lemma : zorny_statement :=
begin
let s : set α := {x | whatever x},
suffices : ∃ x ∈ s, ∀ y ∈ s, y ⊆ x → y = x, -- or with another operator
{ exact proof_post_zorn },
apply zorn.zorn_subset, -- or another variant
rintro c hcs hc,
obtain rfl | hcnemp := c.eq_empty_or_nonempty, -- you might need to disjunct on c empty or not
{ exact ⟨edge_case_construction,
proof_that_edge_case_construction_respects_whatever,
proof_that_edge_case_construction_contains_all_stuff_in_c⟩ },
exact ⟨construction,
proof_that_construction_respects_whatever,
proof_that_construction_contains_all_stuff_in_c⟩,
end
Notes #
Originally ported from Isabelle/HOL. The original file was written by Jacques D. Fleuriot, Tobias Nipkow, Christian Sternagel.
A chain is a subset c
satisfying x ≺ y ∨ x = y ∨ y ≺ x
for all x y ∈ c
.
Equations
- zorn.chain r c = c.pairwise (λ (x y : α), r x y ∨ r y x)
super_chain c₁ c₂
means that c₂
is a chain that strictly includes c₁
.
Equations
- zorn.super_chain c₁ c₂ = (zorn.chain r c₂ ∧ c₁ ⊂ c₂)
A chain c
is a maximal chain if there does not exists a chain strictly including c
.
Equations
- zorn.is_max_chain c = (zorn.chain r c ∧ ¬∃ (c' : set α), zorn.super_chain c c')
Given a set c
, if there exists a chain c'
strictly including c
, then succ_chain c
is one of these chains. Otherwise it is c
.
Equations
- zorn.succ_chain c = dite (∃ (c' : set α), zorn.chain r c ∧ zorn.super_chain c c') (λ (h : ∃ (c' : set α), zorn.chain r c ∧ zorn.super_chain c c'), classical.some h) (λ (h : ¬∃ (c' : set α), zorn.chain r c ∧ zorn.super_chain c c'), c)
- succ : ∀ {α : Type u} {r : α → α → Prop} {s : set α}, zorn.chain_closure s → zorn.chain_closure (zorn.succ_chain s)
- union : ∀ {α : Type u} {r : α → α → Prop} {s : set (set α)}, (∀ (a : set α), a ∈ s → zorn.chain_closure a) → zorn.chain_closure (⋃₀s)
Set of sets reachable from ∅
using succ_chain
and ⋃₀
.
An explicit maximal chain. max_chain
is taken to be the union of all sets in chain_closure
.
Equations
Hausdorff's maximality principle
There exists a maximal totally ordered subset of α
.
Note that we do not require α
to be partially ordered by r
.
Zorn's lemma
If every chain has an upper bound, then there exists a maximal element.
A variant of Zorn's lemma. If every nonempty chain of a nonempty type has an upper bound, then there is a maximal element.
This can be used to turn zorn.chain (≥)
into zorn.chain (≤)
and vice-versa.
Every chain is contained in a maximal chain. This generalizes Hausdorff's maximality principle.