/usr/share/axiom-20170501/src/algebra/PROJSP.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 | )abbrev domain PROJSP ProjectiveSpace
++ Author: Gaetan Hache
++ Date Created: 17 nov 1992
++ Date Last Updated: May 2010 by Tim Daly
++ Description:
++ This is part of the PAFF package, related to projective space.
ProjectiveSpace(dim,K) : SIG == CODE where
dim : NonNegativeInteger
K : Field
NNI ==> NonNegativeInteger
LIST ==> List
SIG ==> ProjectiveSpaceCategory(K)
CODE ==> List(K) add
Rep:= List(K)
coerce(pt:%):OutputForm ==
dd:OutputForm:= ":" :: OutputForm
llout:List(OutputForm):=[ hconcat(dd, a::OutputForm) for a in rest pt]
lout:= cons( (first pt)::OutputForm , llout)
out:= hconcat lout
oo:=paren(out)
ee:OutputForm:= degree(pt) :: OutputForm
oo**ee
definingField(pt)==
K has PseudoAlgebraicClosureOfPerfectFieldCategory => _
maxTower(pt pretend Rep)
1$K
degree(pt)==
K has PseudoAlgebraicClosureOfPerfectFieldCategory => _
extDegree definingField pt
1
coerce(pt:%):List(K) == pt pretend Rep
projectivePoint(pt:LIST(K))==
pt :: %
list(ptt)==
ptt pretend Rep
pointValue(ptt)==
ptt pretend Rep
conjugate(p,e)==
lp:Rep:=p
pc:List(K):=[c**e for c in lp]
projectivePoint(pc)
homogenize(ptt,nV)==
if K has Field then
pt:=list(ptt)$%
zero?(pt.nV) => error "Impossible to homogenize this point"
divPt:=pt.nV
([(a/divPt) for a in pt])
else
ptt
rational?(p,n)== p=conjugate(p,n)
rational?(p)==rational?(p,characteristic()$K)
removeConjugate(l)==removeConjugate(l,characteristic()$K)
removeConjugate(l:LIST(%),n:NNI):LIST(%)==
if K has FiniteFieldCategory then
allconj:LIST(%):=empty()
conjrem:LIST(%):=empty()
for p in l repeat
if ^member?(p,allconj) then
conjrem:=cons(p,conjrem)
allconj:=concat(allconj,orbit(p,n))
conjrem
else
error "The field is not finite"
conjugate(p)==conjugate(p,characteristic()$K)
orbit(p)==orbit(p,characteristic()$K)
orbit(p,e)==
if K has FiniteFieldCategory then
l:LIST(%):=[p]
np:%:=conjugate(p,e)
flag:=^(np=p)::Boolean
while flag repeat
l:=concat(np,l)
np:=conjugate(np,e)
flag:=not (np=p)::Boolean
l
else
error "Cannot compute the conjugate"
aa:% = bb:% ==
ah:=homogenize(aa)
bh:=homogenize(bb)
ah =$Rep bh
coerce(pt:LIST(K))==
^(dim=#pt) => error "Le point n'a pas la bonne dimension"
reduce("and",[zero?(a) for a in pt]) => _
error "Ce n'est pas un point projectif"
ptt:%:= pt
homogenize ptt
homogenize(ptt)==
homogenize(ptt,lastNonNull(ptt))
nonZero?: K -> Boolean
nonZero?(a)==
not(zero?(a))
lastNonNull(ptt)==
pt:=ptt pretend Rep
(dim pretend Integer)+1-_
(position("nonZero?",(reverse(pt)$LIST(K)))$LIST(K))
lastNonNul(pt)==lastNonNull(pt)
|