
(/VERSIONCHECK 2) 

(DEFUN |AUTOMOR;One;$;1| ($) (CONS (|function| |AUTOMOR;ident|) $)) 

(PUT '|AUTOMOR;err| '|SPADreplace|
     '(XLAM (|r|) (|error| "Morphism is not invertible"))) 

(DEFUN |AUTOMOR;err| (|r| $) (|error| "Morphism is not invertible")) 

(PUT '|AUTOMOR;ident| '|SPADreplace| '(XLAM (|r| |n|) |r|)) 

(DEFUN |AUTOMOR;ident| (|r| |n| $) |r|) 

(PUT '|AUTOMOR;=;2$B;4| '|SPADreplace| 'EQ) 

(DEFUN |AUTOMOR;=;2$B;4| (|f| |g| $) (EQ |f| |g|)) 

(DEFUN |AUTOMOR;elt;$2R;5| (|f| |r| $) (|AUTOMOR;apply| |f| |r| 1 $)) 

(DEFUN |AUTOMOR;inv;2$;6| (|f| $)
  (PROG () (RETURN (CONS #'|AUTOMOR;inv;2$;6!0| (VECTOR $ |f|))))) 

(DEFUN |AUTOMOR;inv;2$;6!0| (|#1| |#2| $$)
  (PROG ($)
    (LETT $ (QREFELT $$ 0) |AUTOMOR;inv;2$;6|)
    (RETURN
      (PROGN
        (|AUTOMOR;apply| (QREFELT $$ 1) |#1|
            (SPADCALL |#2| (QREFELT $ 13)) $))))) 

(DEFUN |AUTOMOR;**;$I$;7| (|f| |n| $)
  (PROG () (RETURN (CONS #'|AUTOMOR;**;$I$;7!0| (VECTOR $ |n| |f|))))) 

(DEFUN |AUTOMOR;**;$I$;7!0| (|#1| |#2| $$)
  (PROG ($)
    (LETT $ (QREFELT $$ 0) |AUTOMOR;**;$I$;7|)
    (RETURN
      (PROGN
        (|AUTOMOR;apply| (QREFELT $$ 2) |#1|
            (SPADCALL (QREFELT $$ 1) |#2| (QREFELT $ 15)) $))))) 

(DEFUN |AUTOMOR;coerce;$Of;8| (|f| $)
  (SPADCALL "R -> R" (QREFELT $ 19))) 

(PUT '|AUTOMOR;morphism;M$;9| '|SPADreplace| '(XLAM (|f|) |f|)) 

(DEFUN |AUTOMOR;morphism;M$;9| (|f| $) |f|) 

(DEFUN |AUTOMOR;morphism;M$;10| (|f| $)
  (SPADCALL |f| (CONS (|function| |AUTOMOR;err|) $) (QREFELT $ 24))) 

(DEFUN |AUTOMOR;morphism;2M$;11| (|f| |g| $)
  (CONS #'|AUTOMOR;morphism;2M$;11!0| (VECTOR $ |g| |f|))) 

(DEFUN |AUTOMOR;morphism;2M$;11!0| (|#1| |#2| $$)
  (|AUTOMOR;iterat| (QREFELT $$ 2) (QREFELT $$ 1) |#2| |#1|
      (QREFELT $$ 0))) 

(DEFUN |AUTOMOR;apply| (|f| |r| |n| $)
  (PROG (|g|)
    (RETURN
      (SEQ (LETT |g| |f| |AUTOMOR;apply|)
           (EXIT (SPADCALL |r| |n| |g|)))))) 

(DEFUN |AUTOMOR;iterat| (|f| |g| |n| |r| $)
  (PROG (#0=#:G1831 #1=#:G1832)
    (RETURN
      (COND
        ((< |n| 0)
         (|AUTOMOR;iter| |g|
             (PROG1 (LETT #0# (- |n|) . #2=(|AUTOMOR;iterat|))
               (|check-subtype| (>= #0# 0) '(|NonNegativeInteger|) #0#))
             |r| $))
        ('T
         (|AUTOMOR;iter| |f|
             (PROG1 (LETT #1# |n| . #2#)
               (|check-subtype| (>= #1# 0) '(|NonNegativeInteger|) #1#))
             |r| $)))))) 

(DEFUN |AUTOMOR;iter| (|f| |n| |r| $)
  (PROG (|i|)
    (RETURN
      (SEQ (SEQ (LETT |i| 1 . #0=(|AUTOMOR;iter|)) G190
                (COND ((QSGREATERP |i| |n|) (GO G191)))
                (SEQ (EXIT (LETT |r| (SPADCALL |r| |f|) . #0#)))
                (LETT |i| (QSADD1 |i|) . #0#) (GO G190) G191
                (EXIT NIL))
           (EXIT |r|))))) 

(DEFUN |AUTOMOR;*;3$;15| (|f| |g| $)
  (PROG ()
    (RETURN
      (COND
        ((SPADCALL |f| |g| (QREFELT $ 10))
         (SPADCALL |f| 2 (QREFELT $ 28)))
        ('T (CONS #'|AUTOMOR;*;3$;15!2| (VECTOR |f| |g| $))))))) 

(DEFUN |AUTOMOR;*;3$;15!2| (|#1| |#2| $$)
  (PROG ($ |g| |f|)
    (LETT $ (QREFELT $$ 2) . #0=(|AUTOMOR;*;3$;15|))
    (LETT |g| (QREFELT $$ 1) . #0#)
    (LETT |f| (QREFELT $$ 0) . #0#)
    (RETURN
      (PROGN
        (PROG ()
          (RETURN
            (|AUTOMOR;iterat|
                (CONS #'|AUTOMOR;*;3$;15!0| (VECTOR $ |g| |f|))
                (CONS #'|AUTOMOR;*;3$;15!1| (VECTOR |f| $ |g|)) |#2|
                |#1| $))))))) 

(DEFUN |AUTOMOR;*;3$;15!1| (|#1| $$)
  (PROG ($)
    (LETT $ (QREFELT $$ 1) NIL)
    (RETURN
      (PROGN
        (SPADCALL (SPADCALL (QREFELT $$ 2) (QREFELT $ 14))
            (SPADCALL (SPADCALL (QREFELT $$ 0) (QREFELT $ 14)) |#1|
                (QREFELT $ 11))
            (QREFELT $ 11)))))) 

(DEFUN |AUTOMOR;*;3$;15!0| (|#1| $$)
  (PROG ($)
    (LETT $ (QREFELT $$ 0) NIL)
    (RETURN
      (PROGN
        (SPADCALL (QREFELT $$ 2)
            (SPADCALL (QREFELT $$ 1) |#1| (QREFELT $ 11))
            (QREFELT $ 11)))))) 

(DEFUN |Automorphism| (#0=#:G1841)
  (PROG ()
    (RETURN
      (PROG (#1=#:G1842)
        (RETURN
          (COND
            ((LETT #1#
                   (|lassocShiftWithFunction| (LIST (|devaluate| #0#))
                       (HGET |$ConstructorCache| '|Automorphism|)
                       '|domainEqualList|)
                   . #2=(|Automorphism|))
             (|CDRwithIncrement| #1#))
            ('T
             (UNWIND-PROTECT
               (PROG1 (|Automorphism;| #0#) (LETT #1# T . #2#))
               (COND
                 ((NOT #1#) (HREM |$ConstructorCache| '|Automorphism|))))))))))) 

(DEFUN |Automorphism;| (|#1|)
  (PROG (DV$1 |dv$| $ |pv$|)
    (RETURN
      (PROGN
        (LETT DV$1 (|devaluate| |#1|) . #0=(|Automorphism|))
        (LETT |dv$| (LIST '|Automorphism| DV$1) . #0#)
        (LETT $ (GETREFV 33) . #0#)
        (QSETREFV $ 0 |dv$|)
        (QSETREFV $ 3 (LETT |pv$| (|buildPredVector| 0 0 NIL) . #0#))
        (|haddProp| |$ConstructorCache| '|Automorphism| (LIST DV$1)
            (CONS 1 $))
        (|stuffDomainSlots| $)
        (QSETREFV $ 6 |#1|)
        (QSETREFV $ 7 (|Mapping| |#1| |#1| (|Integer|)))
        $)))) 

(MAKEPROP '|Automorphism| '|infovec|
    (LIST '#(NIL NIL NIL NIL NIL NIL (|local| |#1|) '|Rep|
             (CONS IDENTITY
                   (FUNCALL (|dispatchFunction| |AUTOMOR;One;$;1|) $))
             (|Boolean|) |AUTOMOR;=;2$B;4| |AUTOMOR;elt;$2R;5|
             (|Integer|) (0 . -) |AUTOMOR;inv;2$;6| (5 . *)
             |AUTOMOR;**;$I$;7| (|String|) (|OutputForm|)
             (11 . |message|) |AUTOMOR;coerce;$Of;8| (|Mapping| 6 6 12)
             |AUTOMOR;morphism;M$;9| (|Mapping| 6 6)
             |AUTOMOR;morphism;2M$;11| |AUTOMOR;morphism;M$;10|
             (16 . |Zero|) (|PositiveInteger|) (20 . **)
             |AUTOMOR;*;3$;15| (|NonNegativeInteger|)
             (|Union| $ '"failed") (|SingleInteger|))
          '#(~= 26 |sample| 32 |recip| 36 |one?| 41 |morphism| 46
             |latex| 62 |inv| 67 |hash| 72 |elt| 77 |conjugate| 83
             |commutator| 89 |coerce| 95 ^ 100 |One| 118 = 122 / 128 **
             134 * 152)
          'NIL
          (CONS (|makeByteWordVec2| 1 '(0 0 0 0 0 0 0 0))
                (CONS '#(|Group&| |Monoid&| |SemiGroup&| |SetCategory&|
                         |BasicType&| NIL NIL NIL)
                      (CONS '#((|Group|) (|Monoid|) (|SemiGroup|)
                               (|SetCategory|) (|BasicType|)
                               (|Eltable| 6 6) (|unitsKnown|)
                               (|CoercibleTo| 18))
                            (|makeByteWordVec2| 32
                                '(1 12 0 0 13 2 12 0 12 0 15 1 18 0 17
                                  19 0 6 0 26 2 0 0 0 27 28 2 0 9 0 0 1
                                  0 0 0 1 1 0 31 0 1 1 0 9 0 1 1 0 0 21
                                  22 1 0 0 23 25 2 0 0 23 23 24 1 0 17
                                  0 1 1 0 0 0 14 1 0 32 0 1 2 0 6 0 6
                                  11 2 0 0 0 0 1 2 0 0 0 0 1 1 0 18 0
                                  20 2 0 0 0 12 1 2 0 0 0 30 1 2 0 0 0
                                  27 1 0 0 0 8 2 0 9 0 0 10 2 0 0 0 0 1
                                  2 0 0 0 12 16 2 0 0 0 30 1 2 0 0 0 27
                                  28 2 0 0 0 0 29)))))
          '|lookupComplete|)) 
