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
orω
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, Konig's theorem
The equivalence relation on types given by equivalence (bijective correspondence) of types. Quotienting by this equivalence relation gives the cardinal numbers.
The representative of the cardinal of a type is equivalent ot the original type.
Equations
- cardinal.out_mk_equiv = cardinal.out_mk_equiv._proof_1.some
Lift a function between Type*
s to a function between cardinal
s.
Equations
- cardinal.map f hf = quotient.map f _
Lift a binary operation Type* → Type* → Type*
to a binary operation on cardinal
s.
Equations
- cardinal.map₂ f hf = quotient.map₂ f _
The universe lift operation on cardinals. You can specify the universes explicitly with
lift.{u v} : cardinal.{v} → cardinal.{max v u}
Equations
- c.lift = cardinal.map ulift (λ (α β : Type v) (e : α ≃ β), equiv.ulift.trans (e.trans equiv.ulift.symm)) c
We define the order on cardinal numbers by #α ≤ #β
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.preorder = {le := has_le.le cardinal.has_le, lt := λ (a b : cardinal), a ≤ b ∧ ¬b ≤ a, le_refl := cardinal.preorder._proof_1, le_trans := cardinal.preorder._proof_2, lt_iff_le_not_le := cardinal.preorder._proof_3}
Equations
- cardinal.partial_order = {le := preorder.le cardinal.preorder, lt := preorder.lt cardinal.preorder, le_refl := _, le_trans := _, lt_iff_le_not_le := _, le_antisymm := cardinal.partial_order._proof_1}
A variant of cardinal.lift_mk_le
with specialized universes.
Because Lean often can not realize it should use this specialization itself,
we provide this statement separately so you don't have to solve the specialization problem either.
A variant of cardinal.lift_mk_eq
with specialized universes.
Because Lean often can not realize it should use this specialization itself,
we provide this statement separately so you don't have to solve the specialization problem either.
cardinal.lift
as an order_embedding
.
Equations
- cardinal.lift_order_embedding = order_embedding.of_map_le_iff cardinal.lift cardinal.lift_order_embedding._proof_1
Equations
- cardinal.inhabited = {default := 0}
Equations
- cardinal.has_add = {add := cardinal.map₂ sum (λ (α β γ δ : Type u), equiv.sum_congr)}
Equations
- cardinal.has_mul = {mul := cardinal.map₂ prod (λ (α β γ δ : Type u), equiv.prod_congr)}
The cardinal exponential. #α ^ #β
is the cardinal of β → α
.
Equations
- a.power b = cardinal.map₂ (λ (α β : Type u), β → α) (λ (α β γ δ : Type u) (e₁ : α ≃ β) (e₂ : γ ≃ δ), e₂.arrow_congr e₁) a b
Equations
Equations
- cardinal.comm_semiring = {add := has_add.add cardinal.has_add, add_assoc := cardinal.comm_semiring._proof_1, zero := 0, zero_add := cardinal.zero_add, add_zero := cardinal.comm_semiring._proof_2, nsmul := semiring.nsmul._default 0 has_add.add cardinal.zero_add cardinal.comm_semiring._proof_3, nsmul_zero' := cardinal.comm_semiring._proof_4, nsmul_succ' := cardinal.comm_semiring._proof_5, add_comm := cardinal.add_comm, mul := has_mul.mul cardinal.has_mul, left_distrib := cardinal.left_distrib, right_distrib := cardinal.comm_semiring._proof_6, zero_mul := cardinal.zero_mul, mul_zero := cardinal.comm_semiring._proof_7, mul_assoc := cardinal.comm_semiring._proof_8, one := 1, one_mul := cardinal.one_mul, mul_one := cardinal.comm_semiring._proof_9, npow := λ (n : ℕ) (c : cardinal), c ^ ↑n, npow_zero' := cardinal.power_zero, npow_succ' := cardinal.comm_semiring._proof_10, mul_comm := cardinal.mul_comm}
Equations
- cardinal.order_bot = {bot := 0, 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 := partial_order.le cardinal.partial_order, lt := partial_order.lt cardinal.partial_order, le_refl := _, le_trans := _, lt_iff_le_not_le := _, le_antisymm := _, add_le_add_left := cardinal.canonically_ordered_comm_semiring._proof_1, 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, left_distrib := _, right_distrib := _, zero_mul := _, mul_zero := _, mul_assoc := _, one := comm_semiring.one cardinal.comm_semiring, one_mul := _, mul_one := _, npow := comm_semiring.npow cardinal.comm_semiring, npow_zero' := _, npow_succ' := _, mul_comm := _, eq_zero_or_eq_zero_of_mul_eq_zero := cardinal.eq_zero_or_eq_zero_of_mul_eq_zero}
Equations
- cardinal.linear_order = {le := partial_order.le cardinal.partial_order, lt := partial_order.lt cardinal.partial_order, le_refl := _, le_trans := _, lt_iff_le_not_le := _, le_antisymm := _, le_total := cardinal.linear_order._proof_1, 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), max := max_default (λ (a b : cardinal), classical.dec_rel has_le.le a b), max_def := cardinal.linear_order._proof_2, min := min_default (λ (a b : cardinal), classical.dec_rel has_le.le a b), min_def := cardinal.linear_order._proof_3}
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, bot := canonically_ordered_add_monoid.bot infer_instance, bot_le := cardinal.canonically_linear_ordered_add_monoid._proof_12, le_iff_exists_add := cardinal.canonically_linear_ordered_add_monoid._proof_13, 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, max := max cardinal.linear_order, max_def := _, min := min cardinal.linear_order, min_def := _}
The minimum cardinal in a family of cardinals (the existence
of which is provided by min_injective
).
Equations
- cardinal.min I f = f (classical.some _)
Equations
- cardinal.has_wf = {r := has_lt.lt (preorder.to_has_lt cardinal), wf := cardinal.wf}
Equations
- cardinal.conditionally_complete_linear_order_bot = cardinal.wf.conditionally_complete_linear_order_with_bot 0 cardinal.conditionally_complete_linear_order_bot._proof_1
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 range of an indexed cardinal function, whose outputs live in a higher universe than the inputs, is always bounded above.
The indexed supremum of cardinals is the smallest cardinal above everything in the family.
Equations
- cardinal.sup f = Sup (set.range f)
The indexed product of cardinals is the cardinality of the Pi type (dependent product).
Equations
- cardinal.prod f = # (Π (i : ι), quotient.out (f i))
The lift of a supremum is the supremum of the lifts.
To prove that the lift of a supremum is bounded by some cardinal t
,
it suffices to show that the lift of each cardinal is bounded by t
.
To prove an inequality between the lifts to a common universe of two different supremums, it suffices to show that the lift of each cardinal from the smaller supremum if bounded by the lift of some cardinal from the larger supremum.
A variant of lift_sup_le_lift_sup
with universes specialized via w = v
and w' = v'
.
This is sometimes necessary to avoid universe unification issues.
Properties about the cast from ℕ
#
This function sends finite cardinals to the corresponding natural, and infinite cardinals to 0.
to_nat
has a right-inverse: coercion.
This function sends finite cardinals to the corresponding natural, and infinite cardinals
to ⊤
.
König's theorem
The function α^{<β}, defined to be sup_{γ < β} α^γ. We index over {s : set β.out // #s < β } instead of {γ // γ < β}, because the latter lives in a higher universe