/usr/share/axiom-20170501/src/algebra/DIVRING.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 | )abbrev category DIVRING DivisionRing
++ Description:
++ A division ring (sometimes called a skew field),
++ a not necessarily commutative ring where
++ all non-zero elements have multiplicative inverses.
DivisionRing() : Category == SIG where
SIG ==> Join(EntireRing, Algebra Fraction Integer) with
"**" : (%,Integer) -> %
++ x**n returns x raised to the integer power n.
"^" : (%,Integer) -> %
++ x^n returns x raised to the integer power n.
inv : % -> %
++ inv x returns the multiplicative inverse of x.
++ Error: if x is 0.
-- Q-algebra is a lie, should be conditional on characteristic 0,
-- but knownInfo cannot handle the following commented
-- if % has CharacteristicZero then Algebra Fraction Integer
add
n: Integer
x: %
_^(x:%, n:Integer):% == x ** n
import RepeatedSquaring(%)
x ** n: Integer ==
zero? n => 1
zero? x =>
n<0 => error "division by zero"
x
n<0 =>
expt(inv x,(-n) pretend PositiveInteger)
expt(x,n pretend PositiveInteger)
q:Fraction(Integer) * x:% == numer(q) * inv(denom(q)::%) * x
|