Cardinal Numbers #
We define cardinal numbers as a quotient of types under the equivalence relation of equinumerity.
Main definitions #
cardinal
the type of cardinal numbers (in a given universe).cardinal.mk α
or#α
is the cardinality ofα
. The notation#
lives in the localecardinal
.- There is an instance that
cardinal
forms acanonically_ordered_comm_semiring
. - Addition
c₁ + c₂
is defined bycardinal.add_def α β : #α + #β = #(α ⊕ β)
. - Multiplication
c₁ * c₂
is defined bycardinal.mul_def : #α * #β = #(α * β)
. - The order
c₁ ≤ c₂
is defined bycardinal.le_def α β : #α ≤ #β ↔ nonempty (α ↪ β)
. - Exponentiation
c₁ ^ c₂
is defined bycardinal.power_def α β : #α ^ #β = #(β → α)
. cardinal.omega
the cardinality ofℕ
. This definition is universe polymorphic:cardinal.omega.{u} : cardinal.{u}
(contrast withℕ : Type
, which lives in a specific universe). In some cases the universe level has to be given explicitly.cardinal.min (I : nonempty ι) (c : ι → cardinal)
is the minimal cardinal in the range ofc
.cardinal.succ c
is the successor cardinal, the smallest cardinal larger thanc
.cardinal.sum
is the sum of a collection of cardinals.cardinal.sup
is the supremum of a collection of cardinals.cardinal.powerlt c₁ c₂
orc₁ ^< c₂
is defined assup_{γ < β} α^γ
.
Main Statements #
- Cantor's theorem:
cardinal.cantor c : c < 2 ^ c
. - König's theorem:
cardinal.sum_lt_prod
Implementation notes #
- There is a type of cardinal numbers in every universe level:
cardinal.{u} : Type (u + 1)
is the quotient of types inType u
. The operationcardinal.lift
lifts cardinal numbers to a higher level. - Cardinal arithmetic specifically for infinite cardinals (like
κ * κ = κ
) is in the fileset_theory/cardinal_ordinal.lean
. - There is an instance
has_pow cardinal
, but this will only fire if Lean already knows that both the base and the exponent live in the same universe. As a workaround, you can addto a file. This notation will work even if Lean doesn't know yet that the base and the exponent live in the same universe (but no exponents in other types can be used).local infixr ^ := @has_pow.pow cardinal cardinal cardinal.has_pow
References #
Tags #
cardinal number, cardinal arithmetic, cardinal exponentiation, omega, Cantor's theorem, König's theorem
The equivalence relation on types given by equivalence (bijective correspondence) of types. Quotienting by this equivalence relation gives the cardinal numbers.
We define the order on cardinal numbers by mk α ≤ mk β
if and only if
there exists an embedding (injective function) from α to β.
Equations
- cardinal.has_le = {le := λ (q₁ q₂ : cardinal), quotient.lift_on₂ q₁ q₂ (λ (α β : Type u), nonempty (α ↪ β)) cardinal.has_le._proof_1}
Equations
- cardinal.linear_order = {le := has_le.le cardinal.has_le, lt := partial_order.lt._default has_le.le, le_refl := cardinal.linear_order._proof_1, le_trans := cardinal.linear_order._proof_2, lt_iff_le_not_le := cardinal.linear_order._proof_3, le_antisymm := cardinal.linear_order._proof_4, le_total := cardinal.linear_order._proof_5, decidable_le := classical.dec_rel has_le.le, decidable_eq := decidable_eq_of_decidable_le (classical.dec_rel has_le.le), decidable_lt := decidable_lt_of_decidable_le (classical.dec_rel has_le.le)}
Equations
- cardinal.inhabited = {default := 0}
Equations
- cardinal.has_add = {add := λ (q₁ q₂ : cardinal), quotient.lift_on₂ q₁ q₂ (λ (α β : Type u), # (α ⊕ β)) cardinal.has_add._proof_1}
Equations
- cardinal.has_mul = {mul := λ (q₁ q₂ : cardinal), quotient.lift_on₂ q₁ q₂ (λ (α β : Type u), # (α × β)) cardinal.has_mul._proof_1}
Equations
- cardinal.comm_semiring = {add := has_add.add cardinal.has_add, add_assoc := cardinal.comm_semiring._proof_1, zero := 0, zero_add := zero_add, add_zero := cardinal.comm_semiring._proof_2, nsmul := semiring.nsmul._default 0 has_add.add zero_add cardinal.comm_semiring._proof_3, nsmul_zero' := cardinal.comm_semiring._proof_4, nsmul_succ' := cardinal.comm_semiring._proof_5, add_comm := add_comm, mul := has_mul.mul cardinal.has_mul, mul_assoc := cardinal.comm_semiring._proof_6, one := 1, one_mul := one_mul, mul_one := cardinal.comm_semiring._proof_7, npow := semiring.npow._default 1 has_mul.mul one_mul cardinal.comm_semiring._proof_8, npow_zero' := cardinal.comm_semiring._proof_9, npow_succ' := cardinal.comm_semiring._proof_10, zero_mul := zero_mul, mul_zero := cardinal.comm_semiring._proof_11, left_distrib := left_distrib, right_distrib := cardinal.comm_semiring._proof_12, mul_comm := mul_comm}
The cardinal exponential. mk α ^ mk β
is the cardinal of β → α
.
Equations
- a.power b = quotient.lift_on₂ a b (λ (α β : Type u), # (β → α)) cardinal.power._proof_1
Equations
Equations
- cardinal.order_bot = {bot := 0, le := linear_order.le cardinal.linear_order, lt := linear_order.lt cardinal.linear_order, le_refl := _, le_trans := _, lt_iff_le_not_le := _, le_antisymm := _, bot_le := cardinal.zero_le}
Equations
- cardinal.canonically_ordered_comm_semiring = {add := comm_semiring.add cardinal.comm_semiring, add_assoc := _, zero := comm_semiring.zero cardinal.comm_semiring, zero_add := _, add_zero := _, nsmul := comm_semiring.nsmul cardinal.comm_semiring, nsmul_zero' := _, nsmul_succ' := _, add_comm := _, le := order_bot.le cardinal.order_bot, lt := order_bot.lt cardinal.order_bot, le_refl := _, le_trans := _, lt_iff_le_not_le := _, le_antisymm := _, add_le_add_left := cardinal.canonically_ordered_comm_semiring._proof_1, lt_of_add_lt_add_left := cardinal.canonically_ordered_comm_semiring._proof_2, bot := order_bot.bot cardinal.order_bot, bot_le := _, le_iff_exists_add := cardinal.le_iff_exists_add, mul := comm_semiring.mul cardinal.comm_semiring, mul_assoc := _, one := comm_semiring.one cardinal.comm_semiring, one_mul := _, mul_one := _, npow := comm_semiring.npow cardinal.comm_semiring, npow_zero' := _, npow_succ' := _, zero_mul := _, mul_zero := _, left_distrib := _, right_distrib := _, mul_comm := _, eq_zero_or_eq_zero_of_mul_eq_zero := cardinal.eq_zero_or_eq_zero_of_mul_eq_zero}
Equations
- cardinal.canonically_linear_ordered_add_monoid = {add := canonically_ordered_add_monoid.add infer_instance, add_assoc := cardinal.canonically_linear_ordered_add_monoid._proof_1, zero := canonically_ordered_add_monoid.zero infer_instance, zero_add := cardinal.canonically_linear_ordered_add_monoid._proof_2, add_zero := cardinal.canonically_linear_ordered_add_monoid._proof_3, nsmul := canonically_ordered_add_monoid.nsmul infer_instance, nsmul_zero' := cardinal.canonically_linear_ordered_add_monoid._proof_4, nsmul_succ' := cardinal.canonically_linear_ordered_add_monoid._proof_5, add_comm := cardinal.canonically_linear_ordered_add_monoid._proof_6, le := canonically_ordered_add_monoid.le infer_instance, lt := canonically_ordered_add_monoid.lt infer_instance, le_refl := cardinal.canonically_linear_ordered_add_monoid._proof_7, le_trans := cardinal.canonically_linear_ordered_add_monoid._proof_8, lt_iff_le_not_le := cardinal.canonically_linear_ordered_add_monoid._proof_9, le_antisymm := cardinal.canonically_linear_ordered_add_monoid._proof_10, add_le_add_left := cardinal.canonically_linear_ordered_add_monoid._proof_11, lt_of_add_lt_add_left := cardinal.canonically_linear_ordered_add_monoid._proof_12, bot := canonically_ordered_add_monoid.bot infer_instance, bot_le := cardinal.canonically_linear_ordered_add_monoid._proof_13, le_iff_exists_add := cardinal.canonically_linear_ordered_add_monoid._proof_14, le_total := _, decidable_le := linear_order.decidable_le cardinal.linear_order, decidable_eq := linear_order.decidable_eq cardinal.linear_order, decidable_lt := linear_order.decidable_lt cardinal.linear_order}
The minimum cardinal in a family of cardinals (the existence
of which is provided by injective_min
).
Equations
- cardinal.min I f = f (classical.some _)
Equations
- cardinal.has_wf = {r := has_lt.lt (preorder.to_has_lt cardinal), wf := cardinal.wf}
The successor cardinal - the smallest cardinal greater than
c
. This is not the same as c + 1
except in the case of finite c
.
Equations
- c.succ = cardinal.min _ subtype.val
The indexed sum of cardinals is the cardinality of the indexed disjoint union, i.e. sigma type.
Equations
- cardinal.sum f = # (Σ (i : ι), quotient.out (f i))
The indexed supremum of cardinals is the smallest cardinal above everything in the family.
Equations
- cardinal.sup f = cardinal.min _ (λ (a : {c // ∀ (i : ι), f i ≤ c}), a.val)
The indexed product of cardinals is the cardinality of the Pi type (dependent product).
Equations
- cardinal.prod f = # (Π (i : ι), quotient.out (f i))
ω
is the smallest infinite cardinal, also known as ℵ₀.
Equations
- cardinal.omega = (# ℕ).lift
Equations
- cardinal.can_lift_cardinal_nat = {coe := coe coe_to_lift, cond := λ (x : cardinal), x < cardinal.omega, prf := cardinal.can_lift_cardinal_nat._proof_1}
This function sends finite cardinals to the corresponding natural, and infinite cardinals to 0.
Equations
- cardinal.to_nat = {to_fun := λ (c : cardinal), dite (c < cardinal.omega) (λ (h : c < cardinal.omega), classical.some _) (λ (h : ¬c < cardinal.omega), 0), map_zero' := cardinal.to_nat._proof_2}
to_nat
has a right-inverse: coercion.
This function sends finite cardinals to the corresponding natural, and infinite cardinals
to ⊤
.
Equations
- cardinal.to_enat = {to_fun := λ (c : cardinal), ite (c < cardinal.omega) ↑(⇑cardinal.to_nat c) ⊤, map_zero' := cardinal.to_enat._proof_1, map_add' := cardinal.to_enat._proof_2}
König's theorem