
(/VERSIONCHECK 2) 

(DEFUN |SMATCAT-;positivePower| (|x| |n| $)
  (PROG (|y|)
    (RETURN
      (SEQ (COND
             ((EQL |n| 1) |x|)
             ((ODDP |n|)
              (SPADCALL |x| (|SMATCAT-;positivePower| |x| (- |n| 1) $)
                  (QREFELT $ 11)))
             ('T
              (SEQ (LETT |y|
                         (|SMATCAT-;positivePower| |x|
                             (QUOTIENT2 |n| 2) $)
                         |SMATCAT-;positivePower|)
                   (EXIT (SPADCALL |y| |y| (QREFELT $ 11)))))))))) 

(DEFUN |SMATCAT-;**;SNniS;2| (|x| |n| $)
  (COND
    ((ZEROP |n|) (SPADCALL (|spadConstant| $ 12) (QREFELT $ 13)))
    ('T (|SMATCAT-;positivePower| |x| |n| $)))) 

(DEFUN |SMATCAT-;coerce;RS;3| (|r| $) (SPADCALL |r| (QREFELT $ 13))) 

(DEFUN |SMATCAT-;differentiate;SMS;4| (|x| |d| $)
  (SPADCALL |d| |x| (QREFELT $ 18))) 

(DEFUN |SMATCAT-;diagonal;SRow;5| (|x| $)
  (PROG (|v| |k| #0=#:G1840 |j| #1=#:G1839 |i| #2=#:G1838)
    (RETURN
      (SEQ (LETT |v|
                 (SPADCALL (QREFELT $ 7) (|spadConstant| $ 20)
                     (QREFELT $ 22))
                 . #3=(|SMATCAT-;diagonal;SRow;5|))
           (SEQ (LETT |k| (SPADCALL |v| (QREFELT $ 28)) . #3#)
                (LETT #0# (QVSIZE |v|) . #3#)
                (LETT |j| (SPADCALL |x| (QREFELT $ 26)) . #3#)
                (LETT #1# (SPADCALL |x| (QREFELT $ 27)) . #3#)
                (LETT |i| (SPADCALL |x| (QREFELT $ 24)) . #3#)
                (LETT #2# (SPADCALL |x| (QREFELT $ 25)) . #3#) G190
                (COND
                  ((OR (> |i| #2#) (> |j| #1#) (> |k| #0#)) (GO G191)))
                (SEQ (EXIT (SPADCALL |v| |k|
                               (SPADCALL |x| |i| |j| (QREFELT $ 29))
                               (QREFELT $ 30))))
                (LETT |i|
                      (PROG1 (+ |i| 1)
                        (LETT |j|
                              (PROG1 (+ |j| 1)
                                (LETT |k| (+ |k| 1) . #3#)) . #3#)) . #3#)
                (GO G190) G191 (EXIT NIL))
           (EXIT (SPADCALL |v| (QREFELT $ 31))))))) 

(DEFUN |SMATCAT-;retract;SR;6| (|x| $)
  (COND
    ((SPADCALL |x| (QREFELT $ 34))
     (SPADCALL (SPADCALL |x| (QREFELT $ 35)) (QREFELT $ 36)))
    ('T (|error| "Not retractable")))) 

(DEFUN |SMATCAT-;retractIfCan;SU;7| (|x| $)
  (COND
    ((SPADCALL |x| (QREFELT $ 34))
     (SPADCALL (SPADCALL |x| (QREFELT $ 35)) (QREFELT $ 39)))
    ('T (CONS 1 "failed")))) 

(DEFUN |SMATCAT-;equation2R| (|v| $)
  (PROG (|ans| |i| #0=#:G1855 |j| #1=#:G1856)
    (RETURN
      (SEQ (LETT |ans|
                 (SPADCALL (QREFELT $ 7) (QVSIZE |v|)
                     (|spadConstant| $ 41) (QREFELT $ 43))
                 . #2=(|SMATCAT-;equation2R|))
           (SEQ (LETT |i| (SPADCALL |ans| (QREFELT $ 44)) . #2#)
                (LETT #0# (SPADCALL |ans| (QREFELT $ 45)) . #2#) G190
                (COND ((> |i| #0#) #3=(GO G191)))
                (SEQ (EXIT (SEQ (LETT |j|
                                      (SPADCALL |ans| (QREFELT $ 46)) . #2#)
                                (LETT #1#
                                      (SPADCALL |ans| (QREFELT $ 47)) . #2#)
                                G190 (COND ((> |j| #1#) #3#))
                                (SEQ (EXIT
                                      (SPADCALL |ans| |i| |j|
                                       (SPADCALL
                                        (SPADCALL |v| |j|
                                         (QREFELT $ 49))
                                        |i| (QREFELT $ 50))
                                       (QREFELT $ 51))))
                                (LETT |j| (+ |j| 1) . #2#) #4=(GO G190)
                                G191 (EXIT NIL))))
                (LETT |i| (+ |i| 1) . #2#) #4# G191 (EXIT NIL))
           (EXIT (SPADCALL |ans| (QREFELT $ 54))))))) 

(DEFUN |SMATCAT-;reducedSystem;MM;9| (|x| $)
  (PROG (#0=#:G1861 |i| #1=#:G1862)
    (RETURN
      (SEQ (COND
             ((SPADCALL |x| (QREFELT $ 56))
              (SPADCALL 0 0 (|spadConstant| $ 20) (QREFELT $ 57)))
             ('T
              (SPADCALL (ELT $ 58)
                  (PROGN
                    (LETT #0# NIL . #2=(|SMATCAT-;reducedSystem;MM;9|))
                    (SEQ (LETT |i| (SPADCALL |x| (QREFELT $ 59)) . #2#)
                         (LETT #1# (SPADCALL |x| (QREFELT $ 60)) . #2#)
                         G190 (COND ((> |i| #1#) (GO G191)))
                         (SEQ (EXIT (LETT #0#
                                     (CONS
                                      (|SMATCAT-;equation2R|
                                       (SPADCALL |x| |i|
                                        (QREFELT $ 61))
                                       $)
                                      #0#) . #2#)))
                         (LETT |i| (+ |i| 1) . #2#) (GO G190) G191
                         (EXIT (NREVERSE0 #0#))))
                  (QREFELT $ 64)))))))) 

(DEFUN |SMATCAT-;reducedSystem;MVR;10| (|m| |v| $)
  (PROG (|rh| |vh|)
    (RETURN
      (SEQ (LETT |vh|
                 (COND
                   ((SPADCALL |v| (QREFELT $ 66))
                    (SPADCALL 0 (|spadConstant| $ 20) (QREFELT $ 22)))
                   ('T
                    (SEQ (LETT |rh|
                               (SPADCALL (SPADCALL |v| (QREFELT $ 67))
                                   (QREFELT $ 68))
                               . #0=(|SMATCAT-;reducedSystem;MVR;10|))
                         (EXIT (SPADCALL |rh|
                                   (SPADCALL |rh| (QREFELT $ 69))
                                   (QREFELT $ 70)))))) . #0#)
           (EXIT (CONS (SPADCALL |m| (QREFELT $ 68)) |vh|)))))) 

(DEFUN |SMATCAT-;trace;SR;11| (|x| $)
  (PROG (|j| #0=#:G1873 |i| #1=#:G1872 |tr|)
    (RETURN
      (SEQ (LETT |tr| (|spadConstant| $ 20)
                 . #2=(|SMATCAT-;trace;SR;11|))
           (SEQ (LETT |j| (SPADCALL |x| (QREFELT $ 26)) . #2#)
                (LETT #0# (SPADCALL |x| (QREFELT $ 27)) . #2#)
                (LETT |i| (SPADCALL |x| (QREFELT $ 24)) . #2#)
                (LETT #1# (SPADCALL |x| (QREFELT $ 25)) . #2#) G190
                (COND ((OR (> |i| #1#) (> |j| #0#)) (GO G191)))
                (SEQ (EXIT (LETT |tr|
                                 (SPADCALL |tr|
                                     (SPADCALL |x| |i| |j|
                                      (QREFELT $ 74))
                                     (QREFELT $ 75)) . #2#)))
                (LETT |i|
                      (PROG1 (+ |i| 1) (LETT |j| (+ |j| 1) . #2#)) . #2#)
                (GO G190) G191 (EXIT NIL))
           (EXIT |tr|))))) 

(DEFUN |SMATCAT-;diagonalProduct;SR;12| (|x| $)
  (PROG (|j| #0=#:G1878 |i| #1=#:G1877 |pr|)
    (RETURN
      (SEQ (LETT |pr| (|spadConstant| $ 12)
                 . #2=(|SMATCAT-;diagonalProduct;SR;12|))
           (SEQ (LETT |j| (SPADCALL |x| (QREFELT $ 26)) . #2#)
                (LETT #0# (SPADCALL |x| (QREFELT $ 27)) . #2#)
                (LETT |i| (SPADCALL |x| (QREFELT $ 24)) . #2#)
                (LETT #1# (SPADCALL |x| (QREFELT $ 25)) . #2#) G190
                (COND ((OR (> |i| #1#) (> |j| #0#)) (GO G191)))
                (SEQ (EXIT (LETT |pr|
                                 (SPADCALL |pr|
                                     (SPADCALL |x| |i| |j|
                                      (QREFELT $ 74))
                                     (QREFELT $ 77)) . #2#)))
                (LETT |i|
                      (PROG1 (+ |i| 1) (LETT |j| (+ |j| 1) . #2#)) . #2#)
                (GO G190) G191 (EXIT NIL))
           (EXIT |pr|))))) 

(DEFUN |SMATCAT-;**;SIS;13| (|x| |n| $)
  (PROG (|xInv|)
    (RETURN
      (SEQ (COND
             ((ZEROP |n|)
              (SPADCALL (|spadConstant| $ 12) (QREFELT $ 13)))
             ((SPADCALL |n| (QREFELT $ 79))
              (|SMATCAT-;positivePower| |x| |n| $))
             ('T
              (SEQ (LETT |xInv| (SPADCALL |x| (QREFELT $ 81))
                         |SMATCAT-;**;SIS;13|)
                   (EXIT (COND
                           ((QEQCAR |xInv| 1)
                            (|error| "**: matrix must be invertible"))
                           ('T
                            (|SMATCAT-;positivePower| (QCDR |xInv|)
                                (- |n|) $))))))))))) 

(DEFUN |SquareMatrixCategory&| (|#1| |#2| |#3| |#4| |#5|)
  (PROG (DV$1 DV$2 DV$3 DV$4 DV$5 |dv$| $ |pv$|)
    (RETURN
      (PROGN
        (LETT DV$1 (|devaluate| |#1|) . #0=(|SquareMatrixCategory&|))
        (LETT DV$2 (|devaluate| |#2|) . #0#)
        (LETT DV$3 (|devaluate| |#3|) . #0#)
        (LETT DV$4 (|devaluate| |#4|) . #0#)
        (LETT DV$5 (|devaluate| |#5|) . #0#)
        (LETT |dv$|
              (LIST '|SquareMatrixCategory&| DV$1 DV$2 DV$3 DV$4 DV$5) . #0#)
        (LETT $ (GETREFV 93) . #0#)
        (QSETREFV $ 0 |dv$|)
        (QSETREFV $ 3
            (LETT |pv$|
                  (|buildPredVector| 0 0
                      (LIST (|HasCategory| |#3| '(|Field|))
                            (|HasCategory| |#3| '(|CommutativeRing|)))) . #0#))
        (|stuffDomainSlots| $)
        (QSETREFV $ 6 |#1|)
        (QSETREFV $ 7 |#2|)
        (QSETREFV $ 8 |#3|)
        (QSETREFV $ 9 |#4|)
        (QSETREFV $ 10 |#5|)
        (COND
          ((|testBitVector| |pv$| 1)
           (QSETREFV $ 82
               (CONS (|dispatchFunction| |SMATCAT-;**;SIS;13|) $))))
        $)))) 

(MAKEPROP '|SquareMatrixCategory&| '|infovec|
    (LIST '#(NIL NIL NIL NIL NIL NIL (|local| |#1|) (|local| |#2|)
             (|local| |#3|) (|local| |#4|) (|local| |#5|) (0 . *)
             (6 . |One|) (10 . |scalarMatrix|) (|NonNegativeInteger|)
             |SMATCAT-;**;SNniS;2| |SMATCAT-;coerce;RS;3|
             (|Mapping| 8 8) (15 . |map|)
             |SMATCAT-;differentiate;SMS;4| (21 . |Zero|) (|Vector| 8)
             (25 . |new|) (|Integer|) (31 . |minRowIndex|)
             (36 . |maxRowIndex|) (41 . |minColIndex|)
             (46 . |maxColIndex|) (51 . |minIndex|) (56 . |qelt|)
             (63 . |qsetelt!|) (70 . |directProduct|)
             |SMATCAT-;diagonal;SRow;5| (|Boolean|) (75 . |diagonal?|)
             (80 . |diagonal|) (85 . |retract|) |SMATCAT-;retract;SR;6|
             (|Union| 8 '"failed") (90 . |retractIfCan|)
             |SMATCAT-;retractIfCan;SU;7| (95 . |Zero|) (|Matrix| 10)
             (99 . |new|) (106 . |minRowIndex|) (111 . |maxRowIndex|)
             (116 . |minColIndex|) (121 . |maxColIndex|) (|Vector| 6)
             (126 . |qelt|) (132 . |column|) (138 . |qsetelt!|)
             (|Matrix| 8) (|Matrix| $) (146 . |reducedSystem|)
             (|Matrix| 6) (151 . |empty?|) (156 . |new|)
             (163 . |vertConcat|) (169 . |minRowIndex|)
             (174 . |maxRowIndex|) (179 . |row|) (|Mapping| 52 52 52)
             (|List| 52) (185 . |reduce|) |SMATCAT-;reducedSystem;MM;9|
             (191 . |empty?|) (196 . |coerce|) (201 . |reducedSystem|)
             (206 . |minColIndex|) (211 . |column|)
             (|Record| (|:| |mat| 52) (|:| |vec| 21)) (|Vector| $)
             |SMATCAT-;reducedSystem;MVR;10| (217 . |elt|) (224 . +)
             |SMATCAT-;trace;SR;11| (230 . *)
             |SMATCAT-;diagonalProduct;SR;12| (236 . |positive?|)
             (|Union| $ '"failed") (241 . |inverse|) (246 . **)
             (|Record| (|:| |mat| 84) (|:| |vec| (|Vector| 23)))
             (|Matrix| 23) (|Fraction| 23) (|Union| 85 '"failed")
             (|Union| 23 '"failed") (|Symbol|) (|List| 88) (|List| 14)
             (|OutputForm|) (|PositiveInteger|))
          '#(|trace| 252 |retractIfCan| 257 |retract| 262
             |reducedSystem| 267 |differentiate| 278 |diagonalProduct|
             284 |diagonal| 289 |coerce| 294 ** 299)
          'NIL
          (CONS (|makeByteWordVec2| 1 'NIL)
                (CONS '#()
                      (CONS '#()
                            (|makeByteWordVec2| 82
                                '(2 6 0 0 0 11 0 8 0 12 1 6 0 8 13 2 6
                                  0 17 0 18 0 8 0 20 2 21 0 14 8 22 1 6
                                  23 0 24 1 6 23 0 25 1 6 23 0 26 1 6
                                  23 0 27 1 21 23 0 28 3 6 8 0 23 23 29
                                  3 21 8 0 23 8 30 1 9 0 21 31 1 6 33 0
                                  34 1 6 9 0 35 1 9 8 0 36 1 9 38 0 39
                                  0 10 0 41 3 42 0 14 14 10 43 1 42 23
                                  0 44 1 42 23 0 45 1 42 23 0 46 1 42
                                  23 0 47 2 48 6 0 23 49 2 6 10 0 23 50
                                  4 42 10 0 23 23 10 51 1 10 52 53 54 1
                                  55 33 0 56 3 52 0 14 14 8 57 2 52 0 0
                                  0 58 1 55 23 0 59 1 55 23 0 60 2 55
                                  48 0 23 61 2 63 52 62 0 64 1 48 33 0
                                  66 1 55 0 48 67 1 6 52 53 68 1 52 23
                                  0 69 2 52 21 0 23 70 3 6 8 0 23 23 74
                                  2 8 0 0 0 75 2 8 0 0 0 77 1 23 33 0
                                  79 1 6 80 0 81 2 0 0 0 23 82 1 0 8 0
                                  76 1 0 38 0 40 1 0 8 0 37 1 0 52 53
                                  65 2 0 71 53 72 73 2 0 0 0 17 19 1 0
                                  8 0 78 1 0 9 0 32 1 0 0 8 16 2 0 0 0
                                  23 82 2 0 0 0 14 15)))))
          '|lookupComplete|)) 
