This file is indexed.

/usr/share/axiom-20170501/src/algebra/DIRPCAT.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
)abbrev category DIRPCAT DirectProductCategory
++ Description:
++ This category represents a finite cartesian product of a given type.
++ Many categorical properties are preserved under this construction.
-- all direct product category domains must be compiled
-- without subsumption, set SourceLevelSubset to EQUAL
--)bo $noSubsumption := true
 
DirectProductCategory(dim,R) : Category == SIG where
  dim : NonNegativeInteger
  R : Type

  SIG ==> Join(IndexedAggregate(Integer, R), CoercibleTo Vector R) with

    finiteAggregate
      ++ attribute to indicate an aggregate of finite size

    directProduct : Vector R -> %
      ++ directProduct(v) converts the vector v to become
      ++ a direct product. Error: if the length of v is
      ++ different from dim.

    if R has SetCategory then FullyRetractableTo R

    if R has Ring then

      BiModule(R, R)

      DifferentialExtension R

      FullyLinearlyExplicitRingOver R

      unitVector : PositiveInteger -> %
        ++ unitVector(n) produces a vector with 1 in position n and
        ++ zero elsewhere.

      dot : (%, %) -> R
        ++ dot(x,y) computes the inner product of the vectors x and y.

    if R has AbelianSemiGroup then AbelianSemiGroup

    if R has CancellationAbelianMonoid then CancellationAbelianMonoid

    if R has Monoid then

      Monoid

      _* : (R, %) -> %
        ++ r * y multiplies the element r times each component of the
        ++ vector y.

      _* : (%, R) -> %
        ++ y * r multiplies each component of the vector y 
        ++ by the element r.

    if R has Finite then Finite

    if R has CommutativeRing then

      Algebra R

      CommutativeRing

    if R has unitsKnown then unitsKnown

    if R has OrderedRing then OrderedRing

    if R has OrderedAbelianMonoidSup then OrderedAbelianMonoidSup

    if R has Field then VectorSpace R

   add

      if R has Ring then

        equation2R: Vector % -> Matrix R
 
        coerce(n:Integer):%          == n::R::%

        characteristic()             == characteristic()$R

        differentiate(z:%, d:R -> R) == map(d, z)
 
        equation2R v ==
          ans:Matrix(R) := new(dim, #v, 0)
          for i in minRowIndex ans .. maxRowIndex ans repeat
            for j in minColIndex ans .. maxColIndex ans repeat
              qsetelt_!(ans, i, j, qelt(qelt(v, j), i))
          ans
 
        reducedSystem(m:Matrix %):Matrix(R) ==
          empty? m => new(0, 0, 0)
          reduce(vertConcat, [equation2R row(m, i)
                 for i in minRowIndex m .. maxRowIndex m])$List(Matrix R)
 
        reducedSystem(m:Matrix %, v:Vector %):
          Record(mat:Matrix R, vec:Vector R) ==
            vh:Vector(R) :=
              empty? v => empty()
              rh := reducedSystem(v::Matrix %)@Matrix(R)
              column(rh, minColIndex rh)
            [reducedSystem(m)@Matrix(R), vh]
 
      if R has Finite then size == size$R ** dim
 
      if R has Field then
        x / b       == x * inv b

        dimension() == dim::CardinalNumber