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.lean.
The theory of classes is developed in Mathlib/SetTheory/ZFC/Class.lean.
Main definitions #
ZFSet: ZFC set. Defined asPSetquotiented 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 × ythat can be considered as a ZFC functionx → y. That is, each member ofxis 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 ofxhas 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
PSetfunction.A set function
fis 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.12}) => 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.32}) => 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.23}) => 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.17}) => 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.45}) => 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.35}) => f (s 0) (s 1)) ![x, y]
Instances For
Equations
- ZFSet.instDefinableOfDefinable₁ f n g = { out := fun (xs : Fin n → PSet.{?u.47}) => 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.67}) => 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.22}) => s i, mk_out := ⋯ }
All functions are classically definable.
Equations
- Classical.allZFSetDefinable F = { out := fun (xs : Fin n → PSet.{?u.22}) => 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.13}) => x1 ∈ x2) ZFSet.Mem._proof_1
Instances For
Equations
- ZFSet.instMembership = { mem := fun (t s : ZFSet.{?u.4}) => 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.12}⦄, z ∈ x → z ∈ y
Instances For
Equations
- ZFSet.hasSubset = { Subset := ZFSet.Subset }
Equations
- ZFSet.instSetLike = { coe := ZFSet.toSet, coe_injective' := ZFSet.toSet_injective }
Equations
- ZFSet.instHasSSubset = { SSubset := fun (x1 x2 : ZFSet.{?u.4}) => x1 < x2 }
Equations
- ZFSet.instEmptyCollection = { emptyCollection := ZFSet.empty }
Equations
- ZFSet.instInhabited = { default := ∅ }
Alias of ZFSet.notMem_empty.
Insert x y is the set {x} ∪ y
Instances For
Equations
- ZFSet.instInsert = { insert := ZFSet.Insert }
Equations
- ZFSet.instSingleton = { singleton := fun (x : ZFSet.{?u.3}) => 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.12}) => 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. Uses ⋃₀ notation,
scoped under the ZFSet namespace.
Instances For
The union operator, the collection of elements of elements of a ZFC set. Uses ⋃₀ notation,
scoped under the ZFSet namespace.
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 ⋂₀ ∅ = ∅. Uses ⋂₀ notation, scoped under the ZFSet namespace.
Instances For
The intersection operator, the collection of elements in all of the elements of a ZFC set. We
define ⋂₀ ∅ = ∅. Uses ⋂₀ notation, scoped under the ZFSet namespace.
Equations
- ZFSet.«term⋂₀_» = Lean.ParserDescr.node `ZFSet.«term⋂₀_» 110 (Lean.ParserDescr.binary `andthen (Lean.ParserDescr.symbol "⋂₀ ") (Lean.ParserDescr.cat `term 110))
Instances For
Alias of ZFSet.notMem_sInter_of_notMem.
The binary intersection operation
Equations
- x.inter y = ZFSet.sep (fun (z : ZFSet.{?u.11}) => z ∈ y) x
Instances For
The set difference operation
Equations
- x.diff y = ZFSet.sep (fun (z : ZFSet.{?u.11}) => 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.4}) => x1 ∈ x2, wf := ZFSet.mem_wf }
Alias of ZFSet.notMem_of_subset.
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.20, ?u.19} α) (Quotient.out ∘ f ∘ ⇑(equivShrink α).symm)⟧
Instances For
The Cartesian product, {(a, b) | a ∈ x, b ∈ y}
Equations
- ZFSet.prod = ZFSet.pairSep fun (x x_1 : 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.24}) => 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.