Overview - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim


Ordinals

A package for ordinal numbers and their arithmetic

 

Calling Sequence

Description

Accessing Ordinals Package Commands

List of Ordinals Package Commands

Examples

Compatibility

Calling Sequence

Ordinals:-command(arguments)

command(arguments)

Description

• 

The Ordinals package is a collection of commands for computing with ordinal numbers in Cantor normal form. Mathematically, an ordinal number, or ordinal for short, represents an isomorphism class of well-orderings. The Ordinals package can represent and handle all ordinals less than ϵ0, that is, ordinal numbers that can be obtained from non-negative integers and ω, the ordinal for the standard ordering of the natural numbers , in a finite number of steps by ordinal addition, multiplication and exponentiation.

• 

Every non-negative integer n is an ordinal, representing the finite well-ordered set 0<1<<n1 of numbers less than n. Infinite ordinals can be created using the Ordinal constructor. The constant omega represents the ordinal ω.

• 

The ordinals themselves are well-ordered by the relation ab meaning that the well-ordering represented by a is order-isomorphic to an initial segment of the well-ordering represented by b. See LessThan for more details.

• 

The data structure for an infinite ordinal is basically a list of pairs e1&comma;c1&comma;...&comma;ek&comma;ck encoding its Cantor normal form ωe1c1&plus;&plus;ωekck, where k1 is an integer, e1ek are ordinals (that is, non-negative integers, or recursively, ordinal data structures) and c1,...,ck are positive integers. See Ordinal for more details.

• 

The access functions degree, lcoeff and lterm return e1, c1 and e1&comma;c1, respectively. Similarly, the access functions tdegree, tcoeff and tterm return ek, ck and ek&comma;ck, respectively.

• 

The basic arithmetic operations for ordinals are addition, multiplication, and exponentiation. Their corresponding inverse operations are left subtraction, left division, and logarithm, respectively. Other operations implemented include maximum and minimum, greatest common left divisors and least common right multiples, and factorization.

• 

The arithmetic operators +, ., ^ and the relational operators < and <= are overloaded for ordinals, and they cause the corresponding commands Add, Mult, Power and LessThan, respectively, to be executed. Note that + is not a commutative operator for ordinals. In addition, the package also recognizes inactive or inert versions of these operators, namely, &+, &., &^, &-, &<, &>, &<=, and &>=. Such inactive operators do not result in any computations and are useful for display purposes. The value command turns these inert operators into their active forms.

• 

The Ordinals package allows ordinals to be parametric. This means that the coefficients c1,...,ck in the Cantor normal form may contain variables, such as x or y1, and depend on these polynomially with positive integer coefficients. For example, x2+2 is a valid parametric coefficient, but x22, x, and sinx+13 are not. Currently, only the coefficients ci can be parametric; the exponents ei cannot contain any parameters.

• 

All parameters are implicitly assumed to represent non-negative integers. Each command in the Ordinals package guarantees that the results it returns are correct when arbitrary non-negative integers are substituted for some or all of the parameters. If such a universally valid result cannot be computed, an error will be raised. For example, if x is a parameter, then x&plus;2ω&equals;ω is correct for all non-negative integer values of x, but neither xω&equals;ω nor x&plus;1ω&equals;ω are universally valid, since 0ω&equals;0 and 1ω&equals;1.

• 

The Eval command can be used to substitute integer values or polynomial expressions for some or all of the parameters in a parametric ordinal.

Accessing Ordinals Package Commands

• 

Each command in the Ordinals package can be accessed by using either the long form or the short form of the command name in the command calling sequence.

  

The long form, Ordinals:-command, is always available. The short form can be used after loading the package.

List of Ordinals Package Commands

• 

The following is a list of commands available in the Ordinals package.

`+`

`.`

`<=`

`<`

`^`

Add

Base

Dec

Decompose

degree

Div

Eval

Factor

Gcd

Lcm

lcoeff

LessThan

Log

log

lterm

Max

Min

Mult

omega

Ordinal

Power

quo

rem

Split

Sub

tcoeff

tdegree

tterm

type/ordinal

 

 

• 

To display the help page for a particular Ordinals command, see Getting Help with a Command in a Package.

Examples

withOrdinals

`+`&comma;`.`&comma;`<`&comma;<=&comma;Add&comma;Base&comma;Dec&comma;Decompose&comma;Div&comma;Eval&comma;Factor&comma;Gcd&comma;Lcm&comma;LessThan&comma;Log&comma;Max&comma;Min&comma;Mult&comma;Ordinal&comma;Power&comma;Split&comma;Sub&comma;`^`&comma;degree&comma;lcoeff&comma;log&comma;lterm&comma;ω&comma;quo&comma;rem&comma;tcoeff&comma;tdegree&comma;tterm

