login  home  contents  what's new  discussion  bug reports help  links  subscribe  changes  refresh  edit

# Edit detail for SandBoxRealSpace revision 1 of 1

 1 Editor: Kurt Pagani Time: 2014/11/07 04:26:32 GMT+0 Note:

changed:
-
)abbrev domain RR Real
++ ===================================
++ THE REAL LINE MODELLED AS EXPR(INT)
++ ===================================
++ Modified version of Expression R
++ Author: Manuel Bronstein
++ Date Created: 19 July 1988
++ Date Last Updated: October 1993 (P.Gianni), February 1995 (MB)
++ Description: Expressions involving symbolic functions.
++ Keywords: operator, kernel, function.
Real : Exports == Implementation where
R   ==> Integer
Q   ==> Fraction Integer
K   ==> Kernel %
MP  ==> SparseMultivariatePolynomial(R, K)
AF  ==> AlgebraicFunction(R, %)
EF  ==> ElementaryFunction(R, %)
CF  ==> CombinatorialFunction(R, %)
LF  ==> LiouvillianFunction(R, %)
AN  ==> AlgebraicNumber
KAN ==> Kernel AN
FSF ==> FunctionalSpecialFunction(R, %)
ESD ==> ExpressionSpace_&(%)
FSD ==> FunctionSpace_&(%, R)
POWER  ==> '%power
SUP    ==> SparseUnivariatePolynomial

Exports ==> FunctionSpace R with
if R has IntegralDomain then
AlgebraicallyClosedFunctionSpace R
TranscendentalFunctionCategory
CombinatorialOpsCategory
LiouvillianFunctionCategory
SpecialFunctionCategory
reduce : % -> %
++ reduce(f) simplifies all the unreduced algebraic quantities
++ present in f by applying their defining relations.
number? : % -> Boolean
++ number?(f) tests if f is rational
simplifyPower : (%, Integer) -> %
++ simplifyPower(f, n) \undocumented{}
if R has GcdDomain then
factorPolynomial : SUP  % -> Factored SUP %
++ factorPolynomial(p) \undocumented{}
squareFreePolynomial : SUP % -> Factored SUP %
++ squareFreePolynomial(p) \undocumented{}
if R has RetractableTo Integer then RetractableTo AN
setSimplifyDenomsFlag : Boolean -> Boolean
++ setSimplifyDenomsFlag(x) sets flag affecting simplification
++ of denominators.  If true irrational algebraics are removed from
++ denominators.  If false they are kept.
getSimplifyDenomsFlag : () -> Boolean
++ getSimplifyDenomsFlag() gets values of flag affecting
++ simplification of denominators.  See setSimplifyDenomsFlag.

import from KernelFunctions2(R, %)

SYMBOL := '%symbol
ALGOP  := '%alg

retNotUnit     : % -> R
retNotUnitIfCan : % -> Union(R, "failed")

belong? op == true

retNotUnit x ==
(u := constantIfCan(k := retract(x)@K)) case R => u::R
error "Not retractable"

retNotUnitIfCan x ==
(r := retractIfCan(x)@Union(K,"failed")) case "failed" => "failed"
constantIfCan(r::K)

SPCH ==> SparsePolynomialCoercionHelpers(R, Symbol, K)

if R has Ring then
poly_to_MP(p : Polynomial(R)) : MP ==
ps := p pretend SparseMultivariatePolynomial(R, Symbol)
vl1 : List Symbol := variables(ps)
vl2 : List K := [kernel(z)$K for z in vl1] remap_variables(ps, vl1, vl2)$SPCH

if R has IntegralDomain then
reduc  : (%, List Kernel %) -> %
algreduc : (%, List Kernel %) -> %
commonk   : (%, %) -> List K
commonk0  : (List K, List K) -> List K
toprat    : % -> %
algkernels : List K -> List K
algtower  : % -> List K
evl       : (MP, K, SparseUnivariatePolynomial %) -> Fraction MP
evl0      : (MP, K) -> SparseUnivariatePolynomial Fraction MP

Rep := Fraction MP
0                == 0$Rep 1 == 1$Rep
one? x           == (x = 1)$Rep zero? x == zero?(x)$Rep
- x : %            == -$Rep x n : Integer * x : % == n *$Rep x
coerce(n : Integer) ==  coerce(n)$Rep@Rep::% x : % * y : % == algreduc(x *$Rep y, commonk(x, y))
x : % + y : %        == algreduc(x +$Rep y, commonk(x, y)) (x : % - y : %) : % == algreduc(x -$Rep y, commonk(x, y))
x : % / y : %        == algreduc(x /$Rep y, commonk(x, y)) number?(x : %) : Boolean == if R has RetractableTo(Integer) then ground?(x) or ((retractIfCan(x)@Union(Q,"failed")) case Q) else ground?(x) simplifyPower(x : %, n : Integer) : % == k : List K := kernels x is?(x, POWER) => -- Look for a power of a number in case we can do -- a simplification args : List % := argument first k not(#args = 2) => error "Too many arguments to ^" number?(args.1) => reduc((args.1) ^$Rep n,
algtower(args.1))^(args.2)
(first args)^(n*second(args))
reduc(x ^$Rep n, algtower(x)) x : % ^ n : NonNegativeInteger == n = 0 => 1$%
n = 1 => x
simplifyPower(numerator x, n::Integer) /
simplifyPower(denominator x, n::Integer)

x : % ^ n : Integer ==
n = 0 => 1$% n = 1 => x n = -1 => 1/x simplifyPower(numerator x, n) / simplifyPower(denominator x, n) x : % ^ n : PositiveInteger == n = 1 => x simplifyPower(numerator x, n::Integer) / simplifyPower(denominator x, n::Integer) smaller?(x : %, y : %) == smaller?(x, y)$Rep
x : % = y : %        == (x - y) =$Rep 0$Rep
numer x          == numer(x)$Rep denom x == denom(x)$Rep

EREP := Record(num : MP, den : MP)

coerce(p : MP) : %   == [p, 1]$EREP pretend % coerce(p : Polynomial(R)) : % == en := poly_to_MP(p) [en, 1]$EREP pretend %

coerce(pq : Fraction(Polynomial(R))) : % ==
en := poly_to_MP(numer(pq))
ed := poly_to_MP(denom(pq))
[en, ed]$EREP pretend % reduce x == reduc(x, algtower x) commonk(x, y) == commonk0(algtower x, algtower y) algkernels l == select!(x +-> has?(operator x, ALGOP), l) toprat f == ratDenom(f, algtower f )$AlgebraicManipulations(R, %)

