In the mathematical field of set theory, ordinal arithmetic describes the three usual operations on ordinal numbers: addition, multiplication, and exponentiation.
Each can be defined in essentially two different ways: either by constructing an explicit well-ordered set that represents the result of the operation or by using transfinite recursion.
Cantor normal form provides a standardized way of writing ordinals.
In addition to these usual ordinal operations, there are also the "natural" arithmetic of ordinals and the nimber operations.
Addition
The union of two disjoint well-ordered sets S and T can be well-ordered.
The order-type of that union is the ordinal that results from adding the order-types of S and T.
If two well-ordered sets are not already disjoint, then they can be replaced by order-isomorphic disjoint sets, e.g. replace S by {0} × S and T by {1} × T.
This way, the well-ordered set S is written "to the left" of the well-ordered set T, meaning one defines an order on S \cup T in which every element of S is smaller than every element of T.
The sets S and T themselves keep the ordering they already have.
This addition of the order-types is associative and generalizes the addition of natural numbers.
The first transfinite ordinal is ω, the set of all natural numbers.
For example, the ordinal ω + ω is obtained by two copies of the natural numbers ordered in the usual fashion and the second copy completely to the right of the first.
Writing 0' < 1' < 2' < ... for the second copy, ω + ω looks like
0 < 1 < 2 < 3 < ... < 0' < 1' < 2' < ...
This is different from ω because in ω only 0 does not have a direct predecessor while in ω + ω the two elements 0 and 0' do not have direct predecessors.
As another example, here are 3 + ω and ω + 3:
0 < 1 < 2 < 0' < 1' < 2' < ...
0 < 1 < 2 < ... < 0' < 1' < 2'
After relabeling, the former just looks like ω itself, i.e. 3 + ω = ω, while the latter does not:  is not equal to ω since  has a largest element (namely, 2') and ω does not (even if ω and  are equipotent, they are not isomorphic).
Hence, this addition is not commutative.
In fact it is quite rare for α+β to be equal to β+α: this happens if and only if α=γm, β=γn for some ordinal γ and natural numbers m and n.
From this it follows that "α commutes with β" is an equivalence relation on the class of nonzero ordinals, and all the equivalence classes are countably infinite.
However, addition is still associative; one can see for example that (ω + 4) + ω = ω + (4 + ω) = ω + ω.
The definition of addition can also be given inductively (the following induction is on β):
α + 0 = α,
α + (β + 1) = (α + β) + 1 (here, "+ 1" denotes the successor of an ordinal),
and if β is a limit ordinal then α + β is the limit of  α + δ for all δ < β.
Using this definition, ω + 3 can be seen to be a successor ordinal (it is the successor of ω + 2), whereas 3 + ω is a limit ordinal, namely, the limit of 3 + 0 = 3, 3 + 1 = 4, 3 + 2 = 5, etc., which is just ω.
Zero is an additive identity α + 0 = 0 + α = α.
Addition is associative (α + β) + γ = α + (β + γ).
Addition is strictly increasing and continuous in the right argument:
\alpha < \beta \Rightarrow \gamma + \alpha < \gamma + \beta
but the analogous relation does not hold for the left argument; instead we only have:
\alpha < \beta \Rightarrow \alpha+\gamma \le \beta+\gamma
Ordinal addition is left-cancellative: if α + β = α + γ, then β = γ.
Furthermore, one can define left subtraction for ordinals β ≤ α: there is a unique γ such that α = β + γ.
On the other hand, right cancellation does not work:
3+\omega = 0+\omega = \omega but 3 \neq 0
Nor does right subtraction, even when β ≤ α: for example, there does not exist any γ such that γ + 42 = ω.
If the ordinals less than α are closed under addition and contain 0 then α is occasionally called a γ-number (see additively indecomposable ordinal).
These are exactly the ordinals of the form ωβ.
Multiplication
The Cartesian product, S×T, of two well-ordered sets S and T can be well-ordered by a variant of lexicographical order that puts the least significant position first.
Effectively, each element of T is replaced by a disjoint copy of S.
The order-type of the Cartesian product is the ordinal that results from multiplying the order-types of S and T.  Again, this operation is associative and generalizes the multiplication of natural numbers.
Here is ω·2:
00 < 10 < 20 < 30 < ... < 01 < 11 < 21 < 31 < ...,
which has the same order type as ω + ω.
In contrast, 2·ω looks like this:
00 < 10 < 01 < 11 < 02 < 12 < 03 < 13 < ...
and after relabeling, this looks just like ω.
Thus, ω·2 = ω+ω ≠ ω = 2·ω, showing that multiplication of ordinals is not commutative.
More generally, a natural number greater than 1 never commutes with any infinite ordinal, and two infinite ordinals α, β commute if and only if αm = βn for some positive natural numbers m and n.
The relation "α commutes with β" is an equivalence relation on the ordinals greater than 1, and all equivalence classes are countably infinite.
Distributivity partially holds for ordinal arithmetic: α(β+γ) = αβ+αγ.
However, the other distributive law (β+γ)α = βα+γα is not generally true: (1+1)·ω = 2·ω = ω while 1·ω+1·ω = ω+ω, which is different.
Therefore, the ordinal numbers form a left near-semiring, but do not form a ring.
The definition of multiplication can also be given inductively (the following induction is on β):
α·0 = 0,
α·(β+1) = (α·β)+α,
and if β is a limit ordinal then α·β is the limit of the α·δ for δ < β.
The main properties of the product are:
α·0 = 0·α = 0.
One (1) is a multiplicative identity α·1 = 1·α = α.
Multiplication is associative (α·β)·γ = α·(β·γ).
Multiplication is strictly increasing and continuous in the right argument: (α < β and γ > 0) \Rightarrow γ·α < γ·β
Multiplication is not strictly increasing in the left argument, for example, 1 < 2 but 1·ω = 2·ω = ω.
However, it is (non-strictly) increasing, i.e. α ≤ β \Rightarrow α·γ ≤ β·γ.
There is a left cancellation law:  If α > 0 and α·β = α·γ, then β = γ.
Right cancellation does not work, e.g. 1·ω = 2·ω = ω, but 1 and 2 are different.
α·β = 0 \Rightarrow α = 0 or β = 0.
Distributive law on the left: α·(β+γ) = α·β+α·γ
No distributive law on the right: e.g. (ω+1)·2 = ω+1+ω+1 = ω+ω+1 = ω·2+1, which is not ω·2+2.
Left division with remainder: for all α and β, if β > 0, then there are unique γ and δ such that α = β·γ+δ and δ < β.
(This does not however mean the ordinals are a Euclidean domain, since they are not even a ring, and the Euclidean "norm" is ordinal-valued.)
Right division does not work: there is no α such that α·ω ≤ ωω ≤ (α+1)·ω.
A δ-number (see Multiplicatively indecomposable) is an ordinal greater than 1 such that αβ=β whenever 0<α<β.
These consist of the ordinal 2 and the ordinals of the form ωωβ.
Exponentiation
The definition of ordinal exponentiation for finite exponents is straightforward.
If the exponent is a finite number, the power is the result of iterated multiplication.
For instance, ω2 = ω·ω using the operation of ordinal multiplication.
Note that ω·ω can be defined using the set of functions from 2 = {0,1} to ω = {0,1,2,...}, ordered lexicographically with the least significant position first:
(0,0) < (1,0) < (2,0) < (3,0) < ... < (0,1) < (1,1) < (2,1) < (3,1) < ... < (0,2) < (1,2) < (2,2) < ...
Here for brevity, we have replaced the function {(0,k), (1,m)} by the ordered pair (k, m).
Similarly, for any finite exponent n, \omega^n can be defined using the set of functions from n (the domain) to the natural numbers (the codomain).
These functions can be abbreviated as n-tuples of natural numbers.
But for infinite exponents, the definition may not be obvious.
A limit ordinal, such as ωω, is the supremum of all smaller ordinals.
It might seem natural to define ωω using the set of all infinite sequences of natural numbers.
However, we find that any absolutely defined ordering on this set is not well-ordered.
To deal with this issue we can use the variant lexicographical ordering again.
We restrict the set to sequences that are nonzero for only a finite number of arguments.
This is naturally motivated as the limit of the finite powers of the base (similar to the concept of coproduct in algebra).
This can also be thought of as the infinite union \bigcup_{n<\omega}\omega^n.
Each of those sequences corresponds to an ordinal less than \omega^\omega such as \omega^{n_1} c_1 + \omega^{n_2} c_2 + \cdots + \omega^{n_k} c_k and \omega^\omega is the supremum of all those smaller ordinals.
The lexicographical order on this set is a well ordering that resembles the ordering of natural numbers written in decimal notation, except with digit positions reversed, and with arbitrary natural numbers instead of just the digits 0–9:
(0,0,0,...) < (1,0,0,0,...) < (2,0,0,0,...) < ... <
(0,1,0,0,0,...) < (1,1,0,0,0,...) < (2,1,0,0,0,...) < ... <
(0,2,0,0,0,...) < (1,2,0,0,0,...) < (2,2,0,0,0,...)
< ... <
(0,0,1,0,0,0,...) < (1,0,1,0,0,0,...) < (2,0,1,0,0,0,...)
< ...
In general, any ordinal α can be raised to the power of another ordinal β in the same way to get αβ.
It is easiest to explain this using Von Neumann's definition of an ordinal as the set of all smaller ordinals.
Then, to construct a set of order type αβ consider all functions from β to α such that only a finite number of elements of the domain β map to a non zero element of α (essentially, we consider the functions with finite support).
The order is lexicographic with the least significant position first.
We find
1ω = 1,
2ω = ω,
2ω+1 = ω·2 = ω+ω.
The definition of exponentiation can also be given inductively (the following induction is on β, the exponent):
α0 = 1,
αβ+1 = (αβ)·α, and
if β is a limit ordinal, then αβ is the limit of the αδ for all δ < β.
Properties of ordinal exponentiation:
α0 = 1.
If 0 < α, then 0α = 0.
1α = 1.
α1 = α.
αβ·αγ = αβ + γ.
(αβ)γ = αβ·γ.
There are α, β, and γ for which (α·β)γ ≠ αγ·βγ.
For instance, (ω·2)2 = ω·2·ω·2 = ω2·2 ≠ ω2·4.
Ordinal exponentiation is strictly increasing and continuous in the right argument: If γ > 1 and α < β, then γα < γβ.
If α < β, then αγ ≤ βγ.
Note, for instance, that 2 < 3 and yet 2ω = 3ω = ω.
If α > 1 and αβ = αγ, then β = γ.
If α =  1 or α =  0 this is not the case.
For all α and β, if β > 1 and α > 0 then there exist unique γ, δ, and ρ such that α = βγ·δ + ρ such that 0 < δ < β and ρ < βγ.
While the same notation is used for ordinal exponentiation and cardinal exponentiation, ordinal exponentiation is quite different from cardinal exponentiation.
For example, with ordinal exponentiation 2^\omega = \omega, but for \aleph_0(aleph naught, the cardinality of \omega), 2^{\aleph_0} > \aleph_0.
Here, 2^{\aleph_0} is the cardinality of the set of all functions from the set of all natural numbers to a set with two elements.
(This is the cardinality of the power set of the set of all natural numbers and is equal to \mathfrak c, the cardinality of the continuum.)
To avoid confusing ordinal exponentiation with cardinal exponentiation, one can use symbols for ordinals (e.g. ω) in the former and symbols for cardinals (e.g. \aleph_0) in the latter.
Jacobsthal showed that the only solutions of αβ = βα with α ≤ β are given by α = β, or α = 2 and β = 4, or α is any limit ordinal and β = εα where ε is an ε-number larger than α.Ernst Jacobsthal, Vertauschbarkeit transfiniter Ordnungszahlen, Mathematische Annalen, Bd 64 (1907), 475-488.
Available here Cantor normal form
Every ordinal number α can be uniquely written as \omega^{\beta_1} c_1 + \omega^{\beta_2}c_2 + \cdots + \omega^{\beta_k}c_k, where k is a natural number, c_1, c_2, \ldots, c_k are positive integers, and \beta_1 > \beta_2 > \ldots > \beta_k \geq 0 are ordinal numbers.
The degenerate case α=0 occurs when k=0 and there are no βs nor cs.
This decomposition of α is called the Cantor normal form of α, and can be considered the base-ω positional numeral system.
The highest exponent \beta_1 is called the degree of \alpha, and satisfies \beta_1\le\alpha.
The equality \beta_1=\alpha applies if and only if \alpha=\omega^\alpha.
In that case Cantor normal form does not express the ordinal in terms of smaller ones; this can happen as explained below.
A minor variation of Cantor normal form, which is usually slightly easier to work with, is to set all the numbers ci equal to 1 and allow the exponents to be equal.
In other words, every ordinal number α can be uniquely written as \omega^{\beta_1}  + \omega^{\beta_2} + \cdots + \omega^{\beta_k}, where k is a natural number, and \beta_1 \ge \beta_2 \ge \ldots \ge \beta_k \ge 0 are ordinal numbers.
Another variation of the Cantor normal form is the "base δ expansion", where ω is replaced by any ordinal δ>1, and the numbers ci are positive ordinals less than δ.
The Cantor normal form allows us to uniquely express—and order—the ordinals α that are built from the natural numbers by a finite number of arithmetical operations of addition, multiplication and exponentiation base-\omega: in other words, assuming \beta_1<\alpha in the Cantor normal form, we can also express the exponents \beta_i in Cantor normal form, and making the same assumption for the \beta_i as for α and so on recursively, we get a system of notation for these ordinals (for example,
\omega^{\left( \omega^{\left( \omega^7\cdot6+\omega+42 \right)}\cdot1729+\omega^9+88 \right)}\cdot3+\omega^{\left( \omega^\omega \right)}\cdot5+65537
denotes an ordinal).
The ordinal ε0 (epsilon nought) is the set of ordinal values α of the finite-length arithmetical expressions of Cantor normal form that are hereditarily non-trivial where non-trivial means β1<α when 0<α.
It is the smallest ordinal that does not have a finite arithmetical expression in terms of ω, and the smallest ordinal such that \varepsilon_0 = \omega^{\varepsilon_0}, i.e. in Cantor normal form the exponent is not smaller than the ordinal itself.
It is the limit of the sequence
0, \, 1=\omega^0, \, \omega=\omega^1, \, \omega^\omega, \, \omega^{\omega^\omega}, \, \ldots \,.
The ordinal ε0 is important for various reasons in arithmetic (essentially because it measures the proof-theoretic strength of the first-order Peano arithmetic: that is, Peano's axioms can show transfinite induction up to any ordinal less than ε0 but not up to ε0 itself).
The Cantor normal form also allows us to compute sums and products of ordinals: to compute the sum, for example, one need merely know (see the properties listed in  and ) that
\omega^{\beta} c+\omega^{\beta'} c' = \omega^{\beta'}c' \,,
if \beta'>\beta (if \beta'=\beta one can apply the distributive law on the left and rewrite this as \omega^{\beta} (c+c'), and if \beta'<\beta the expression is already in Cantor normal form); and to compute products, the essential facts are that when 0 < \alpha = \omega^{\beta_1} c_1 + \cdots + \omega^{\beta_k}c_k is in Cantor normal form and 0 < \beta' , then
\alpha\omega^{\beta'} = \omega^{\beta_1 + \beta'} \,
and
\alpha n = \omega^{\beta_1} c_1 n + \omega^{\beta_2} c_2 + \cdots + \omega^{\beta_k}c_k \,,
if n is a non-zero natural number.
To compare two ordinals written in Cantor normal form, first compare \beta_1, then c_1, then \beta_2, then c_2, etc..
At the first difference, the ordinal that has the larger component is the larger ordinal.
If they are the same until one terminates before the other, then the one that terminates first is smaller.
Factorization into primes
Ernst Jacobsthal showed that the ordinals satisfy a form of the unique factorization theorem: every nonzero ordinal can be written as a product of a finite number of prime ordinals.
This factorization into prime ordinals is in general not unique, but there is a "minimal" factorization into primes that is unique up to changing the order of finite prime factors .
A prime ordinal is an ordinal greater than 1 that cannot be written as a product of two smaller ordinals.
Some of the first primes are 2, 3, 5, ... , ω, ω+1, ω2+1, ω3+1, ..., ωω, ωω+1, ωω+1+1, ...
There are three sorts of prime ordinals:
The finite primes 2, 3, 5, ...
The ordinals of the form ωωα for any ordinal α.
These are the prime ordinals that are limits, and are the delta numbers.
The ordinals of the form ωα+1 for any ordinal α>0.
These are the infinite successor primes, and are the successors of gamma numbers, the additively indecomposable ordinals.
Factorization into primes is not unique: for example, 2×3=3×2, 2×ω=ω, (ω+1)×ω=ω×ω and ω×ωω = ωω.
However, there is a unique factorization into primes satisfying the following additional conditions:
Every limit prime occurs before every successor prime
If two consecutive primes of the prime factorization are both limits or both finite, then the second one is at most the first one.
This prime factorization can easily be read off using the Cantor normal form as follows:
First write the ordinal as a product αβ where α is the smallest power of ω in the Cantor normal form and β is a successor.
If α=ωγ then writing γ in Cantor normal form gives an expansion of α as a product of limit primes.
Now look at the Cantor normal form of β.
If β = ωλm + ωμn + smaller terms, then β = (ωμn + smaller terms)(ωλ−μ + 1)m is a product of a smaller ordinal and a prime and an integer m.
Repeating this and factorizing the integers into primes gives the prime factorization of β.
So the factorization of the Cantor normal form ordinal
\omega^{\alpha_1}n_1+\cdots +\omega^{\alpha_k}n_k (with \alpha_1>\cdots>\alpha_k)
into a minimal product of infinite primes and integers is
\omega^{\omega^{\beta_1}}\cdots\omega^{\omega^{\beta_m}}n_k(\omega^{\alpha_{k-1}-\alpha_k}+1)n_{k-1}\cdots n_2(\omega^{\alpha_{1}-\alpha_2}+1)n_1
where each ni should be replaced by its factorization into a non-increasing sequence of finite primes and
\alpha_k=\omega^{\beta_1}+\cdots +\omega^{\beta_m} with \beta_1\ge\cdots\ge\beta_m.
Large countable ordinals
As discussed above, the Cantor normal form of ordinals below \varepsilon_0 can be expressed in an alphabet containing only the function symbols for addition, multiplication and exponentiation, as well as constant symbols for each natural number and for \omega.
We can do away with the infinitely many numerals by using just the constant symbol 0 and the operation of successor, S (for example, the integer 4 may be expressed as S(S(S(S(0))))).
This describes an ordinal notation: a system for naming ordinals over a finite alphabet.
This particular system of ordinal notation is called the collection of arithmetical ordinal expressions, and can express all ordinals below \varepsilon_0, but cannot express \varepsilon_0.
There are other ordinal notations capable of capturing ordinals well past \varepsilon_0, but because there are only countably many strings over any finite alphabet, for any given ordinal notation there will be ordinals below \omega_1 (the first uncountable ordinal) that are not expressible.
Such ordinals are known as large countable ordinals.
The operations of addition, multiplication and exponentiation are all examples of primitive recursive ordinal functions, and more general primitive recursive ordinal functions can be used to describe larger ordinals.
== Natural operations ==
The natural sum  and natural product operations on ordinals  were defined in 1906 by Gerhard Hessenberg, and are sometimes called the  Hessenberg sum (or product) .
These are the same as the addition and multiplication (restricted to ordinals) of John Conway's field of surreal numbers.
They have the advantage that they are associative and commutative, and natural product distributes over natural sum.
The cost of making these operations commutative is that they lose the continuity in the right argument, which is a property of the ordinary sum and product.
The natural sum of α and β is often denoted by  α⊕β or α#β, and the natural product by α⊗β or α⨳β.
The natural operations come up in the theory of well partial orders; given two well partial orders S and T, of types (maximum linearizations) o(S) and o(T), the type of the disjoint union is o(S)⊕o(T), while the type of the direct product is o(S)⊗o(T).D. H. J. De Jongh and R. Parikh, Well-partial orderings and hierarchies, Indag.
Math.
39 (1977), 195–206.
Available here  One may take this relation as a definition of the natural operations by choosing S and T to be ordinals α and β; so α⊕β is the maximum order type of a total order extending the disjoint union (as a partial order) of α and β; while α⊗β is the maximum order type of a total order extending the direct product (as a partial order) of α and β.Philip W. Carruth, Arithmetic of ordinals with applications to the theory of ordered Abelian groups, Bull.
Amer.
Math.
Soc.
48 (1942), 262–271.
See Theorem 1.
Available here  A useful application of this is when α and β are both subsets of some larger total order; then their union has order type at most α⊕β.
If they are both subsets of some ordered abelian group, then their sum has order type at most α⊗β.
We can also define the natural sum of α and β inductively (by simultaneous induction on α and β) as the smallest ordinal greater than the natural sum of α and γ for all γ < β and of γ and β for all γ < α.
There is also an inductive definition of the natural product (by mutual induction), but it is somewhat tedious to write down and we shall not do so (see the article on surreal numbers for the definition in that context, which, however, uses surreal subtraction, something that obviously cannot be defined on ordinals).
The natural sum is associative and commutative.
It is always greater or equal to the usual sum, but it may be strictly greater.
For example, the natural sum of ω and 1 is ω+1 (the usual sum), but this is also the natural sum of 1 and ω.
The natural product is associative and commutative and distributes over the natural sum.
The natural product is always greater or equal to the usual product, but it may be strictly greater.
For example, the natural product of ω and 2 is ω·2 (the usual product), but this is also the natural product of 2 and ω.
Yet another way to define the natural sum and product of two ordinals α and β is to use the Cantor normal form: one can find a sequence of ordinals  γ1 > … > γn  and two sequences (k1, …, kn) and  (j1, …, jn) of natural numbers (including zero, but satisfying  ki + ji > 0 for all i) such that
\alpha = \omega^{\gamma_1}\cdot k_1 + \cdots +\omega^{\gamma_n}\cdot k_n
\beta = \omega^{\gamma_1}\cdot j_1 + \cdots +\omega^{\gamma_n}\cdot j_n
and define
\alpha \#\beta = \omega^{\gamma_1}\cdot (k_1+j_1) + \cdots +\omega^{\gamma_n}\cdot (k_n+j_n).
Under natural addition, the ordinals can be identified with the elements of the free commutative monoid generated by the gamma numbers ωα.
Under natural addition and multiplication, the ordinals can be identified with the elements of the free commutative semiring generated by the delta numbers ωωα.
The ordinals do not have unique factorization into primes under the natural product.
While the full polynomial ring does have unique factorization, the subset of polynomials with non-negative coefficients does not: for example, if x is any delta number, then
x^5+x^4+x^3+x^2+x+1=(x+1)(x^4+x^2+1)=(x^2+x+1)(x^3+1)
has two incompatible expressions as a natural product of polynomials with non-negative coefficients that cannot be decomposed further.
Nimber arithmetic
There are arithmetic operations on ordinals by virtue of the one-to-one correspondence between ordinals and nimbers.
Three common operations on nimbers are nimber addition, nimber multiplication, and minimum excludance (mex).
Nimber addition is a generalization of the bitwise exclusive or operation on natural numbers.
The  of a set of ordinals is the smallest ordinal not present in the set.
Notes
References
Kunen, Kenneth, 1980.
Set Theory: An Introduction to Independence Proofs.
Elsevier.  .
External links
ordCalc ordinal calculator
