Transfinite ordinal arithmetic and factorisation up to the first epsilon number.
Works with Python 3. Can be installed via pip using:
pip install transfinite
For a basic introduction to ordinal arithmetic, look at Wikipedia or see the notebook here.
Here's a quick demonstration of the library in Jupyter's qtconsole (note that the variable w
is the first transfinite number). First, some ordinal arithmetic:
The Ordinal class implements several methods which can be used to check properties of the ordinal:
Ordinal.is_limit()
, returns True if the ordinal is a limit ordinal.Ordinal.is_successor()
, returns True if the ordinal is a successor ordinal.Ordinal.is_gamma()
, returns True if the ordinal is additively indecomposable.Ordinal.is_delta()
, returns True if the ordinal is multiplicatively indecomposable.Ordinal.is_prime()
, returns True if the ordinal is prime.
Ordinal factorisation into prime ordinals is also implemented. Any composite ordinal a
can be written as a product of two or more prime ordinals less than a
:
Note that finite ordinals are not factorised using this method.