/usr/share/axiom-20170501/src/algebra/FDIV.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 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 | )abbrev domain FDIV FiniteDivisor
++ Author: Manuel Bronstein
++ Date Created: 1987
++ Date Last Updated: 29 July 1993
++ Description:
++ This domains implements finite rational divisors on a curve, that
++ is finite formal sums SUM(n * P) where the n's are integers and the
++ P's are finite rational points on the curve.
FiniteDivisor(F, UP, UPUP, R) : SIG == CODE where
F : Field
UP : UnivariatePolynomialCategory F
UPUP: UnivariatePolynomialCategory Fraction UP
R : FunctionFieldCategory(F, UP, UPUP)
N ==> NonNegativeInteger
RF ==> Fraction UP
ID ==> FractionalIdeal(UP, RF, UPUP, R)
SIG ==> FiniteDivisorCategory(F, UP, UPUP, R) with
finiteBasis : % -> Vector R
++ finiteBasis(d) returns a basis for d as a module over K[x].
lSpaceBasis : % -> Vector R
++ lSpaceBasis(d) returns a basis for \spad{L(d) = {f | (f) >= -d}}
++ as a module over \spad{K[x]}.
CODE ==> add
if hyperelliptic()$R case UP then
Rep := HyperellipticFiniteDivisor(F, UP, UPUP, R)
0 == 0$Rep
coerce(d:$):OutputForm == coerce(d)$Rep
d1 = d2 == d1 =$Rep d2
n * d == n *$Rep d
d1 + d2 == d1 +$Rep d2
- d == -$Rep d
ideal d == ideal(d)$Rep
reduce d == reduce(d)$Rep
generator d == generator(d)$Rep
decompose d == decompose(d)$Rep
divisor(i:ID) == divisor(i)$Rep
divisor(f:R) == divisor(f)$Rep
divisor(a, b) == divisor(a, b)$Rep
divisor(a, b, n) == divisor(a, b, n)$Rep
divisor(h, d, dp, g, r) == divisor(h, d, dp, g, r)$Rep
else
Rep := Record(id:ID, fbasis:Vector(R))
import CommonDenominator(UP, RF, Vector RF)
import UnivariatePolynomialCommonDenominator(UP, RF, UPUP)
makeDivisor : (UP, UPUP, UP) -> %
intReduce : (R, UP) -> R
ww := integralBasis()$R
0 == [1, empty()]
divisor(i:ID) == [i, empty()]
divisor(f:R) == divisor ideal [f]
coerce(d:%):OutputForm == ideal(d)::OutputForm
ideal d == d.id
decompose d == [ideal d, 1]
d1 = d2 == basis(ideal d1) = basis(ideal d2)
n * d == divisor(ideal(d) ** n)
d1 + d2 == divisor(ideal d1 * ideal d2)
- d == divisor inv ideal d
divisor(h, d, dp, g, r) == makeDivisor(d, lift h - (r * dp)::RF::UPUP, g)
intReduce(h, b) ==
v := integralCoordinates(h).num
integralRepresents(
[qelt(v, i) rem b for i in minIndex v .. maxIndex v], 1)
divisor(a, b) ==
x := monomial(1, 1)$UP
not ground? gcd(d := x - a::UP, retract(discriminant())@UP) =>
error "divisor: point is singular"
makeDivisor(d, monomial(1, 1)$UPUP - b::UP::RF::UPUP, 1)
divisor(a, b, n) ==
not(ground? gcd(d := monomial(1, 1)$UP - a::UP,
retract(discriminant())@UP)) and
((n exquo rank()) case "failed") =>
error "divisor: point is singular"
m:N :=
n < 0 => (-n)::N
n::N
g := makeDivisor(d**m,(monomial(1,1)$UPUP - b::UP::RF::UPUP)**m,1)
n < 0 => -g
g
reduce d ==
(i := minimize(j := ideal d)) = j => d
#(n := numer i) ^= 2 => divisor i
cd := splitDenominator lift n(1 + minIndex n)
b := gcd(cd.den * retract(retract(n minIndex n)@RF)@UP,
retract(norm reduce(cd.num))@UP)
e := cd.den * denom i
divisor ideal([(b / e)::R,
reduce map((s:RF):RF+->(retract(s)@UP rem b)/e, cd.num)]$Vector(R))
finiteBasis d ==
if empty?(d.fbasis) then
d.fbasis := normalizeAtInfinity
basis module(ideal d)$FramedModule(UP, RF, UPUP, R, ww)
d.fbasis
generator d ==
bsis := finiteBasis d
for i in minIndex bsis .. maxIndex bsis repeat
integralAtInfinity? qelt(bsis, i) =>
return primitivePart qelt(bsis,i)
"failed"
lSpaceBasis d ==
map_!(primitivePart, reduceBasisAtInfinity finiteBasis(-d))
-- b = center, hh = integral function, g = gcd(b, discriminant)
makeDivisor(b, hh, g) ==
b := gcd(b, retract(norm(h := reduce hh))@UP)
h := intReduce(h, b)
if not ground? gcd(g, b) then h := intReduce(h ** rank(), b)
divisor ideal [b::RF::R, h]$Vector(R)
|