alg_ker_set(x : %) : List(K) ==
resl : List(K) := []
ak1 : List(K) := []
for k in kernels x repeat
not(is?(k, 'nthRoot) or is?(k, 'rootOf)) => "iterate"
ak1 := cons(k, ak1)
while not(empty?(ak1)) repeat
ak := ak1
ak1 := []
for k in ak repeat
needed := true
for k1 in resl while needed repeat
if EQ(k1, k)$Lisp then needed := false for k1 in resl while needed repeat if k1 = k then needed := false not(needed) => "iterate" resl := cons(k, resl) ak1 := cons(k, ak1) arg := argument(k) for k1 in kernels(arg.1) repeat if (is?(k1, 'nthRoot) or is?(k1, 'rootOf)) then ak1 := cons(k1, ak1) resl algtower(x : %) : List K == reverse!(sort! alg_ker_set(x)) simple_root(r : K) : Boolean == is?(r, 'nthRoot) => al := argument(r) al.2 ~= 2::% => false a := al.1 #algkernels(kernels(a)) > 0 => false true false root_reduce(x : %, r : K) : % == a := argument(r).1 an := numer(a) dn := denom(a) dp := univariate(denom x, r) n0 := numer x c1 := leadingCoefficient(dp) c0 := leadingCoefficient(reductum(dp)) n1 := dn*(c0*n0 - monomial(1, r, 1)$MP*c1*n0)
d1 := c0*c0*dn - an*c1*c1
reduc(n1 /$Rep d1, [r]) DEFVAR(algreduc_flag$Lisp, false$Boolean)$Lisp

getSimplifyDenomsFlag() ==
algreduc_flag$Lisp setSimplifyDenomsFlag(x) == res := getSimplifyDenomsFlag() SETF(algreduc_flag$Lisp, x)$Lisp res algreduc(x, ckl) == x1 := reduc(x, ckl) not(getSimplifyDenomsFlag()) => x1 akl := algtower(1$MP /$Rep denom x1) #akl = 0 => x1 if #akl = 1 then r := akl.1 simple_root(r) => return root_reduce(x, r) sas := create()$SingletonAsOrderedSet
for k in akl repeat
q := univariate(x1, k, minPoly k
)$PolynomialCategoryQuotientFunctions(IndexedExponents K, K, R, MP, %) x1 := retract(eval(q, sas, k::%))@% reduc(x1, akl) x : MP / y : MP == reduc(x /$Rep y, commonk(x /$Rep 1$MP, y /$Rep 1$MP))

-- since we use the reduction from FRAC SMP which asssumes
-- that the variables are independent, we must remove algebraic
-- from the denominators

reducedSystem(m : Matrix %) : Matrix(R) ==
mm : Matrix(MP) := reducedSystem(map(toprat, m))$Rep reducedSystem(mm)$MP

reducedSystem(m : Matrix %, v : Vector %):
Record(mat : Matrix R, vec : Vector R) ==
r : Record(mat : Matrix MP, vec : Vector MP) :=
reducedSystem(map(toprat, m), map(toprat, v))$Rep reducedSystem(r.mat, r.vec)$MP

-- The result MUST be left sorted deepest first   MB 3/90
commonk0(x, y) ==
ans := empty()$List(K) for k in reverse! x repeat if member?(k, y) then ans := concat(k, ans) ans rootOf(x : SparseUnivariatePolynomial %, v : Symbol) == rootOf(x, v)$AF
rootSum(x : %, p : SparseUnivariatePolynomial %, v : Symbol) : % ==
rootSum(x, p, v)$AF pi() == pi()$EF
exp x                     == exp(x)$EF log x == log(x)$EF
sin x                     == sin(x)$EF cos x == cos(x)$EF
tan x                     == tan(x)$EF cot x == cot(x)$EF
sec x                     == sec(x)$EF csc x == csc(x)$EF
asin x                    == asin(x)$EF acos x == acos(x)$EF
atan x                    == atan(x)$EF acot x == acot(x)$EF
asec x                    == asec(x)$EF acsc x == acsc(x)$EF
sinh x                    == sinh(x)$EF cosh x == cosh(x)$EF
tanh x                    == tanh(x)$EF coth x == coth(x)$EF
sech x                    == sech(x)$EF csch x == csch(x)$EF
asinh x                   == asinh(x)$EF acosh x == acosh(x)$EF
atanh x                   == atanh(x)$EF acoth x == acoth(x)$EF
asech x                   == asech(x)$EF acsch x == acsch(x)$EF

abs x                     == abs(x)$FSF Gamma x == Gamma(x)$FSF
Gamma(a, x)               == Gamma(a, x)$FSF Beta(x, y) == Beta(x, y)$FSF
digamma x                 == digamma(x)$FSF polygamma(k, x) == polygamma(k, x)$FSF
besselJ(v, x)             == besselJ(v, x)$FSF besselY(v, x) == besselY(v, x)$FSF
besselI(v, x)             == besselI(v, x)$FSF besselK(v, x) == besselK(v, x)$FSF
airyAi x                  == airyAi(x)$FSF airyAiPrime(x) == airyAiPrime(x)$FSF
airyBi x                  == airyBi(x)$FSF airyBiPrime(x) == airyBiPrime(x)$FSF
lambertW(x)               == lambertW(x)$FSF polylog(s, x) == polylog(s, x)$FSF
weierstrassP(g2, g3, x)   == weierstrassP(g2, g3, x)$FSF weierstrassPPrime(g2, g3, x) == weierstrassPPrime(g2, g3, x)$FSF
weierstrassSigma(g2, g3, x) == weierstrassSigma(g2, g3, x)$FSF weierstrassZeta(g2, g3, x) == weierstrassZeta(g2, g3, x)$FSF
-- weierstrassPInverse(g2, g3, z) == weierstrassPInverse(g2, g3, z)$FSF whittakerM(k, m, z) == whittakerM(k, m, z)$FSF
whittakerW(k, m, z) == whittakerW(k, m, z)$FSF angerJ(v, z) == angerJ(v, z)$FSF
weberE(v, z) == weberE(v, z)$FSF struveH(v, z) == struveH(v, z)$FSF
struveL(v, z) == struveL(v, z)$FSF hankelH1(v, z) == hankelH1(v, z)$FSF
hankelH2(v, z) == hankelH2(v, z)$FSF lommelS1(mu, nu, z) == lommelS1(mu, nu, z)$FSF
lommelS2(mu, nu, z) == lommelS2(mu, nu, z)$FSF kummerM(mu, nu, z) == kummerM(mu, nu, z)$FSF
kummerU(mu, nu, z) == kummerU(mu, nu, z)$FSF legendreP(nu, mu, z) == legendreP(nu, mu, z)$FSF
legendreQ(nu, mu, z) == legendreQ(nu, mu, z)$FSF kelvinBei(v, z) == kelvinBei(v, z)$FSF
kelvinBer(v, z) == kelvinBer(v, z)$FSF kelvinKei(v, z) == kelvinKei(v, z)$FSF
kelvinKer(v, z) == kelvinKer(v, z)$FSF ellipticK(m) == ellipticK(m)$FSF
ellipticE(m) == ellipticE(m)$FSF ellipticE(z, m) == ellipticE(z, m)$FSF
ellipticF(z, m) == ellipticF(z, m)$FSF ellipticPi(z, n, m) == ellipticPi(z, n, m)$FSF
jacobiSn(z, m) == jacobiSn(z, m)$FSF jacobiCn(z, m) == jacobiCn(z, m)$FSF
jacobiDn(z, m) == jacobiDn(z, m)$FSF jacobiZeta(z, m) == jacobiZeta(z, m)$FSF
jacobiTheta(q, z) == jacobiTheta(q, z)$FSF lerchPhi(z, s, a) == lerchPhi(z, s, a)$FSF
riemannZeta(z) == riemannZeta(z)$FSF charlierC(n, a, z) == charlierC(n, a, z)$FSF
hermiteH(n, z) == hermiteH(n, z)$FSF jacobiP(n, a, b, z) == jacobiP(n, a, b, z)$FSF
laguerreL(n, a, z) == laguerreL(n, a, z)$FSF meixnerM(n, b, c, z) == meixnerM(n, b, c, z)$FSF

if % has RetractableTo(Integer) then
hypergeometricF(la, lb, x) == hypergeometricF(la, lb, x)$FSF meijerG(la, lb, lc, ld, x) == meijerG(la, lb, lc, ld, x)$FSF

x : % ^ y : %                 == x ^$CF y factorial x == factorial(x)$CF
binomial(n, m)            == binomial(n, m)$CF permutation(n, m) == permutation(n, m)$CF
factorials x              == factorials(x)$CF factorials(x, n) == factorials(x, n)$CF
summation(x : %, n : Symbol)           == summation(x, n)$CF summation(x : %, s : SegmentBinding %) == summation(x, s)$CF
product(x : %, n : Symbol)             == product(x, n)$CF product(x : %, s : SegmentBinding %) == product(x, s)$CF

erf x                              == erf(x)$LF erfi x == erfi(x)$LF
Ei x                               == Ei(x)$LF Si x == Si(x)$LF
Ci x                               == Ci(x)$LF Shi x == Shi(x)$LF
Chi x                              == Chi(x)$LF li x == li(x)$LF
dilog x                            == dilog(x)$LF fresnelS x == fresnelS(x)$LF
fresnelC x                         == fresnelC(x)$LF integral(x : %, n : Symbol) == integral(x, n)$LF
integral(x : %, s : SegmentBinding %)  == integral(x, s)$LF operator op == belong?(op)$AF  => operator(op)$AF belong?(op)$EF  => operator(op)$EF belong?(op)$CF  => operator(op)$CF belong?(op)$LF  => operator(op)$LF belong?(op)$FSF => operator(op)$FSF belong?(op)$FSD => operator(op)$FSD belong?(op)$ESD => operator(op)$ESD nullary? op and has?(op, SYMBOL) => operator(kernel(name op)$K)
(n := arity op) case "failed" => operator name op
operator(name op, n::NonNegativeInteger)

reduc(x, l) ==
for k in l repeat
p := minPoly k
x := evl(numer x, k, p) /$Rep evl(denom x, k, p) x evl0(p, k) == numer univariate(p::Fraction(MP), k)$PolynomialCategoryQuotientFunctions(IndexedExponents K,
K, R, MP, Fraction MP)

-- uses some operations from Rep instead of % in order not to
-- reduce recursively during those operations.
evl(p, k, m) ==
degree(p, k) < degree m => p::Fraction(MP)
(((evl0(p, k) pretend SparseUnivariatePolynomial(%)) rem m)
pretend SparseUnivariatePolynomial Fraction MP)
(k::MP::Fraction(MP))

if R has GcdDomain then
noalg? : SUP % -> Boolean

noalg? p ==
while p ~= 0 repeat
not empty? algkernels kernels leadingCoefficient p =>
return false
p := reductum p
true

gcdPolynomial(p : SUP %, q : SUP %) ==
noalg? p and noalg? q => gcdPolynomial(p, q)$Rep gcdPolynomial(p, q)$GcdDomain_&(%)

factorPolynomial(x : SUP %) : Factored SUP % ==
uf := factor(x pretend SUP(Rep))$SupFractionFactorizer( IndexedExponents K, K, R, MP) uf pretend Factored SUP % squareFreePolynomial(x : SUP %) : Factored SUP % == uf := squareFree(x pretend SUP(Rep))$SupFractionFactorizer(
IndexedExponents K, K, R, MP)
uf pretend Factored SUP %

if (R has RetractableTo Integer) then
x : % ^ r : Q                  == x ^$AF r minPoly k == minPoly(k)$AF
definingPolynomial x       == definingPolynomial(x)$AF retract(x : %) : Q == retract(x)$Rep
retractIfCan(x : %) : Union(Q, "failed") == retractIfCan(x)$Rep if not(R is AN) then k2expr : KAN -> % smp2expr : SparseMultivariatePolynomial(Integer, KAN) -> % R2AN : R -> Union(AN, "failed") k2an : K -> Union(AN, "failed") smp2an : MP -> Union(AN, "failed") coerce(x : AN) : % == smp2expr(numer x) / smp2expr(denom x) k2expr k == map(x +-> x::%, k)$ExpressionSpaceFunctions2(AN, %)

smp2expr p ==
map(k2expr, x +-> x::%, p
)$PolynomialCategoryLifting(IndexedExponents KAN, KAN, Integer, SparseMultivariatePolynomial( Integer, KAN), %) retractIfCan(x : %) : Union(AN, "failed") == ((n := smp2an numer x) case AN) and ((d := smp2an denom x) case AN) => (n::AN) / (d::AN) "failed" R2AN r == (u := retractIfCan(r::%)@Union(Q, "failed")) case Q => u::Q::AN "failed" k2an k == not(belong?(op := operator k)$AN) => "failed"
is?(op, 'rootOf) =>
args := argument(k)
a2 := args.2
k1u := retractIfCan(a2)@Union(K, "failed")
k1u case "failed" => "failed"
k1 := k1u::K
s1u := retractIfCan(a2)@Union(Symbol, "failed")
s1u case "failed" => "failed"
s1 := s1u::Symbol
a1 := args.1
denom(a1) ~= 1 =>
eq := univariate(numer(a1), k1)
eqa : SUP(AN) := 0
while eq ~= 0 repeat
ccu := retractIfCan(cc)@Union(AN, "failed")
ccu case "failed" => return "failed"
eqa := eqa + monomial(ccu::AN, degree eq)
eq := reductum eq
rootOf(eqa, s1)$AN arg : List(AN) := empty() for x in argument k repeat if (a := retractIfCan(x)@Union(AN, "failed")) case "failed" then return "failed" else arg := concat(a::AN, arg) (operator(op)$AN) reverse!(arg)

smp2an p ==
(x1 := mainVariable p) case "failed" =>
up := univariate(p, k := x1::K)
(t  := k2an k) case "failed" => "failed"
ans : AN := 0
while not ground? up repeat
case "failed" => return "failed"
ans := ans + (c::AN) * (t::AN) ^ (degree up)
up  := reductum up
case "failed" => "failed"
ans + c::AN

if R has ConvertibleTo InputForm then
convert(x : %) : InputForm == convert(x)$Rep import from MakeUnaryCompiledFunction(%, %, %) eval(f : %, op : BasicOperator, g : %, x : Symbol) : % == eval(f, [op], [g], x) eval(f : %, ls : List BasicOperator, lg : List %, x : Symbol) == -- handle subscripted symbols by renaming -> eval -- -> renaming back llsym : List List Symbol := [variables g for g in lg] lsym : List Symbol := removeDuplicates concat llsym lsd : List Symbol := select (scripted?, lsym) empty? lsd => eval(f, ls, [compiledFunction(g, x) for g in lg]) ns : List Symbol := [new()$Symbol for i in lsd]
lforwardSubs : List Equation % :=
[(i::%)= (j::%) for i in lsd for j in ns]
lbackwardSubs : List Equation % :=
[(j::%)= (i::%) for i in lsd for j in ns]
nlg : List % := [subst(g, lforwardSubs) for g in lg]
res : % :=
eval(f, ls, [compiledFunction(g, x) for g in nlg])
subst(res, lbackwardSubs)

if R has PatternMatchable Integer then
patternMatch(x : %, p : Pattern Integer,
l : PatternMatchResult(Integer, %)) ==
patternMatch(x, p,
l)$PatternMatchFunctionSpace(Integer, R, %) )abbrev domain RSPACE RealSpace ++ Author: kfp ++ Date Created: Thu Nov 06 03:51:56 CET 2014 ++ License: BSD (same as Axiom) ++ Date Last Updated: ++ Basic Operations: ++ Related Domains: ++ Also See: ++ AMS Classifications: ++ Keywords: ++ Examples: ++ References: ++ ++ Description: ++ ++ RealSpace(n) : Exports == Implementation where NNI ==> NonNegativeInteger PI ==> PositiveInteger I ==> Integer R ==> Real n:NNI Exports == Join(CoercibleTo OutputForm, ConvertibleTo String) with coerce : % -> OutputForm coerce : List R -> % coerce : R -> % dot : (%,%) -> R dim : % -> NNI "+" : (%,%) -> % "-" : (%,%) -> % "*" : (R,%) -> % "*" : (NNI,%) -> % "*" : (PI,%) -> % "*" : (I,%) -> % "/" : (%,R) -> % "#" : % -> NNI "-" : % -> % "=" : (%,%) -> Boolean "~=": (%,%) -> Boolean unitVector : PI -> % elt : (%,I) -> R eval: (%, Equation R) -> % eval: (%, List Equation R) -> % every?: (R -> Boolean, %) -> Boolean map: (R -> R, %) -> % -- strange, to check member?: (R, %) -> Boolean any?: (R -> Boolean, %) -> Boolean copy: % -> % D: (%, Symbol) -> % D: (%, Symbol, NonNegativeInteger) -> % D: (%, List Symbol) -> % D: (%, List Symbol, List NonNegativeInteger) -> % dist : (%,%) -> R Implementation == DirectProduct(n,R) add Rep := DirectProduct(n,R) coerce(l:List R):% == #l=n => directProduct((vector l)::Vector(R))$Rep

coerce(x:R):% == x*unitVector(1)$Rep if n=1 then coerce(x:%):OutputForm == elt(x,1)::OutputForm dim(x:%):NNI == n dist(x:%,y:%):R == sqrt dot(x-y,x-y) \end{spad} \begin{axiom} P:=[x,y,z::RR]::RealSpace(3) Q:=[u,v,w::RR]::RealSpace(3) \end{axiom} \begin{axiom} s:=s::RR t:=t::RR \end{axiom} \begin{axiom} P+Q P-Q -P dot(P,Q) dist(P,Q) t*P+s*Q unitVector(1)$RSPACE(3)
P.1
Q.2
\end{axiom}

**Functions**

\begin{axiom}
f:Real -> Real
f(t) == t^2*sin(t)
X:Real -> RealSpace(4)
X(t) == [f(t),f(2*t),t^2,cos(t::RR)]::RealSpace(4)
X(t) -- curve in R^4
D(X(t),'t)
D(X(t),'t,2)
eval(X(t),t=1)
Z:RealSpace(2)->RealSpace(3)
z:=[x,y::RR]::RSPACE(2)
Z(q) == [q.1^2,exp(-q.1*q.2),(q.1+q.2)^n]
Z(z)
D(Z(z),['x,'y])
D(Z(z),['x,'y],[2,3])
D(Z(z),'x,3)
\end{axiom}

\begin{axiom}
limit(1/n^2::RR,n=%plusInfinity)
limit(X(t).4,'t=0)
\end{axiom}

\begin{axiom}
integrate((sin(y::RR))^2,y)
integrate(sin(s)^2,'s)
integrate(dist(X(u),X(v)),u)
\end{axiom}

-- continue with PROP domain



\begin{spad}
)abbrev domain RR Real
++ ===================================
++ THE REAL LINE MODELLED AS EXPR(INT)
++ ===================================
++ Modified version of Expression R
++ Author: Manuel Bronstein
++ Date Created: 19 July 1988
++ Date Last Updated: October 1993 (P.Gianni), February 1995 (MB)
++ Description: Expressions involving symbolic functions.
++ Keywords: operator, kernel, function.
Real : Exports == Implementation where
R   ==> Integer
Q   ==> Fraction Integer
K   ==> Kernel %
MP  ==> SparseMultivariatePolynomial(R, K)
AF  ==> AlgebraicFunction(R, %)
EF  ==> ElementaryFunction(R, %)
CF  ==> CombinatorialFunction(R, %)
LF  ==> LiouvillianFunction(R, %)
AN  ==> AlgebraicNumber
KAN ==> Kernel AN
FSF ==> FunctionalSpecialFunction(R, %)
ESD ==> ExpressionSpace_&(%)
FSD ==> FunctionSpace_&(%, R)
POWER  ==> '%power
SUP    ==> SparseUnivariatePolynomial  Exports ==> FunctionSpace R with
if R has IntegralDomain then
AlgebraicallyClosedFunctionSpace R
TranscendentalFunctionCategory
CombinatorialOpsCategory
LiouvillianFunctionCategory
SpecialFunctionCategory
reduce : % -> %
++ reduce(f) simplifies all the unreduced algebraic quantities
++ present in f by applying their defining relations.
number? : % -> Boolean
++ number?(f) tests if f is rational
simplifyPower : (%, Integer) -> %
++ simplifyPower(f, n) \undocumented{}
if R has GcdDomain then
factorPolynomial : SUP  % -> Factored SUP %
++ factorPolynomial(p) \undocumented{}
squareFreePolynomial : SUP % -> Factored SUP %
++ squareFreePolynomial(p) \undocumented{}
if R has RetractableTo Integer then RetractableTo AN
setSimplifyDenomsFlag : Boolean -> Boolean
++ setSimplifyDenomsFlag(x) sets flag affecting simplification
++ of denominators.  If true irrational algebraics are removed from
++ denominators.  If false they are kept.
getSimplifyDenomsFlag : () -> Boolean
++ getSimplifyDenomsFlag() gets values of flag affecting
++ simplification of denominators.  See setSimplifyDenomsFlag.
import from KernelFunctions2(R, %)    SYMBOL := '%symbol
ALGOP  := '%alg
retNotUnit     : % -> R
retNotUnitIfCan : % -> Union(R, "failed")
belong? op == true
retNotUnit x ==
(u := constantIfCan(k := retract(x)@K)) case R => u::R
error "Not retractable"
retNotUnitIfCan x ==
(r := retractIfCan(x)@Union(K,"failed")) case "failed" => "failed"
constantIfCan(r::K)
SPCH ==> SparsePolynomialCoercionHelpers(R, Symbol, K)
if R has Ring then
poly_to_MP(p : Polynomial(R)) : MP ==
ps := p pretend SparseMultivariatePolynomial(R, Symbol)
vl1 : List Symbol := variables(ps)
vl2 : List K := [kernel(z)$K for z in vl1] remap_variables(ps, vl1, vl2)$SPCH        if R has IntegralDomain then
reduc  : (%, List Kernel %) -> %
algreduc : (%, List Kernel %) -> %
commonk   : (%, %) -> List K
commonk0  : (List K, List K) -> List K
toprat    : % -> %
algkernels : List K -> List K
algtower  : % -> List K
evl       : (MP, K, SparseUnivariatePolynomial %) -> Fraction MP
evl0      : (MP, K) -> SparseUnivariatePolynomial Fraction MP            Rep := Fraction MP
0                == 0$Rep 1 == 1$Rep
one? x           == (x = 1)$Rep zero? x == zero?(x)$Rep
- x : %            == -$Rep x n : Integer x : % == n$Rep x
coerce(n : Integer) ==  coerce(n)$Rep@Rep::% x : % y : % == algreduc(x$Rep y, commonk(x, y))
x : % + y : %        == algreduc(x +$Rep y, commonk(x, y)) (x : % - y : %) : % == algreduc(x -$Rep y, commonk(x, y))
x : % / y : %        == algreduc(x /$Rep y, commonk(x, y)) number?(x : %) : Boolean == if R has RetractableTo(Integer) then ground?(x) or ((retractIfCan(x)@Union(Q,"failed")) case Q) else ground?(x) simplifyPower(x : %, n : Integer) : % == k : List K := kernels x is?(x, POWER) => -- Look for a power of a number in case we can do -- a simplification args : List % := argument first k not(#args = 2) => error "Too many arguments to ^" number?(args.1) => reduc((args.1) ^$Rep n,
algtower(args.1))^(args.2)
(first args)^(n*second(args))
reduc(x ^$Rep n, algtower(x)) x : % ^ n : NonNegativeInteger == n = 0 => 1$%
n = 1 => x
simplifyPower(numerator x, n::Integer) /
simplifyPower(denominator x, n::Integer)
x : % ^ n : Integer ==
n = 0 => 1$% n = 1 => x n = -1 => 1/x simplifyPower(numerator x, n) / simplifyPower(denominator x, n) x : % ^ n : PositiveInteger == n = 1 => x simplifyPower(numerator x, n::Integer) / simplifyPower(denominator x, n::Integer) smaller?(x : %, y : %) == smaller?(x, y)$Rep
x : % = y : %        == (x - y) =$Rep 0$Rep
numer x          == numer(x)$Rep denom x == denom(x)$Rep
EREP := Record(num : MP, den : MP)
coerce(p : MP) : %   == [p, 1]$EREP pretend % coerce(p : Polynomial(R)) : % == en := poly_to_MP(p) [en, 1]$EREP pretend %
coerce(pq : Fraction(Polynomial(R))) : % ==
en := poly_to_MP(numer(pq))
ed := poly_to_MP(denom(pq))
[en, ed]$EREP pretend % reduce x == reduc(x, algtower x) commonk(x, y) == commonk0(algtower x, algtower y) algkernels l == select!(x +-> has?(operator x, ALGOP), l) toprat f == ratDenom(f, algtower f )$AlgebraicManipulations(R, %)
alg_ker_set(x : %) : List(K) ==
resl : List(K) := []
ak1 : List(K) := []
for k in kernels x repeat
not(is?(k, 'nthRoot) or is?(k, 'rootOf)) => "iterate"
ak1 := cons(k, ak1)
while not(empty?(ak1)) repeat
ak := ak1
ak1 := []
for k in ak repeat
needed := true
for k1 in resl while needed repeat
if EQ(k1, k)$Lisp then needed := false for k1 in resl while needed repeat if k1 = k then needed := false not(needed) => "iterate" resl := cons(k, resl) ak1 := cons(k, ak1) arg := argument(k) for k1 in kernels(arg.1) repeat if (is?(k1, 'nthRoot) or is?(k1, 'rootOf)) then ak1 := cons(k1, ak1) resl algtower(x : %) : List K == reverse!(sort! alg_ker_set(x)) simple_root(r : K) : Boolean == is?(r, 'nthRoot) => al := argument(r) al.2 ~= 2::% => false a := al.1 #algkernels(kernels(a)) > 0 => false true false root_reduce(x : %, r : K) : % == a := argument(r).1 an := numer(a) dn := denom(a) dp := univariate(denom x, r) n0 := numer x c1 := leadingCoefficient(dp) c0 := leadingCoefficient(reductum(dp)) n1 := dn(c0n0 - monomial(1, r, 1)$MPc1n0)
d1 := c0c0dn - anc1c1
reduc(n1 /$Rep d1, [r]) DEFVAR(algreduc_flag$Lisp, false$Boolean)$Lisp
getSimplifyDenomsFlag() ==
algreduc_flag$Lisp setSimplifyDenomsFlag(x) == res := getSimplifyDenomsFlag() SETF(algreduc_flag$Lisp, x)$Lisp res algreduc(x, ckl) == x1 := reduc(x, ckl) not(getSimplifyDenomsFlag()) => x1 akl := algtower(1$MP /$Rep denom x1) #akl = 0 => x1 if #akl = 1 then r := akl.1 simple_root(r) => return root_reduce(x, r) sas := create()$SingletonAsOrderedSet
for k in akl repeat
q := univariate(x1, k, minPoly k
)$PolynomialCategoryQuotientFunctions(IndexedExponents K, K, R, MP, %) x1 := retract(eval(q, sas, k::%))@% reduc(x1, akl) x : MP / y : MP == reduc(x /$Rep y, commonk(x /$Rep 1$MP, y /$Rep 1$MP))
-- since we use the reduction from FRAC SMP which asssumes
-- that the variables are independent, we must remove algebraic
-- from the denominators
reducedSystem(m : Matrix %) : Matrix(R) ==
mm : Matrix(MP) := reducedSystem(map(toprat, m))$Rep reducedSystem(mm)$MP
reducedSystem(m : Matrix %, v : Vector %):
Record(mat : Matrix R, vec : Vector R) ==
r : Record(mat : Matrix MP, vec : Vector MP) :=
reducedSystem(map(toprat, m), map(toprat, v))$Rep reducedSystem(r.mat, r.vec)$MP

-- The result MUST be left sorted deepest first   MB 3/90
commonk0(x, y) ==
ans := empty()$List(K) for k in reverse! x repeat if member?(k, y) then ans := concat(k, ans) ans rootOf(x : SparseUnivariatePolynomial %, v : Symbol) == rootOf(x, v)$AF
rootSum(x : %, p : SparseUnivariatePolynomial %, v : Symbol) : % ==
rootSum(x, p, v)$AF pi() == pi()$EF
exp x                     == exp(x)$EF log x == log(x)$EF
sin x                     == sin(x)$EF cos x == cos(x)$EF
tan x                     == tan(x)$EF cot x == cot(x)$EF
sec x                     == sec(x)$EF csc x == csc(x)$EF
asin x                    == asin(x)$EF acos x == acos(x)$EF
atan x                    == atan(x)$EF acot x == acot(x)$EF
asec x                    == asec(x)$EF acsc x == acsc(x)$EF
sinh x                    == sinh(x)$EF cosh x == cosh(x)$EF
tanh x                    == tanh(x)$EF coth x == coth(x)$EF
sech x                    == sech(x)$EF csch x == csch(x)$EF
asinh x                   == asinh(x)$EF acosh x == acosh(x)$EF
atanh x                   == atanh(x)$EF acoth x == acoth(x)$EF
asech x                   == asech(x)$EF acsch x == acsch(x)$EF
abs x                     == abs(x)$FSF Gamma x == Gamma(x)$FSF
Gamma(a, x)               == Gamma(a, x)$FSF Beta(x, y) == Beta(x, y)$FSF
digamma x                 == digamma(x)$FSF polygamma(k, x) == polygamma(k, x)$FSF
besselJ(v, x)             == besselJ(v, x)$FSF besselY(v, x) == besselY(v, x)$FSF
besselI(v, x)             == besselI(v, x)$FSF besselK(v, x) == besselK(v, x)$FSF
airyAi x                  == airyAi(x)$FSF airyAiPrime(x) == airyAiPrime(x)$FSF
airyBi x                  == airyBi(x)$FSF airyBiPrime(x) == airyBiPrime(x)$FSF
lambertW(x)               == lambertW(x)$FSF polylog(s, x) == polylog(s, x)$FSF
weierstrassP(g2, g3, x)   == weierstrassP(g2, g3, x)$FSF weierstrassPPrime(g2, g3, x) == weierstrassPPrime(g2, g3, x)$FSF
weierstrassSigma(g2, g3, x) == weierstrassSigma(g2, g3, x)$FSF weierstrassZeta(g2, g3, x) == weierstrassZeta(g2, g3, x)$FSF
-- weierstrassPInverse(g2, g3, z) == weierstrassPInverse(g2, g3, z)$FSF whittakerM(k, m, z) == whittakerM(k, m, z)$FSF
whittakerW(k, m, z) == whittakerW(k, m, z)$FSF angerJ(v, z) == angerJ(v, z)$FSF
weberE(v, z) == weberE(v, z)$FSF struveH(v, z) == struveH(v, z)$FSF
struveL(v, z) == struveL(v, z)$FSF hankelH1(v, z) == hankelH1(v, z)$FSF
hankelH2(v, z) == hankelH2(v, z)$FSF lommelS1(mu, nu, z) == lommelS1(mu, nu, z)$FSF
lommelS2(mu, nu, z) == lommelS2(mu, nu, z)$FSF kummerM(mu, nu, z) == kummerM(mu, nu, z)$FSF
kummerU(mu, nu, z) == kummerU(mu, nu, z)$FSF legendreP(nu, mu, z) == legendreP(nu, mu, z)$FSF
legendreQ(nu, mu, z) == legendreQ(nu, mu, z)$FSF kelvinBei(v, z) == kelvinBei(v, z)$FSF
kelvinBer(v, z) == kelvinBer(v, z)$FSF kelvinKei(v, z) == kelvinKei(v, z)$FSF
kelvinKer(v, z) == kelvinKer(v, z)$FSF ellipticK(m) == ellipticK(m)$FSF
ellipticE(m) == ellipticE(m)$FSF ellipticE(z, m) == ellipticE(z, m)$FSF
ellipticF(z, m) == ellipticF(z, m)$FSF ellipticPi(z, n, m) == ellipticPi(z, n, m)$FSF
jacobiSn(z, m) == jacobiSn(z, m)$FSF jacobiCn(z, m) == jacobiCn(z, m)$FSF
jacobiDn(z, m) == jacobiDn(z, m)$FSF jacobiZeta(z, m) == jacobiZeta(z, m)$FSF
jacobiTheta(q, z) == jacobiTheta(q, z)$FSF lerchPhi(z, s, a) == lerchPhi(z, s, a)$FSF
riemannZeta(z) == riemannZeta(z)$FSF charlierC(n, a, z) == charlierC(n, a, z)$FSF
hermiteH(n, z) == hermiteH(n, z)$FSF jacobiP(n, a, b, z) == jacobiP(n, a, b, z)$FSF
laguerreL(n, a, z) == laguerreL(n, a, z)$FSF meixnerM(n, b, c, z) == meixnerM(n, b, c, z)$FSF
if % has RetractableTo(Integer) then
hypergeometricF(la, lb, x) == hypergeometricF(la, lb, x)$FSF meijerG(la, lb, lc, ld, x) == meijerG(la, lb, lc, ld, x)$FSF
x : % ^ y : %                 == x ^$CF y factorial x == factorial(x)$CF
binomial(n, m)            == binomial(n, m)$CF permutation(n, m) == permutation(n, m)$CF
factorials x              == factorials(x)$CF factorials(x, n) == factorials(x, n)$CF
summation(x : %, n : Symbol)           == summation(x, n)$CF summation(x : %, s : SegmentBinding %) == summation(x, s)$CF
product(x : %, n : Symbol)             == product(x, n)$CF product(x : %, s : SegmentBinding %) == product(x, s)$CF
erf x                              == erf(x)$LF erfi x == erfi(x)$LF
Ei x                               == Ei(x)$LF Si x == Si(x)$LF
Ci x                               == Ci(x)$LF Shi x == Shi(x)$LF
Chi x                              == Chi(x)$LF li x == li(x)$LF
dilog x                            == dilog(x)$LF fresnelS x == fresnelS(x)$LF
fresnelC x                         == fresnelC(x)$LF integral(x : %, n : Symbol) == integral(x, n)$LF
integral(x : %, s : SegmentBinding %)  == integral(x, s)$LF operator op == belong?(op)$AF  => operator(op)$AF belong?(op)$EF  => operator(op)$EF belong?(op)$CF  => operator(op)$CF belong?(op)$LF  => operator(op)$LF belong?(op)$FSF => operator(op)$FSF belong?(op)$FSD => operator(op)$FSD belong?(op)$ESD => operator(op)$ESD nullary? op and has?(op, SYMBOL) => operator(kernel(name op)$K)
(n := arity op) case "failed" => operator name op
operator(name op, n::NonNegativeInteger)
reduc(x, l) ==
for k in l repeat
p := minPoly k
x := evl(numer x, k, p) /$Rep evl(denom x, k, p) x evl0(p, k) == numer univariate(p::Fraction(MP), k)$PolynomialCategoryQuotientFunctions(IndexedExponents K,
K, R, MP, Fraction MP)
-- uses some operations from Rep instead of % in order not to
-- reduce recursively during those operations.
evl(p, k, m) ==
degree(p, k) < degree m => p::Fraction(MP)
(((evl0(p, k) pretend SparseUnivariatePolynomial(%)) rem m)
pretend SparseUnivariatePolynomial Fraction MP)
(k::MP::Fraction(MP))
if R has GcdDomain then
noalg? : SUP % -> Boolean                noalg? p ==
while p ~= 0 repeat
not empty? algkernels kernels leadingCoefficient p =>
return false
p := reductum p
true
gcdPolynomial(p : SUP %, q : SUP %) ==
noalg? p and noalg? q => gcdPolynomial(p, q)$Rep gcdPolynomial(p, q)$GcdDomain_&(%)
factorPolynomial(x : SUP %) : Factored SUP % ==
uf := factor(x pretend SUP(Rep))$SupFractionFactorizer( IndexedExponents K, K, R, MP) uf pretend Factored SUP % squareFreePolynomial(x : SUP %) : Factored SUP % == uf := squareFree(x pretend SUP(Rep))$SupFractionFactorizer(
IndexedExponents K, K, R, MP)
uf pretend Factored SUP %

if (R has RetractableTo Integer) then
x : % ^ r : Q                  == x ^$AF r minPoly k == minPoly(k)$AF
definingPolynomial x       == definingPolynomial(x)$AF retract(x : %) : Q == retract(x)$Rep
retractIfCan(x : %) : Union(Q, "failed") == retractIfCan(x)$Rep if not(R is AN) then k2expr : KAN -> % smp2expr : SparseMultivariatePolynomial(Integer, KAN) -> % R2AN : R -> Union(AN, "failed") k2an : K -> Union(AN, "failed") smp2an : MP -> Union(AN, "failed") coerce(x : AN) : % == smp2expr(numer x) / smp2expr(denom x) k2expr k == map(x +-> x::%, k)$ExpressionSpaceFunctions2(AN, %)
smp2expr p ==
map(k2expr, x +-> x::%, p
)$PolynomialCategoryLifting(IndexedExponents KAN, KAN, Integer, SparseMultivariatePolynomial( Integer, KAN), %) retractIfCan(x : %) : Union(AN, "failed") == ((n := smp2an numer x) case AN) and ((d := smp2an denom x) case AN) => (n::AN) / (d::AN) "failed" R2AN r == (u := retractIfCan(r::%)@Union(Q, "failed")) case Q => u::Q::AN "failed" k2an k == not(belong?(op := operator k)$AN) => "failed"
is?(op, 'rootOf) =>
args := argument(k)
a2 := args.2
k1u := retractIfCan(a2)@Union(K, "failed")
k1u case "failed" => "failed"
k1 := k1u::K
s1u := retractIfCan(a2)@Union(Symbol, "failed")
s1u case "failed" => "failed"
s1 := s1u::Symbol
a1 := args.1
denom(a1) ~= 1 =>
eq := univariate(numer(a1), k1)
eqa : SUP(AN) := 0
while eq ~= 0 repeat
ccu := retractIfCan(cc)@Union(AN, "failed")
ccu case "failed" => return "failed"
eqa := eqa + monomial(ccu::AN, degree eq)
eq := reductum eq
rootOf(eqa, s1)$AN arg : List(AN) := empty() for x in argument k repeat if (a := retractIfCan(x)@Union(AN, "failed")) case "failed" then return "failed" else arg := concat(a::AN, arg) (operator(op)$AN) reverse!(arg)
smp2an p ==
(x1 := mainVariable p) case "failed" =>
up := univariate(p, k := x1::K)
(t  := k2an k) case "failed" => "failed"
ans : AN := 0
while not ground? up repeat
case "failed" => return "failed"
ans := ans + (c::AN) * (t::AN) ^ (degree up)
up  := reductum up
case "failed" => "failed"
ans + c::AN

if R has ConvertibleTo InputForm then
convert(x : %) : InputForm == convert(x)$Rep import from MakeUnaryCompiledFunction(%, %, %) eval(f : %, op : BasicOperator, g : %, x : Symbol) : % == eval(f, [op], [g], x) eval(f : %, ls : List BasicOperator, lg : List %, x : Symbol) == -- handle subscripted symbols by renaming -> eval -- -> renaming back llsym : List List Symbol := [variables g for g in lg] lsym : List Symbol := removeDuplicates concat llsym lsd : List Symbol := select (scripted?, lsym) empty? lsd => eval(f, ls, [compiledFunction(g, x) for g in lg]) ns : List Symbol := [new()$Symbol for i in lsd]
lforwardSubs : List Equation % :=
[(i::%)= (j::%) for i in lsd for j in ns]
lbackwardSubs : List Equation % :=
[(j::%)= (i::%) for i in lsd for j in ns]
nlg : List % := [subst(g, lforwardSubs) for g in lg]
res : % :=
eval(f, ls, [compiledFunction(g, x) for g in nlg])
subst(res, lbackwardSubs)
if R has PatternMatchable Integer then
patternMatch(x : %, p : Pattern Integer,
l : PatternMatchResult(Integer, %)) ==
patternMatch(x, p,
l)$PatternMatchFunctionSpace(Integer, R, %) )abbrev domain RSPACE RealSpace ++ Author: kfp ++ Date Created: Thu Nov 06 03:51:56 CET 2014 ++ License: BSD (same as Axiom) ++ Date Last Updated: ++ Basic Operations: ++ Related Domains: ++ Also See: ++ AMS Classifications: ++ Keywords: ++ Examples: ++ References: ++ ++ Description: ++ ++ RealSpace(n) : Exports == Implementation where NNI ==> NonNegativeInteger PI ==> PositiveInteger I ==> Integer R ==> Real n:NNI Exports == Join(CoercibleTo OutputForm, ConvertibleTo String) with coerce : % -> OutputForm coerce : List R -> % coerce : R -> % dot : (%,%) -> R dim : % -> NNI "+" : (%,%) -> % "-" : (%,%) -> % "" : (R,%) -> % "" : (NNI,%) -> % "" : (PI,%) -> % "" : (I,%) -> % "/" : (%,R) -> % "#" : % -> NNI "-" : % -> % "=" : (%,%) -> Boolean "~=": (%,%) -> Boolean unitVector : PI -> % elt : (%,I) -> R eval: (%, Equation R) -> % eval: (%, List Equation R) -> % every?: (R -> Boolean, %) -> Boolean map: (R -> R, %) -> % -- strange, to check member?: (R, %) -> Boolean any?: (R -> Boolean, %) -> Boolean copy: % -> % D: (%, Symbol) -> % D: (%, Symbol, NonNegativeInteger) -> % D: (%, List Symbol) -> % D: (%, List Symbol, List NonNegativeInteger) -> % dist : (%,%) -> R Implementation == DirectProduct(n,R) add Rep := DirectProduct(n,R) coerce(l:List R):% == #l=n => directProduct((vector l)::Vector(R))$Rep
coerce(x:R):% == x*unitVector(1)$Rep if n=1 then coerce(x:%):OutputForm == elt(x,1)::OutputForm dim(x:%):NNI == n dist(x:%,y:%):R == sqrt dot(x-y,x-y) \end{spad} \begin{axiom} P:=[x,y,z::RR]::RealSpace(3) Q:=[u,v,w::RR]::RealSpace(3) \end{axiom} \begin{axiom} s:=s::RR t:=t::RR \end{axiom} \begin{axiom} P+Q P-Q -P dot(P,Q) dist(P,Q) tP+sQ unitVector(1)$RSPACE(3)
P.1
Q.2
\end{axiom}
Functions
\begin{axiom}
f:Real -> Real
f(t) == t^2*sin(t)
X:Real -> RealSpace(4)
X(t) == [f(t),f(2*t),t^2,cos(t::RR)]::RealSpace(4)
X(t) -- curve in R^4
D(X(t),'t)
D(X(t),'t,2)
eval(X(t),t=1)
Z:RealSpace(2)->RealSpace(3)
z:=[x,y::RR]::RSPACE(2)
Z(q) == [q.1^2,exp(-q.1*q.2),(q.1+q.2)^n]
Z(z)
D(Z(z),['x,'y])
D(Z(z),['x,'y],[2,3])
D(Z(z),'x,3)
\end{axiom}
\begin{axiom}
limit(1/n^2::RR,n=%plusInfinity)
limit(X(t).4,'t=0)
\end{axiom}
\begin{axiom}
integrate((sin(y::RR))^2,y)
integrate(sin(s)^2,'s)
integrate(dist(X(u),X(v)),u)
\end{axiom}
-- continue with PROP domain

Some or all expressions may not have rendered properly,
because Axiom returned the following error:Error: export FRICAS=/usr/local/lib/fricas/target/x86_64-unknown-linux; export ALDORROOT=/usr/local/aldor/linux/1.1.0; export PATH=$ALDORROOT/bin:$PATH; export HOME=/var/zope2/var/LatexWiki; ulimit -t 600; export LD_LIBRARY_PATH=/usr/local/lib/fricas/target/x86_64-unknown-linux/lib; LANG=en_US.UTF-8 $FRICAS/bin/FRICASsys < /var/lib/zope2.10/instance/axiom-wiki/var/LatexWiki/5506941156876877809-25px.axm /bin/sh: /usr/local/lib/fricas/target/x86_64-unknown-linux/bin/FRICASsys: not found  Some or all expressions may not have rendered properly, because Latex returned the following error: ! Missing$ inserted.
<inserted text>
l.145 ESD ==> ExpressionSpace_ &(%) (/usr/share/texmf-texlive/tex/latex/jknapltx/ursfs.fd) (/usr/share/texmf-texlive/tex/latex/amsfonts/umsa.fd) (/usr/share/texmf-texlive/tex/latex/amsfonts/umsb.fd) (/usr/share/texmf-texlive/tex/latex/base/ulasy.fd) Missing { inserted. <to be read again> & l.145 ESD ==> ExpressionSpace_& (%) Misplaced alignment tab character &. <recently read> & l.145 ESD ==> ExpressionSpace_& (%) Missing { inserted. <to be read again> & l.146 FSD ==> FunctionSpace_& (%, R) Misplaced alignment tab character &. <recently read> & l.146 FSD ==> FunctionSpace_& (%, R) Missing inserted.
<inserted text>
$l.149 Missing } inserted. <inserted text> } l.149 Missing } inserted. <inserted text> } l.149 Undefined control sequence. l.163 ++ simplifyPower(f, n) \undocumented {} Undefined control sequence. l.166 ... ++ factorPolynomial(p) \undocumented {} Undefined control sequence. l.168 ... ++ squareFreePolynomial(p) \undocumented {} Missing$ inserted.
<inserted text>
$l.202 poly_ to_MP(p : Polynomial(R)) : MP == Missing$ inserted.
<inserted text>
$l.206 remap_ variables(ps, vl1, vl2)$SPCH

Overfull \hbox (6.98257pt too wide) in paragraph at lines 201--207
[]\T1/cmr/m/n/12 if R has Ring then poly$[]\OML/cmm/m/it/12 o[]P\OT1/cmr/m/n/12 (\OML/cmm/m/it/12 p \OT1/cmr/m/n/12 : \OML/cmm/m/it/12 Polynomial\OT1/cmr/m/n/ 12 (\OML/cmm/m/it/12 R\OT1/cmr/m/n/12 )) : \OML/cmm/m/it/12 MP \OT1/cmr/m/n/12 == \OML/cmm/m/it/12 ps \OT1/cmr/m/n/12 := \OML/cmm/m/it/12 ppretendSparseMultiv ariatePolynomial\OT1/cmr/m/n/12 (\OML/cmm/m/it/12 R; Symbol\OT1/cmr/m/n/12 )\OM L/cmm/m/it/12 vl\OT1/cmr/m/n/12 1 : \OML/cmm/m/it/12 ListSymbol \OT1/cmr/m/n/12 := Missing$ inserted.
<inserted text>
$l.231 You can't use macro parameter character #' in horizontal mode. l.244 not(# args = 2) => error "Too many arguments to ^" Missing$ inserted.
<inserted text>
$l.244 ...gs = 2) => error "Too many arguments to ^ " Missing { inserted. <to be read again>$
l.246                        reduc((args.1) ^$Rep n, Missing } inserted. <inserted text> } l.246 reduc((args.1) ^$
Rep n,
Missing $inserted. <inserted text>$
l.247 ...                       algtower(args.1))^
(args.2)
Missing { inserted.
$l.249 reduc(x ^$
Rep n, algtower(x))
Missing } inserted.
<inserted text>
}
l.249                 reduc(x ^$Rep n, algtower(x)) Missing$ inserted.
<inserted text>
$l.256 Missing$ inserted.
<inserted text>
$l.262 Missing$ inserted.
<inserted text>
$l.278 en := poly_ to_MP(p) [1] Missing$ inserted.
<inserted text>
$l.282 en := poly_ to_MP(numer(pq)) Missing$ inserted.
<inserted text>
$l.291 Missing$ inserted.
<inserted text>
$l.292 alg_ ker_set(x : %) : List(K) == Missing$ inserted.
<inserted text>
$l.318 simple_ root(r : K) : Boolean == You can't use macro parameter character #' in math mode. l.323 # algkernels(kernels(a)) > 0 => false Missing$ inserted.
<inserted text>
$l.326 Missing$ inserted.
<inserted text>
$l.327 root_ reduce(x : %, r : K) : % == Missing$ inserted.
<inserted text>
$l.338 Overfull \hbox (37.94356pt too wide) in paragraph at lines 327--338 []\T1/cmr/m/n/12 root$[]\OML/cmm/m/it/12 educe\OT1/cmr/m/n/12 (\OML/cmm/m/it/12
x \OT1/cmr/m/n/12 : \OML/cmm/m/it/12 a \OT1/cmr/m/n/12 := \OML/cmm/m/it/12 arg
ument\OT1/cmr/m/n/12 (\OML/cmm/m/it/12 r\OT1/cmr/m/n/12 )\OML/cmm/m/it/12 :\OT1
/cmr/m/n/12 1\OML/cmm/m/it/12 an \OT1/cmr/m/n/12 := \OML/cmm/m/it/12 numer\OT1/
cmr/m/n/12 (\OML/cmm/m/it/12 a\OT1/cmr/m/n/12 )\OML/cmm/m/it/12 dn \OT1/cmr/m/n
/12 := \OML/cmm/m/it/12 denom\OT1/cmr/m/n/12 (\OML/cmm/m/it/12 a\OT1/cmr/m/n/12
)\OML/cmm/m/it/12 dp \OT1/cmr/m/n/12 := \OML/cmm/m/it/12 univariate\OT1/cmr/m/
n/12 (\OML/cmm/m/it/12 denomx; r\OT1/cmr/m/n/12 )\OML/cmm/m/it/12 n\OT1/cmr/m/n
/12 0 := \OML/cmm/m/it/12 numerxc\OT1/cmr/m/n/12 1 := \OML/cmm/m/it/12 leadingC
oefficient\OT1/cmr/m/n/12 (\OML/cmm/m/it/12 dp\OT1/cmr/m/n/12 )\OML/cmm/m/it/12
c\OT1/cmr/m/n/12 0 :=
Missing $inserted. <inserted text>$
l.339             DEFVAR(algreduc_
flag$Lisp, false$Boolean)$Lisp Missing$ inserted.
<inserted text>
$l.342 algreduc_ flag$Lisp
Missing $inserted. <inserted text>$
l.346                 SETF(algreduc_
flag$Lisp, x)$Lisp
Missing $inserted. <inserted text>$
l.348  You can't use macro parameter character #' in horizontal mode.
l.353                 #
akl = 0 => x1
You can't use macro parameter character #' in horizontal mode.
l.354                 if #
akl = 1 then
Missing $inserted. <inserted text>$
l.356                     simple_
root(r) =>
Missing $inserted. <inserted text>$
l.365
Missing $inserted. <inserted text>$
l.368
Missing $inserted. <inserted text>$
l.389

Overfull \hbox (59.74031pt too wide) in paragraph at lines 383--389
[]\T1/cmr/m/n/12 -- The re-sult MUST be left sorted deep-est first MB 3/90 com-
monk0(x, y) == ans := empty()$\OML/cmm/m/it/12 List\OT1/cmr/m/n/12 (\OML/cmm/m/ it/12 K\OT1/cmr/m/n/12 )\OML/cmm/m/it/12 forkinreverse\OT1/cmr/m/n/12 !\OML/cmm /m/it/12 xrepeatifmember\OT1/cmr/m/n/12 ?(\OML/cmm/m/it/12 k; y\OT1/cmr/m/n/12 )\OML/cmm/m/it/12 thenans \OT1/cmr/m/n/12 := Missing$ inserted.
<inserted text>
$l.421 Overfull \hbox (20.28061pt too wide) in paragraph at lines 422--478 \T1/cmr/m/n/12 veL(v, z)$\OML/cmm/m/it/12 FSFhankelH\OT1/cmr/m/n/12 1(\OML/cmm/
m/it/12 v; z\OT1/cmr/m/n/12 ) == \OML/cmm/m/it/12 hankelH\OT1/cmr/m/n/12 1(\OML
/cmm/m/it/12 v; z\OT1/cmr/m/n/12 )$\T1/cmr/m/n/12 FSF han-kelH2(v, z) == han-ke lH2(v, z)$\OML/cmm/m/it/12 FSFlommelS\OT1/cmr/m/n/12 1(\OML/cmm/m/it/12 mu; nu;
z\OT1/cmr/m/n/12 ) == \OML/cmm/m/it/12 lommelS\OT1/cmr/m/n/12 1(\OML/cmm/m/it/
12 mu; nu; z\OT1/cmr/m/n/12 )$\T1/cmr/m/n/12 FSF Overfull \hbox (21.35368pt too wide) in paragraph at lines 422--478 \T1/cmr/m/n/12 merU(mu, nu, z)$\OML/cmm/m/it/12 FSFlegendreP\OT1/cmr/m/n/12 (\O
ML/cmm/m/it/12 nu; mu; z\OT1/cmr/m/n/12 ) == \OML/cmm/m/it/12 legendreP\OT1/cmr
/m/n/12 (\OML/cmm/m/it/12 nu; mu; z\OT1/cmr/m/n/12 )$\T1/cmr/m/n/12 FSF leg-en- dreQ(nu, mu, z) == leg-en-dreQ(nu, mu, z)$\OML/cmm/m/it/12 FSFkelvinBei\OT1/cmr
/m/n/12 (\OML/cmm/m/it/12 v; z\OT1/cmr/m/n/12 ) ==
Overfull \hbox (78.9594pt too wide) in paragraph at lines 422--478
\OML/cmm/m/it/12 kelvinBei\OT1/cmr/m/n/12 (\OML/cmm/m/it/12 v; z\OT1/cmr/m/n/12
)$\T1/cmr/m/n/12 FSF kelv-in-Ber(v, z) == kelv-in-Ber(v, z)$\OML/cmm/m/it/12 F
SFkelvinKei\OT1/cmr/m/n/12 (\OML/cmm/m/it/12 v; z\OT1/cmr/m/n/12 ) == \OML/cmm/
m/it/12 kelvinKei\OT1/cmr/m/n/12 (\OML/cmm/m/it/12 v; z\OT1/cmr/m/n/12 )$\T1/cm r/m/n/12 FSF kelvinKer(v, z) == kelvinKer(v, z)$\OML/cmm/m/it/12 FSFellipticK\O
T1/cmr/m/n/12 (\OML/cmm/m/it/12 m\OT1/cmr/m/n/12 ) ==
Overfull \hbox (52.0066pt too wide) in paragraph at lines 422--478
\OML/cmm/m/it/12 ellipticK\OT1/cmr/m/n/12 (\OML/cmm/m/it/12 m\OT1/cmr/m/n/12 )$\T1/cmr/m/n/12 FSF el-lip-ticE(m) == ellipticE(m)$\OML/cmm/m/it/12 FSFellipticE
\OT1/cmr/m/n/12 (\OML/cmm/m/it/12 z; m\OT1/cmr/m/n/12 ) == \OML/cmm/m/it/12 ell
ipticE\OT1/cmr/m/n/12 (\OML/cmm/m/it/12 z; m\OT1/cmr/m/n/12 )$\T1/cmr/m/n/12 FS F el-lip-ticF(z, m) == el-lip-ticF(z, m)$\OML/cmm/m/it/12 FSFellipticPi\OT1/cmr
/m/n/12 (\OML/cmm/m/it/12 z; n; m\OT1/cmr/m/n/12 ) ==
Overfull \hbox (108.13228pt too wide) in paragraph at lines 422--478
\OML/cmm/m/it/12 ellipticPi\OT1/cmr/m/n/12 (\OML/cmm/m/it/12 z; n; m\OT1/cmr/m/
n/12 )$\T1/cmr/m/n/12 FSF ja-co-biSn(z, m) == ja-co-biSn(z, m)$\OML/cmm/m/it/12
FSFjacobiCn\OT1/cmr/m/n/12 (\OML/cmm/m/it/12 z; m\OT1/cmr/m/n/12 ) == \OML/cmm
/m/it/12 jacobiCn\OT1/cmr/m/n/12 (\OML/cmm/m/it/12 z; m\OT1/cmr/m/n/12 )$\T1/cm r/m/n/12 FSF ja-co-biDn(z, m) == ja-co-biDn(z, m)$\OML/cmm/m/it/12 FSFjacobiZet
a\OT1/cmr/m/n/12 (\OML/cmm/m/it/12 z; m\OT1/cmr/m/n/12 ) ==
Overfull \hbox (151.32904pt too wide) in paragraph at lines 422--478
\OML/cmm/m/it/12 jacobiZeta\OT1/cmr/m/n/12 (\OML/cmm/m/it/12 z; m\OT1/cmr/m/n/1
2 )$\T1/cmr/m/n/12 FSF ja-co-bi-Theta(q, z) == ja-co-bi-Theta(q, z)$\OML/cmm/m/
it/12 FSFlerchPhi\OT1/cmr/m/n/12 (\OML/cmm/m/it/12 z; s; a\OT1/cmr/m/n/12 ) ==
\OML/cmm/m/it/12 lerchPhi\OT1/cmr/m/n/12 (\OML/cmm/m/it/12 z; s; a\OT1/cmr/m/n/
12 )$\T1/cmr/m/n/12 FSF rie-mannZeta(z) == riemannZeta(z)$\OML/cmm/m/it/12 FSFc
harlierC\OT1/cmr/m/n/12 (\OML/cmm/m/it/12 n; a; z\OT1/cmr/m/n/12 ) ==
[2]
Missing $inserted. <inserted text>$
l.493  Missing $inserted. <inserted text>$
l.507

Overfull \hbox (0.50365pt too wide) in paragraph at lines 494--507
[]\T1/cmr/m/n/12 erf x == erf(x)$\OML/cmm/m/it/12 LFerfix \OT1/cmr/m/n/12 == \O ML/cmm/m/it/12 erfi\OT1/cmr/m/n/12 (\OML/cmm/m/it/12 x\OT1/cmr/m/n/12 )$\T1/cmr
/m/n/12 LF Ei x == Ei(x)$\OML/cmm/m/it/12 LFSix \OT1/cmr/m/n/12 == \OML/cmm/m/i t/12 Si\OT1/cmr/m/n/12 (\OML/cmm/m/it/12 x\OT1/cmr/m/n/12 )$\T1/cmr/m/n/12 LF C
i x == Ci(x)$\OML/cmm/m/it/12 LFShix \OT1/cmr/m/n/12 == \OML/cmm/m/it/12 Shi\OT 1/cmr/m/n/12 (\OML/cmm/m/it/12 x\OT1/cmr/m/n/12 )$\T1/cmr/m/n/12 LF Chi x == Ch
i(x)$\OML/cmm/m/it/12 LFlix \OT1/cmr/m/n/12 == Missing$ inserted.
<inserted text>
$l.519 Overfull \hbox (39.51459pt too wide) in paragraph at lines 508--519 []\T1/cmr/m/n/12 operator op == belong?(op)$\OML/cmm/m/it/12 AF \OT1/cmr/m/n/12
=\OML/cmm/m/it/12 > operator\OT1/cmr/m/n/12 (\OML/cmm/m/it/12 op\OT1/cmr/m/n/1
2 )$\T1/cmr/m/n/12 AF belong?(op)$\OML/cmm/m/it/12 EF \OT1/cmr/m/n/12 =\OML/cmm
/m/it/12 > operator\OT1/cmr/m/n/12 (\OML/cmm/m/it/12 op\OT1/cmr/m/n/12 )$\T1/cm r/m/n/12 EF belong?(op)$\OML/cmm/m/it/12 CF \OT1/cmr/m/n/12 =\OML/cmm/m/it/12 >
operator\OT1/cmr/m/n/12 (\OML/cmm/m/it/12 op\OT1/cmr/m/n/12 )$\T1/cmr/m/n/12 C F belong?(op)$\OML/cmm/m/it/12 LF \OT1/cmr/m/n/12 =\OML/cmm/m/it/12 >
Missing $inserted. <inserted text>$
l.525  Missing $inserted. <inserted text>$
l.530

Overfull \hbox (17.95305pt too wide) in paragraph at lines 526--530
[]\T1/cmr/m/n/12 evl0(p, k) == nu-mer uni-vari-ate(p::Fraction(MP), k)$\OML/cmm /m/it/12 PolynomialCategoryQuotientFunctions\OT1/cmr/m/n/12 (\OML/cmm/m/it/12 I ndexedExponentsK; K; R; MP; FractionMP\OT1/cmr/m/n/12 )$
Missing $inserted. <inserted text>$
l.551 ...           gcdPolynomial(p, q)$GcdDomain_ &(%) Missing { inserted. <to be read again> & l.551 ... gcdPolynomial(p, q)$GcdDomain_&
(%)
Misplaced alignment tab character &.
l.551 ...          gcdPolynomial(p, q)$GcdDomain_& (%) Missing$ inserted.
<inserted text>
$l.552 Missing } inserted. <inserted text> } l.552 Missing$ inserted.
<inserted text>
$l.557 Overfull \hbox (27.33372pt too wide) in paragraph at lines 553--557 []\T1/cmr/m/n/12 factorPolynomial(x : SUP uf := fac-tor(x pre-tend SUP(Rep))$\O
ML/cmm/m/it/12 SupFractionFactorizer\OT1/cmr/m/n/12 (\OML/cmm/m/it/12 IndexedEx
ponentsK; K; R; MP\OT1/cmr/m/n/12 )\OML/cmm/m/it/12 ufpretendFactoredSUP$Missing$ inserted.
<inserted text>
$l.562 Overfull \hbox (77.38542pt too wide) in paragraph at lines 558--562 []\T1/cmr/m/n/12 squareFreePolynomial(x : SUP uf := square-Free(x pre-tend SUP( Rep))$\OML/cmm/m/it/12 SupFractionFactorizer\OT1/cmr/m/n/12 (\OML/cmm/m/it/12 I
ndexedExponentsK; K; R; MP\OT1/cmr/m/n/12 )\OML/cmm/m/it/12 ufpretendFactoredSU
P$Missing$ inserted.
<inserted text>
$l.587 Overfull \hbox (119.38678pt too wide) in paragraph at lines 582--587 []\T1/cmr/m/n/12 smp2expr p == map(k2expr, x +-> x::)$\OML/cmm/m/it/12 Polynomi
alCategoryLifting\OT1/cmr/m/n/12 (\OML/cmm/m/it/12 IndexedExponentsKAN; KAN; In
teger; SparseMultivariatePolynomial\OT1/cmr/m/n/12 (\OML/cmm/m/it/12 Integer; K
AN\OT1/cmr/m/n/12 )\OML/cmm/m/it/12 ;$Missing$ inserted.
<inserted text>
$l.629 Overfull \hbox (226.2014pt too wide) in paragraph at lines 599--629 []\T1/cmr/m/n/12 k2an k == not(belong?(op := op-er-a-tor k)$\OML/cmm/m/it/12 AN
\OT1/cmr/m/n/12 ) =\OML/cmm/m/it/12 > \OT1/cmr/m/n/12 "\OML/cmm/m/it/12 failed\
OT1/cmr/m/n/12 "\OML/cmm/m/it/12 is\OT1/cmr/m/n/12 ?