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

Edit detail for TypeTowerDemo revision 2 of 5

1 2 3 4 5
Editor: hemmecke
Time: 2008/08/18 12:06:24 GMT-7
Note:

changed:
-unfortunately not an integral domain. So Axiom simply stops by telling you that
unfortunately not a field (not even an integral domain), so we cannot simply
apply Euclid's algorithm. Axiom simply stops by telling you that

This page demonstrates some features of Axiom.

Let's begin with the construction of a polynomial ring LatexWiki Image in the indeterminate LatexWiki Image with coefficients from the ring LatexWiki Image of square matrices with entries that are polynomials LatexWiki Image where LatexWiki Image is the Galois field with 3 elements.

axiom
F:= PrimeField 3
LatexWiki Image(1)
Type: Domain
axiom
P:=UnivariatePolynomial(x, F)
LatexWiki Image(2)
Type: Domain
axiom
S := SquareMatrix(2, P)
LatexWiki Image(3)
Type: Domain
axiom
R := UnivariatePolynomial(z, S)
LatexWiki Image(4)
Type: Domain

OK, now we have the type LatexWiki Image. Let's construct an element. We start with constructing some coefficients first.

axiom
s1:S := matrix[[2*x +1 ,x^2-1],[0,x-1]]
LatexWiki Image(5)
Type: SquareMatrix?(2,UnivariatePolynomial?(x,PrimeField? 3))
axiom
s2 := transpose s1
LatexWiki Image(6)
Type: SquareMatrix?(2,UnivariatePolynomial?(x,PrimeField? 3))

And now we build the polynomial.

axiom
r: R := z^2 + s1*z + s2
LatexWiki Image(7)
Type: UnivariatePolynomial?(z,SquareMatrix?(2,UnivariatePolynomial?(x,PrimeField? 3)))

Of course, since we work in characteristic 3, the following sum must be zero.

axiom
r+ 2*r
LatexWiki Image(8)
Type: UnivariatePolynomial?(z,SquareMatrix?(2,UnivariatePolynomial?(x,PrimeField? 3)))

Note that this is not the integer 0, but it is still a polynomial of type LatexWiki Image.

Asking for the degree of LatexWiki Image is no problem, because LatexWiki Image is a univariate polynomial ring.

axiom
degree r
LatexWiki Image(9)
Type: PositiveInteger?

So let's see what happens if we multiply LatexWiki Image by itself.

axiom
r2 := r*r
LatexWiki Image(10)
Type: UnivariatePolynomial?(z,SquareMatrix?(2,UnivariatePolynomial?(x,PrimeField? 3)))

Well, of course there is a common factor of LatexWiki Image an LatexWiki Image. Can Axiom find it?

axiom
gcd(r2, r)
There are 4 exposed and 3 unexposed library operations named gcd having 2 argument(s) but none was determined to be applicable. Use HyperDoc Browse, or issue )display op gcd 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 gcd with argument type(s) UnivariatePolynomial(z,SquareMatrix(2,UnivariatePolynomial(x,PrimeField 3))) UnivariatePolynomial(z,SquareMatrix(2,UnivariatePolynomial(x,PrimeField 3)))
Perhaps you should use "@" to indicate the required return type, or "$" to specify which version of the function you need.

Ooops. What does that say?:

  Cannot find a definition or applicable library operation named gcd.

Ah, of course, the coefficient ring of LatexWiki Image is the matrix ring LatexWiki Image and this is unfortunately not a field (not even an integral domain), so we cannot simply apply Euclid's algorithm. Axiom simply stops by telling you that there is no applicaple operation.

Of course, Axiom can compute a gcd of univariate polynomials.

axiom
p1:=s1(1,1)
LatexWiki Image(11)
Type: UnivariatePolynomial?(x,PrimeField? 3)
axiom
p2:=s1(1,2)
LatexWiki Image(12)
Type: UnivariatePolynomial?(x,PrimeField? 3)
axiom
gcd(p1,p2)
LatexWiki Image(13)
Type: UnivariatePolynomial?(x,PrimeField? 3)

OK, let us do that again.

axiom
q1: UP(x, INT) := 2*x+1
LatexWiki Image(14)
Type: UnivariatePolynomial?(x,Integer)
axiom
q2: UP(x, INT) := x^2+2
LatexWiki Image(15)
Type: UnivariatePolynomial?(x,Integer)
axiom
gcd(q1,q2)
LatexWiki Image(16)
Type: UnivariatePolynomial?(x,Integer)

Nice! Depending on where I compute these polynomials either have a common factor or are coprime.

Well, all depends on the underlying ring, of course.