--* From BMT%WATSON.vnet.ibm.com@yktvmh.watson.ibm.com  Wed Sep 15 17:34:15 1993
--* Received: from yktvmh.watson.ibm.com by radical.watson.ibm.com (AIX 3.2/UCB 5.64/900524)
--*           id AA26003; Wed, 15 Sep 1993 17:34:15 -0400
--* Received: from watson.vnet.ibm.com by yktvmh.watson.ibm.com (IBM VM SMTP V2R3)
--*    with BSMTP id 8730; Wed, 15 Sep 93 17:38:09 EDT
--* Received: from YKTVMH by watson.vnet.ibm.com with "VAGENT.V1.0"
--*           id <A.BMT.NOTE.VAGENT2.6937.Sep.15.17:38:09.-0400>
--*           for asbugs@watson; Wed, 15 Sep 93 17:38:09 -0400
--* Received: from YKTVMH by watson.vnet.ibm.com with "VAGENT.V1.0"
--*           id 6935; Wed, 15 Sep 1993 17:38:08 EDT
--* Received: from cyst.watson.ibm.com by yktvmh.watson.ibm.com (IBM VM SMTP V2R3)
--*    with TCP; Wed, 15 Sep 93 17:38:07 EDT
--* Received: from spadserv.watson.ibm.com by cyst.watson.ibm.com (AIX 3.2/UCB 5.64/900528)
--*   id AA39752; Wed, 15 Sep 1993 17:37:24 -0400
--* Received: by spadserv.watson.ibm.com (AIX 3.2/UCB 5.64/900524)
--*           id AA21071; Wed, 15 Sep 1993 17:43:37 -0400
--* Date: Wed, 15 Sep 1993 17:43:37 -0400
--* From: bmt@spadserv.watson.ibm.com
--* X-External-Networks: yes
--* Message-Id: <9309152143.AA21071@spadserv.watson.ibm.com>
--* To: asbugs@watson.ibm.com
--* Subject: compiler dies with program fault [dpc.as][30.3 (current0]

--@ Fixed  by:  SSD   Mon Oct 18 16:18:00 1993 
--@ Tested by:  none 
--@ Summary:    No more program fault, but many missing categories. 


#include "aslib.as"

CoercibleTo(S:Type): Category == with
    coerce: % -> S
      ++ coerce(a) transforms \spad{a} into an element of S.

finiteAggregate: Category == with

unitsKnown: Category == with

(T: Type) has (C: Category): Bit == true

--% DirectProductCategory

+++ Author:
+++ Date Created:
+++ Date Last Updated:
+++ Basic Functions:
+++ Related Constructors: DirectProduct
+++ Also See: VectorCategory
+++ AMS Classifications:
+++ Keywords:
+++ References:
+++ Description:
+++   This category represents a finite cartesian product of a given type.
+++ Many categorical properties are preserved under this construction.

DirectProductCategory(dim:SingleInteger, R:Type): Category ==
  Join(Aggregate(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 Ring then
           BiModule(R, R)
           DifferentialExtension 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 AbelianMonoid then AbelianMonoid
         if R has Monoid then
           _* : (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
 
