
(/VERSIONCHECK 2) 

(DEFUN |PWFFINTB;reducedDiscriminant;UPR;1| (|f| $)
  (PROG (|ff| |ee| |cc| |cden| |denom| |gg| |ans|)
    (RETURN
      (SEQ (LETT |ff|
                 (SPADCALL
                     (CONS #'|PWFFINTB;reducedDiscriminant;UPR;1!0| $)
                     |f| (QREFELT $ 15))
                 . #0=(|PWFFINTB;reducedDiscriminant;UPR;1|))
           (LETT |ee|
                 (SPADCALL |ff| (SPADCALL |ff| (QREFELT $ 16))
                     (QREFELT $ 18)) . #0#)
           (LETT |cc|
                 (SPADCALL (SPADCALL (QVELT |ee| 0) (QREFELT $ 20))
                     (SPADCALL (QVELT |ee| 1) (QREFELT $ 20))
                     (QREFELT $ 21)) . #0#)
           (LETT |cden| (SPADCALL |cc| (QREFELT $ 24)) . #0#)
           (LETT |denom| (QCDR |cden|) . #0#)
           (LETT |gg|
                 (SPADCALL
                     (SPADCALL (ELT $ 25) (QCAR |cden|) (QREFELT $ 29))
                     (QREFELT $ 31)) . #0#)
           (LETT |ans| (SPADCALL |denom| |gg| (QREFELT $ 33)) . #0#)
           (EXIT (COND
                   ((QEQCAR |ans| 1)
                    (|error| "PWFFINTB: error in reduced discriminant computation"))
                   ('T (QCDR |ans|)))))))) 

(DEFUN |PWFFINTB;reducedDiscriminant;UPR;1!0| (|#1| $)
  (SPADCALL |#1| (QREFELT $ 11))) 

(DEFUN |PWFFINTB;compLocalBasis| (|poly| |prime| $)
  (PROG (|sae|)
    (RETURN
      (SEQ (LETT |sae|
                 (|SimpleAlgebraicExtension| (QREFELT $ 7)
                     (QREFELT $ 8) |poly|)
                 |PWFFINTB;compLocalBasis|)
           (EXIT (SPADCALL |prime|
                     (|compiledLookupCheck| '|localIntegralBasis|
                         (LIST (LIST '|Record|
                                     (LIST '|:| '|basis|
                                      (LIST '|Matrix|
                                       (|devaluate| (ELT $ 7))))
                                     (LIST '|:| '|basisDen|
                                      (|devaluate| (ELT $ 7)))
                                     (LIST '|:| '|basisInv|
                                      (LIST '|Matrix|
                                       (|devaluate| (ELT $ 7)))))
                               (|devaluate| (ELT $ 7)))
                         (|WildFunctionFieldIntegralBasis| (ELT $ 6)
                             (ELT $ 7) (ELT $ 8) |sae|)))))))) 

(DEFUN |PWFFINTB;compLocalBasisOverExt|
       (|poly0| |prime0| |irrPoly0| |k| $)
  (PROG (|n| |disc0| |r| #0=#:G1842 |irrPoly| E |poly| |redDisc0|
             |redDisc| |prime| |sae| |pp| |redIrrPoly| |factorListSAE|
             #1=#:G1862 |f| #2=#:G1863 |redFactors| #3=#:G1864 |ff|
             #4=#:G1865 |primaries| #5=#:G1847 |deg| |henselInfo|
             |henselFactors| |psi1| FF |factorIb| |bs| |ib| |b| |bas|
             |bInv| |p| |bDen|)
    (RETURN
      (SEQ (LETT |n| (SPADCALL |poly0| (QREFELT $ 36))
                 . #6=(|PWFFINTB;compLocalBasisOverExt|))
           (LETT |disc0| (SPADCALL |poly0| (QREFELT $ 37)) . #6#)
           (EXIT (COND
                   ((QEQCAR (SPADCALL |disc0| |prime0| (QREFELT $ 33))
                            1)
                    (VECTOR (SPADCALL |n| (|spadConstant| $ 39)
                                (QREFELT $ 41))
                            (|spadConstant| $ 39)
                            (SPADCALL |n| (|spadConstant| $ 39)
                                (QREFELT $ 41))))
                   ('T
                    (SEQ (LETT |r|
                               (SPADCALL |irrPoly0| (QREFELT $ 36)) . #6#)
                         (LETT |irrPoly|
                               (SPADCALL
                                   (PROG1 (LETT #0# |r| . #6#)
                                     (|check-subtype| (> #0# 0)
                                      '(|PositiveInteger|) #0#))
                                   (QREFELT $ 45)) . #6#)
                         (LETT E
                               (|SimpleAlgebraicExtension|
                                   (QREFELT $ 6)
                                   (|SparseUnivariatePolynomial|
                                    (QREFELT $ 6))
                                   |irrPoly|) . #6#)
                         (LETT |poly|
                               (SPADCALL
                                   (CONS
                                    #'|PWFFINTB;compLocalBasisOverExt!0|
                                    (VECTOR E $))
                                   |poly0|
                                   (|compiledLookupCheck|
                                    '|mapBivariate|
                                    (LIST
                                     (LIST
                                      '|SparseUnivariatePolynomial|
                                      (LIST
                                       '|SparseUnivariatePolynomial|
                                       (|devaluate| E)))
                                     (LIST '|Mapping| (|devaluate| E)
                                      (|devaluate| (ELT $ 6)))
                                     (|devaluate| (ELT $ 8)))
                                    (|IntegralBasisPolynomialTools|
                                     (ELT $ 6) (ELT $ 7) (ELT $ 8) E))) . #6#)
                         (LETT |redDisc0|
                               (SPADCALL |poly0| (QREFELT $ 34)) . #6#)
                         (LETT |redDisc|
                               (SPADCALL
                                   (CONS
                                    #'|PWFFINTB;compLocalBasisOverExt!1|
                                    (VECTOR E $))
                                   |redDisc0|
                                   (|compiledLookupCheck|
                                    '|mapUnivariate|
                                    (LIST
                                     (LIST
                                      '|SparseUnivariatePolynomial|
                                      (|devaluate| E))
                                     (LIST '|Mapping| (|devaluate| E)
                                      (|devaluate| (ELT $ 6)))
                                     (|devaluate| (ELT $ 7)))
                                    (|IntegralBasisPolynomialTools|
                                     (ELT $ 6) (ELT $ 7) (ELT $ 8) E))) . #6#)
                         (LETT |prime|
                               (SPADCALL
                                   (CONS
                                    #'|PWFFINTB;compLocalBasisOverExt!2|
                                    (VECTOR E $))
                                   |prime0|
                                   (|compiledLookupCheck|
                                    '|mapUnivariate|
                                    (LIST
                                     (LIST
                                      '|SparseUnivariatePolynomial|
                                      (|devaluate| E))
                                     (LIST '|Mapping| (|devaluate| E)
                                      (|devaluate| (ELT $ 6)))
                                     (|devaluate| (ELT $ 7)))
                                    (|IntegralBasisPolynomialTools|
                                     (ELT $ 6) (ELT $ 7) (ELT $ 8) E))) . #6#)
                         (LETT |sae|
                               (|SimpleAlgebraicExtension| E
                                   (|SparseUnivariatePolynomial| E)
                                   |prime|) . #6#)
                         (LETT |redIrrPoly|
                               (SEQ (LETT |pp|
                                     (SPADCALL
                                      (CONS
                                       #'|PWFFINTB;compLocalBasisOverExt!3|
                                       (VECTOR E $))
                                      |irrPoly0|
                                      (|compiledLookupCheck|
                                       '|mapBivariate|
                                       (LIST
                                        (LIST
                                         '|SparseUnivariatePolynomial|
                                         (LIST
                                          '|SparseUnivariatePolynomial|
                                          (|devaluate| E)))
                                        (LIST '|Mapping|
                                         (|devaluate| E)
                                         (|devaluate| (ELT $ 6)))
                                        (|devaluate| (ELT $ 8)))
                                       (|IntegralBasisPolynomialTools|
                                        (ELT $ 6) (ELT $ 7) (ELT $ 8)
                                        E))) . #6#)
                                    (EXIT
                                     (SPADCALL
                                      (|compiledLookupCheck| '|reduce|
                                       (LIST '$
                                        (LIST
                                         '|SparseUnivariatePolynomial|
                                         (|devaluate| E)))
                                       |sae|)
                                      |pp|
                                      (|compiledLookupCheck|
                                       '|mapUnivariate|
                                       (LIST
                                        (LIST
                                         '|SparseUnivariatePolynomial|
                                         (|devaluate| |sae|))
                                        (LIST '|Mapping|
                                         (|devaluate| |sae|)
                                         (LIST
                                          '|SparseUnivariatePolynomial|
                                          (|devaluate| E)))
                                        (LIST
                                         '|SparseUnivariatePolynomial|
                                         (LIST
                                          '|SparseUnivariatePolynomial|
                                          (|devaluate| E))))
                                       (|IntegralBasisPolynomialTools|
                                        (|SparseUnivariatePolynomial|
                                         E)
                                        (|SparseUnivariatePolynomial|
                                         (|SparseUnivariatePolynomial|
                                          E))
                                        (|SparseUnivariatePolynomial|
                                         (|SparseUnivariatePolynomial|
                                          (|SparseUnivariatePolynomial|
                                           E)))
                                        |sae|))))) . #6#)
                         (LETT |factorListSAE|
                               (SPADCALL
                                   (SPADCALL |redIrrPoly|
                                    (|compiledLookupCheck| '|factor|
                                     (LIST
                                      (LIST '|Factored|
                                       (LIST
                                        '|SparseUnivariatePolynomial|
                                        (|devaluate| |sae|)))
                                      (LIST
                                       '|SparseUnivariatePolynomial|
                                       (|devaluate| |sae|)))
                                     (|DistinctDegreeFactorize| |sae|
                                      (|SparseUnivariatePolynomial|
                                       |sae|))))
                                   (|compiledLookupCheck| '|factors|
                                    (LIST
                                     (LIST '|List|
                                      (LIST '|Record|
                                       (LIST '|:| '|factor|
                                        (LIST
                                         '|SparseUnivariatePolynomial|
                                         (|devaluate| |sae|)))
                                       (LIST '|:| '|exponent|
                                        (LIST '|Integer|))))
                                     '$)
                                    (|Factored|
                                     (|SparseUnivariatePolynomial|
                                      |sae|)))) . #6#)
                         (LETT |redFactors|
                               (PROGN
                                 (LETT #1# NIL . #6#)
                                 (SEQ (LETT |f| NIL . #6#)
                                      (LETT #2# |factorListSAE| . #6#)
                                      G190
                                      (COND
                                        ((OR (ATOM #2#)
                                          (PROGN
                                            (LETT |f| (CAR #2#) . #6#)
                                            NIL))
                                         #7=(GO G191)))
                                      (SEQ
                                       (EXIT
                                        (LETT #1#
                                         (CONS
                                          (SPADCALL (QCAR |f|) |k|
                                           (|compiledLookupCheck| '**
                                            (LIST '$ '$
                                             (LIST
                                              '|NonNegativeInteger|))
                                            (|SparseUnivariatePolynomial|
                                             |sae|)))
                                          #1#) . #6#)))
                                      (LETT #2# (CDR #2#) . #6#)
                                      #8=(GO G190) G191
                                      (EXIT (NREVERSE0 #1#)))) . #6#)
                         (LETT |primaries|
                               (PROGN
                                 (LETT #3# NIL . #6#)
                                 (SEQ (LETT |ff| NIL . #6#)
                                      (LETT #4# |redFactors| . #6#)
                                      G190
                                      (COND
                                        ((OR (ATOM #4#)
                                          (PROGN
                                            (LETT |ff| (CAR #4#) . #6#)
                                            NIL))
                                         #7#))
                                      (SEQ
                                       (EXIT
                                        (LETT #3#
                                         (CONS
                                          (SPADCALL
                                           (|compiledLookupCheck|
                                            '|lift|
                                            (LIST
                                             (LIST
                                              '|SparseUnivariatePolynomial|
                                              (|devaluate| E))
                                             '$)
                                            |sae|)
                                           |ff|
                                           (|compiledLookupCheck|
                                            '|mapUnivariate|
                                            (LIST
                                             (LIST
                                              '|SparseUnivariatePolynomial|
                                              (LIST
                                               '|SparseUnivariatePolynomial|
                                               (|devaluate| E)))
                                             (LIST '|Mapping|
                                              (LIST
                                               '|SparseUnivariatePolynomial|
                                               (|devaluate| E))
                                              (|devaluate| |sae|))
                                             (LIST
                                              '|SparseUnivariatePolynomial|
                                              (|devaluate| |sae|)))
                                            (|IntegralBasisPolynomialTools|
                                             (|SparseUnivariatePolynomial|
                                              E)
                                             (|SparseUnivariatePolynomial|
                                              (|SparseUnivariatePolynomial|
                                               E))
                                             (|SparseUnivariatePolynomial|
                                              (|SparseUnivariatePolynomial|
                                               (|SparseUnivariatePolynomial|
                                                E)))
                                             |sae|)))
                                          #3#) . #6#)))
                                      (LETT #4# (CDR #4#) . #6#) #8#
                                      G191 (EXIT (NREVERSE0 #3#)))) . #6#)
                         (LETT |deg|
                               (PROG1 (LETT #5#
                                       (+ 1
                                        (*
                                         (SPADCALL |redDisc| |prime|
                                          (|compiledLookupCheck|
                                           '|order|
                                           (LIST
                                            (LIST
                                             '|NonNegativeInteger|)
                                            '$ '$)
                                           (|SparseUnivariatePolynomial|
                                            E)))
                                         (SPADCALL |prime|
                                          (|compiledLookupCheck|
                                           '|degree|
                                           (LIST
                                            (LIST
                                             '|NonNegativeInteger|)
                                            '$)
                                           (|SparseUnivariatePolynomial|
                                            E))))) . #6#)
                                 (|check-subtype| (> #5# 0)
                                     '(|PositiveInteger|) #5#)) . #6#)
                         (LETT |henselInfo|
                               (SPADCALL |poly| |primaries| |prime|
                                   |deg|
                                   (|compiledLookupCheck| '|HenselLift|
                                    (LIST
                                     (LIST '|Record|
                                      (LIST '|:| '|plist|
                                       (LIST '|List|
                                        (LIST
                                         '|SparseUnivariatePolynomial|
                                         (LIST
                                          '|SparseUnivariatePolynomial|
                                          (|devaluate| E)))))
                                      (LIST '|:| '|modulo|
                                       (LIST
                                        '|SparseUnivariatePolynomial|
                                        (|devaluate| E))))
                                     (LIST
                                      '|SparseUnivariatePolynomial|
                                      (LIST
                                       '|SparseUnivariatePolynomial|
                                       (|devaluate| E)))
                                     (LIST '|List|
                                      (LIST
                                       '|SparseUnivariatePolynomial|
                                       (LIST
                                        '|SparseUnivariatePolynomial|
                                        (|devaluate| E))))
                                     (LIST
                                      '|SparseUnivariatePolynomial|
                                      (|devaluate| E))
                                     (LIST '|PositiveInteger|))
                                    (|GeneralHenselPackage|
                                     (|SparseUnivariatePolynomial| E)
                                     (|SparseUnivariatePolynomial|
                                      (|SparseUnivariatePolynomial| E))))) . #6#)
                         (LETT |henselFactors|
                               (QCAR |henselInfo|) . #6#)
                         (LETT |psi1|
                               (|SPADfirst| |henselFactors|) . #6#)
                         (LETT FF
                               (|SimpleAlgebraicExtension|
                                   (|SparseUnivariatePolynomial| E)
                                   (|SparseUnivariatePolynomial|
                                    (|SparseUnivariatePolynomial| E))
                                   |psi1|) . #6#)
                         (LETT |factorIb|
                               (SPADCALL |prime|
                                   (|compiledLookupCheck|
                                    '|localIntegralBasis|
                                    (LIST
                                     (LIST '|Record|
                                      (LIST '|:| '|basis|
                                       (LIST '|Matrix|
                                        (LIST
                                         '|SparseUnivariatePolynomial|
                                         (|devaluate| E))))
                                      (LIST '|:| '|basisDen|
                                       (LIST
                                        '|SparseUnivariatePolynomial|
                                        (|devaluate| E)))
                                      (LIST '|:| '|basisInv|
                                       (LIST '|Matrix|
                                        (LIST
                                         '|SparseUnivariatePolynomial|
                                         (|devaluate| E)))))
                                     (LIST
                                      '|SparseUnivariatePolynomial|
                                      (|devaluate| E)))
                                    (|WildFunctionFieldIntegralBasis| E
                                     (|SparseUnivariatePolynomial| E)
                                     (|SparseUnivariatePolynomial|
                                      (|SparseUnivariatePolynomial| E))
                                     FF))) . #6#)
                         (LETT |bs|
                               (SPADCALL |factorIb|
                                   (SPADCALL (QREFELT $ 48)) |r|
                                   (|compiledLookupCheck|
                                    '|listConjugateBases|
                                    (LIST
                                     (LIST '|List|
                                      (LIST '|Record|
                                       (LIST '|:| '|basis|
                                        (LIST '|Matrix|
                                         (LIST
                                          '|SparseUnivariatePolynomial|
                                          (|devaluate| E))))
                                       (LIST '|:| '|basisDen|
                                        (LIST
                                         '|SparseUnivariatePolynomial|
                                         (|devaluate| E)))
                                       (LIST '|:| '|basisInv|
                                        (LIST '|Matrix|
                                         (LIST
                                          '|SparseUnivariatePolynomial|
                                          (|devaluate| E))))))
                                     (LIST '|Record|
                                      (LIST '|:| '|basis|
                                       (LIST '|Matrix|
                                        (LIST
                                         '|SparseUnivariatePolynomial|
                                         (|devaluate| E))))
                                      (LIST '|:| '|basisDen|
                                       (LIST
                                        '|SparseUnivariatePolynomial|
                                        (|devaluate| E)))
                                      (LIST '|:| '|basisInv|
                                       (LIST '|Matrix|
                                        (LIST
                                         '|SparseUnivariatePolynomial|
                                         (|devaluate| E)))))
                                     (LIST '|NonNegativeInteger|)
                                     (LIST '|NonNegativeInteger|))
                                    (|ChineseRemainderToolsForIntegralBases|
                                     E (|SparseUnivariatePolynomial| E)
                                     (|SparseUnivariatePolynomial|
                                      (|SparseUnivariatePolynomial| E))))) . #6#)
                         (LETT |ib|
                               (SPADCALL |henselFactors| |bs| |n|
                                   (|compiledLookupCheck|
                                    '|chineseRemainder|
                                    (LIST
                                     (LIST '|Record|
                                      (LIST '|:| '|basis|
                                       (LIST '|Matrix|
                                        (LIST
                                         '|SparseUnivariatePolynomial|
                                         (|devaluate| E))))
                                      (LIST '|:| '|basisDen|
                                       (LIST
                                        '|SparseUnivariatePolynomial|
                                        (|devaluate| E)))
                                      (LIST '|:| '|basisInv|
                                       (LIST '|Matrix|
                                        (LIST
                                         '|SparseUnivariatePolynomial|
                                         (|devaluate| E)))))
                                     (LIST '|List|
                                      (LIST
                                       '|SparseUnivariatePolynomial|
                                       (LIST
                                        '|SparseUnivariatePolynomial|
                                        (|devaluate| E))))
                                     (LIST '|List|
                                      (LIST '|Record|
                                       (LIST '|:| '|basis|
                                        (LIST '|Matrix|
                                         (LIST
                                          '|SparseUnivariatePolynomial|
                                          (|devaluate| E))))
                                       (LIST '|:| '|basisDen|
                                        (LIST
                                         '|SparseUnivariatePolynomial|
                                         (|devaluate| E)))
                                       (LIST '|:| '|basisInv|
                                        (LIST '|Matrix|
                                         (LIST
                                          '|SparseUnivariatePolynomial|
                                          (|devaluate| E))))))
                                     (LIST '|NonNegativeInteger|))
                                    (|ChineseRemainderToolsForIntegralBases|
                                     E (|SparseUnivariatePolynomial| E)
                                     (|SparseUnivariatePolynomial|
                                      (|SparseUnivariatePolynomial| E))))) . #6#)
                         (LETT |b|
                               (SEQ (LETT |bas|
                                     (SPADCALL
                                      (|compiledLookupCheck|
                                       '|retractIfCan|
                                       (LIST
                                        (LIST '|Union|
                                         (|devaluate| (ELT $ 6))
                                         '"failed")
                                        '$)
                                       E)
                                      (QVELT |ib| 0)
                                      (|compiledLookupCheck|
                                       '|mapMatrixIfCan|
                                       (LIST
                                        (LIST '|Union|
                                         (LIST '|Matrix|
                                          (|devaluate| (ELT $ 7)))
                                         '"failed")
                                        (LIST '|Mapping|
                                         (LIST '|Union|
                                          (|devaluate| (ELT $ 6))
                                          '"failed")
                                         (|devaluate| E))
                                        (LIST '|Matrix|
                                         (LIST
                                          '|SparseUnivariatePolynomial|
                                          (|devaluate| E))))
                                       (|IntegralBasisPolynomialTools|
                                        (ELT $ 6) (ELT $ 7) (ELT $ 8)
                                        E))) . #6#)
                                    (EXIT
                                     (COND
                                       ((QEQCAR |bas| 1)
                                        (|error|
                                         "retraction of basis failed"))
                                       ('T (QCDR |bas|))))) . #6#)
                         (LETT |bInv|
                               (SEQ (LETT |bas|
                                     (SPADCALL
                                      (|compiledLookupCheck|
                                       '|retractIfCan|
                                       (LIST
                                        (LIST '|Union|
                                         (|devaluate| (ELT $ 6))
                                         '"failed")
                                        '$)
                                       E)
                                      (QVELT |ib| 2)
                                      (|compiledLookupCheck|
                                       '|mapMatrixIfCan|
                                       (LIST
                                        (LIST '|Union|
                                         (LIST '|Matrix|
                                          (|devaluate| (ELT $ 7)))
                                         '"failed")
                                        (LIST '|Mapping|
                                         (LIST '|Union|
                                          (|devaluate| (ELT $ 6))
                                          '"failed")
                                         (|devaluate| E))
                                        (LIST '|Matrix|
                                         (LIST
                                          '|SparseUnivariatePolynomial|
                                          (|devaluate| E))))
                                       (|IntegralBasisPolynomialTools|
                                        (ELT $ 6) (ELT $ 7) (ELT $ 8)
                                        E))) . #6#)
                                    (EXIT
                                     (COND
                                       ((QEQCAR |bas| 1)
                                        (|error|
                                         "retraction of basis inverse failed"))
                                       ('T (QCDR |bas|))))) . #6#)
                         (LETT |bDen|
                               (SEQ (LETT |p|
                                     (SPADCALL
                                      (|compiledLookupCheck|
                                       '|retractIfCan|
                                       (LIST
                                        (LIST '|Union|
                                         (|devaluate| (ELT $ 6))
                                         '"failed")
                                        '$)
                                       E)
                                      (QVELT |ib| 1)
                                      (|compiledLookupCheck|
                                       '|mapUnivariateIfCan|
                                       (LIST
                                        (LIST '|Union|
                                         (|devaluate| (ELT $ 7))
                                         '"failed")
                                        (LIST '|Mapping|
                                         (LIST '|Union|
                                          (|devaluate| (ELT $ 6))
                                          '"failed")
                                         (|devaluate| E))
                                        (LIST
                                         '|SparseUnivariatePolynomial|
                                         (|devaluate| E)))
                                       (|IntegralBasisPolynomialTools|
                                        (ELT $ 6) (ELT $ 7) (ELT $ 8)
                                        E))) . #6#)
                                    (EXIT
                                     (COND
                                       ((QEQCAR |p| 1)
                                        (|error|
                                         "retraction of basis denominator failed"))
                                       ('T (QCDR |p|))))) . #6#)
                         (EXIT (VECTOR |b| |bDen| |bInv|)))))))))) 

(DEFUN |PWFFINTB;compLocalBasisOverExt!3| (|#1| $$)
  (SPADCALL |#1|
      (|compiledLookupCheck| '|coerce|
          (LIST '$ (|devaluate| (ELT (QREFELT $$ 1) 6)))
          (QREFELT $$ 0)))) 

(DEFUN |PWFFINTB;compLocalBasisOverExt!2| (|#1| $$)
  (SPADCALL |#1|
      (|compiledLookupCheck| '|coerce|
          (LIST '$ (|devaluate| (ELT (QREFELT $$ 1) 6)))
          (QREFELT $$ 0)))) 

(DEFUN |PWFFINTB;compLocalBasisOverExt!1| (|#1| $$)
  (SPADCALL |#1|
      (|compiledLookupCheck| '|coerce|
          (LIST '$ (|devaluate| (ELT (QREFELT $$ 1) 6)))
          (QREFELT $$ 0)))) 

(DEFUN |PWFFINTB;compLocalBasisOverExt!0| (|#1| $$)
  (SPADCALL |#1|
      (|compiledLookupCheck| '|coerce|
          (LIST '$ (|devaluate| (ELT (QREFELT $$ 1) 6)))
          (QREFELT $$ 0)))) 

(DEFUN |PWFFINTB;padicLocalIntegralBasis|
       (|p| |disc| |redDisc| |prime| $)
  (PROG (|sae| |reducedP| |factorListSAE| #0=#:G1892 #1=#:G1893
               |redPrimes| #2=#:G1894 #3=#:G1895 |primes| #4=#:G1896
               #5=#:G1897 #6=#:G1875 |expons| #7=#:G1898 |f| #8=#:G1899
               #9=#:G1877 |redPrimaries| #10=#:G1900 |ff| #11=#:G1901
               |primaries| #12=#:G1880 |deg| |henselInfo|
               |henselFactors| |degPrime| |qq| #13=#:G1904 |k|
               #14=#:G1903 |pp| #15=#:G1902 |degPp| |base|
               |factorBases| |ib| |index|)
    (RETURN
      (SEQ (LETT |sae|
                 (|SimpleAlgebraicExtension| (QREFELT $ 6)
                     (QREFELT $ 7) |prime|)
                 . #16=(|PWFFINTB;padicLocalIntegralBasis|))
           (LETT |reducedP|
                 (SPADCALL
                     (|compiledLookupCheck| '|reduce|
                         (LIST '$ (|devaluate| (ELT $ 7))) |sae|)
                     |p|
                     (|compiledLookupCheck| '|mapUnivariate|
                         (LIST (LIST '|SparseUnivariatePolynomial|
                                     (|devaluate| |sae|))
                               (LIST '|Mapping| (|devaluate| |sae|)
                                     (|devaluate| (ELT $ 7)))
                               (|devaluate| (ELT $ 8)))
                         (|IntegralBasisPolynomialTools| (ELT $ 7)
                             (ELT $ 8)
                             (|SparseUnivariatePolynomial| (ELT $ 8))
                             |sae|))) . #16#)
           (LETT |factorListSAE|
                 (SPADCALL
                     (SPADCALL |reducedP|
                         (|compiledLookupCheck| '|factor|
                             (LIST (LIST '|Factored|
                                    (LIST '|SparseUnivariatePolynomial|
                                     (|devaluate| |sae|)))
                                   (LIST '|SparseUnivariatePolynomial|
                                    (|devaluate| |sae|)))
                             (|DistinctDegreeFactorize| |sae|
                                 (|SparseUnivariatePolynomial| |sae|))))
                     (|compiledLookupCheck| '|factors|
                         (LIST (LIST '|List|
                                     (LIST '|Record|
                                      (LIST '|:| '|factor|
                                       (LIST
                                        '|SparseUnivariatePolynomial|
                                        (|devaluate| |sae|)))
                                      (LIST '|:| '|exponent|
                                       (LIST '|Integer|))))
                               '$)
                         (|Factored|
                             (|SparseUnivariatePolynomial| |sae|)))) . #16#)
           (EXIT (COND
                   ((EQL (LENGTH |factorListSAE|) 1)
                    (SEQ (LETT |ib|
                               (SPADCALL |prime| (QREFELT $ 53)) . #16#)
                         (LETT |index|
                               (SPADCALL (QVELT |ib| 2) (QREFELT $ 55)) . #16#)
                         (EXIT (VECTOR (QVELT |ib| 0) (QVELT |ib| 1)
                                       (QVELT |ib| 2)
                                       (SPADCALL |disc|
                                        (SPADCALL |index| |index|
                                         (QREFELT $ 56))
                                        (QREFELT $ 57))))))
                   ('T
                    (SEQ (LETT |redPrimes|
                               (PROGN
                                 (LETT #0# NIL . #16#)
                                 (SEQ (LETT |f| NIL . #16#)
                                      (LETT #1# |factorListSAE| . #16#)
                                      G190
                                      (COND
                                        ((OR (ATOM #1#)
                                          (PROGN
                                            (LETT |f| (CAR #1#) . #16#)
                                            NIL))
                                         #17=(GO G191)))
                                      (SEQ
                                       (EXIT
                                        (LETT #0#
                                         (CONS (QCAR |f|) #0#) . #16#)))
                                      (LETT #1# (CDR #1#) . #16#)
                                      #18=(GO G190) G191
                                      (EXIT (NREVERSE0 #0#)))) . #16#)
                         (LETT |primes|
                               (PROGN
                                 (LETT #2# NIL . #16#)
                                 (SEQ (LETT |ff| NIL . #16#)
                                      (LETT #3# |redPrimes| . #16#)
                                      G190
                                      (COND
                                        ((OR (ATOM #3#)
                                          (PROGN
                                            (LETT |ff|
                                             (CAR #3#) . #16#)
                                            NIL))
                                         #17#))
                                      (SEQ
                                       (EXIT
                                        (LETT #2#
                                         (CONS
                                          (SPADCALL
                                           (|compiledLookupCheck|
                                            '|lift|
                                            (LIST
                                             (|devaluate| (ELT $ 7))
                                             '$)
                                            |sae|)
                                           |ff|
                                           (|compiledLookupCheck|
                                            '|mapUnivariate|
                                            (LIST
                                             (|devaluate| (ELT $ 8))
                                             (LIST '|Mapping|
                                              (|devaluate| (ELT $ 7))
                                              (|devaluate| |sae|))
                                             (LIST
                                              '|SparseUnivariatePolynomial|
                                              (|devaluate| |sae|)))
                                            (|IntegralBasisPolynomialTools|
                                             (ELT $ 7) (ELT $ 8)
                                             (|SparseUnivariatePolynomial|
                                              (ELT $ 8))
                                             |sae|)))
                                          #2#) . #16#)))
                                      (LETT #3# (CDR #3#) . #16#) #18#
                                      G191 (EXIT (NREVERSE0 #2#)))) . #16#)
                         (LETT |expons|
                               (PROGN
                                 (LETT #4# NIL . #16#)
                                 (SEQ (LETT |f| NIL . #16#)
                                      (LETT #5# |factorListSAE| . #16#)
                                      G190
                                      (COND
                                        ((OR (ATOM #5#)
                                          (PROGN
                                            (LETT |f| (CAR #5#) . #16#)
                                            NIL))
                                         #17#))
                                      (SEQ
                                       (EXIT
                                        (LETT #4#
                                         (CONS
                                          (PROG1
                                           (LETT #6# (QCDR |f|) . #16#)
                                            (|check-subtype| (>= #6# 0)
                                             '(|NonNegativeInteger|)
                                             #6#))
                                          #4#) . #16#)))
                                      (LETT #5# (CDR #5#) . #16#) #18#
                                      G191 (EXIT (NREVERSE0 #4#)))) . #16#)
                         (LETT |redPrimaries|
                               (PROGN
                                 (LETT #7# NIL . #16#)
                                 (SEQ (LETT |f| NIL . #16#)
                                      (LETT #8# |factorListSAE| . #16#)
                                      G190
                                      (COND
                                        ((OR (ATOM #8#)
                                          (PROGN
                                            (LETT |f| (CAR #8#) . #16#)
                                            NIL))
                                         #17#))
                                      (SEQ
                                       (EXIT
                                        (LETT #7#
                                         (CONS
                                          (SPADCALL (QCAR |f|)
                                           (PROG1
                                            (LETT #9#
                                             (QCDR |f|) . #16#)
                                             (|check-subtype|
                                              (>= #9# 0)
                                              '(|NonNegativeInteger|)
                                              #9#))
                                           (|compiledLookupCheck| '**
                                            (LIST '$ '$
                                             (LIST
                                              '|NonNegativeInteger|))
                                            (|SparseUnivariatePolynomial|
                                             |sae|)))
                                          #7#) . #16#)))
                                      (LETT #8# (CDR #8#) . #16#) #18#
                                      G191 (EXIT (NREVERSE0 #7#)))) . #16#)
                         (LETT |primaries|
                               (PROGN
                                 (LETT #10# NIL . #16#)
                                 (SEQ (LETT |ff| NIL . #16#)
                                      (LETT #11# |redPrimaries| . #16#)
                                      G190
                                      (COND
                                        ((OR (ATOM #11#)
                                          (PROGN
                                            (LETT |ff|
                                             (CAR #11#) . #16#)
                                            NIL))
                                         #17#))
                                      (SEQ
                                       (EXIT
                                        (LETT #10#
                                         (CONS
                                          (SPADCALL
                                           (|compiledLookupCheck|
                                            '|lift|
                                            (LIST
                                             (|devaluate| (ELT $ 7))
                                             '$)
                                            |sae|)
                                           |ff|
                                           (|compiledLookupCheck|
                                            '|mapUnivariate|
                                            (LIST
                                             (|devaluate| (ELT $ 8))
                                             (LIST '|Mapping|
                                              (|devaluate| (ELT $ 7))
                                              (|devaluate| |sae|))
                                             (LIST
                                              '|SparseUnivariatePolynomial|
                                              (|devaluate| |sae|)))
                                            (|IntegralBasisPolynomialTools|
                                             (ELT $ 7) (ELT $ 8)
                                             (|SparseUnivariatePolynomial|
                                              (ELT $ 8))
                                             |sae|)))
                                          #10#) . #16#)))
                                      (LETT #11# (CDR #11#) . #16#)
                                      #18# G191
                                      (EXIT (NREVERSE0 #10#)))) . #16#)
                         (LETT |deg|
                               (PROG1 (LETT #12#
                                       (+ 1
                                        (*
                                         (SPADCALL |redDisc| |prime|
                                          (QREFELT $ 58))
                                         (SPADCALL |prime|
                                          (QREFELT $ 59)))) . #16#)
                                 (|check-subtype| (> #12# 0)
                                     '(|PositiveInteger|) #12#)) . #16#)
                         (LETT |henselInfo|
                               (SPADCALL |p| |primaries| |prime| |deg|
                                   (QREFELT $ 63)) . #16#)
                         (LETT |henselFactors|
                               (QCAR |henselInfo|) . #16#)
                         (LETT |factorBases| NIL . #16#)
                         (LETT |degPrime|
                               (SPADCALL |prime| (QREFELT $ 59)) . #16#)
                         (SEQ (LETT |qq| NIL . #16#)
                              (LETT #13# |henselFactors| . #16#)
                              (LETT |k| NIL . #16#)
                              (LETT #14# |expons| . #16#)
                              (LETT |pp| NIL . #16#)
                              (LETT #15# |primes| . #16#) G190
                              (COND
                                ((OR (ATOM #15#)
                                     (PROGN
                                       (LETT |pp| (CAR #15#) . #16#)
                                       NIL)
                                     (ATOM #14#)
                                     (PROGN
                                       (LETT |k| (CAR #14#) . #16#)
                                       NIL)
                                     (ATOM #13#)
                                     (PROGN
                                       (LETT |qq| (CAR #13#) . #16#)
                                       NIL))
                                 #17#))
                              (SEQ (LETT |base|
                                    (SEQ
                                     (LETT |degPp|
                                      (SPADCALL |pp| (QREFELT $ 36)) . #16#)
                                     (COND
                                       ((< 1 |degPp|)
                                        (COND
                                          ((EQL
                                            (GCD |degPp| |degPrime|) 1)
                                           (EXIT
                                            (|PWFFINTB;compLocalBasisOverExt|
                                             |qq| |prime| |pp| |k| $))))))
                                     (EXIT
                                      (|PWFFINTB;compLocalBasis| |qq|
                                       |prime| $))) . #16#)
                                   (EXIT
                                    (LETT |factorBases|
                                     (CONS |base| |factorBases|) . #16#)))
                              (LETT #15#
                                    (PROG1 (CDR #15#)
                                      (LETT #14#
                                       (PROG1 (CDR #14#)
                                         (LETT #13# (CDR #13#) . #16#)) . #16#)) . #16#)
                              #18# G191 (EXIT NIL))
                         (LETT |factorBases|
                               (NREVERSE |factorBases|) . #16#)
                         (LETT |ib|
                               (SPADCALL |henselFactors| |factorBases|
                                   (SPADCALL (QREFELT $ 66))
                                   (QREFELT $ 69)) . #16#)
                         (LETT |index|
                               (SPADCALL (QVELT |ib| 2) (QREFELT $ 55)) . #16#)
                         (EXIT (VECTOR (QVELT |ib| 0) (QVELT |ib| 1)
                                       (QVELT |ib| 2)
                                       (SPADCALL |disc|
                                        (SPADCALL |index| |index|
                                         (QREFELT $ 56))
                                        (QREFELT $ 57)))))))))))) 

(DEFUN |PWFFINTB;localIntegralBasis;RR;5| (|prime| $)
  (PROG (|p| |disc| |redDisc| |ib|)
    (RETURN
      (SEQ (LETT |p| (SPADCALL (QREFELT $ 70))
                 . #0=(|PWFFINTB;localIntegralBasis;RR;5|))
           (LETT |disc| (SPADCALL |p| (QREFELT $ 37)) . #0#)
           (LETT |redDisc| (SPADCALL |p| (QREFELT $ 34)) . #0#)
           (LETT |ib|
                 (|PWFFINTB;padicLocalIntegralBasis| |p| |disc|
                     |redDisc| |prime| $) . #0#)
           (EXIT (VECTOR (QVELT |ib| 0) (QVELT |ib| 1) (QVELT |ib| 2))))))) 

(DEFUN |PWFFINTB;listSquaredFactors| (|px| $)
  (PROG (|factored| |f| #0=#:G1916 |ans|)
    (RETURN
      (SEQ (LETT |ans| NIL . #1=(|PWFFINTB;listSquaredFactors|))
           (LETT |factored| (SPADCALL |px| (QREFELT $ 74)) . #1#)
           (SEQ (LETT |f| NIL . #1#)
                (LETT #0# (SPADCALL |factored| (QREFELT $ 77)) . #1#)
                G190
                (COND
                  ((OR (ATOM #0#)
                       (PROGN (LETT |f| (CAR #0#) . #1#) NIL))
                   (GO G191)))
                (SEQ (EXIT (COND
                             ((< 1 (QCDR |f|))
                              (LETT |ans|
                                    (CONS (QCAR |f|) |ans|) . #1#)))))
                (LETT #0# (CDR #0#) . #1#) (GO G190) G191 (EXIT NIL))
           (EXIT |ans|))))) 

(DEFUN |PWFFINTB;integralBasis;R;7| ($)
  (PROG (|p| |n| |singList| |redDisc| |prime| #0=#:G1924 |lb| |rb|
             |rbinv| |rbden| |disc| |mat| |runningRbden| |runningRb|
             |runningRbinv|)
    (RETURN
      (SEQ (LETT |p| (SPADCALL (QREFELT $ 70))
                 . #1=(|PWFFINTB;integralBasis;R;7|))
           (LETT |disc| (SPADCALL |p| (QREFELT $ 37)) . #1#)
           (LETT |n| (SPADCALL (QREFELT $ 66)) . #1#)
           (LETT |singList|
                 (|PWFFINTB;listSquaredFactors| |disc| $) . #1#)
           (LETT |redDisc| (SPADCALL |p| (QREFELT $ 34)) . #1#)
           (LETT |runningRb|
                 (LETT |runningRbinv|
                       (SPADCALL |n| (|spadConstant| $ 39)
                           (QREFELT $ 41)) . #1#) . #1#)
           (LETT |runningRbden| (|spadConstant| $ 39) . #1#)
           (EXIT (COND
                   ((NULL |singList|)
                    (VECTOR |runningRb| |runningRbden| |runningRbinv|))
                   ('T
                    (SEQ (SEQ (LETT |prime| NIL . #1#)
                              (LETT #0# |singList| . #1#) G190
                              (COND
                                ((OR (ATOM #0#)
                                     (PROGN
                                       (LETT |prime| (CAR #0#) . #1#)
                                       NIL))
                                 (GO G191)))
                              (SEQ (LETT |lb|
                                    (|PWFFINTB;padicLocalIntegralBasis|
                                     |p| |disc| |redDisc| |prime| $) . #1#)
                                   (LETT |rb| (QVELT |lb| 0) . #1#)
                                   (LETT |rbinv| (QVELT |lb| 2) . #1#)
                                   (LETT |rbden| (QVELT |lb| 1) . #1#)
                                   (LETT |disc| (QVELT |lb| 3) . #1#)
                                   (LETT |mat|
                                    (SPADCALL
                                     (SPADCALL |rbden| |runningRb|
                                      (QREFELT $ 79))
                                     (SPADCALL |runningRbden| |rb|
                                      (QREFELT $ 79))
                                     (QREFELT $ 80)) . #1#)
                                   (LETT |runningRbden|
                                    (SPADCALL |runningRbden| |rbden|
                                     (QREFELT $ 56)) . #1#)
                                   (LETT |runningRb|
                                    (SPADCALL
                                     (SPADCALL |mat| |runningRbden|
                                      (QREFELT $ 82))
                                     (QREFELT $ 83)) . #1#)
                                   (EXIT
                                    (LETT |runningRbinv|
                                     (SPADCALL |runningRb|
                                      |runningRbden| (QREFELT $ 85)) . #1#)))
                              (LETT #0# (CDR #0#) . #1#) (GO G190) G191
                              (EXIT NIL))
                         (EXIT (VECTOR |runningRb| |runningRbden|
                                       |runningRbinv|)))))))))) 

(DEFUN |PAdicWildFunctionFieldIntegralBasis| (&REST #0=#:G1925)
  (PROG ()
    (RETURN
      (PROG (#1=#:G1926)
        (RETURN
          (COND
            ((LETT #1#
                   (|lassocShiftWithFunction| (|devaluateList| #0#)
                       (HGET |$ConstructorCache|
                             '|PAdicWildFunctionFieldIntegralBasis|)
                       '|domainEqualList|)
                   . #2=(|PAdicWildFunctionFieldIntegralBasis|))
             (|CDRwithIncrement| #1#))
            ('T
             (UNWIND-PROTECT
               (PROG1 (APPLY (|function|
                                 |PAdicWildFunctionFieldIntegralBasis;|)
                             #0#)
                 (LETT #1# T . #2#))
               (COND
                 ((NOT #1#)
                  (HREM |$ConstructorCache|
                        '|PAdicWildFunctionFieldIntegralBasis|))))))))))) 

(DEFUN |PAdicWildFunctionFieldIntegralBasis;| (|#1| |#2| |#3| |#4|)
  (PROG (DV$1 DV$2 DV$3 DV$4 |dv$| $ |pv$|)
    (RETURN
      (PROGN
        (LETT DV$1 (|devaluate| |#1|)
              . #0=(|PAdicWildFunctionFieldIntegralBasis|))
        (LETT DV$2 (|devaluate| |#2|) . #0#)
        (LETT DV$3 (|devaluate| |#3|) . #0#)
        (LETT DV$4 (|devaluate| |#4|) . #0#)
        (LETT |dv$|
              (LIST '|PAdicWildFunctionFieldIntegralBasis| DV$1 DV$2
                    DV$3 DV$4) . #0#)
        (LETT $ (GETREFV 87) . #0#)
        (QSETREFV $ 0 |dv$|)
        (QSETREFV $ 3 (LETT |pv$| (|buildPredVector| 0 0 NIL) . #0#))
        (|haddProp| |$ConstructorCache|
            '|PAdicWildFunctionFieldIntegralBasis|
            (LIST DV$1 DV$2 DV$3 DV$4) (CONS 1 $))
        (|stuffDomainSlots| $)
        (QSETREFV $ 6 |#1|)
        (QSETREFV $ 7 |#2|)
        (QSETREFV $ 8 |#3|)
        (QSETREFV $ 9 |#4|)
        $)))) 

(MAKEPROP '|PAdicWildFunctionFieldIntegralBasis| '|infovec|
    (LIST '#(NIL NIL NIL NIL NIL NIL (|local| |#1|) (|local| |#2|)
             (|local| |#3|) (|local| |#4|) (|Fraction| 7)
             (0 . |coerce|) (|SparseUnivariatePolynomial| 10)
             (|Mapping| 10 7)
             (|IntegralBasisPolynomialTools| 7 8
                 (|SparseUnivariatePolynomial| 8) 10)
             (5 . |mapUnivariate|) (11 . |differentiate|)
             (|Record| (|:| |coef1| $) (|:| |coef2| $)
                 (|:| |generator| $))
             (16 . |extendedEuclidean|) (|List| 10)
             (22 . |coefficients|) (27 . |concat|)
             (|Record| (|:| |num| 19) (|:| |den| 7))
             (|CommonDenominator| 7 10 19) (33 . |splitDenominator|)
             (38 . |numer|) (|List| 7) (|Mapping| 7 10)
             (|ListFunctions2| 10 7) (43 . |map|) (|List| $)
             (49 . |gcd|) (|Union| $ '"failed") (54 . |exquo|)
             |PWFFINTB;reducedDiscriminant;UPR;1|
             (|NonNegativeInteger|) (60 . |degree|)
             (65 . |discriminant|) (70 . |One|) (74 . |One|)
             (|Matrix| 7) (78 . |scalarMatrix|)
             (|SparseUnivariatePolynomial| 6) (|PositiveInteger|)
             (|IrredPolyOverFiniteField| 6) (84 . |generateIrredPoly|)
             (89 . |One|) (93 . |One|) (97 . |size|) (|Vector| $)
             (101 . |basis|)
             (|Record| (|:| |basis| 40) (|:| |basisDen| 7)
                 (|:| |basisInv| 40))
             (|WildFunctionFieldIntegralBasis| 6 7 8 9)
             (105 . |localIntegralBasis|) (|IntegralBasisTools| 7 8 9)
             (110 . |diagonalProduct|) (115 . *) (121 . |quo|)
             (127 . |order|) (133 . |degree|)
             (|Record| (|:| |plist| 61) (|:| |modulo| 7)) (|List| 8)
             (|GeneralHenselPackage| 7 8) (138 . |HenselLift|)
             (|Fraction| (|Integer|)) (146 . |One|) (150 . |rank|)
             (|List| 51)
             (|ChineseRemainderToolsForIntegralBases| 6 7 8)
             (154 . |chineseRemainder|) (161 . |definingPolynomial|)
             |PWFFINTB;localIntegralBasis;RR;5| (|Factored| 7)
             (|DistinctDegreeFactorize| 6 7) (165 . |factor|)
             (|Record| (|:| |factor| 7) (|:| |exponent| (|Integer|)))
             (|List| 75) (170 . |factors|) (175 . |One|) (179 . *)
             (185 . |vertConcat|) (|ModularHermitianRowReduction| 7)
             (191 . |rowEchelon|) (197 . |squareTop|)
             (|TriangularMatrixOperations| 7 (|Vector| 7) (|Vector| 7)
                 40)
             (202 . |UpTriBddDenomInv|) |PWFFINTB;integralBasis;R;7|)
          '#(|reducedDiscriminant| 208 |localIntegralBasis| 213
             |integralBasis| 218)
          'NIL
          (CONS (|makeByteWordVec2| 1 'NIL)
                (CONS '#()
                      (CONS '#()
                            (|makeByteWordVec2| 86
                                '(1 10 0 7 11 2 14 12 13 8 15 1 12 0 0
                                  16 2 12 17 0 0 18 1 12 19 0 20 2 19 0
                                  0 0 21 1 23 22 19 24 1 10 7 0 25 2 28
                                  26 27 19 29 1 7 0 30 31 2 7 32 0 0 33
                                  1 8 35 0 36 1 8 7 0 37 0 6 0 38 0 7 0
                                  39 2 40 0 35 7 41 1 44 42 43 45 0 8 0
                                  46 0 9 0 47 0 6 35 48 0 9 49 50 1 52
                                  51 7 53 1 54 7 40 55 2 7 0 0 0 56 2 7
                                  0 0 0 57 2 7 35 0 0 58 1 7 35 0 59 4
                                  62 60 8 61 7 43 63 0 64 0 65 0 9 43
                                  66 3 68 51 61 67 35 69 0 9 8 70 1 73
                                  72 7 74 1 72 76 0 77 0 72 0 78 2 40 0
                                  7 0 79 2 40 0 0 0 80 2 81 40 40 7 82
                                  1 40 0 0 83 2 84 40 40 7 85 1 0 7 8
                                  34 1 0 51 7 71 0 0 51 86)))))
          '|lookupComplete|)) 
