/usr/share/axiom-20170501/src/algebra/MONOGEN.spad is in axiom-source 20170501-3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 | )abbrev category MONOGEN MonogenicAlgebra
++ Author: Barry Trager
++ Description:
++ A \spadtype{MonogenicAlgebra} is an algebra of finite rank which
++ can be generated by a single element.
MonogenicAlgebra(R,UP) : Category == SIG where
R : CommutativeRing
UP : UnivariatePolynomialCategory(R)
FA ==> FramedAlgebra(R,UP)
CR ==> CommutativeRing
CT ==> ConvertibleTo(UP)
FRT ==> FullyRetractableTo(R)
FLERO ==> FullyLinearlyExplicitRingOver(R)
SIG ==> Join(FA,CR,CT,FRT,FLERO) with
generator : () -> %
++ generator() returns the generator for this domain.
definingPolynomial : () -> UP
++ definingPolynomial() returns the minimal polynomial which
++ \spad{generator()} satisfies.
reduce : UP -> %
++ reduce(up) converts the univariate polynomial up to an algebra
++ element, reducing by the \spad{definingPolynomial()} if necessary.
convert : UP -> %
++ convert(up) converts the univariate polynomial up to an algebra
++ element, reducing by the \spad{definingPolynomial()} if necessary.
lift : % -> UP
++ lift(z) returns a minimal degree univariate polynomial up such that
++ \spad{z=reduce up}.
if R has Finite then Finite
if R has Field then
Field
DifferentialExtension R
reduce : Fraction UP -> Union(%, "failed")
++ reduce(frac) converts the fraction frac to an algebra element.
derivationCoordinates: (Vector %, R -> R) -> Matrix R
++ derivationCoordinates(b, ') returns M such that \spad{b' = M b}.
if R has FiniteFieldCategory then FiniteFieldCategory
add
convert(x:%):UP == lift x
convert(p:UP):% == reduce p
generator() == reduce monomial(1, 1)$UP
norm x == resultant(definingPolynomial(), lift x)
retract(x:%):R == retract lift x
retractIfCan(x:%):Union(R, "failed") == retractIfCan lift x
basis() ==
[reduce monomial(1,i)$UP for i in 0..(rank()-1)::NonNegativeInteger]
characteristicPolynomial(x:%):UP ==
characteristicPolynomial(x)$CharacteristicPolynomialInMonogenicalAlgebra(R,UP,%)
if R has Finite then
size() == size()$R ** rank()
random() == represents [random()$R for i in 1..rank()]$Vector(R)
if R has Field then
reduce(x:Fraction UP) == reduce(numer x) exquo reduce(denom x)
differentiate(x:%, d:R -> R) ==
p := definingPolynomial()
yprime := - reduce(map(d, p)) / reduce(differentiate p)
reduce(map(d, lift x)) + yprime * reduce differentiate lift x
derivationCoordinates(b, d) ==
coordinates(map(x +-> differentiate(x, d), b), b)
recip x ==
(bc := extendedEuclidean(lift x, definingPolynomial(), 1))
case "failed" => "failed"
reduce(bc.coef1)
|