Cantor Normal Form #
THIS FILE IS SYNCHRONIZED WITH MATHLIB4. Any changes to this file require a corresponding PR to mathlib4.
The Cantor normal form of an ordinal is generally defined as its base ω
expansion, with its
non-zero exponents in decreasing order. Here, we more generally define a base b
expansion
ordinal.CNF
in this manner, which is well-behaved for any b ≥ 2
.
Implementation notes #
We implement ordinal.CNF
as an association list, where keys are exponents and values are
coefficients. This is because this structure intrinsically reflects two key properties of the Cantor
normal form:
- It is ordered.
- It has finitely many entries.
Todo #
- Add API for the coefficients of the Cantor normal form.
- Prove the basic results relating the CNF to the arithmetic operations on ordinals.
The Cantor normal form of an ordinal o
is the list of coefficients and exponents in the
base-b
expansion of o
.
We special-case CNF 0 o = CNF 1 o = [(0, o)]
for o ≠ 0
.
CNF b (b ^ u₁ * v₁ + b ^ u₂ * v₂) = [(u₁, v₁), (u₂, v₂)]
Equations
- ordinal.CNF b o = b.CNF_rec list.nil (λ (o : ordinal) (ho : o ≠ 0) (IH : list (ordinal × ordinal)), (ordinal.log b o, o / b ^ ordinal.log b o) :: IH) o
Recursive definition for the Cantor normal form.
Evaluating the Cantor normal form of an ordinal returns the ordinal.
Every exponent in the Cantor normal form CNF b o
is less or equal to log b o
.
Every exponent in the Cantor normal form CNF b o
is less or equal to o
.
The exponents of the Cantor normal form are decreasing.