/usr/share/axiom-20170501/src/algebra/EAB.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 | )abbrev domain EAB ExtAlgBasis
++ Author: Larry Lambe
++ Date created: 03/14/89
++ Description:
++ A domain used in the construction of the exterior algebra on a set
++ X over a ring R. This domain represents the set of all ordered
++ subsets of the set X, assumed to be in correspondance with
++ {1,2,3, ...}. The ordered subsets are themselves ordered
++ lexicographically and are in bijective correspondance with an ordered
++ basis of the exterior algebra. In this domain we are dealing strictly
++ with the exponents of basis elements which can only be 0 or 1.
-- Thus we really have L({0,1}).
++
++ The multiplicative identity element of the exterior algebra corresponds
++ to the empty subset of X. A coerce from List Integer to an
++ ordered basis element is provided to allow the convenient input of
++ expressions. Another exported function forgets the ordered structure
++ and simply returns the list corresponding to an ordered subset.
ExtAlgBasis() : SIG == CODE where
I ==> Integer
L ==> List
NNI ==> NonNegativeInteger
SIG ==> OrderedSet with
coerce : L I -> %
++ coerce(l) converts a list of 0's and 1's into a basis
++ element, where 1 (respectively 0) designates that the
++ variable of the corresponding index of l is (respectively, is not)
++ present.
++ Error: if an element of l is not 0 or 1.
degree : % -> NNI
++ degree(x) gives the numbers of 1's in x, the number
++ of non-zero exponents in the basis element that x represents.
exponents : % -> L I
++ exponents(x) converts a domain element into a list of zeros
++ and ones corresponding to the exponents in the basis element
++ that x represents.
Nul : NNI -> %
++ Nul() gives the basis element 1 for the algebra generated
++ by n generators.
CODE ==> add
Rep := L I
x,y : %
x = y == x =$Rep y
x < y ==
null x => not null y
null y => false
first x = first y => rest x < rest y
first x > first y
coerce(li:(L I)) ==
for x in li repeat
if x ^= 1 and x ^= 0 then error "coerce: values can only be 0 and 1"
li
degree x == (_+/x)::NNI
exponents x == copy(x @ Rep)
Nul n == [0 for i in 1..n]
coerce x == coerce(x @ Rep)$(L I)
|