
(/VERSIONCHECK 2) 

(DEFPARAMETER |MonoidRingCategory;CAT| 'NIL) 

(DEFPARAMETER |MonoidRingCategory;AL| 'NIL) 

(DEFUN |MonoidRingCategory| (&REST #0=#:G1817)
  (LET (#1=#:G1818)
    (COND
      ((SETQ #1#
             (|assoc| #2=(|devaluateList| #0#) |MonoidRingCategory;AL|))
       (CDR #1#))
      (T (SETQ |MonoidRingCategory;AL|
               (|cons5| (CONS #2#
                              (SETQ #1#
                                    (APPLY #'|MonoidRingCategory;| #0#)))
                        |MonoidRingCategory;AL|))
         #1#)))) 

(DEFUN |MonoidRingCategory;| (|t#1| |t#2|)
  (PROG (#0=#:G1816)
    (RETURN
      (PROG1 (LETT #0#
                   (|sublisV|
                       (PAIR '(|t#1| |t#2|)
                             (LIST (|devaluate| |t#1|)
                                   (|devaluate| |t#2|)))
                       (COND
                         (|MonoidRingCategory;CAT|)
                         ('T
                          (LETT |MonoidRingCategory;CAT|
                                (|Join| (|Ring|)
                                        (|RetractableTo| '|t#2|)
                                        (|RetractableTo| '|t#1|)
                                        (|mkCategory| '|domain|
                                         '(((|monomial|
                                             ($ |t#1| |t#2|))
                                            T)
                                           ((|coefficient|
                                             (|t#1| $ |t#2|))
                                            T)
                                           ((|coerce|
                                             ($
                                              (|List|
                                               (|Record|
                                                (|:| |coef| |t#1|)
                                                (|:| |monom| |t#2|)))))
                                            T)
                                           ((|terms|
                                             ((|List|
                                               (|Record|
                                                (|:| |coef| |t#1|)
                                                (|:| |monom| |t#2|)))
                                              $))
                                            T)
                                           ((|map|
                                             ($ (|Mapping| |t#1| |t#1|)
                                              $))
                                            T)
                                           ((|monomial?|
                                             ((|Boolean|) $))
                                            T)
                                           ((|coefficients|
                                             ((|List| |t#1|) $))
                                            T)
                                           ((|monomials|
                                             ((|List| $) $))
                                            T)
                                           ((|numberOfMonomials|
                                             ((|NonNegativeInteger|) $))
                                            T)
                                           ((|leadingMonomial|
                                             (|t#2| $))
                                            (|has| |t#2|
                                             (|OrderedSet|)))
                                           ((|leadingCoefficient|
                                             (|t#1| $))
                                            (|has| |t#2|
                                             (|OrderedSet|)))
                                           ((|reductum| ($ $))
                                            (|has| |t#2|
                                             (|OrderedSet|))))
                                         '(((|CharacteristicZero|)
                                            (|has| |t#1|
                                             (|CharacteristicZero|)))
                                           ((|CharacteristicNonZero|)
                                            (|has| |t#1|
                                             (|CharacteristicNonZero|)))
                                           ((|Algebra| |t#1|)
                                            (|has| |t#1|
                                             (|CommutativeRing|)))
                                           ((|Finite|)
                                            (AND
                                             (|has| |t#2| (|Finite|))
                                             (|has| |t#1| (|Finite|)))))
                                         '((|NonNegativeInteger|)
                                           (|List| $) (|List| |t#1|)
                                           (|Boolean|)
                                           (|List|
                                            (|Record|
                                             (|:| |coef| |t#1|)
                                             (|:| |monom| |t#2|))))
                                         NIL))
                                . #1=(|MonoidRingCategory|))))) . #1#)
        (SETELT #0# 0
                (LIST '|MonoidRingCategory| (|devaluate| |t#1|)
                      (|devaluate| |t#2|))))))) 