(1)

Creating ordinals.

a2

a2

(2)

bω

bω

(3)

cOrdinalω&comma;1&comma;2&comma;3&comma;0&comma;5

cωω&plus;ω23&plus;5

(4)

typea&comma;ordinal,typeb&comma;ordinal,typec&comma;ordinal

false,true,true

(5)

Extracting components.

degreea,degreeb,degreec

0,1,ω

(6)

lcoeffa,lcoeffb,lcoeffc

2,1,1

(7)

tterma,ttermb,ttermc

0&comma;2,1&comma;1,0&comma;5

(8)

Ordinal addition.

Addc&comma;a=c+a

ωω&plus;ω23&plus;7=ωω&plus;ω23&plus;7

(9)

Using inert operators for display. The inert addition operator &+ is rendered as a regular + but in grey. Also note that addition is non-commutative.

a&+c=a+c

2&plus;ωω&plus;ω23&plus;5=ωω&plus;ω23&plus;5

(10)

Adding more than two ordinals.

da+c+b

dωω&plus;ω23&plus;ω

(11)

Comparing and subtracting ordinals.

LessThanc&comma;d,c<d

true,true

(12)

d&−c=Subd&comma;c

ωω&plus;ω23&plus;ωωω&plus;ω23&plus;5=ω

(13)

Verify the result.

c&+ω=c+ω

ωω&plus;ω23&plus;5&plus;ω=ωω&plus;ω23&plus;ω

(14)

Multiplication and exponentiation.

Multb&comma;c=b·c

ωω&plus;ω33&plus;ω5=ωω&plus;ω33&plus;ω5

(15)

c&.b=c·b

ωω&plus;ω23&plus;5ω=ωω&plus;1

(16)

c&.b&.a=c·b·a

ωω&plus;ω23&plus;5ω2=ωω&plus;12

(17)

Powerc&comma;a=ca

ωω2&plus;ωω&plus;23&plus;ωω5&plus;ω23&plus;5=ωω2&plus;ωω&plus;23&plus;ωω5&plus;ω23&plus;5

(18)

ac=ac

2ωω&plus;ω23&plus;5=ωωω&plus;ω332

(19)

Division, greatest common divisors.

eOrdinal4&comma;2&comma;3&comma;1&comma;2&comma;3&comma;0&comma;5

eω42&plus;ω3&plus;ω23&plus;5

(20)

gGcdc&comma;e

gω23&plus;5

(21)

c1quoc&comma;g

c1ωω&plus;1

(22)

e1quoe&comma;g

e1ω22&plus;ω&plus;1

(23)

Verify the divisibility.

remc&comma;g,reme&comma;g

0,0

(24)

g&.c1=g·c1

ω23&plus;5ωω&plus;1=ωω&plus;ω23&plus;5

(25)

g&.e1=g·e1

ω23&plus;5ω22&plus;ω&plus;1=ω42&plus;ω3&plus;ω23&plus;5

(26)

Verify the gcd property by factorization.

Factorc&comma;output=inert

5ω2&plus;13ωω&plus;1

(27)

Factore&comma;output=inert

5ω2&plus;13ω&plus;122

(28)

Factorg&comma;output=inert

5ω2&plus;13

(29)

value

ω23&plus;5

(30)

Factorc1&comma;output=inert

ωω&plus;1

(31)

Factore1&comma;output=inert

ω&plus;122

(32)

Gcdc1&comma;e1

1

(33)

Parametric ordinals. The variables x,y,z below are parameters implicitly assumed to represent non-negative integers. Unless there is an error, the results below remain correct for arbitrary non-negative integer values of the parameters.

rω+x&.ω+1&colon;

r=valuer

ω&plus;xω&plus;1=ω2&plus;ω&plus;x

(34)

Substitute a value for x.

r1Evalr&comma;x=1000&colon;

r1=valuer1

ω&plus;1000ω&plus;1=ω2&plus;ω&plus;1000

(35)

pω2·x+1+ω·y+z

pω2x+1&plus;ωy&plus;z

(36)

p3

Error, (in Ordinals:-Power) cannot determine if z is nonzero

Evalp&comma;z=z+13

ω6x+1&plus;ω5y&plus;ω4xz+x+z+1&plus;ω3y&plus;ω2xz+x+z+1&plus;ωy&plus;z+1

(37)

Indeed, the result when z=0 looks very different:

Evalp&comma;z=03

ω6x+1&plus;ω5y

(38)

Compatibility

• 

The Ordinals package was introduced in Maple 2015.

• 

For more information on Maple 2015 changes, see Updates in Maple 2015.

See Also

Ordinals[Ordinal]