ZFC Natural numbers #
This file defines the natural numbers in ZF set theory. The definition is based on the construction of the Von Neumann ordinals, where each natural number is represented as the set of all smaller natural numbers.
The set of all natural numbers is defined as the smallest inductive set. Because of the axiom of
separation, the definition relies on the existence of an infinite set, which is provided by the
some_inf constant. It can be shown that the choice of some_inf does not affect the definition of
the natural numbers and leads to isomorphic definitions.
The file also includes the definition of the ZFNat type for ZF natural numbers, and provides
various properties and usual arithmetic operations on natural numbers.
Preliminary definitions #
Imported ZFLean declaration.
Equations
- ZFSet.termω = Lean.ParserDescr.node `ZFSet.termω 1024 (Lean.ParserDescr.symbol "ω")
Instances For
The first Von Neumann ordinal ω is an inductive set.
Natural numbers #
The set of natural numbers Nat is defined as the smallest inductive set.
This definition avoids the use of ω, even though ω may be thought of as ℕ.
Equations
Instances For
Nat is an infinite inductive set.
Equations
- ZFSet.ZFNat.natZero = { zero := ⟨∅, ZFSet.ZFNat.zero_in_Nat⟩ }
Equations
- ZFSet.ZFNat.natLt = { lt := fun (x y : ZFSet.ZFNat) => ↑x ∈ ↑y }
Equations
- ZFSet.ZFNat.natLe = { le := fun (x y : ZFSet.ZFNat) => x < y ∨ x = y }
Any inductive set contains zero.
Any inductive set containing an element also contains its successor.
Any inductive set is a subset of some_inf.
Equations
- ZFSet.ZFNat.natOne = { one := ZFSet.ZFNat.succ 0 }
Any inductive set a separated by an inductive predicate P is inductive.
Recursion on natural numbers #
The relation built over the successor function is a subrelation of the membership relation.
The induction principle for sets in Nat. This principle is meant to be used for definitional
purposes only.
The predecessor function on natural numbers, defined directly as the union of a set.
Equations
Instances For
The recursion principle for sets in Nat. This principle is meant to be used for definitional
purposes only.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Provides the base case of the recursion principle for sets in Nat.
Provides the inductive step of the recursion principle for sets in Nat.
The recursion principle for natural numbers. This recursor allows inductive definitions over natural numbers to be defined in a more natural way.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The predecessor function pred' on natural numbers, defined inductively.
This definition is equivalent to pred, as proven by pred'_eq_pred.
Equations
- m.pred' = ZFSet.ZFNat.rec m 0 fun (x x_1 : ZFSet.ZFNat) => x
Instances For
Arithmetic #
Equations
- ZFSet.ZFNat.instPreorder = { toLE := ZFSet.ZFNat.natLe, toLT := ZFSet.ZFNat.natLt, le_refl := ZFSet.ZFNat.instPreorder._proof_1, le_trans := ⋯, lt_iff_le_not_ge := ⋯ }
Equations
- One or more equations did not get rendered due to their size.
The addition function on natural numbers, defined inductively.
Equations
- n.add m = ZFSet.ZFNat.rec n m fun (x : ZFSet.ZFNat) => ZFSet.ZFNat.succ
Instances For
Equations
- ZFSet.ZFNat.addInst = { add := ZFSet.ZFNat.add }
Natural-number subtraction in the ZF natural model.
Equations
- n.sub m = ZFSet.ZFNat.rec m n fun (x : ZFSet.ZFNat) => ZFSet.ZFNat.pred
Instances For
Imported ZFLean declaration.
Equations
- ZFSet.ZFNat.subInst = { sub := ZFSet.ZFNat.sub }
The multiplication function on natural numbers, defined inductively.
Equations
- n.mul m = ZFSet.ZFNat.rec n 0 fun (x : ZFSet.ZFNat) (x_1 : ZFSet.ZFNat) => x_1 + m
Instances For
Equations
- ZFSet.ZFNat.mulInst = { mul := ZFSet.ZFNat.mul }
The power function on natural numbers, defined inductively.
Equations
- n.pow p = ZFSet.ZFNat.rec p 1 fun (x : ZFSet.ZFNat) (x_1 : ZFSet.ZFNat) => x_1 * n
Instances For
Equations
- ZFSet.ZFNat.powInst = { pow := ZFSet.ZFNat.pow }
Scalar multiplication by a Lean natural number.
Equations
- ZFSet.ZFNat.nsmul 0 x✝ = 0
- ZFSet.ZFNat.nsmul n.succ x✝ = x✝ + ZFSet.ZFNat.nsmul n x✝
Instances For
Imported ZFLean declaration.
Equations
- One or more equations did not get rendered due to their size.
Equations
- ZFSet.ZFNat.instCommSemiring = { toSemiring := ZFSet.ZFNat.instSemiring, mul_comm := ZFSet.ZFNat.mul_comm }
Converts a ZF natural number to a Lean natural number.
Equations
- n.toNat = ZFSet.ZFNat.rec n 0 fun (x : ZFSet.ZFNat) => Nat.succ
Instances For
Imported ZFLean declaration.
Equations
Instances For
The equivalence between ZF natural numbers and Lean natural numbers.
Equations
- One or more equations did not get rendered due to their size.