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

Ordinals

 Div
 left Euclidean division of ordinals
 quo
 left Euclidean quotient of ordinals
 rem
 left Euclidean remainder of ordinals

 Calling Sequence Div(a, b) quo(a, b) rem(a, b)

Parameters

 a, b - ordinals, nonnegative integers, or polynomials with positive integer coefficients

Returns

 • Div returns an expression sequence q, r such that $a=b\cdot q+r$, where q and r are ordinals, nonnegative integers, or polynomials with positive integer coefficients, and r is as small as possible.
 • quo returns just q and rem returns just r.

Description

 • The Div(a, b) calling sequence computes the unique ordinal numbers $q$ and $r$ such that $a=b\cdot q+r$ and $r\prec b$, where $\prec$ is the strict ordering of ordinals.
 • If $b=0$, a division by zero error is raised.
 • The ordinal $a$ is left divisible by $b$ if and only if $r=0$.
 • If one of a and b is a parametric ordinal and the division cannot be performed, an error is raised.
 • The quo and rem commands overload the corresponding top-level routines quo and rem, respectively. The top-level commands are still accessible via the :- qualifier, that is, :-quo and :-rem, respectively.

Examples

 > $\mathrm{with}\left(\mathrm{Ordinals}\right)$
 $\left[{\mathrm{+}}{,}{\mathrm{.}}{,}{\mathrm{<}}{,}{\mathrm{<=}}{,}{\mathrm{Add}}{,}{\mathrm{Base}}{,}{\mathrm{Dec}}{,}{\mathrm{Decompose}}{,}{\mathrm{Div}}{,}{\mathrm{Eval}}{,}{\mathrm{Factor}}{,}{\mathrm{Gcd}}{,}{\mathrm{Lcm}}{,}{\mathrm{LessThan}}{,}{\mathrm{Log}}{,}{\mathrm{Max}}{,}{\mathrm{Min}}{,}{\mathrm{Mult}}{,}{\mathrm{Ordinal}}{,}{\mathrm{Power}}{,}{\mathrm{Split}}{,}{\mathrm{Sub}}{,}{\mathrm{^}}{,}{\mathrm{degree}}{,}{\mathrm{lcoeff}}{,}{\mathrm{log}}{,}{\mathrm{lterm}}{,}{\mathrm{\omega }}{,}{\mathrm{quo}}{,}{\mathrm{rem}}{,}{\mathrm{tcoeff}}{,}{\mathrm{tdegree}}{,}{\mathrm{tterm}}\right]$ (1)
 > $a≔\mathrm{Ordinal}\left(\left[\left[\mathrm{ω},1\right],\left[3,2\right],\left[2,5\right],\left[0,4\right]\right]\right)$
 ${a}{≔}{{\mathbf{\omega }}}^{{\mathbf{\omega }}}{+}{{\mathbf{\omega }}}^{{3}}{\cdot }{2}{+}{{\mathbf{\omega }}}^{{2}}{\cdot }{5}{+}{4}$ (2)
 > $b≔\mathrm{Ordinal}\left(\left[\left[2,4\right],\left[1,7\right],\left[0,5\right]\right]\right)$
 ${b}{≔}{{\mathbf{\omega }}}^{{2}}{\cdot }{4}{+}{\mathbf{\omega }}{\cdot }{7}{+}{5}$ (3)
 > $q,r≔\mathrm{Div}\left(a,b\right)$
 ${q}{,}{r}{≔}{{\mathbf{\omega }}}^{{\mathbf{\omega }}}{+}{\mathbf{\omega }}{\cdot }{2}{+}{1}{,}{{\mathbf{\omega }}}^{{2}}{+}{4}$ (4)
 > $\mathrm{quo}\left(a,b\right)=q$
 ${{\mathbf{\omega }}}^{{\mathbf{\omega }}}{+}{\mathbf{\omega }}{\cdot }{2}{+}{1}{=}{{\mathbf{\omega }}}^{{\mathbf{\omega }}}{+}{\mathbf{\omega }}{\cdot }{2}{+}{1}$ (5)
 > $\mathrm{rem}\left(a,b\right)=r$
 ${{\mathbf{\omega }}}^{{2}}{+}{4}{=}{{\mathbf{\omega }}}^{{2}}{+}{4}$ (6)
 > $a=\mathrm{.}\left(b,q\right)+r$
 ${{\mathbf{\omega }}}^{{\mathbf{\omega }}}{+}{{\mathbf{\omega }}}^{{3}}{\cdot }{2}{+}{{\mathbf{\omega }}}^{{2}}{\cdot }{5}{+}{4}{=}{{\mathbf{\omega }}}^{{\mathbf{\omega }}}{+}{{\mathbf{\omega }}}^{{3}}{\cdot }{2}{+}{{\mathbf{\omega }}}^{{2}}{\cdot }{5}{+}{4}$ (7)
 > $r
 ${\mathrm{true}}$ (8)

Any of the arguments can be an integer.

 > $\mathrm{Div}\left(a,2\right)$
 ${{\mathbf{\omega }}}^{{\mathbf{\omega }}}{+}{{\mathbf{\omega }}}^{{3}}{\cdot }{2}{+}{{\mathbf{\omega }}}^{{2}}{\cdot }{5}{+}{2}{,}{0}$ (9)
 > $\mathrm{Div}\left(b,3\right)$
 ${{\mathbf{\omega }}}^{{2}}{\cdot }{4}{+}{\mathbf{\omega }}{\cdot }{7}{+}{1}{,}{2}$ (10)
 > $\mathrm{Div}\left(b,0\right)$

Parametric examples.

 > $c≔\mathrm{Ordinal}\left(\left[\left[2,4x\right],\left[1,y+10\right],\left[0,z\right]\right]\right)$
 ${c}{≔}{{\mathbf{\omega }}}^{{2}}{\cdot }\left({4}{}{x}\right){+}{\mathbf{\omega }}{\cdot }\left({y}{+}{10}\right){+}{z}$ (11)
 > $\mathrm{Div}\left(c,b\right)$
 > $q,r≔\mathrm{Div}\left(\mathrm{Eval}\left(c,\left[x=x+1\right]\right),b\right)$
 ${q}{,}{r}{≔}{x}{+}{1}{,}{\mathbf{\omega }}{\cdot }\left({y}{+}{3}\right){+}{z}$ (12)

Compatibility

 • The Ordinals[Div], Ordinals[quo] and Ordinals[rem] commands were introduced in Maple 2015.
 • For more information on Maple 2015 changes, see Updates in Maple 2015.