$SPAD/src/input examples.input

Timothy Daly December 3, 2016

Abstract

Contents

2

— * —

)set break resume
)sys rm -f examples.output
)spool examples.output
)set message auto off
)clear all

———-

1 Big Floats

Big Float numbers give extra precision when integer arithmetic is not indicated, yet single or double precision is not enough.

— * —

(a,b,c,d,e,p):BigFloat
precisions 20
p:=pi()

———-

It is rumored that

e^{π∗sqrt163}

is an integer.

— * —

d:=sqrt(163)
exp(p*d)
precision 60
p:-pi()
d:=sqrt(163)
exp(p*d)
a:=sin(p/4)
a*a
b:=cos(p/4)
c:=cos(p/12)
16*c^4 - 16*c^2 + 1
precision 1000
pi()

———-

2 Matrix Computations

The following is a simple demonstration of matrix handling in the system. We first of all declare a matrix whose entries are polynomials in a..d. This is small and prints neatly. As we play with it, it grows until it can no longer be printed “naturally”, whereupon the system switches to an “item-at-a-time” printing.

— * —

(m1,m2,m3): SM(2,MP([a,b,c,d],1))
m1:=[[a,b],[c,d]]
m2:=(m1+1)^2
m3:=(m2+1)^2

———-

We can also construct polynomials with matrix coefficients. Here again the printing is either “whole matrix” or “item-at-a-time” depending on the size of each individual matrix.

— * —

(p1,p2,p3):UP(x,SM(2,MP([a,b,c,d],1)))
p1:=x*m1+m2
p2:=p1*m1
p3:=x*m1+m1
p3^2
p3^3
p3^4
p3:=x*m1 + transpose m1

———-

Notice in the following that the coefficient of x is not divisible by 2. There is no reason why it should be, since polynomials over a matrix domain are not commutative, and the binomial theorem does not apply. The system in fact applies the binomial theorem to exponentiate when the coefficients are commutative but not otherwise.

— * —

p3^2

———-

We can also have matrices of matrices. Not how output may have to be nested. — * —

(mm1,mm2):SM(2,(SM(2,MP([a,b,c,d],1))))
mm1:=[[m1,m1],[m1,m1]]
mm2:=[[m1,transpose m1],[m1,-m1]]
mm2^2
mm2^3

———-

3 Integer Factorization

This is a demonstration of the factoring of values of cyclotomic polynomials which are irreducible and therefore have values wich are relatively hard to factor

— * —

factor(3^17-1)
factor(3^23-1)
factor(3^31-1)
factor(3^41-1)
factor(3^53-1)
factor(3^67-1)
factor(111111111111111111111111)
factor(11111111111111111111111111111111111111111111111)

———-

4 Polynomial Factorization

Axiom offers extensive polynomial factoring facilities. The following examples display some factorizations of univariate polynomials over finite fields and multivariate polynomials over the integers.

We begin with Univariate Polynomials in x over GaloisField 2 — * —

u2:P[x]GF(2)
u2:=x^51+1
factor u2
u2:=x^73+1
factor u2

———-

Now we have Univariate Polynomials in x over GaloisField 5 — * —

u5:P[x]GF5
u5:=x^51+1
factor u5

———-

Now we look at Multivariate Polynomials in (x,y,z) over the Integers — * —

f:=(x^2-y^2-z^2) * (x^2+y^2+z^2) * (z*y+3*z)
factor f
f:=(7*y*x^2 - 3*y^2 - 4*z^2) * (y^2 * x^2 + y^2 + z^2) * (x*z*y + 3*z)
factor f
f:=(x^2+y^4+z) * (x+y+z^5) * (x^2+y^4+z^3) * (x^2-y^2) * (y^2-z^2)
factor f

———-

5 Factored Form Rings

Given an Algebra A over a Ring R, it is frequently more convenient to deal with factored expressions rather than ones multiplied out. In particular, denominators of fractions should usually be left factored. By defining the domain constructor FactoredFormRing A, one can take advantage of factored forms in calculation. Let’s look at two examples, one with factored integers and another with factored P[t]I

— * —

i:=2^8 * 78^7 * 111^3 * 74534
j:=2^4 * 45^3 * 162^6 * 774325
(x,y,z):FFR I
x:=factor i
y:=factor j

———-

Notice that the next answer stays factored — * —

x*y

———-

Notice that the answer is sorted by factor — * —

y*x

———-

Once again we will get a factored answer — * —

x+y

———-

Now we work in a Quotient Field — * —

(r,s):QF FFR I

———-

Note that there is cancellation because Integer is a Unique Factorization Domain. — * —

r:=x/y
s:=(x^9)/y
FFactorial 250
(u,v):P[x]I
(f,g): FFR P[x]I
u:=(x-1)^2 * (x+1)^2
v:=x^5 + 5*x^3 - x
HenselFactorize P[x]I
f:=factor u
q:=factor v
f^67
f*g
(f+g)*f

(n,m): QF FFR P[x]I
n:=f/g
m:=g/f
n*m

———-

6 Simple Algebraic Extensions

The following example illustrates the calculation of the integral closure of a Simple Algebraic Extension (SAE) of a polynomial ring over the Rational Numbers. This is done by means of the Zassenhaus algorithm for integral closure as adopted by Barry Trager to polynomial rings. In all cases we deal with the affine coordinate ring of a plane algebraic curve. The examples come from the book Algebraic Curves by Fulton.

First we define the original ring, display some of its properties, calculate the integral closure, and display the same properties. (note, the actual calculation of the integral closure is not made until the first property of the integral closure is asked for. That’s why there are relatively large timings for rank.)

For each curve we display the rank (degress of the curve), the DiscMatrix, which is (trace(x[i]x[j]) where x[i] is a basis of the ring over P[x]RN. We then display the discriminant of the curve (which is the determinant of DiscMatrix).

— * —

f:=(x^2 + y^2)^2 + 3*x^2*y - y^3
SS:=SAE(RN,x,y,f)
rank$SS
DiscMatrix$SS
discriminant$SS
TT:=IntegralClosure(P[x}RN,SAE(RN,x,y,f))
rank$TT
DiscMatrix$TT
discriminant$TT

———-

7 Grobner Basis Computations

— * —

———-

— * —

)spool

)lisp (bye) ———-

8

References^{[1] nothing}

9