Skip to content

Commit

Permalink
doc(set_theory/ordinal/cantor_normal_form): implementation notes (#15466
Browse files Browse the repository at this point in the history
)

We write a short paragraph on why `CNF` is implemented as a list of pairs.
  • Loading branch information
vihdzp committed Jul 18, 2022
1 parent 92f31fb commit 2cdc757
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/set_theory/ordinal/cantor_normal_form.lean
Expand Up @@ -11,7 +11,16 @@ import set_theory.ordinal.arithmetic
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, for any `b ≥ 2`.
`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
Expand Down

0 comments on commit 2cdc757

Please sign in to comment.