Choose n items from a list. Returns list of size binomial(#a,n) of lists.
- The Main Result
fricas
sum(x)==reduce(+,x,0)
Type: Void
fricas
product(x)==reduce(*,x,1)
Type: Void
fricas
-- specify n
f(i,j) == sum [ product x for x in choose([r[q]::Expression Integer for q in 1..n|q~=j],n-i-1)]
Type: Void
fricas
groupPolyCoeff(i) == (-1)^(i+n+1)*reduce(+,[exp(r[j])/reduce(*,[r[j]-r[m] for m in 1..n | j~=m])*f(i,j) for j in 1..n])
Type: Void
- Polynomial of degree 2
fricas
n:=2
fricas
eq2_1:= m[X]=(x-r[1])*(x-r[2])
Type: Equation(Polynomial(Integer))
fricas
eq2_2:= exp(X)=g[0]*id+g[1]*X
Type: Equation(Expression(Integer))
fricas
eq2_3a:= g[0]=groupPolyCoeff(0)
fricas
Compiling function choose with type (List(Expression(Integer)),
Integer) -> List(List(Expression(Integer)))
fricas
Compiling function product with type List(Expression(Integer)) ->
Expression(Integer)
fricas
Compiling function sum with type List(Expression(Integer)) ->
Expression(Integer)
fricas
Compiling function f with type (NonNegativeInteger,PositiveInteger)
-> Expression(Integer)
fricas
Compiling function groupPolyCoeff with type NonNegativeInteger ->
Expression(Integer)
Type: Equation(Expression(Integer))
fricas
eq2_3b:= g[1]=groupPolyCoeff(1)
fricas
Compiling function f with type (PositiveInteger,PositiveInteger) ->
Expression(Integer)
fricas
Compiling function groupPolyCoeff with type PositiveInteger ->
Expression(Integer)
Type: Equation(Expression(Integer))
Example 2.1
fricas
eval(eq2_1,[r[2]=-r[1]])
Type: Equation(Polynomial(Integer))
fricas
eq2_4:= eval(eval(eq2_2,[eq2_3a,eq2_3b]),r[2]=-r[1])
Type: Equation(Expression(Integer))
fricas
htrigs rhs %
Type: Expression(Integer)
- Polynomial of degree 3
fricas
n:=3
fricas
eq3_1:= m[X]=(x-r[1])*(x-r[2])*(x-r[3])
Type: Equation(Polynomial(Integer))
fricas
eq3_2:= exp(X)=g[0]*id+g[1]*X+g[2]*X^2
Type: Equation(Expression(Integer))
fricas
eq3_3a:= g[0]=groupPolyCoeff(0)
Type: Equation(Expression(Integer))
fricas
eq3_3b:= g[1]=groupPolyCoeff(1)
Type: Equation(Expression(Integer))
fricas
eq3_3c:= g[2]=groupPolyCoeff(2)
Type: Equation(Expression(Integer))
Example 3.1
fricas
eval(eq3_1,[r[2]=-r[1],r[3]=0])
Type: Equation(Polynomial(Integer))
fricas
eq3_4:= eval(eval(eq3_2,[eq3_3a,eq3_3b,eq3_3c]),[r[2]=-r[1],r[3]=0])
Type: Equation(Expression(Integer))
fricas
htrigs rhs eq3_4
Type: Expression(Integer)
Comment 3.2 (Rescaled enomorphism)
fricas
eq3_6:= X' = sinh(r[1])/r[1]*X
Type: Equation(Expression(Integer))
fricas
eq3_7:= γ = cosh(r[1])
Type: Equation(Expression(Integer))
fricas
eq3_8:= exp(X) = id+X'+X'^2/(1+γ)
Type: Equation(Expression(Integer))
fricas
test(normalize(rhs eval(eq3_8,[eq3_6,eq3_7]) - rhs eq3_4)=0)
Type: Boolean
Exercise 3.3
fricas
eval(eq3_1,[r[3]=r[2]])
Type: Equation(Polynomial(Integer))
fricas
eq3_9a:=lhs eq3_3a = limit(rhs eq3_3a,r[3]=r[2])
Type: Equation(OrderedCompletion
?(Expression(Integer)))
fricas
(numer rhs eq3_9a)/factor(denom rhs eq3_9a)
Type: SparseMultivariatePolynomial
?(Fraction(Factored(SparseMultivariatePolynomial
?(Integer,
Kernel(Expression(Integer))))),
Kernel(Expression(Integer)))
fricas
eq3_9b:=lhs eq3_3b = limit(rhs eq3_3b,r[3]=r[2])
Type: Equation(OrderedCompletion
?(Expression(Integer)))
fricas
(numer rhs eq3_9b)/factor(denom rhs eq3_9b)
Type: SparseMultivariatePolynomial
?(Fraction(Factored(SparseMultivariatePolynomial
?(Integer,
Kernel(Expression(Integer))))),
Kernel(Expression(Integer)))
fricas
eq3_9c:=lhs eq3_3c = limit(rhs eq3_3c,r[3]=r[2])
Type: Equation(OrderedCompletion
?(Expression(Integer)))
fricas
(numer rhs eq3_9c)/factor(denom rhs eq3_9c)
Type: SparseMultivariatePolynomial
?(Fraction(Factored(SparseMultivariatePolynomial
?(Integer,
Kernel(Expression(Integer))))),
Kernel(Expression(Integer)))
- Polynomial of degree 4
fricas
n:=4
fricas
eq4_1:= m[X]=(x-r[1])*(x-r[2])*(x-r[3])*(x-r[4])
Type: Equation(Polynomial(Integer))
fricas
eq4_2:= g[0]=groupPolyCoeff(0)
Type: Equation(Expression(Integer))
fricas
eq4_3:= g[1]=groupPolyCoeff(1)
Type: Equation(Expression(Integer))
fricas
eq4_4:= g[2]=groupPolyCoeff(2)
Type: Equation(Expression(Integer))
fricas
eq4_5:= g[3]=groupPolyCoeff(3)
Type: Equation(Expression(Integer))
-
fricas
eq5_1:=eval(eq4_1,[r[3]=-r[1],r[4]=-r[2]])
Type: Equation(Polynomial(Integer))
Corollary 5.1
fricas
eq5_2:= exp(X)=g[0]*id+g[1]*X+g[2]*X^2+g[3]*X^3
Type: Equation(Expression(Integer))
fricas
eq5_3a:= eval(eq4_2,[r[3]=-r[1],r[4]=-r[2]])
Type: Equation(Expression(Integer))
fricas
htrigs rhs %
Type: Expression(Integer)
fricas
eq5_3b:= eval(eq4_3,[r[3]=-r[1],r[4]=-r[2]])
Type: Equation(Expression(Integer))
fricas
htrigs rhs %
Type: Expression(Integer)
fricas
eq5_3c:= eval(eq4_4,[r[3]=-r[1],r[4]=-r[2]])
Type: Equation(Expression(Integer))
fricas
htrigs rhs %
Type: Expression(Integer)
fricas
eq5_3d:= eval(eq4_5,[r[3]=-r[1],r[4]=-r[2]])
Type: Equation(Expression(Integer))
fricas
htrigs rhs %
Type: Expression(Integer)
fricas
eq5_4:= eval(eval(eq5_2,[eq4_2,eq4_3,eq4_4,eq4_5]),[r[3]=-r[1],r[4]=-r[2]])
Type: Equation(Expression(Integer))
fricas
htrigs rhs %
Type: Expression(Integer)
Definition 5.2
fricas
eq5_5a:= Y[1] = 1/(2*r[1]^2-r[1]^2-r[2]^2)*(X^3-(r[1]^2+r[2]^2-r[1]^2)*X)
Type: Equation(Fraction(Polynomial(Integer)))
fricas
eq5_5b:= Y[2] = 1/(2*r[2]^2-r[1]^2-r[2]^2)*(X^3-(r[1]^2+r[2]^2-r[2]^2)*X)
Type: Equation(Fraction(Polynomial(Integer)))
Exercise 5.3
fricas
eq5_6a:= X = Y[1]+Y[2]
Type: Equation(Polynomial(Integer))
fricas
test(eval(eq5_6a,[eq5_5a,eq5_5b]))
Type: Boolean
fricas
eq5_6b:= eval(Y[1]*Y[2]=0,[eq5_5a,eq5_5b])
Type: Equation(Expression(Integer))
fricas
X^4 = X^4-eval(rhs eq5_1,x=X)
Type: Equation(Polynomial(Integer))
fricas
test(_rule(X^2*(lhs %),X^2*(rhs %))(lhs eq5_6b)=rhs eq5_6b)
Type: Boolean
Comment 5.4 (Rescaling)
fricas
eq5_7:= sinh(r[1])/r[1]*Y[1]+sinh(r[2])/r[2]*Y[2]
Type: Expression(Integer)
fricas
eq5_8a:= [ Y'[1]=sinh(r[1])/r[1]*Y[1], Y'[2]=sinh(r[2])/r[2]*Y[2] ]
Type: List(Equation(Expression(Integer)))
fricas
eq5_8b:= [ γ[1] = cosh(r[1]), γ[2] = cosh(r[2]) ]
Type: List(Equation(Expression(Integer)))
fricas
eq5_9:= exp(X) = exp(Y[1])*exp(Y[2])
Type: Equation(Expression(Integer))
fricas
eval(eq5_9,[eq5_5a,eq5_5b])
Type: Equation(Expression(Integer))
fricas
test(lhs % = simplify expand rhs %)
Type: Boolean