|
|
|
last edited 5 months ago by test1 |
| 1 2 3 4 5 6 7 8 9 10 11 12 13 | ||
|
Editor: Bill Page
Time: 2008/08/25 14:58:25 GMT-7 |
||
| Note: check axioms | ||
changed: -$$ \begin{equation} changed: -$$ -$$ \end{equation} \begin{equation} changed: -$$ -$$ \end{equation} \begin{equation} changed: -$$ \end{equation} added: Demonstrating the axioms (1) (2) and (3) of the tensor product: \begin{axiom} w:= 13*y^2+17*y+19 test( tensorPoly(p+q,w) = (tensorPoly(p,w) + tensorPoly(q,w)) ) test( tensorPoly(p,q+w) = (tensorPoly(p,q) + tensorPoly(p,w)) ) test( tensorPoly(p,23*w) = 23*tensorPoly(p,w) ) test( tensorPoly(23*p,w) = 23*tensorPoly(p,w) ) \end{axiom} I suppose that we could give an inductive proof that this implementation of the tensor product of polynomials is correct ... but for now lets take this demonstration as reassurance.
http://en.wikipedia.org/wiki/Tensor_product
A tensor product is "the most general bilinear operation" available in a specified domain of computation, satisfying:
| (1) |
| (2) |
| (3) |
We can use the domain constructor Sum [SandBoxSum]?
(1) -> )lib SUM
Sum is now explicitly exposed in frame initial Sum will be automatically loaded when needed from /var/aw/var/LatexWiki/SUM.NRLIB/SUM
First we can define some recursive operations on the polynomials
scanPoly(p,n) == _ (p=0 => 0; mapMonomial(leadingMonomial(p), n)+scanPoly(reductum p, n))
mapMonomial(p,n) == _ monomial(coefficient(p, degree p), scanIndex(degree(p), n))$SMP(Integer, Sum(Symbol, Symbol))
scanIndex(p,n) == _ (zero? p => 0$IndexedExponents(Sum(Symbol, Symbol)); _ monomial(leadingCoefficient(p), _ if n=1 then in1(leadingSupport(p))$Sum(Symbol, Symbol) _ else in2(leadingSupport(p))$Sum(Symbol, Symbol) _ )$IndexedExponents(Sum(Symbol, Symbol))+ _ scanIndex(reductum(p), n))
For example:
-- functions are first compiled here -- scanPoly(x,1)
There are 1 exposed and 3 unexposed library operations named leadingMonomial having 1 argument(s) but none was determined to be applicable. Use HyperDoc Browse,or issue )display op leadingMonomial to learn more about the available operations. Perhaps package-calling the operation or using coercions on the arguments will allow you to apply the operation. Cannot find a definition or applicable library operation named leadingMonomial with argument type(s) Variable(x)
Perhaps you should use "@" to indicate the required return type,or "$" to specify which version of the function you need. FriCAS will attempt to step through and interpret the code. There are 1 exposed and 3 unexposed library operations named leadingMonomial having 1 argument(s) but none was determined to be applicable. Use HyperDoc Browse, or issue )display op leadingMonomial to learn more about the available operations. Perhaps package-calling the operation or using coercions on the arguments will allow you to apply the operation.
Cannot find a definition or applicable library operation named leadingMonomial with argument type(s) Variable(x)
Perhaps you should use "@" to indicate the required return type,or "$" to specify which version of the function you need.
injects the polynomial x in to the tensor product. So
now the full tensor product is just:
tensorPoly(p,q) == _ scanPoly(p, 1)*scanPoly(q, 2)
For example:
p:=2*x^2+3
| (4) |
q:=5*x*y+7*y+11
| (5) |
r:=tensorPoly(p,q)
>> System error: The function BOOT::PUT is undefined.
Demonstrating the axioms (1) (2) and (3) of the tensor product:
w:= 13*y^2+17*y+19
| (6) |
test( tensorPoly(p+q,w) = (tensorPoly(p, w) + tensorPoly(q, w)) )
Compiling function tensorPoly with type (Polynomial(Integer),Polynomial(Integer)) -> NonNegativeInteger
>> System error: The function BOOT::|*2;scanPoly;1;initial| is undefined.
I suppose that we could give an inductive proof that this implementation of the tensor product of polynomials is correct ... but for now lets take this demonstration as reassurance.