A model of ZFC #
In this file, we model Zermelo-Fraenkel set theory (+ choice) using Lean's underlying type theory,
building on the pre-sets defined in Mathlib.SetTheory.ZFC.PSet
.
The theory of classes is developed in Mathlib.SetTheory.ZFC.Class
.
Main definitions #
ZFSet
: ZFC set. Defined asPSet
quotiented byPSet.Equiv
, the extensional equivalence.ZFSet.choice
: Axiom of choice. Proved from Lean's axiom of choice.ZFSet.omega
: The von Neumann ordinalω
as aSet
.Classical.allZFSetDefinable
: All functions are classically definable.ZFSet.IsFunc
: Predicate that a ZFC set is a subset ofx × y
that can be considered as a ZFC functionx → y
. That is, each member ofx
is related by the ZFC set to exactly one member ofy
.ZFSet.funs
: ZFC set of ZFC functionsx → y
.ZFSet.Hereditarily p x
: Predicate that every set in the transitive closure ofx
has propertyp
.
Notes #
To avoid confusion between the Lean Set
and the ZFC Set
, docstrings in this file refer to them
respectively as "Set
" and "ZFC set".
The ZFC universe of sets consists of the type of pre-sets, quotiented by extensional equivalence.
Equations
Instances For
Turns a pre-set into a ZFC set.
Equations
Instances For
A set function is "definable" if it is the image of some n-ary PSet
function. This isn't exactly definability, but is useful as a sufficient
condition for functions that have a computable image.
Turns a definable function into an n-ary
PSet
function.A set function
f
is the image ofDefinable.out f
.
Instances
An abbrev of ZFSet.Definable
for unary functions.
Equations
- ZFSet.Definable₁ f = ZFSet.Definable 1 fun (s : Fin 1 → ZFSet.{?u.18}) => f (s 0)
Instances For
A simpler constructor for ZFSet.Definable₁
.
Equations
- ZFSet.Definable₁.mk out mk_out = { out := fun (xs : Fin 1 → PSet.{?u.42}) => out (xs 0), mk_out := ⋯ }
Instances For
Turns a unary definable function into a unary PSet
function.
Equations
- ZFSet.Definable₁.out f x = ZFSet.Definable.out (fun (s : Fin (Nat.succ 0) → ZFSet.{?u.33}) => f (s 0)) ![x]
Instances For
An abbrev of ZFSet.Definable
for binary functions.
Equations
- ZFSet.Definable₂ f = ZFSet.Definable 2 fun (s : Fin 2 → ZFSet.{?u.24}) => f (s 0) (s 1)
Instances For
A simpler constructor for ZFSet.Definable₂
.
Equations
- ZFSet.Definable₂.mk out mk_out = { out := fun (xs : Fin 2 → PSet.{?u.56}) => out (xs 0) (xs 1), mk_out := ⋯ }
Instances For
Turns a binary definable function into a binary PSet
function.
Equations
- ZFSet.Definable₂.out f x y = ZFSet.Definable.out (fun (s : Fin (Nat.succ 0).succ → ZFSet.{?u.48}) => f (s 0) (s 1)) ![x, y]
Instances For
Equations
- ZFSet.instDefinableOfDefinable₁ f n g = { out := fun (xs : Fin n → PSet.{?u.62}) => ZFSet.Definable₁.out f (ZFSet.Definable.out g xs), mk_out := ⋯ }
Equations
- ZFSet.instDefinableOfDefinable₂ f n g₁ g₂ = { out := fun (xs : Fin n → PSet.{?u.88}) => ZFSet.Definable₂.out f (ZFSet.Definable.out g₁ xs) (ZFSet.Definable.out g₂ xs), mk_out := ⋯ }
Equations
- ZFSet.instDefinable n i = { out := fun (s : Fin n → PSet.{?u.29}) => s i, mk_out := ⋯ }
All functions are classically definable.
Equations
- Classical.allZFSetDefinable F = { out := fun (xs : Fin n → PSet.{?u.30}) => Quotient.out (F fun (x : Fin n) => ZFSet.mk (xs x)), mk_out := ⋯ }
Instances For
The membership relation for ZFC sets is inherited from the membership relation for pre-sets.
Equations
- ZFSet.Mem = Quotient.lift₂ (fun (x1 x2 : PSet.{?u.17}) => x1 ∈ x2) ZFSet.Mem.proof_1
Instances For
Equations
- ZFSet.instMembership = { mem := fun (t s : ZFSet.{?u.5}) => s.Mem t }
A nonempty set is one that contains some element.
Instances For
x ⊆ y
as ZFC sets means that all members of x
are members of y
.
Equations
- x.Subset y = ∀ ⦃z : ZFSet.{?u.19}⦄, z ∈ x → z ∈ y
Instances For
Equations
- ZFSet.hasSubset = { Subset := ZFSet.Subset }
Equations
- ZFSet.instEmptyCollection = { emptyCollection := ZFSet.empty }
Equations
- ZFSet.instInhabited = { default := ∅ }
Insert x y
is the set {x} ∪ y
Instances For
Equations
- ZFSet.instInsert = { insert := ZFSet.Insert }
Equations
- ZFSet.instSingleton = { singleton := fun (x : ZFSet.{?u.4}) => insert x ∅ }
{x ∈ a | p x}
is the set of elements in a
satisfying p
Equations
- ZFSet.sep p = Quotient.map (PSet.sep fun (y : PSet.{?u.17}) => p (ZFSet.mk y)) ⋯
Instances For
Equations
- ZFSet.instSep = { sep := ZFSet.sep }
The powerset operation, the collection of subsets of a ZFC set
Instances For
The union operator, the collection of elements of elements of a ZFC set
Instances For
The union operator, the collection of elements of elements of a ZFC set
Equations
- ZFSet.«term⋃₀_» = Lean.ParserDescr.node `ZFSet.«term⋃₀_» 110 (Lean.ParserDescr.binary `andthen (Lean.ParserDescr.symbol "⋃₀ ") (Lean.ParserDescr.cat `term 110))
Instances For
The intersection operator, the collection of elements in all of the elements of a ZFC set. We
define ⋂₀ ∅ = ∅
.
Instances For
The intersection operator, the collection of elements in all of the elements of a ZFC set. We
define ⋂₀ ∅ = ∅
.
Equations
- ZFSet.«term⋂₀_» = Lean.ParserDescr.node `ZFSet.«term⋂₀_» 110 (Lean.ParserDescr.binary `andthen (Lean.ParserDescr.symbol "⋂₀ ") (Lean.ParserDescr.cat `term 110))
Instances For
The binary intersection operation
Equations
- x.inter y = ZFSet.sep (fun (z : ZFSet.{?u.18}) => z ∈ y) x
Instances For
The set difference operation
Equations
- x.diff y = ZFSet.sep (fun (z : ZFSet.{?u.18}) => z ∉ y) x
Instances For
Equations
- ZFSet.instUnion = { union := ZFSet.union }
Equations
- ZFSet.instInter = { inter := ZFSet.inter }
Induction on the ∈
relation.
Equations
- ZFSet.instWellFoundedRelation = { rel := fun (x1 x2 : ZFSet.{?u.5}) => x1 ∈ x2, wf := ZFSet.mem_wf }
The image of a (definable) ZFC set function
Equations
- ZFSet.image f = Quotient.map (PSet.image (ZFSet.Definable₁.out f)) ⋯
Instances For
The range of a type-indexed family of sets.
Equations
- ZFSet.range f = ⟦PSet.mk (Shrink.{?u.30, ?u.29} α) (Quotient.out ∘ f ∘ ⇑(equivShrink α).symm)⟧
Instances For
The cartesian product, {(a, b) | a ∈ x, b ∈ y}
Equations
- ZFSet.prod = ZFSet.pairSep fun (x x : ZFSet.{?u.6}) => True
Instances For
isFunc x y f
is the assertion that f
is a subset of x × y
which relates to each element
of x
a unique element of y
, so that we can consider f
as a ZFC function x → y
.
Instances For
Equations
Equations
Graph of a function: map f x
is the ZFC function which maps a ∈ x
to f a
Equations
- ZFSet.map f = ZFSet.image fun (y : ZFSet.{?u.32}) => y.pair (f y)
Instances For
Given a predicate p
on ZFC sets. Hereditarily p x
means that x
has property p
and the
members of x
are all Hereditarily p
.
Equations
- ZFSet.Hereditarily p x = (p x ∧ ∀ y ∈ x, ZFSet.Hereditarily p y)
Instances For
Alias of the forward direction of ZFSet.hereditarily_iff
.