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
- NatOrdinal.linearOrder = let __src := Ordinal.linearOrder; LinearOrder.mk ⋯ LinearOrder.decidableLE LinearOrder.decidableEq LinearOrder.decidableLT ⋯ ⋯ ⋯
Equations
- One or more equations did not get rendered due to their size.
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
- x✝.nadd x = max (x✝.blsub fun (a' : Ordinal.{?u.4}) (x_1 : a' < x✝) => a'.nadd x) (x.blsub fun (b' : Ordinal.{?u.4}) (x : b' < x) => x✝.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
- x✝.nmul x = sInf {c : Ordinal.{?u.4} | ∀ a' < x✝, ∀ b' < x, (a'.nmul x).nadd (x✝.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
Equations
- NatOrdinal.addMonoidWithOne = AddMonoidWithOne.unary
Natural multiplication #
The set in the definition of nmul
is nonempty.
Equations
- instMulNatOrdinal = { mul := Ordinal.nmul }
Equations
- instOrderedCommSemiringNatOrdinal = let __src := NatOrdinal.orderedCancelAddCommMonoid; let __src_1 := NatOrdinal.linearOrder; OrderedCommSemiring.mk Ordinal.nmul_comm