Natural operations on ordinals #
The goal of this file is to define natural addition and multiplication on ordinals, also known as
the Hessenberg sum and product, and provide a basic API. The natural addition of two ordinals
a ♯ b
is recursively defined as the least ordinal greater than a' ♯ b
and a ♯ b'
for a' < a
and b' < b
. The natural multiplication a ⨳ b
is likewise recursively defined as the least
ordinal such that a ⨳ b ♯ a' ⨳ b'
is greater than a' ⨳ b ♯ a ⨳ b'
for any a' < a
and
b' < b
.
These operations form a rich algebraic structure: they're commutative, associative, preserve order,
have the usual 0
and 1
from ordinals, and distribute over one another.
Moreover, these operations are the addition and multiplication of ordinals when viewed as
combinatorial Game
s. This makes them particularly useful for game theory.
Finally, both operations admit simple, intuitive descriptions in terms of the Cantor normal form.
The natural addition of two ordinals corresponds to adding their Cantor normal forms as if they were
polynomials in ω
. Likewise, their natural multiplication corresponds to multiplying the Cantor
normal forms as polynomials.
Implementation notes #
Given the rich algebraic structure of these two operations, we choose to create a type synonym
NatOrdinal
, where we provide the appropriate instances. However, to avoid casting back and forth
between both types, we attempt to prove and state most results on Ordinal
.
Todo #
- Prove the characterizations of natural addition and multiplication in terms of the Cantor normal form.
Basic casts between Ordinal
and NatOrdinal
#
A type synonym for ordinals with natural addition and multiplication.
Equations
Instances For
Equations
Equations
- NatOrdinal.linearOrder = LinearOrder.mk ⋯ LinearOrder.decidableLE LinearOrder.decidableEq LinearOrder.decidableLT ⋯ ⋯ ⋯
Equations
- One or more equations did not get rendered due to their size.
Equations
A recursor for NatOrdinal
. Use as induction x
.
Equations
- NatOrdinal.rec h a = h (NatOrdinal.toOrdinal a)
Instances For
Ordinal.induction
but for NatOrdinal
.
We place the definitions of nadd
and nmul
before actually developing their API, as this
guarantees we only need to open the NaturalOps
locale once.
Natural addition on ordinals a ♯ b
, also known as the Hessenberg sum, is recursively defined
as the least ordinal greater than a' ♯ b
and a ♯ b'
for all a' < a
and b' < b
. In contrast
to normal ordinal addition, it is commutative.
Natural addition can equivalently be characterized as the ordinal resulting from adding up
corresponding coefficients in the Cantor normal forms of a
and b
.
Equations
- a.nadd b = max (a.blsub fun (a' : Ordinal.{?u.3}) (x : a' < a) => a'.nadd b) (b.blsub fun (b' : Ordinal.{?u.3}) (x : b' < b) => a.nadd b')
Instances For
Natural addition on ordinals a ♯ b
, also known as the Hessenberg sum, is recursively defined
as the least ordinal greater than a' ♯ b
and a ♯ b'
for all a' < a
and b' < b
. In contrast
to normal ordinal addition, it is commutative.
Natural addition can equivalently be characterized as the ordinal resulting from adding up
corresponding coefficients in the Cantor normal forms of a
and b
.
Equations
- NaturalOps.«term_♯_» = Lean.ParserDescr.trailingNode `NaturalOps.«term_♯_» 65 65 (Lean.ParserDescr.binary `andthen (Lean.ParserDescr.symbol " ♯ ") (Lean.ParserDescr.cat `term 66))
Instances For
Natural multiplication on ordinals a ⨳ b
, also known as the Hessenberg product, is recursively
defined as the least ordinal such that a ⨳ b ♯ a' ⨳ b'
is greater than a' ⨳ b ♯ a ⨳ b'
for all
a' < a
and b < b'
. In contrast to normal ordinal multiplication, it is commutative and
distributive (over natural addition).
Natural multiplication can equivalently be characterized as the ordinal resulting from multiplying
the Cantor normal forms of a
and b
as if they were polynomials in ω
. Addition of exponents is
done via natural addition.
Equations
- a.nmul b = sInf {c : Ordinal.{?u.3} | ∀ a' < a, ∀ b' < b, (a'.nmul b).nadd (a.nmul b') < c.nadd (a'.nmul b')}
Instances For
Natural multiplication on ordinals a ⨳ b
, also known as the Hessenberg product, is recursively
defined as the least ordinal such that a ⨳ b ♯ a' ⨳ b'
is greater than a' ⨳ b ♯ a ⨳ b'
for all
a' < a
and b < b'
. In contrast to normal ordinal multiplication, it is commutative and
distributive (over natural addition).
Natural multiplication can equivalently be characterized as the ordinal resulting from multiplying
the Cantor normal forms of a
and b
as if they were polynomials in ω
. Addition of exponents is
done via natural addition.
Equations
- NaturalOps.«term_⨳_» = Lean.ParserDescr.trailingNode `NaturalOps.«term_⨳_» 70 70 (Lean.ParserDescr.binary `andthen (Lean.ParserDescr.symbol " ⨳ ") (Lean.ParserDescr.cat `term 71))
Instances For
Natural addition #
Equations
- NatOrdinal.instAdd = { add := Ordinal.nadd }
Equations
Equations
Equations
- NatOrdinal.addMonoidWithOne = AddMonoidWithOne.unary
Natural multiplication #
Alias of Ordinal.nmul_le_nmul_left
.
Alias of Ordinal.nmul_le_nmul_right
.
Equations
- instMulNatOrdinal = { mul := Ordinal.nmul }
Alias of Ordinal.mul_le_nmul
.