axiom-developer
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Axiom-developer] 20080620.01.wxh.patch (fix directproduct multiply in M


From: daly
Subject: [Axiom-developer] 20080620.01.wxh.patch (fix directproduct multiply in Monoid)
Date: Sun, 22 Jun 2008 12:41:07 -0500

The direct product D of two (or more) copies of a monoid R is not
implemented in Axiom. The scalar multiplication is implemented
coordinatewise, the identity element is defined, but the monoid
product between elements of D is not, and the domain is not declared
as a monoid. On the other hand, if R is a ring, then the direct
product is a ring. (Bug report 117). 

======================================================================
diff --git a/changelog b/changelog
index 47c791c..8d9986d 100644
--- a/changelog
+++ b/changelog
@@ -1,3 +1,6 @@
+20080620 src/input/Makefile test direct product multiply
+20080620 tpd src/input/directproduct.input test direct product multiply
+20080620 wxh src/algebra/vector.spad handle direct product multiply
 20080619 rhx src/interp/ax.boot document makeAxExportForm
 20080619 tpd books/bookvol8 systematically index chunks
 20080619 tpd readme add Anatoly Raportirenko
diff --git a/src/algebra/vector.spad.pamphlet b/src/algebra/vector.spad.pamphlet
index 9656917..88ed2ea 100644
--- a/src/algebra/vector.spad.pamphlet
+++ b/src/algebra/vector.spad.pamphlet
@@ -471,11 +471,12 @@ DirectProductCategory(dim:NonNegativeInteger, R:Type): 
Category ==
          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.
+             ++ 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
@@ -582,7 +583,7 @@ DirectProduct(dim:NonNegativeInteger, R:Type):
         1 == new(dim, 1)$Vector(R) pretend %
         u:% * r:R       == map(#1 * r, u)
         r:R * u:%       == map(r * #1, u)
- 
+        x:% * y:% == [x.i * y.i for i in 1..dim]$Vector(R) pretend %
  
       if R has CancellationAbelianMonoid then
         subtractIfCan(u:%, v:%):Union(%,"failed") ==
diff --git a/src/input/Makefile.pamphlet b/src/input/Makefile.pamphlet
index 9bd57b6..3fc5383 100644
--- a/src/input/Makefile.pamphlet
+++ b/src/input/Makefile.pamphlet
@@ -302,7 +302,8 @@ REGRES= algaggr.regress algbrbf.regress  algfacob.regress 
alist.regress  \
     cycles1.regress   cycles.regress   cyfactor.regress \
     danzwill.regress  danzwill2.regress  \
     decimal.regress   defintef.regress defintrf.regress \
-    derham.regress    dfloat.regress   dhtri.regress    divisor.regress \
+    derham.regress    dfloat.regress   dhtri.regress directproduct.regress \
+    divisor.regress \
     dmp.regress       dpol.regress     e1.regress       ei.regress \
     easter.regress    efi.regress \
     eigen.regress     elemfun.regress  elemnum.regress  elfuts.regress \
@@ -547,7 +548,8 @@ FILES= ${OUT}/algaggr.input  ${OUT}/algbrbf.input    
${OUT}/algfacob.input \
        ${OUT}/decimal.input    ${OUT}/defs.input \
        ${OUT}/defintef.input ${OUT}/defintrf.input   ${OUT}/derham.input \
        ${OUT}/de2re.input \
-       ${OUT}/dfloat.input   ${OUT}/dhtri.input      ${OUT}/divisor.input \
+       ${OUT}/dfloat.input   ${OUT}/dhtri.input  ${OUT}/directproduct.input \
+       ${OUT}/divisor.input \
        ${OUT}/dmp.input      ${OUT}/dpol.input       ${OUT}/draw2dsf.input \
        ${OUT}/drawalg.input  ${OUT}/drawcfn.input \
        ${OUT}/drawcfun.input ${OUT}/drawcurv.input \
@@ -775,6 +777,7 @@ DOCFILES= \
   ${DOC}/defintef.input.dvi    ${DOC}/defintrf.input.dvi   \
   ${DOC}/defs.input.dvi        ${DOC}/derham.input.dvi     \
   ${DOC}/dfloat.input.dvi      ${DOC}/dhtri.input.dvi      \
+  ${DOC}/directproduct.input.dvi \
   ${DOC}/divisor.input.dvi     ${DOC}/dmp.input.dvi        \
   ${DOC}/dpol.input.dvi        \
   ${DOC}/draw2dsf.input.dvi    ${DOC}/drawalg.input.dvi    \
diff --git a/src/input/directproduct.input.pamphlet 
b/src/input/directproduct.input.pamphlet
new file mode 100644
index 0000000..cc99107
--- /dev/null
+++ b/src/input/directproduct.input.pamphlet
@@ -0,0 +1,130 @@
+\documentclass{article}
+\usepackage{axiom}
+\begin{document}
+\title{\$SPAD/src/input algaggr.input}
+\author{Timothy Daly}
+\maketitle
+\begin{abstract}
+Handle direct product of two copies of a monoid R.
+\end{abstract}
+\eject
+\tableofcontents
+\eject
+The direct product D of two (or more) copies of a monoid R is not
+implemented in Axiom. The scalar multiplication is implemented
+coordinatewise, the identity element is defined, but the monoid
+product between elements of D is not, and the domain is not declared
+as a monoid. On the other hand, if R is a ring, then the direct
+product is a ring. (Bug report 117). This is fixed by patch
+20080620.01.wxh.patch.
+<<*>>=
+)spool directproduct.output
+)set message auto off
+)set message test on
+)clear all
+
+--S 1
+NNI has Monoid
+--R 
+--R
+--R   (1)  true
+--R                                                                Type: 
Boolean
+--E 1
+
+--S 2
+NNI2:=DirectProduct(2,NNI)
+--R 
+--R
+--R   (2)  DirectProduct(2,NonNegativeInteger)
+--R                                                                 Type: 
Domain
+--E 2
+
+--S 3
+NNI2 has Monoid
+--R 
+--R
+--R   (3)  true
+--R                                                                Type: 
Boolean
+--E 3
+
+--S 4
+a:NNI2:=directProduct([3,5])
+--R 
+--R
+--R   (4)  [3,5]
+--R                                    Type: 
DirectProduct(2,NonNegativeInteger)
+--E 4
+
+--S 5
+3*a
+--R 
+--R
+--R   (5)  [9,15]
+--R                                    Type: 
DirectProduct(2,NonNegativeInteger)
+--E 5
+
+--S 6
+b:NNI2:=1
+--R 
+--R
+--R   (6)  [1,1]
+--R                                    Type: 
DirectProduct(2,NonNegativeInteger)
+--E 6
+
+--S 7
+1*a
+--R 
+--R
+--R   (7)  [3,5]
+--R                                    Type: 
DirectProduct(2,NonNegativeInteger)
+--E 7
+
+--S 8
+b*a
+--R 
+--R
+--R   (8)  [3,5]
+--R                                    Type: 
DirectProduct(2,NonNegativeInteger)
+--E 8
+
+--S 9
+c:NNI2:=directProduct([1,1])
+--R 
+--R
+--R   (9)  [1,1]
+--R                                    Type: 
DirectProduct(2,NonNegativeInteger)
+--E 9
+
+--S 10
+c*a
+--R 
+--R
+--R   (10)  [3,5]
+--R                                    Type: 
DirectProduct(2,NonNegativeInteger)
+--E 10
+
+--S 11
+d:NNI2:=directProduct([1,2])
+--R 
+--R
+--R   (11)  [1,2]
+--R                                    Type: 
DirectProduct(2,NonNegativeInteger)
+--E 11
+
+--S 12
+d*a
+--R 
+--R
+--R   (12)  [3,10]
+--R                                    Type: 
DirectProduct(2,NonNegativeInteger)
+--E 12
+
+)spool 
+)lisp (bye)
+ 
+@
+\eject
+\begin{thebibliography}{99}
+\bibitem{1} nothing
+\end{thebibliography}
+\end{document}




reply via email to

[Prev in Thread] Current Thread [Next in Thread]