This file is indexed.

/usr/share/axiom-20170501/src/algebra/PFECAT.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
)abbrev category PFECAT PolynomialFactorizationExplicit
++ Author: James Davenport
++ Description:
++ This is the category of domains that know "enough" about
++ themselves in order to factor univariate polynomials over themselves.
++ This will be used in future releases for supporting factorization
++ over finitely generated coefficient fields, it is not yet available
++ in the current release of axiom.

PolynomialFactorizationExplicit() : Category == SIG where

  P ==> SparseUnivariatePolynomial %

  SIG ==> UniqueFactorizationDomain with

    squareFreePolynomial : P -> Factored(P)
      ++ squareFreePolynomial(p) returns the
      ++ square-free factorization of the
      ++ univariate polynomial p.

    factorPolynomial : P -> Factored(P)
      ++ factorPolynomial(p) returns the factorization
      ++ into irreducibles of the univariate polynomial p.

    factorSquareFreePolynomial : P -> Factored(P)
      ++ factorSquareFreePolynomial(p) factors the
      ++ univariate polynomial p into irreducibles
      ++ where p is known to be square free
      ++ and primitive with respect to its main variable.

    gcdPolynomial : (P, P) -> P
      ++ gcdPolynomial(p,q) returns the gcd of the univariate
      ++ polynomials p qnd q.
      -- defaults to Euclidean, but should be implemented via
      -- modular or p-adic methods.

    solveLinearPolynomialEquation : (List P, P) -> Union(List P,"failed")
      ++ solveLinearPolynomialEquation([f1, ..., fn], g)
      ++ (where the fi are relatively prime to each other)
      ++ returns a list of ai such that
      ++ \spad{g/prod fi = sum ai/fi}
      ++ or returns "failed" if no such list of ai's exists.

    if % has CharacteristicNonZero then

      conditionP : Matrix % -> Union(Vector %,"failed")
        ++ conditionP(m) returns a vector of elements, not all zero,
        ++ whose \spad{p}-th powers (p is the characteristic of the domain)
        ++ are a solution of the homogenous linear system represented
        ++ by m, or "failed" is there is no such vector.

      charthRoot : % -> Union(%,"failed")
        ++ charthRoot(r) returns the \spad{p}-th root of r, or "failed"
        ++ if none exists in the domain.
        -- this is a special case of conditionP, but often the one we want

   add

     gcdPolynomial(f,g) ==
        zero? f => g
        zero? g => f
        cf:=content f
        if not one? cf then f:=(f exquo cf)::P
        cg:=content g
        if not one? cg then g:=(g exquo cg)::P
        ans:=subResultantGcd(f,g)$P
        gcd(cf,cg)*(ans exquo content ans)::P

     if % has CharacteristicNonZero then

       charthRoot f ==
          -- to take p'th root of f, solve the system X-fY=0,
          -- so solution is [x,y]
          -- with x^p=X and y^p=Y, then (x/y)^p = f
          zero? f => 0
          m:Matrix % := matrix [[1,-f]]
          ans:= conditionP m
          ans case "failed" => "failed"
          (ans.1) exquo (ans.2)

     if % has Field then

       solveLinearPolynomialEquation(lf,g) ==
         multiEuclidean(lf,g)$P

     else

       solveLinearPolynomialEquation(lf,g) ==
         LPE ==> LinearPolynomialEquationByFractions %
         solveLinearPolynomialEquationByFractions(lf,g)$LPE