A model of ZFC #
In this file, we model Zermelo-Fraenkel set theory (+ Choice) using Lean's underlying type theory. We do this in four main steps:
- Define pre-sets inductively.
- Define extensional equivalence on pre-sets and give it a
setoid
instance. - Define ZFC sets by quotienting pre-sets by extensional equivalence.
- Define classes as sets of ZFC sets. Then the rest is usual set theory.
The model #
PSet
: Pre-set. A pre-set is inductively defined by its indexing type and its members, which are themselves pre-sets.ZFSet
: ZFC set. Defined asPSet
quotiented byPSet.Equiv
, the extensional equivalence.Class
: Class. Defined asSet ZFSet
.ZFSet.choice
: Axiom of choice. Proved from Lean's axiom of choice.
Other definitions #
Arity α n
:n
-ary functionα → α → ... → α
. Defined inductively.Arity.const a n
:n
-ary constant function equal toa
.PSet.Type
: Underlying type of a pre-set.PSet.Func
: Underlying family of pre-sets of a pre-set.PSet.Equiv
: Extensional equivalence of pre-sets. Defined inductively.PSet.omega
,ZFSet.omega
: The von Neumann ordinalω
as aPSet
, as aSet
.PSet.Arity.Equiv
: Extensional equivalence ofn
-aryPSet
-valued functions. Extension ofPSet.Equiv
.PSet.Resp
: Collection ofn
-aryPSet
-valued functions that respect extensional equivalence.PSet.eval
: Turns aPSet
-valued function that respect extensional equivalence into aZFSet
-valued function.Classical.allDefinable
: 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
.Class.iota
: Definite description operator.
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".
TODO #
Prove Set.map_definable_aux
computably.
Constant n
-ary function with value a
.
Equations
- Arity.const a 0 = a
- Arity.const a (Nat.succ n) = fun x => Arity.const a n
Instances For
Two pre-sets are extensionally equivalent if every element of the first family is extensionally equivalent to some element of the second family and vice-versa.
Equations
- PSet.Equiv (PSet.mk α A) (PSet.mk α_1 B) = ((∀ (a : α), ∃ b, PSet.Equiv (A a) (B b)) ∧ ∀ (b : α_1), ∃ a, PSet.Equiv (A a) (B b))
Instances For
A pre-set is a subset of another pre-set if every element of the first family is extensionally equivalent to some element of the second family.
Instances For
A nonempty set is one that contains some element.
Instances For
Two pre-sets are equivalent iff they have the same members.
The n-th von Neumann ordinal
Equations
- PSet.ofNat 0 = ∅
- PSet.ofNat (Nat.succ n) = insert (PSet.ofNat n) (PSet.ofNat n)
Instances For
Function equivalence is defined so that f ~ g
iff ∀ x y, x ~ y → f x ~ g y
. This extends to
equivalence of n
-ary functions.
Equations
- PSet.Arity.Equiv a b = PSet.Equiv a b
- PSet.Arity.Equiv a b = ∀ (x y : PSet), PSet.Equiv x y → PSet.Arity.Equiv (a x) (b y)
Instances For
Function equivalence for functions respecting equivalence. See PSet.Arity.Equiv
.
Instances For
Helper function for PSet.eval
.
Equations
- One or more equations did not get rendered due to their size.
Instances For
- mk: {n : ℕ} → (f : PSet.Resp n) → PSet.Definable n (PSet.Resp.eval n f)
A set function is "definable" if it is the image of some n-ary pre-set function. This isn't exactly definability, but is useful as a sufficient condition for functions that have a computable image.
Instances
The evaluation of a function respecting equivalence is definable, by that same function.
Instances For
Turns a definable function into a function that respects equivalence.
Instances For
All functions are classically definable.
Equations
- One or more equations did not get rendered due to their size.
Instances For
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
.
Instances For
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
Instances For
The intersection operator, the collection of elements in all of the elements of a ZFC set. We
special-case ⋂₀ ∅ = ∅
.
Instances For
The intersection operator, the collection of elements in all of the elements of a ZFC set. We
special-case ⋂₀ ∅ = ∅
.
Instances For
The image of a (definable) ZFC set function
Instances For
The cartesian product, {(a, b) | a ∈ x, b ∈ 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 : ZFSet), y ∈ x → ZFSet.Hereditarily p y)
Instances For
Alias of the forward direction of ZFSet.hereditarily_iff
.
Assert that A
is a ZFC set satisfying B
Instances For
Convert a conglomerate (a collection of classes) into a class
Instances For
Convert a class into a conglomerate (a collection of classes)
Instances For
The power class of a class is the class of all subclasses that are ZFC sets
Instances For
The union of a class is the class of all members of ZFC sets in the class
Instances For
The union of a class is the class of all members of ZFC sets in the class
Instances For
The intersection of a class is the class of all members of ZFC sets in the class
Instances For
The intersection of a class is the class of all members of ZFC sets in the class
Instances For
An induction principle for sets. If every subset of a class is a member, then the class is universal.
The definite description operator, which is {x}
if {y | A y} = {x}
and ∅
otherwise.
Instances For
A choice function on the class of nonempty ZFC sets.
Instances For
ZFSet.toSet
as an equivalence.