diff --git a/changelog b/changelog index eeab935..6ffd80a 100644 --- a/changelog +++ b/changelog @@ -1,3 +1,53 @@ +20070905 tpd src/doc/spadhelp add Set +20070905 tpd src/algebra/Makefile add Set.help +20070905 tpd src/algebra/sets.spad add Set.help (SET) +20070905 tpd src/algebra/sets.spad Set.input +20070905 tpd src/doc/spadhelp add SegmentBinding +20070905 tpd src/algebra/Makefile add SegmentBinding.help +20070905 tpd src/algebra/seg.spad add SegmentBinding.help (SEGBIND) +20070905 tpd src/algebra/seg.spad SegmentBinding.input +20070905 tpd src/doc/spadhelp add Segment +20070905 tpd src/algebra/Makefile add Segment.help +20070905 tpd src/algebra/seg.spad add Segment.help (SEG) +20070905 tpd src/algebra/seg.spad Segment.input +20070905 tpd src/algebra/integer.spad update RomanNumeral.help (ROMAN) +20070905 tpd src/algebra/integer.spad update RomanNumeral.input +20070904 tpd src/doc/spadhelp add RegularTriangularSet +20070904 tpd src/algebra/Makefile add RegularTriangularSet.help +20070904 tpd src/algebra/regset.spad add RegularTriangularSet.help (REGSET) +20070904 tpd src/algebra/regset.spad RegularTriangularSet.input +20070904 tpd src/doc/spadhelp add RealClosure +20070904 tpd src/algebra/Makefile add RealClosure.help +20070904 tpd src/algebra/reclos.spad add RealClosure.help (RECLOS) +20070904 tpd src/algebra/reclos.spad RealClosure.input +20070904 tpd src/doc/spadhelp add RadixExpansion +20070904 tpd src/algebra/Makefile add RadixExpansion.help +20070904 tpd src/algebra/radix.spad add RadixExpansion.help (RADIX) +20070904 tpd src/algebra/radix.spad RadixExpansion.input +20070903 tpd src/doc/spadhelp add Polynomial +20070903 tpd src/algebra/Makefile add Polynomial.help +20070903 tpd src/algebra/multpoly.spad add Polynomial.help (POLY) +20070903 tpd src/algebra/multpoly.spad Polynomial.input +20070903 tpd src/doc/spadhelp add Permanent +20070903 tpd src/algebra/Makefile add Permanent.help +20070903 tpd src/algebra/perman.spad add Permanent.help (PERMAN) +20070903 tpd src/algebra/perman.spad Permanent.input +20070903 tpd src/doc/spadhelp add PartialFraction +20070903 tpd src/algebra/Makefile add PartialFraction.help +20070903 tpd src/algebra/pfr.spad add PartialFraction.help (PFR) +20070903 tpd src/algebra/pfr.spad PartialFraction.input +20070903 tpd src/doc/spadhelp add OrderlyDifferentialPolynomial +20070903 tpd src/algebra/Makefile add OrderlyDifferentialPolynomial.help +20070903 tpd src/algebra/dpolcat.spad add OrderlyDifferentialPolynomial (ODPOL) +20070903 tpd src/algebra/dpolcat.spad OrderlyDifferentialPolynomial.input +20070903 tpd src/doc/spadhelp add OrderedVariableList +20070903 tpd src/algebra/Makefile add OrderedVariableList.help +20070903 tpd src/algebra/variable.spad add OrderedVariableList.help (OVAR) +20070903 tpd src/algebra/variable.spad OrderedVariableList.input +20070903 tpd src/doc/spadhelp add Operator +20070903 tpd src/algebra/Makefile add Operator.help +20070903 tpd src/algebra/opalg.spad add Operator.help (OP) +20070903 tpd src/algebra/opalg.spad Operator.input 20070903 tpd src/algebra/radix.spad fix typos in help file 20070903 tpd src/algebra/integer.spad fix typos in help file 20070903 tpd src/doc/bookvol4 fix typos @@ -26,7 +76,7 @@ 20070902 tpd src/algebra/Makefile add Matrix.help 20070902 tpd src/algebra/matrix.spad add Matrix.help (MATRIX) 20070902 tpd src/algebra/matrix.spad Matrix.input -20070902 tpd src/doc/bookvol4 document how to add help files +20070902 tpd src/doc/Makefile document how to add help files 20070902 tpd src/algebra/Makefile document how to add help files 20070902 tpd src/doc/spadhelp add MappingPackage3 20070902 tpd src/algebra/Makefile add MappingPackage3.help diff --git a/src/algebra/Makefile.pamphlet b/src/algebra/Makefile.pamphlet index b011d80..8c50591 100644 --- a/src/algebra/Makefile.pamphlet +++ b/src/algebra/Makefile.pamphlet @@ -2098,10 +2098,16 @@ SPADHELP=\ ${HELP}/Matrix.help ${HELP}/Multiset.help \ ${HELP}/MultivariatePolynomial.help ${HELP}/None.help \ ${HELP}/Octonion.help ${HELP}/OneDimensionalArray.help \ + ${HELP}/Operator.help ${HELP}/OrderedVariableList.help \ + ${HELP}/OrderlyDifferentialPolynomial.help \ ${HELP}/PlaneAlgebraicCurvePlot.help \ - ${HELP}/Permutation.help \ - ${HELP}/RealSolvePackage.help \ - ${HELP}/RomanNumeral.help \ + ${HELP}/Permutation.help ${HELP}/PartialFraction.help \ + ${HELP}/Permanent.help ${HELP}/Polynomial.help \ + ${HELP}/Quaternion.help ${HELP}/RadixExpansion.help \ + ${HELP}/RealClosure.help ${HELP}/RealSolvePackage.help \ + ${HELP}/RegularTriangularSet.help \ + ${HELP}/RomanNumeral.help ${HELP}/Segment.help \ + ${HELP}/Set.help \ ${HELP}/TwoDimensionalViewport.help @ @@ -2142,10 +2148,15 @@ REGRESS=\ Matrix.regress Multiset.regress \ MultivariatePolynomial.regress None.regress \ Octonion.regress OneDimensionalArray.regress \ - RealSolvePackage.regress \ + Operator.regress OrderedVariableList.regress \ + OrderlyDifferentialPolynomial.regress PartialFraction.regress \ + Permanent.regress Permutation.regress \ PlaneAlgebraicCurvePlot.regress \ - Permutation.regress \ - RomanNumeral.regress + Polynomial.regress Quaternion.regress \ + RadixExpansion.regress RealClosure.regress \ + RealSolvePackage.regress RegularTriangularSet.regress \ + RomanNumeral.regress Segment.regress \ + Set.regress # this requires graphics # TwoDimensionalViewport @@ -2628,8 +2639,60 @@ ${HELP}/OneDimensionalArray.help: ${IN}/array1.spad.pamphlet @${TANGLE} -R"OneDimensionalArray.input" ${IN}/array1.spad.pamphlet \ >${INPUT}/OneDimensionalArray.input +${HELP}/Operator.help: ${IN}/opalg.spad.pamphlet + @echo 7053 create Operator.help from ${IN}/opalg.spad.pamphlet + @${TANGLE} -R"Operator.help" ${IN}/opalg.spad.pamphlet \ + >${HELP}/Operator.help + @cp ${HELP}/Operator.help ${HELP}/OP.help + @${TANGLE} -R"Operator.input" ${IN}/opalg.spad.pamphlet \ + >${INPUT}/Operator.input + +${HELP}/OrderedVariableList.help: ${IN}/variable.spad.pamphlet + @echo 7054 create OrderedVariableList.help from \ + ${IN}/variable.spad.pamphlet + @${TANGLE} -R"OrderedVariableList.help" ${IN}/variable.spad.pamphlet \ + >${HELP}/OrderedVariableList.help + @cp ${HELP}/OrderedVariableList.help ${HELP}/OVAR.help + @${TANGLE} -R"OrderedVariableList.input" ${IN}/variable.spad.pamphlet \ + >${INPUT}/OrderedVariableList.input + +${HELP}/OrderlyDifferentialPolynomial.help: ${IN}/dpolcat.spad.pamphlet + @echo 7055 create OrderlyDifferentialPolynomial.help from \ + ${IN}/dpolcat.spad.pamphlet + @${TANGLE} -R"OrderlyDifferentialPolynomial.help" \ + ${IN}/dpolcat.spad.pamphlet \ + >${HELP}/OrderlyDifferentialPolynomial.help + @cp ${HELP}/OrderlyDifferentialPolynomial.help ${HELP}/ODPOL.help + @${TANGLE} -R"OrderlyDifferentialPolynomial.input" \ + ${IN}/dpolcat.spad.pamphlet \ + >${INPUT}/OrderlyDifferentialPolynomial.input + +${HELP}/PartialFraction.help: ${IN}/pfr.spad.pamphlet + @echo 7056 create PartialFraction.help from ${IN}/pfr.spad.pamphlet + @${TANGLE} -R"PartialFraction.help" ${IN}/pfr.spad.pamphlet \ + >${HELP}/PartialFraction.help + @cp ${HELP}/PartialFraction.help ${HELP}/PFR.help + @${TANGLE} -R"PartialFraction.input" ${IN}/pfr.spad.pamphlet \ + >${INPUT}/PartialFraction.input + +${HELP}/Permanent.help: ${IN}/perman.spad.pamphlet + @echo 7057 create Permanent.help from ${IN}/perman.spad.pamphlet + @${TANGLE} -R"Permanent.help" ${IN}/perman.spad.pamphlet \ + >${HELP}/Permanent.help + @cp ${HELP}/Permanent.help ${HELP}/PERMAN.help + @${TANGLE} -R"Permanent.input" ${IN}/perman.spad.pamphlet \ + >${INPUT}/Permanent.input + +${HELP}/Polynomial.help: ${IN}/multpoly.spad.pamphlet + @echo 7058 create Polynomial.help from ${IN}/multpoly.spad.pamphlet + @${TANGLE} -R"Polynomial.help" ${IN}/multpoly.spad.pamphlet \ + >${HELP}/Polynomial.help + @cp ${HELP}/Polynomial.help ${HELP}/POLY.help + @${TANGLE} -R"Polynomial.input" ${IN}/multpoly.spad.pamphlet \ + >${INPUT}/Polynomial.input + ${HELP}/PlaneAlgebraicCurvePlot.help: ${IN}/acplot.spad.pamphlet - @echo 7053 create PlaneAlgebraicCurvePlot.help from \ + @echo 7059 create PlaneAlgebraicCurvePlot.help from \ ${IN}/acplot.spad.pamphlet @${TANGLE} -R"PlaneAlgebraicCurvePlot.help" \ ${IN}/acplot.spad.pamphlet \ @@ -2640,31 +2703,80 @@ ${HELP}/PlaneAlgebraicCurvePlot.help: ${IN}/acplot.spad.pamphlet >${INPUT}/PlaneAlgebraicCurvePlot.input ${HELP}/Permutation.help: ${IN}/perm.spad.pamphlet - @echo 7054 create Permutation.help from ${IN}/perm.spad.pamphlet + @echo 7060 create Permutation.help from ${IN}/perm.spad.pamphlet @${TANGLE} -R"Permutation.help" ${IN}/perm.spad.pamphlet \ >${HELP}/Permutation.help @cp ${HELP}/Permutation.help ${HELP}/PERM.help @${TANGLE} -R"Permutation.input" ${IN}/perm.spad.pamphlet \ >${INPUT}/Permutation.input +${HELP}/Quaternion.help: ${IN}/quat.spad.pamphlet + @echo 7061 create Quaternion.help from ${IN}/quat.spad.pamphlet + @${TANGLE} -R"Quaternion.help" ${IN}/quat.spad.pamphlet \ + >${HELP}/Quaternion.help + @cp ${HELP}/Quaternion.help ${HELP}/QUAT.help + @${TANGLE} -R"Quaternion.input" ${IN}/quat.spad.pamphlet \ + >${INPUT}/Quaternion.input + +${HELP}/RadixExpansion.help: ${IN}/radix.spad.pamphlet + @echo 7062 create RadixExpansion.help from ${IN}/radix.spad.pamphlet + @${TANGLE} -R"RadixExpansion.help" ${IN}/radix.spad.pamphlet \ + >${HELP}/RadixExpansion.help + @cp ${HELP}/RadixExpansion.help ${HELP}/RADIX.help + @${TANGLE} -R"RadixExpansion.input" ${IN}/radix.spad.pamphlet \ + >${INPUT}/RadixExpansion.input + +${HELP}/RealClosure.help: ${IN}/reclos.spad.pamphlet + @echo 7063 create RealClosure.help from ${IN}/reclos.spad.pamphlet + @${TANGLE} -R"RealClosure.help" ${IN}/reclos.spad.pamphlet \ + >${HELP}/RealClosure.help + @cp ${HELP}/RealClosure.help ${HELP}/RECLOS.help + @${TANGLE} -R"RealClosure.input" ${IN}/reclos.spad.pamphlet \ + >${INPUT}/RealClosure.input + ${HELP}/RealSolvePackage.help: ${IN}/acplot.spad.pamphlet - @echo 7055 create RealSolvePackage.help from ${IN}/acplot.spad.pamphlet + @echo 7064 create RealSolvePackage.help from ${IN}/acplot.spad.pamphlet @${TANGLE} -R"RealSolvePackage.help" ${IN}/acplot.spad.pamphlet \ >${HELP}/RealSolvePackage.help @cp ${HELP}/RealSolvePackage.help ${HELP}/REALSOLV.help @${TANGLE} -R"RealSolvePackage.input" ${IN}/acplot.spad.pamphlet \ >${INPUT}/RealSolvePackage.input +${HELP}/RegularTriangularSet.help: ${IN}/regset.spad.pamphlet + @echo 7065 create RegularTriangularSet.help from \ + ${IN}/regset.spad.pamphlet + @${TANGLE} -R"RegularTriangularSet.help" ${IN}/regset.spad.pamphlet \ + >${HELP}/RegularTriangularSet.help + @cp ${HELP}/RegularTriangularSet.help ${HELP}/REGSET.help + @${TANGLE} -R"RegularTriangularSet.input" ${IN}/regset.spad.pamphlet \ + >${INPUT}/RegularTriangularSet.input + ${HELP}/RomanNumeral.help: ${IN}/integer.spad.pamphlet - @echo 7056 create RomanNumeral.help from ${IN}/integer.spad.pamphlet + @echo 7066 create RomanNumeral.help from ${IN}/integer.spad.pamphlet @${TANGLE} -R"RomanNumeral.help" ${IN}/integer.spad.pamphlet \ >${HELP}/RomanNumeral.help @cp ${HELP}/RomanNumeral.help ${HELP}/ROMAN.help @${TANGLE} -R"RomanNumeral.input" ${IN}/integer.spad.pamphlet \ >${INPUT}/RomanNumeral.input +${HELP}/Segment.help: ${IN}/seg.spad.pamphlet + @echo 7067 create Segment.help from ${IN}/seg.spad.pamphlet + @${TANGLE} -R"Segment.help" ${IN}/seg.spad.pamphlet \ + >${HELP}/Segment.help + @cp ${HELP}/Segment.help ${HELP}/SEG.help + @${TANGLE} -R"Segment.input" ${IN}/seg.spad.pamphlet \ + >${INPUT}/Segment.input + +${HELP}/Set.help: ${IN}/sets.spad.pamphlet + @echo 7068 create Set.help from ${IN}/sets.spad.pamphlet + @${TANGLE} -R"Set.help" ${IN}/sets.spad.pamphlet \ + >${HELP}/Set.help + @cp ${HELP}/Set.help ${HELP}/SET.help + @${TANGLE} -R"Set.input" ${IN}/sets.spad.pamphlet \ + >${INPUT}/Set.input + ${HELP}/TwoDimensionalViewport.help: ${IN}/view2d.spad.pamphlet - @echo 7057 create TwoDimensionalViewport.help from \ + @echo 7069 create TwoDimensionalViewport.help from \ ${IN}/view2d.spad.pamphlet @${TANGLE} -R"TwoDimensionalViewport.help" \ ${IN}/view2d.spad.pamphlet \ diff --git a/src/algebra/dpolcat.spad.pamphlet b/src/algebra/dpolcat.spad.pamphlet index 2a17025..f01f7df 100644 --- a/src/algebra/dpolcat.spad.pamphlet +++ b/src/algebra/dpolcat.spad.pamphlet @@ -471,6 +471,658 @@ DifferentialSparseMultivariatePolynomial(R, S, V): @ \section{domain ODPOL OrderlyDifferentialPolynomial} +<>= +-- dpolcat.spad.pamphlet OrderlyDifferentialPolynomial.input +)spool OrderlyDifferentialPolynomial.output +)set message test on +)set message auto off +)clear all +--S 1 of 36 +dpol:= ODPOL(FRAC INT) +--R +--R +--R (1) OrderlyDifferentialPolynomial Fraction Integer +--R Type: Domain +--E 1 + +--S 2 of 36 +w := makeVariable('w)$dpol +--R +--R +--R (2) theMap(DPOLCAT-;makeVariable;AM;17!0,0) +--R Type: (NonNegativeInteger -> OrderlyDifferentialPolynomial Fraction Integer) +--E 2 + +--S 3 of 36 +z := makeVariable('z)$dpol +--R +--R +--R (3) theMap(DPOLCAT-;makeVariable;AM;17!0,0) +--R Type: (NonNegativeInteger -> OrderlyDifferentialPolynomial Fraction Integer) +--E 3 + +--S 4 of 36 +w.5 +--R +--R +--R (4) w +--R 5 +--R Type: OrderlyDifferentialPolynomial Fraction Integer +--E 4 + +--S 5 of 36 +w 0 +--R +--R +--R (5) w +--R Type: OrderlyDifferentialPolynomial Fraction Integer +--E 5 + +--S 6 of 36 +[z.i for i in 1..5] +--R +--R +--R (6) [z ,z ,z ,z ,z ] +--R 1 2 3 4 5 +--R Type: List OrderlyDifferentialPolynomial Fraction Integer +--E 6 + +--S 7 of 36 +f:= w.4 - w.1 * w.1 * z.3 +--R +--R +--R 2 +--R (7) w - w z +--R 4 1 3 +--R Type: OrderlyDifferentialPolynomial Fraction Integer +--E 7 + +--S 8 of 36 +g:=(z.1)**3 * (z.2)**2 - w.2 +--R +--R +--R 3 2 +--R (8) z z - w +--R 1 2 2 +--R Type: OrderlyDifferentialPolynomial Fraction Integer +--E 8 + +--S 9 of 36 +D(f) +--R +--R +--R 2 +--R (9) w - w z - 2w w z +--R 5 1 4 1 2 3 +--R Type: OrderlyDifferentialPolynomial Fraction Integer +--E 9 + +--S 10 of 36 +D(f,4) +--R +--R +--R (10) +--R 2 2 +--R w - w z - 8w w z + (- 12w w - 12w )z - 2w z w +--R 8 1 7 1 2 6 1 3 2 5 1 3 5 +--R + +--R 2 +--R (- 8w w - 24w w )z - 8w z w - 6w z +--R 1 4 2 3 4 2 3 4 3 3 +--R Type: OrderlyDifferentialPolynomial Fraction Integer +--E 10 + +--S 11 of 36 +df:=makeVariable(f)$dpol +--R +--R +--R (11) theMap(DPOLCAT-;makeVariable;AM;17!0,0) +--R Type: (NonNegativeInteger -> OrderlyDifferentialPolynomial Fraction Integer) +--E 11 + +--S 12 of 36 +df.4 +--R +--R +--R (12) +--R 2 2 +--R w - w z - 8w w z + (- 12w w - 12w )z - 2w z w +--R 8 1 7 1 2 6 1 3 2 5 1 3 5 +--R + +--R 2 +--R (- 8w w - 24w w )z - 8w z w - 6w z +--R 1 4 2 3 4 2 3 4 3 3 +--R Type: OrderlyDifferentialPolynomial Fraction Integer +--E 12 + +--S 13 of 36 +order(g) +--R +--R +--R (13) 2 +--R Type: PositiveInteger +--E 13 + +--S 14 of 36 +order(g, 'w) +--R +--R +--R (14) 2 +--R Type: PositiveInteger +--E 14 + +--S 15 of 36 +differentialVariables(g) +--R +--R +--R (15) [z,w] +--R Type: List Symbol +--E 15 + +--S 16 of 36 +degree(g) +--R +--R +--R 2 3 +--R (16) z z +--R 2 1 +--R Type: IndexedExponents OrderlyDifferentialVariable Symbol +--E 16 + +--S 17 of 36 +degree(g, 'w) +--R +--R +--R (17) 1 +--R Type: PositiveInteger +--E 17 + +--S 18 of 36 +weights(g) +--R +--R +--R (18) [7,2] +--R Type: List NonNegativeInteger +--E 18 + +--S 19 of 36 +weights(g,'w) +--R +--R +--R (19) [2] +--R Type: List NonNegativeInteger +--E 19 + +--S 20 of 36 +weight(g) +--R +--R +--R (20) 7 +--R Type: PositiveInteger +--E 20 + +--S 21 of 36 +isobaric?(g) +--R +--R +--R (21) false +--R Type: Boolean +--E 21 + +--S 22 of 36 +eval(g,['w::Symbol],[f]) +--R +--R +--R 2 2 3 2 +--R (22) - w + w z + 4w w z + (2w w + 2w )z + z z +--R 6 1 5 1 2 4 1 3 2 3 1 2 +--R Type: OrderlyDifferentialPolynomial Fraction Integer +--E 22 + +--S 23 of 36 +eval(g,variables(w.0),[f]) +--R +--R +--R 3 2 +--R (23) z z - w +--R 1 2 2 +--R Type: OrderlyDifferentialPolynomial Fraction Integer +--E 23 + +--S 24 of 36 +monomials(g) +--R +--R +--R 3 2 +--R (24) [z z ,- w ] +--R 1 2 2 +--R Type: List OrderlyDifferentialPolynomial Fraction Integer +--E 24 + +--S 25 of 36 +variables(g) +--R +--R +--R (25) [z ,w ,z ] +--R 2 2 1 +--R Type: List OrderlyDifferentialVariable Symbol +--E 25 + +--S 26 of 36 +gcd(f,g) +--R +--R +--R (26) 1 +--R Type: OrderlyDifferentialPolynomial Fraction Integer +--E 26 + +--S 27 of 36 +groebner([f,g]) +--R +--R +--R 2 3 2 +--R (27) [w - w z ,z z - w ] +--R 4 1 3 1 2 2 +--R Type: List OrderlyDifferentialPolynomial Fraction Integer +--E 27 + +--S 28 of 36 +lg:=leader(g) +--R +--R +--R (28) z +--R 2 +--R Type: OrderlyDifferentialVariable Symbol +--E 28 + +--S 29 of 36 +sg:=separant(g) +--R +--R +--R 3 +--R (29) 2z z +--R 1 2 +--R Type: OrderlyDifferentialPolynomial Fraction Integer +--E 29 + +--S 30 of 36 +ig:=initial(g) +--R +--R +--R 3 +--R (30) z +--R 1 +--R Type: OrderlyDifferentialPolynomial Fraction Integer +--E 30 + +--S 31 of 36 +g1 := D g +--R +--R +--R 3 2 3 +--R (31) 2z z z - w + 3z z +--R 1 2 3 3 1 2 +--R Type: OrderlyDifferentialPolynomial Fraction Integer +--E 31 + +--S 32 of 36 +lg1:= leader g1 +--R +--R +--R (32) z +--R 3 +--R Type: OrderlyDifferentialVariable Symbol +--E 32 + +--S 33 of 36 +pdf:=D(f, lg1) +--R +--R +--R 2 +--R (33) - w +--R 1 +--R Type: OrderlyDifferentialPolynomial Fraction Integer +--E 33 + +--S 34 of 36 +prf:=sg * f- pdf * g1 +--R +--R +--R 3 2 2 2 3 +--R (34) 2z z w - w w + 3w z z +--R 1 2 4 1 3 1 1 2 +--R Type: OrderlyDifferentialPolynomial Fraction Integer +--E 34 + +--S 35 of 36 +lcf:=leadingCoefficient univariate(prf, lg) +--R +--R +--R 2 2 +--R (35) 3w z +--R 1 1 +--R Type: OrderlyDifferentialPolynomial Fraction Integer +--E 35 + +--S 36 of 36 +ig * prf - lcf * g * lg +--R +--R +--R 6 2 3 2 2 +--R (36) 2z z w - w z w + 3w z w z +--R 1 2 4 1 1 3 1 1 2 2 +--R Type: OrderlyDifferentialPolynomial Fraction Integer +--E 36 +)spool +)lisp (bye) +@ +<>= +==================================================================== +OrderlyDifferentialPolynomial examples +==================================================================== + +Many systems of differential equations may be transformed to equivalent +systems of ordinary differential equations where the equations are expressed +polynomially in terms of the unknown functions. In Axiom, the domain +constructors OrderlyDifferentialPolynomial (abbreviated ODPOL) and +SequentialDifferentialPolynomial (abbreviation SDPOL) implement two +domains of ordinary differential polynomials over any differential +ring. In the simplest case, this differential ring is usually either +the ring of integers, or the field of rational numbers. However, +Axiom can handle ordinary differential polynomials over a field of +rational functions in a single indeterminate. + +The two domains ODPOL and SDPOL are almost identical, the only difference +being the choice of a different ranking, which is an ordering of the +derivatives of the indeterminates. The first domain uses an orderly ranking, +that is, derivatives of higher order are ranked higher, and derivatives of +the same order are ranked alphabetically. The second domain uses a +sequential ranking, where derivatives are ordered first alphabetically +by the differential indeterminates, and then by order. A more general +domain constructor, DifferentialSparseMultivariatePolynomial (abbreviation +DSMP) allows both a user-provided list of differential indeterminates +as well as a user-defined ranking. We shall illustrate ODPOL(FRAC INT), +which constructs a domain of ordinary differential polynomials in an +arbitrary number of differential indeterminates with rational numbers +as coefficients. + + dpol:= ODPOL(FRAC INT) + OrderlyDifferentialPolynomial Fraction Integer + Type: Domain + +A differential indeterminate w may be viewed as an infinite sequence of +algebraic indeterminates, which are the derivatives of w. To facilitate +referencing these, Axiom provides the operation makeVariable to convert +an element of type Symbol to a map from the natural numbers to the +differential polynomial ring. + + w := makeVariable('w)$dpol + theMap(DPOLCAT-;makeVariable;AM;17!0,0) + Type: (NonNegativeInteger -> OrderlyDifferentialPolynomial Fraction Integer) + + z := makeVariable('z)$dpol + theMap(DPOLCAT-;makeVariable;AM;17!0,0) + Type: (NonNegativeInteger -> OrderlyDifferentialPolynomial Fraction Integer) + +The fifth derivative of w can be obtained by applying the map w to the +number 5. Note that the order of differentiation is given as a subscript +(except when the order is 0). + + w.5 + w + 5 + Type: OrderlyDifferentialPolynomial Fraction Integer + + w 0 + w + Type: OrderlyDifferentialPolynomial Fraction Integer + +The first five derivatives of z can be generated by a list. + + [z.i for i in 1..5] + [z ,z ,z ,z ,z ] + 1 2 3 4 5 + Type: List OrderlyDifferentialPolynomial Fraction Integer + +The usual arithmetic can be used to form a differential polynomial from +the derivatives. + + f:= w.4 - w.1 * w.1 * z.3 + 2 + w - w z + 4 1 3 + Type: OrderlyDifferentialPolynomial Fraction Integer + + g:=(z.1)**3 * (z.2)**2 - w.2 + 3 2 + z z - w + 1 2 2 + Type: OrderlyDifferentialPolynomial Fraction Integer + +The operation D computes the derivative of any differential polynomial. + + D(f) + 2 + w - w z - 2w w z + 5 1 4 1 2 3 + Type: OrderlyDifferentialPolynomial Fraction Integer + +The same operation can compute higher derivatives, like the fourth derivative. + + D(f,4) + 2 2 + w - w z - 8w w z + (- 12w w - 12w )z - 2w z w + 8 1 7 1 2 6 1 3 2 5 1 3 5 + + + 2 + (- 8w w - 24w w )z - 8w z w - 6w z + 1 4 2 3 4 2 3 4 3 3 + Type: OrderlyDifferentialPolynomial Fraction Integer + +The operation makeVariable creates a map to facilitate referencing the +derivatives of f, similar to the map w. + + df:=makeVariable(f)$dpol + theMap(DPOLCAT-;makeVariable;AM;17!0,0) + Type: (NonNegativeInteger -> OrderlyDifferentialPolynomial Fraction Integer) + +The fourth derivative of f may be referenced easily. + + df.4 + 2 2 + w - w z - 8w w z + (- 12w w - 12w )z - 2w z w + 8 1 7 1 2 6 1 3 2 5 1 3 5 + + + 2 + (- 8w w - 24w w )z - 8w z w - 6w z + 1 4 2 3 4 2 3 4 3 3 + Type: OrderlyDifferentialPolynomial Fraction Integer + +The operation order returns the order of a differential polynomial, +or the order in a specified differential indeterminate. + + order(g) + 2 + Type: PositiveInteger + + order(g, 'w) + 2 + Type: PositiveInteger + +The operation differentialVariables returns a list of differential +indeterminates occurring in a differential polynomial. + + differentialVariables(g) + [z,w] + Type: List Symbol + +The operation degree returns the degree, or the degree in the differential +indeterminate specified. + + degree(g) + 2 3 + z z + 2 1 + Type: IndexedExponents OrderlyDifferentialVariable Symbol + + degree(g, 'w) + 1 + Type: PositiveInteger + +The operation weights returns a list of weights of differential monomials +appearing in differential polynomial, or a list of weights in a specified +differential indeterminate. + + weights(g) + [7,2] + Type: List NonNegativeInteger + + weights(g,'w) + [2] + Type: List NonNegativeInteger + +The operation weight returns the maximum weight of all differential +monomials appearing in the differential polynomial. + + weight(g) + 7 + Type: PositiveInteger + +A differential polynomial is isobaric if the weights of all differential +monomials appearing in it are equal. + + isobaric?(g) + false + Type: Boolean + +To substitute differentially, use eval. Note that we must coerce 'w to +Symbol, since in ODPOL, differential indeterminates belong to the domain +Symbol. Compare this result to the next, which substitutes algebraically +(no substitution is done since w.0 does not appear in g). + + eval(g,['w::Symbol],[f]) + 2 2 3 2 + - w + w z + 4w w z + (2w w + 2w )z + z z + 6 1 5 1 2 4 1 3 2 3 1 2 + Type: OrderlyDifferentialPolynomial Fraction Integer + + eval(g,variables(w.0),[f]) + 3 2 + z z - w + 1 2 2 + Type: OrderlyDifferentialPolynomial Fraction Integer + +Since OrderlyDifferentialPolynomial belongs to PolynomialCategory, all +the operations defined in the latter category, or in packages for the +latter category, are available. + + monomials(g) + 3 2 + [z z ,- w ] + 1 2 2 + Type: List OrderlyDifferentialPolynomial Fraction Integer + + variables(g) + [z ,w ,z ] + 2 2 1 + Type: List OrderlyDifferentialVariable Symbol + + gcd(f,g) + 1 + Type: OrderlyDifferentialPolynomial Fraction Integer + + groebner([f,g]) + 2 3 2 + [w - w z ,z z - w ] + 4 1 3 1 2 2 + Type: List OrderlyDifferentialPolynomial Fraction Integer + +The next three operations are essential for elimination procedures in +differential polynomial rings. The operation leader returns the leader +of a differential polynomial, which is the highest ranked derivative +of the differential indeterminates that occurs. + + lg:=leader(g) + z + 2 + Type: OrderlyDifferentialVariable Symbol + +The operation separant returns the separant of a differential polynomial, +which is the partial derivative with respect to the leader. + + sg:=separant(g) + 3 + 2z z + 1 2 + Type: OrderlyDifferentialPolynomial Fraction Integer + +The operation initial returns the initial, which is the leading coefficient +when the given differential polynomial is expressed as a polynomial in +the leader. + + ig:=initial(g) + 3 + z + 1 + Type: OrderlyDifferentialPolynomial Fraction Integer + +Using these three operations, it is possible to reduce f modulo the +differential ideal generated by g. The general scheme is to first +reduce the order, then reduce the degree in the leader. First, eliminate +z.3 using the derivative of g. + + g1 := D g + 3 2 3 + 2z z z - w + 3z z + 1 2 3 3 1 2 + Type: OrderlyDifferentialPolynomial Fraction Integer + +Find its leader. + + lg1:= leader g1 + z + 3 + Type: OrderlyDifferentialVariable Symbol + +Differentiate f partially with respect to this leader. + + pdf:=D(f, lg1) + 2 + - w + 1 + Type: OrderlyDifferentialPolynomial Fraction Integer + +Compute the partial remainder of f with respect to g. + + prf:=sg * f- pdf * g1 + 3 2 2 2 3 + 2z z w - w w + 3w z z + 1 2 4 1 3 1 1 2 + Type: OrderlyDifferentialPolynomial Fraction Integer + +Note that high powers of lg still appear in prf. Compute the leading +coefficient of prf as a polynomial in the leader of g. + + lcf:=leadingCoefficient univariate(prf, lg) + 2 2 + 3w z + 1 1 + Type: OrderlyDifferentialPolynomial Fraction Integer + +Finally, continue eliminating the high powers of lg appearing in prf to +obtain the (pseudo) remainder of f modulo g and its derivatives. + + ig * prf - lcf * g * lg + 6 2 3 2 2 + 2z z w - w z w + 3w z w z + 1 2 4 1 1 3 1 1 2 2 + Type: OrderlyDifferentialPolynomial Fraction Integer + +See Also: +o )show OrderlyDifferentialPolynomial +o $AXIOM/doc/src/algebra/dpolcat.spad.dvi + +@ <>= )abbrev domain ODPOL OrderlyDifferentialPolynomial ++ Author: William Sit diff --git a/src/algebra/integer.spad.pamphlet b/src/algebra/integer.spad.pamphlet index b5e56d2..16ac727 100644 --- a/src/algebra/integer.spad.pamphlet +++ b/src/algebra/integer.spad.pamphlet @@ -1443,54 +1443,247 @@ Note that this code is not included in the generated catdef.spad file. )set message test on )set message auto off )clear all ---S 1 of 5 +--S 1 of 15 +f := operator 'f +--R +--R +--R (1) f +--R Type: BasicOperator +--E 1 + +--S 2 of 15 +D(f x,x,7) +--R +--R +--R (vii) +--R (2) f (x) +--R +--R Type: Expression Integer +--E 2 + +--S 3 of 15 +a := roman(1978 - 1965) +--R +--R +--R (3) XIII +--R Type: RomanNumeral +--E 3 + +--S 4 of 15 +x : UTS(ROMAN,'x,0) := x +--R +--R +--R (4) x +--R Type: UnivariateTaylorSeries(RomanNumeral,x,0) +--E 4 + +--S 5 of 15 +recip(1 - x - x**2) +--R +--R +--R (5) +--R 2 3 4 5 6 7 8 +--R I + x + II x + III x + V x + VIII x + XIII x + XXI x + XXXIV x +--R + +--R 9 10 11 +--R LV x + LXXXIX x + O(x ) +--R Type: Union(UnivariateTaylorSeries(RomanNumeral,x,0),...) +--E 5 + +--S 6 of 15 +m : MATRIX FRAC ROMAN +--R +--R Type: Void +--E 6 + +--S 7 of 15 +m := matrix [ [1/(i + j) for i in 1..3] for j in 1..3] +--R +--R +--R + I I I+ +--R |-- --- --| +--R |II III IV| +--R | | +--R | I I I | +--R (7) |--- -- - | +--R |III IV V | +--R | | +--R | I I I| +--R |-- - --| +--R +IV V VI+ +--R Type: Matrix Fraction RomanNumeral +--E 7 + +--S 8 of 15 +inverse m +--R +--R +--R +LXXII - CCXL CLXXX + +--R | | +--R (8) |- CCXL CM - DCCXX| +--R | | +--R +CLXXX - DCCXX DC + +--R Type: Union(Matrix Fraction RomanNumeral,...) +--E 8 + +--S 9 of 15 +y := factorial 10 +--R +--R +--R (9) 3628800 +--R Type: PositiveInteger +--E 9 + +--S 10 of 15 +roman y +--R +--R +--R (10) +--R ((((I))))((((I))))((((I)))) (((I)))(((I)))(((I)))(((I)))(((I)))(((I))) ((I))( +--R (I)) MMMMMMMMDCCC +--R Type: RomanNumeral +--E 10 + +--S 11 of 15 a := roman(78) --R --R ---R (1) LXXVIII +--R (11) LXXVIII --R Type: RomanNumeral ---E 1 +--E 11 ---S 2 of 5 +--S 12 of 15 b := roman(87) --R --R ---R (2) LXXXVII +--R (12) LXXXVII --R Type: RomanNumeral ---E 2 +--E 12 ---S 3 of 5 +--S 13 of 15 a + b --R --R ---R (3) CLXV +--R (13) CLXV --R Type: RomanNumeral ---E 3 +--E 13 ---S 4 of 5 +--S 14 of 15 a * b --R --R ---R (4) MMMMMMDCCLXXXVI +--R (14) MMMMMMDCCLXXXVI --R Type: RomanNumeral ---E 4 +--E 14 ---S 5 of 5 +--S 15 of 15 b rem a --R --R ---R (5) IX +--R (15) IX --R Type: RomanNumeral ---E 5 +--E 15 )spool )lisp (bye) @ - <>= ==================================================================== RomanNumeral Examples ==================================================================== +The Roman numeral package was added to Axiom in MCMLXXXVI for use in +denoting higher order derivatives. + +For example, let f be a symbolic operator. + + f := operator 'f + f + Type: BasicOperator + +This is the seventh derivative of f with respect to x. + D(f x,x,7) + (vii) + f (x) + Type: Expression Integer + +You can have integers printed as Roman numerals by declaring variables to +be of type RomanNumeral (abbreviation ROMAN). + + a := roman(1978 - 1965) + XIII + Type: RomanNumeral + +This package now has a small but devoted group of followers that claim +this domain has shown its efficacy in many other contexts. They claim +that Roman numerals are every bit as useful as ordinary integers. + +In a sense, they are correct, because Roman numerals form a ring and you +can therefore construct polynomials with Roman numeral coefficients, +matrices over Roman numerals, etc.. + + x : UTS(ROMAN,'x,0) := x + x + Type: UnivariateTaylorSeries(RomanNumeral,x,0) + +Was Fibonacci Italian or ROMAN? + + recip(1 - x - x**2) + 2 3 4 5 6 7 8 + I + x + II x + III x + V x + VIII x + XIII x + XXI x + XXXIV x + + + 9 10 11 + LV x + LXXXIX x + O(x ) + Type: Union(UnivariateTaylorSeries(RomanNumeral,x,0),...) + +You can also construct fractions with Roman numeral numerators and +denominators, as this matrix Hilberticus illustrates. + + m : MATRIX FRAC ROMAN + Type: Void + + m := matrix [ [1/(i + j) for i in 1..3] for j in 1..3] + + I I I+ + |-- --- --| + |II III IV| + | | + | I I I | + |--- -- - | + |III IV V | + | | + | I I I| + |-- - --| + +IV V VI+ + Type: Matrix Fraction RomanNumeral + +Note that the inverse of the matrix has integral ROMAN entries. + + inverse m + +LXXII - CCXL CLXXX + + | | + |- CCXL CM - DCCXX| + | | + +CLXXX - DCCXX DC + + Type: Union(Matrix Fraction RomanNumeral,...) + +Unfortunately, the spoil-sports say that the fun stops when the +numbers get big---mostly because the Romans didn't establish +conventions about representing very large numbers. + + y := factorial 10 + 3628800 + Type: PositiveInteger + +You work it out! + + roman y + ((((I))))((((I))))((((I)))) (((I)))(((I)))(((I)))(((I)))(((I)))(((I))) ((I))( + (I)) MMMMMMMMDCCC + Type: RomanNumeral + +Issue the system command )show RomanNumeral to display the full +list of operations defined by RomanNumeral. + + a := roman(78) LXXVIII Type: RomanNumeral diff --git a/src/algebra/multpoly.spad.pamphlet b/src/algebra/multpoly.spad.pamphlet index 76a5624..68abc3c 100644 --- a/src/algebra/multpoly.spad.pamphlet +++ b/src/algebra/multpoly.spad.pamphlet @@ -10,6 +10,798 @@ \tableofcontents \eject \section{domain POLY Polynomial} +<>= +-- multpoly.spad.pamphlet Polynomial.input +)spool Polynomial.output +)set message test on +)set message auto off +--S 1 of 46 +x + 1 +--R +--R +--R (1) x + 1 +--R Type: Polynomial Integer +--E 1 + +--S 2 of 46 +z - 2.3 +--R +--R +--R (2) z - 2.3 +--R Type: Polynomial Float +--E 2 + +--S 3 of 46 +y**2 - z + 3/4 +--R +--R +--R 2 3 +--R (3) - z + y + - +--R 4 +--R Type: Polynomial Fraction Integer +--E 3 + +--S 4 of 46 +y **2 + x*y + y +--R +--R +--R 2 +--R (4) y + (x + 1)y +--R Type: Polynomial Integer +--E 4 + +--S 5 of 46 +% :: DMP([y,x],INT) +--R +--R +--R 2 +--R (5) y + y x + y +--R Type: DistributedMultivariatePolynomial([y,x],Integer) +--E 5 + +--S 6 of 46 +p := (y-1)**2 * x * z +--R +--R +--R 2 +--R (6) (x y - 2x y + x)z +--R Type: Polynomial Integer +--E 6 + +--S 7 of 46 +q := (y-1) * x * (z+5) +--R +--R +--R (7) (x y - x)z + 5x y - 5x +--R Type: Polynomial Integer +--E 7 + +--S 8 of 46 +factor(q) +--R +--R +--R (8) x(y - 1)(z + 5) +--R Type: Factored Polynomial Integer +--E 8 + +--S 9 of 46 +p - q**2 +--R +--R +--R (9) +--R 2 2 2 2 2 2 2 2 2 +--R (- x y + 2x y - x )z + ((- 10x + x)y + (20x - 2x)y - 10x + x)z +--R + +--R 2 2 2 2 +--R - 25x y + 50x y - 25x +--R Type: Polynomial Integer +--E 9 + +--S 10 of 46 +gcd(p,q) +--R +--R +--R (10) x y - x +--R Type: Polynomial Integer +--E 10 + +--S 11 of 46 +factor % +--R +--R +--R (11) x(y - 1) +--R Type: Factored Polynomial Integer +--E 11 + +--S 12 of 46 +lcm(p,q) +--R +--R +--R 2 2 2 +--R (12) (x y - 2x y + x)z + (5x y - 10x y + 5x)z +--R Type: Polynomial Integer +--E 12 + +--S 13 of 46 +content p +--R +--R +--R (13) 1 +--R Type: PositiveInteger +--E 13 + +--S 14 of 46 +resultant(p,q,z) +--R +--R +--R 2 3 2 2 2 2 +--R (14) 5x y - 15x y + 15x y - 5x +--R Type: Polynomial Integer +--E 14 + +--S 15 of 46 +resultant(p,q,x) +--R +--R +--R (15) 0 +--R Type: Polynomial Integer +--E 15 + +--S 16 of 46 +mainVariable p +--R +--R +--R (16) z +--R Type: Union(Symbol,...) +--E 16 + +--S 17 of 46 +mainVariable(1 :: POLY INT) +--R +--R +--R (17) "failed" +--R Type: Union("failed",...) +--E 17 + +--S 18 of 46 +ground? p +--R +--R +--R (18) false +--R Type: Boolean +--E 18 + +--S 19 of 46 +ground?(1 :: POLY INT) +--R +--R +--R (19) true +--R Type: Boolean +--E 19 + +--S 20 of 46 +variables p +--R +--R +--R (20) [z,y,x] +--R Type: List Symbol +--E 20 + +--S 21 of 46 +degree(p,x) +--R +--R +--R (21) 1 +--R Type: PositiveInteger +--E 21 + +--S 22 of 46 +degree(p,y) +--R +--R +--R (22) 2 +--R Type: PositiveInteger +--E 22 + +--S 23 of 46 +degree(p,z) +--R +--R +--R (23) 1 +--R Type: PositiveInteger +--E 23 + +--S 24 of 46 +degree(p,[x,y,z]) +--R +--R +--R (24) [1,2,1] +--R Type: List NonNegativeInteger +--E 24 + +--S 25 of 46 +minimumDegree(p,z) +--R +--R +--R (25) 1 +--R Type: PositiveInteger +--E 25 + +--S 26 of 46 +totalDegree p +--R +--R +--R (26) 4 +--R Type: PositiveInteger +--E 26 + +--S 27 of 46 +leadingMonomial p +--R +--R +--R 2 +--R (27) x y z +--R Type: Polynomial Integer +--E 27 + +--S 28 of 46 +reductum p +--R +--R +--R (28) (- 2x y + x)z +--R Type: Polynomial Integer +--E 28 + +--S 29 of 46 +p - leadingMonomial p - reductum p +--R +--R +--R (29) 0 +--R Type: Polynomial Integer +--E 29 + +--S 30 of 46 +leadingCoefficient p +--R +--R +--R (30) 1 +--R Type: PositiveInteger +--E 30 + +--S 31 of 46 +p +--R +--R +--R 2 +--R (31) (x y - 2x y + x)z +--R Type: Polynomial Integer +--E 31 + +--S 32 of 46 +eval(p,x,w) +--R +--R +--R 2 +--R (32) (w y - 2w y + w)z +--R Type: Polynomial Integer +--E 32 + +--S 33 of 46 +eval(p,x,1) +--R +--R +--R 2 +--R (33) (y - 2y + 1)z +--R Type: Polynomial Integer +--E 33 + +--S 34 of 46 +eval(p,x,y^2 - 1) +--R +--R +--R 4 3 +--R (34) (y - 2y + 2y - 1)z +--R Type: Polynomial Integer +--E 34 + +--S 35 of 46 +D(p,x) +--R +--R +--R 2 +--R (35) (y - 2y + 1)z +--R Type: Polynomial Integer +--E 35 + +--S 36 of 46 +D(p,y) +--R +--R +--R (36) (2x y - 2x)z +--R Type: Polynomial Integer +--E 36 + +--S 37 of 46 +D(p,z) +--R +--R +--R 2 +--R (37) x y - 2x y + x +--R Type: Polynomial Integer +--E 37 + +--S 38 of 46 +integrate(p,y) +--R +--R +--R 1 3 2 +--R (38) (- x y - x y + x y)z +--R 3 +--R Type: Polynomial Fraction Integer +--E 38 + +--S 39 of 46 +qr := monicDivide(p,x+1,x) +--R +--R +--R 2 2 +--R (39) [quotient= (y - 2y + 1)z,remainder= (- y + 2y - 1)z] +--R Type: Record(quotient: Polynomial Integer,remainder: Polynomial Integer) +--E 39 + +--S 40 of 46 +qr.remainder +--R +--R +--R 2 +--R (40) (- y + 2y - 1)z +--R Type: Polynomial Integer +--E 40 + +--S 41 of 46 +p - ((x+1) * qr.quotient + qr.remainder) +--R +--R +--R (41) 0 +--R Type: Polynomial Integer +--E 41 + +--S 42 of 46 +p/q +--R +--R +--R (y - 1)z +--R (42) -------- +--R z + 5 +--R Type: Fraction Polynomial Integer +--E 42 + +--S 43 of 46 +(2/3) * x**2 - y + 4/5 +--R +--R +--R 2 2 4 +--R (43) - y + - x + - +--R 3 5 +--R Type: Polynomial Fraction Integer +--E 43 + +--S 44 of 46 +% :: FRAC POLY INT +--R +--R +--R 2 +--R - 15y + 10x + 12 +--R (44) ----------------- +--R 15 +--R Type: Fraction Polynomial Integer +--E 44 + +--S 45 of 46 +% :: POLY FRAC INT +--R +--R +--R 2 2 4 +--R (45) - y + - x + - +--R 3 5 +--R Type: Polynomial Fraction Integer +--E 45 + +--S 46 of 46 +map(numeric,%) +--R +--R +--R 2 +--R (46) - 1.0 y + 0.6666666666 6666666667 x + 0.8 +--R Type: Polynomial Float +--E 46 +)spool +)lisp (bye) +@ +<>= +==================================================================== +Polynomial examples +==================================================================== + +The domain constructor Polynomial (abbreviation: POLY) provides +polynomials with an arbitrary number of unspecified variables. + +It is used to create the default polynomial domains in Axiom. Here +the coefficients are integers. + + x + 1 + x + 1 + Type: Polynomial Integer + +Here the coefficients have type Float. + + z - 2.3 + z - 2.3 + Type: Polynomial Float + +And here we have a polynomial in two variables with coefficients which +have type Fraction Integer. + + y**2 - z + 3/4 + 2 3 + - z + y + - + 4 + Type: Polynomial Fraction Integer + +The representation of objects of domains created by Polynomial is that +of recursive univariate polynomials. The term univariate means "one +variable". The term multivariate means "possibly more than one variable". + +This recursive structure is sometimes obvious from the display of a polynomial. + + y **2 + x*y + y + 2 + y + (x + 1)y + Type: Polynomial Integer + +In this example, you see that the polynomial is stored as a polynomial +in y with coefficients that are polynomials in x with integer coefficients. +In fact, you really don't need to worry about the representation unless you +are working on an advanced application where it is critical. The polynomial +types created from DistributedMultivariatePolynomial and +NewDistributedMultivariatePolynomial are stored and displayed in a +non-recursive manner. + +You see a "flat" display of the above polynomial by converting to +one of those types. + + % :: DMP([y,x],INT) + 2 + y + y x + y + Type: DistributedMultivariatePolynomial([y,x],Integer) + +We will demonstrate many of the polynomial facilities by using two +polynomials with integer coefficients. + +By default, the interpreter expands polynomial expressions, even if they +are written in a factored format. + + p := (y-1)**2 * x * z + 2 + (x y - 2x y + x)z + Type: Polynomial Integer + +See Factored to see how to create objects in factored form directly. + + q := (y-1) * x * (z+5) + (x y - x)z + 5x y - 5x + Type: Polynomial Integer + +The fully factored form can be recovered by using factor. + + factor(q) + x(y - 1)(z + 5) + Type: Factored Polynomial Integer + +This is the same name used for the operation to factor integers. Such +reuse of names is called overloading and makes it much easier to think +of solving problems in general ways. Axiom facilities for factoring +polynomials created with Polynomial are currently restricted to the +integer and rational number coefficient cases. + +The standard arithmetic operations are available for polynomials. + + p - q**2 + 2 2 2 2 2 2 2 2 2 + (- x y + 2x y - x )z + ((- 10x + x)y + (20x - 2x)y - 10x + x)z + + + 2 2 2 2 + - 25x y + 50x y - 25x + Type: Polynomial Integer + +The operation gcd is used to compute the greatest common divisor of +two polynomials. + + gcd(p,q) + x y - x + Type: Polynomial Integer + +In the case of p and q, the gcd is obvious from their definitions. We +factor the gcd to show this relationship better. + + factor % + x(y - 1) + Type: Factored Polynomial Integer + +The least common multiple is computed by using lcm. + + lcm(p,q) + 2 2 2 + (x y - 2x y + x)z + (5x y - 10x y + 5x)z + Type: Polynomial Integer + +Use content to compute the greatest common divisor of the coefficients +of the polynomial. + + content p + 1 + Type: PositiveInteger + +Many of the operations on polynomials require you to specify a variable. +For example, resultant requires you to give the variable in which the +polynomials should be expressed. + +This computes the resultant of the values of p and q, considering them +as polynomials in the variable z. They do not share a root when thought +of as polynomials in z. + + resultant(p,q,z) + 2 3 2 2 2 2 + 5x y - 15x y + 15x y - 5x + Type: Polynomial Integer + +This value is 0 because as polynomials in x the polynomials have a +common root. + + resultant(p,q,x) + 0 + Type: Polynomial Integer + +The data type used for the variables created by Polynomial is Symbol. +As mentioned above, the representation used by Polynomial is recursive +and so there is a main variable for nonconstant polynomials. + +The operation mainVariable returns this variable. The return type is +actually a union of Symbol and "failed". + + mainVariable p + z + Type: Union(Symbol,...) + +The latter branch of the union is be used if the polynomial has no +variables, that is, is a constant. + + mainVariable(1 :: POLY INT) + "failed" + Type: Union("failed",...) + +You can also use the predicate ground? to test whether a polynomial is +in fact a member of its ground ring. + + ground? p + false + Type: Boolean + + ground?(1 :: POLY INT) + true + Type: Boolean + +The complete list of variables actually used in a particular polynomial +is returned by variables. For constant polynomials, this list is empty. + + variables p + [z,y,x] + Type: List Symbol + +The degree operation returns the degree of a polynomial in a specific variable. + + degree(p,x) + 1 + Type: PositiveInteger + + degree(p,y) + 2 + Type: PositiveInteger + + degree(p,z) + 1 + Type: PositiveInteger + +If you give a list of variables for the second argument, a list of the +degrees in those variables is returned. + + degree(p,[x,y,z]) + [1,2,1] + Type: List NonNegativeInteger + +The minimum degree of a variable in a polynomial is computed using +minimumDegree. + + minimumDegree(p,z) + 1 + Type: PositiveInteger + +The total degree of a polynomial is returned by totalDegree. + + totalDegree p + 4 + Type: PositiveInteger + +It is often convenient to think of a polynomial as a leading monomial plus +the remaining terms. + + leadingMonomial p + 2 + x y z + Type: Polynomial Integer + +The reductum operation returns a polynomial consisting of the sum of +the monomials after the first. + + reductum p + (- 2x y + x)z + Type: Polynomial Integer + +These have the obvious relationship that the original polynomial is +equal to the leading monomial plus the reductum. + + p - leadingMonomial p - reductum p + 0 + Type: Polynomial Integer + +The value returned by leadingMonomial includes the coefficient of that term. +This is extracted by using leadingCoefficient on the original polynomial. + + leadingCoefficient p + 1 + Type: PositiveInteger + +The operation eval is used to substitute a value for a variable in a +polynomial. + + p + 2 + (x y - 2x y + x)z + Type: Polynomial Integer + +This value may be another variable, a constant or a polynomial. + + eval(p,x,w) + 2 + (w y - 2w y + w)z + Type: Polynomial Integer + + eval(p,x,1) + 2 + (y - 2y + 1)z + Type: Polynomial Integer + +Actually, all the things being substituted are just polynomials, +some more trivial than others. + + eval(p,x,y^2 - 1) + 4 3 + (y - 2y + 2y - 1)z + Type: Polynomial Integer + +Derivatives are computed using the D operation. + + D(p,x) + 2 + (y - 2y + 1)z + Type: Polynomial Integer + +The first argument is the polynomial and the second is the variable. + + D(p,y) + (2x y - 2x)z + Type: Polynomial Integer + +Even if the polynomial has only one variable, you must specify it. + + D(p,z) + 2 + x y - 2x y + x + Type: Polynomial Integer + +Integration of polynomials is similar and the integrate operation is used. + +Integration requires that the coefficients support division. Axiom +converts polynomials over the integers to polynomials over the rational +numbers before integrating them. + + integrate(p,y) + 1 3 2 + (- x y - x y + x y)z + 3 + Type: Polynomial Fraction Integer + +It is not possible, in general, to divide two polynomials. In our +example using polynomials over the integers, the operation monicDivide +divides a polynomial by a monic polynomial (that is, a polynomial with +leading coefficient equal to 1). The result is a record of the +quotient and remainder of the division. + +You must specify the variable in which to express the polynomial. + + qr := monicDivide(p,x+1,x) + 2 2 + [quotient= (y - 2y + 1)z,remainder= (- y + 2y - 1)z] + Type: Record(quotient: Polynomial Integer,remainder: Polynomial Integer) + +The selectors of the components of the record are quotient and remainder. +Issue this to extract the remainder. + + qr.remainder + 2 + (- y + 2y - 1)z + Type: Polynomial Integer + +Now that we can extract the components, we can demonstrate the +relationship among them and the arguments to our original expression +qr := monicDivide(p,x+1,x). + + p - ((x+1) * qr.quotient + qr.remainder) + 0 + Type: Polynomial Integer + +If the / operator is used with polynomials, a fraction object is +created. In this example, the result is an object of type +Fraction Polynomial Integer. + + p/q + (y - 1)z + -------- + z + 5 + Type: Fraction Polynomial Integer + +If you use rational numbers as polynomial coefficients, the +resulting object is of type Polynomial Fraction Integer. + + (2/3) * x**2 - y + 4/5 + 2 2 4 + - y + - x + - + 3 5 + Type: Polynomial Fraction Integer + +This can be converted to a fraction of polynomials and back again, if +required. + + % :: FRAC POLY INT + 2 + - 15y + 10x + 12 + ----------------- + 15 + Type: Fraction Polynomial Integer + + % :: POLY FRAC INT + 2 2 4 + - y + - x + - + 3 5 + Type: Polynomial Fraction Integer + +To convert the coefficients to floating point, map the numeric +operation on the coefficients of the polynomial. + + map(numeric,%) + - 1.0 y + 0.6666666666 6666666667 x + 0.8 + Type: Polynomial Float + +See Also: +o )help Factored +o )help UnivariatePolynomial +o )help MultivariatePolynomial +o )help DistributedMultivariatePolynomial +o )help NewDistributedMultivariatePolynomial +o )show Polynomial +o $AXIOM/doc/src/algebra/multpoly.spad.dvi + +@ <>= )abbrev domain POLY Polynomial ++ Author: Dave Barton, Barry Trager diff --git a/src/algebra/opalg.spad.pamphlet b/src/algebra/opalg.spad.pamphlet index a03c8ce..8eab785 100644 --- a/src/algebra/opalg.spad.pamphlet +++ b/src/algebra/opalg.spad.pamphlet @@ -238,6 +238,392 @@ ModuleOperator(R: Ring, M:LeftModule(R)): Exports == Implementation where @ \section{domain OP Operator} +<>= +-- opalg.spad.pamphlet Operator.input +)spool Operator.output +)set message test on +)set message auto off +)clear all +--S 1 of 21 +R := SQMATRIX(2, INT) +--R +--R +--R (1) SquareMatrix(2,Integer) +--R Type: Domain +--E 1 + +--S 2 of 21 +t := operator("tilde") :: OP(R) +--R +--R +--R (2) tilde +--R Type: Operator SquareMatrix(2,Integer) +--E 2 + +--S 3 of 21 +)set expose add constructor Operator +--R +--R Operator is now explicitly exposed in frame frame0 +--E 3 + +--S 4 of 21 +evaluate(t, m +-> transpose m) +--R +--R +--R (3) tilde +--R Type: Operator SquareMatrix(2,Integer) +--E 4 + +--S 5 of 21 +s : R := matrix [ [0, 1], [1, 0] ] +--R +--R +--R +0 1+ +--R (4) | | +--R +1 0+ +--R Type: SquareMatrix(2,Integer) +--E 5 + +--S 6 of 21 +rho := t * s +--R +--R +--R +0 1+ +--R (5) tilde| | +--R +1 0+ +--R Type: Operator SquareMatrix(2,Integer) +--E 6 + +--S 7 of 21 +z := rho**4 - 1 +--R +--R +--R +0 1+ +0 1+ +0 1+ +0 1+ +--R (6) - 1 + tilde| |tilde| |tilde| |tilde| | +--R +1 0+ +1 0+ +1 0+ +1 0+ +--R Type: Operator SquareMatrix(2,Integer) +--E 7 + +--S 8 of 21 +m:R := matrix [ [1, 2], [3, 4] ] +--R +--R +--R +1 2+ +--R (7) | | +--R +3 4+ +--R Type: SquareMatrix(2,Integer) +--E 8 + +--S 9 of 21 +z m +--R +--R +--R +0 0+ +--R (8) | | +--R +0 0+ +--R Type: SquareMatrix(2,Integer) +--E 9 + +--S 10 of 21 +rho m +--R +--R +--R +3 1+ +--R (9) | | +--R +4 2+ +--R Type: SquareMatrix(2,Integer) +--E 10 + +--S 11 of 21 +rho rho m +--R +--R +--R +4 3+ +--R (10) | | +--R +2 1+ +--R Type: SquareMatrix(2,Integer) +--E 11 + +--S 12 of 21 +(rho^3) m +--R +--R +--R +2 4+ +--R (11) | | +--R +1 3+ +--R Type: SquareMatrix(2,Integer) +--E 12 + +--S 13 of 21 +b := t * s - s * t +--R +--R +--R +0 1+ +0 1+ +--R (12) - | |tilde + tilde| | +--R +1 0+ +1 0+ +--R Type: Operator SquareMatrix(2,Integer) +--E 13 + +--S 14 of 21 +b m +--R +--R +--R +1 - 3+ +--R (13) | | +--R +3 - 1+ +--R Type: SquareMatrix(2,Integer) +--E 14 + +--S 15 of 21 +L n == + n = 0 => 1 + n = 1 => x + (2*n-1)/n * x * L(n-1) - (n-1)/n * L(n-2) +--R +--R Type: Void +--E 15 + +--S 16 of 21 +dx := operator("D") :: OP(POLY FRAC INT) +--R +--R +--R (15) D +--R Type: Operator Polynomial Fraction Integer +--E 16 + +--S 17 of 21 +evaluate(dx, p +-> D(p, 'x)) +--R +--R +--R (16) D +--R Type: Operator Polynomial Fraction Integer +--E 17 + +--S 18 of 21 +E n == (1 - x**2) * dx**2 - 2 * x * dx + n*(n+1) +--R +--R Type: Void +--E 18 + +--S 19 of 21 +L 15 +--R +--R Compiling function L with type Integer -> Polynomial Fraction +--R Integer +--R Compiling function L as a recurrence relation. +--R +--R (18) +--R 9694845 15 35102025 13 50702925 11 37182145 9 14549535 7 +--R ------- x - -------- x + -------- x - -------- x + -------- x +--R 2048 2048 2048 2048 2048 +--R + +--R 2909907 5 255255 3 6435 +--R - ------- x + ------ x - ---- x +--R 2048 2048 2048 +--R Type: Polynomial Fraction Integer +--E 19 + +--S 20 of 21 +E 15 +--R +--R Compiling function E with type PositiveInteger -> Operator +--R Polynomial Fraction Integer +--R +--R 2 2 +--R (19) 240 - 2x D - (x - 1)D +--R Type: Operator Polynomial Fraction Integer +--E 20 + +--S 21 of 21 +(E 15)(L 15) +--R +--R +--R (20) 0 +--R Type: Polynomial Fraction Integer +--E 21 +)spool +)lisp (bye) +@ +<>= +==================================================================== +Operator examples +==================================================================== + +Given any ring R, the ring of the Integer-linear operators over R is +called Operator(R). To create an operator over R, first create a +basic operator using the operation operator, and then convert it to +Operator(R) for the R you want. + +We choose R to be the two by two matrices over the integers. + + R := SQMATRIX(2, INT) + SquareMatrix(2,Integer) + Type: Domain + +Create the operator tilde on R. + + t := operator("tilde") :: OP(R) + tilde + Type: Operator SquareMatrix(2,Integer) + +Since Operator is unexposed we must either package-call operations +from it, or expose it explicitly. For convenience we will do the latter. + +Expose Operator. + + )set expose add constructor Operator + +To attach an evaluation function (from R to R) to an operator over R, +use evaluate(op, f) where op is an operator over R and f is a function +R -> R. This needs to be done only once when the operator is defined. +Note that f must be Integer-linear (that is, f(ax+y) = a f(x) + f(y) +for any integer a, and any x and y in R). + +We now attach the transpose map to the above operator t. + + evaluate(t, m +-> transpose m) + tilde + Type: Operator SquareMatrix(2,Integer) + +Operators can be manipulated formally as in any ring: + is the +pointwise addition and * is composition. Any element x of R can be +converted to an operator op(x) over R, and the evaluation function of +op(x) is left-multiplication by x. + +Multiplying on the left by this matrix swaps the two rows. + + s : R := matrix [ [0, 1], [1, 0] ] + +0 1+ + | | + +1 0+ + Type: SquareMatrix(2,Integer) + +Can you guess what is the action of the following operator? + + rho := t * s + +0 1+ + tilde| | + +1 0+ + Type: Operator SquareMatrix(2,Integer) + +Hint: applying rho four times gives the identity, so rho^4-1 should +return 0 when applied to any two by two matrix. + + z := rho**4 - 1 + +0 1+ +0 1+ +0 1+ +0 1+ + - 1 + tilde| |tilde| |tilde| |tilde| | + +1 0+ +1 0+ +1 0+ +1 0+ + Type: Operator SquareMatrix(2,Integer) + +Now check with this matrix. + + m:R := matrix [ [1, 2], [3, 4] ] + +1 2+ + | | + +3 4+ + Type: SquareMatrix(2,Integer) + + z m + +0 0+ + | | + +0 0+ + Type: SquareMatrix(2,Integer) + +As you have probably guessed by now, rho acts on matrices by rotating +the elements clockwise. + + rho m + +3 1+ + | | + +4 2+ + Type: SquareMatrix(2,Integer) + + rho rho m + +4 3+ + | | + +2 1+ + Type: SquareMatrix(2,Integer) + + (rho^3) m + +2 4+ + | | + +1 3+ + Type: SquareMatrix(2,Integer) + +Do the swapping of rows and transposition commute? We can check by +computing their bracket. + + b := t * s - s * t + +0 1+ +0 1+ + - | |tilde + tilde| | + +1 0+ +1 0+ + Type: Operator SquareMatrix(2,Integer) + +Now apply it to m. + + b m + +1 - 3+ + | | + +3 - 1+ + Type: SquareMatrix(2,Integer) + +Next we demonstrate how to define a differential operator on a polynomial ring. + +This is the recursive definition of the n-th Legendre polynomial. + + L n == + n = 0 => 1 + n = 1 => x + (2*n-1)/n * x * L(n-1) - (n-1)/n * L(n-2) + Type: Void + +Create the differential operator d/dx on polynomials in x over the +rational numbers. + + dx := operator("D") :: OP(POLY FRAC INT) + D + Type: Operator Polynomial Fraction Integer + +Now attach the map to it. + + evaluate(dx, p +-> D(p, 'x)) + D + Type: Operator Polynomial Fraction Integer + +This is the differential equation satisfied by the n-th Legendre polynomial. + + E n == (1 - x**2) * dx**2 - 2 * x * dx + n*(n+1) + Type: Void + +Now we verify this for n = 15. Here is the polynomial. + + L 15 + 9694845 15 35102025 13 50702925 11 37182145 9 14549535 7 + ------- x - -------- x + -------- x - -------- x + -------- x + 2048 2048 2048 2048 2048 + + + 2909907 5 255255 3 6435 + - ------- x + ------ x - ---- x + 2048 2048 2048 + Type: Polynomial Fraction Integer + +Here is the operator. + + E 15 + 240 - 2x D - (x - 1)D + Type: Operator Polynomial Fraction Integer + +Here is the evaluation. + + (E 15)(L 15) + 0 + Type: Polynomial Fraction Integer + +See Also: +o )show Operator +o $AXIOM/doc/src/algebra/opalg.spad.dvi + +@ <>= )abbrev domain OP Operator ++ Author: Manuel Bronstein diff --git a/src/algebra/perman.spad.pamphlet b/src/algebra/perman.spad.pamphlet index bc2f63f..0e456a2 100644 --- a/src/algebra/perman.spad.pamphlet +++ b/src/algebra/perman.spad.pamphlet @@ -86,6 +86,83 @@ GrayCode: public == private where @ \section{package PERMAN Permanent} +<>= +-- perman.spad.pamphlet Permanent.input +)spool Permanent.output +)set message test on +)set message auto off +)clear all +--S 1 of 3 +kn n == + r : MATRIX INT := new(n,n,1) + for i in 1..n repeat + r.i.i := 0 + r +--R +--R Type: Void +--E 1 + +--S 2 of 3 +permanent(kn(5) :: SQMATRIX(5,INT)) +--R +--R Compiling function kn with type PositiveInteger -> Matrix Integer +--R +--R (2) 44 +--R Type: PositiveInteger +--E 2 + +--S 3 of 3 +[permanent(kn(n) :: SQMATRIX(n,INT)) for n in 1..13] +--R +--R Cannot compile conversion for types involving local variables. In +--R particular, could not compile the expression involving :: +--R SQMATRIX(n,INT) +--R AXIOM will attempt to step through and interpret the code. +--R +--R (3) +--R [0,1,2,9,44,265,1854,14833,133496,1334961,14684570,176214841,2290792932] +--R Type: List NonNegativeInteger +--E 3 +)spool +)lisp (bye) +@ +<>= +==================================================================== +Permanent examples +==================================================================== + +The package Permanent provides the function permanent for square +matrices. The permanent of a square matrix can be computed in the +same way as the determinant by expansion of minors except that for the +permanent the sign for each element is 1, rather than being 1 if the +row plus column indices is positive and -1 otherwise. This function +is much more difficult to compute efficiently than the determinant. +An example of the use of permanent is the calculation of the n-th +derangement number, defined to be the number of different possibilities +for n couples to dance but never with their own spouse. + +Consider an n by n matrix with entries 0 on the diagonal and 1 elsewhere. +Think of the rows as one-half of each couple (for example, the males) and +the columns the other half. The permanent of such a matrix gives the +desired derangement number. + + kn n == + r : MATRIX INT := new(n,n,1) + for i in 1..n repeat + r.i.i := 0 + r + +Here are some derangement numbers, which you see grow quite fast. + + permanent(kn(5) :: SQMATRIX(5,INT)) + + [permanent(kn(n) :: SQMATRIX(n,INT)) for n in 1..13] + +See Also: +o )show Permanent +o $AXIOM/doc/src/algebra/perman.spad.dvi + +@ <>= )abbrev package PERMAN Permanent ++ Authors: Johannes Grabmeier, Oswald Gschnitzer diff --git a/src/algebra/pfr.spad.pamphlet b/src/algebra/pfr.spad.pamphlet index 8286147..ce53bf8 100644 --- a/src/algebra/pfr.spad.pamphlet +++ b/src/algebra/pfr.spad.pamphlet @@ -10,6 +10,279 @@ \tableofcontents \eject \section{domain PFR PartialFraction} +<>= +-- pfr.spad.pamphlet PartialFraction.input +)spool PartialFraction.output +)set message test on +)set message auto off +)clear all +--S 1 of 10 +partialFraction(1,factorial 10) +--R +--R +--R 159 23 12 1 +--R (1) --- - -- - -- + - +--R 8 4 2 7 +--R 2 3 5 +--R Type: PartialFraction Integer +--E 1 + +--S 2 of 10 +f := padicFraction(%) +--R +--R +--R 1 1 1 1 1 1 2 1 2 2 2 1 +--R (2) - + -- + -- + -- + -- + -- - -- - -- - -- - - - -- + - +--R 2 4 5 6 7 8 2 3 4 5 2 7 +--R 2 2 2 2 2 3 3 3 5 +--R Type: PartialFraction Integer +--E 2 + +--S 3 of 10 +compactFraction(f) +--R +--R +--R 159 23 12 1 +--R (3) --- - -- - -- + - +--R 8 4 2 7 +--R 2 3 5 +--R Type: PartialFraction Integer +--E 3 + +--S 4 of 10 +numberOfFractionalTerms(f) +--R +--R +--R (4) 12 +--R Type: PositiveInteger +--E 4 + +--S 5 of 10 +nthFractionalTerm(f,3) +--R +--R +--R 1 +--R (5) -- +--R 5 +--R 2 +--R Type: PartialFraction Integer +--E 5 + +--S 6 of 10 +partialFraction(1,- 13 + 14 * %i) +--R +--R +--R 1 4 +--R (6) - ------- + ------- +--R 1 + 2%i 3 + 8%i +--R Type: PartialFraction Complex Integer +--E 6 + +--S 7 of 10 +% :: Fraction Complex Integer +--R +--R +--R %i +--R (7) - --------- +--R 14 + 13%i +--R Type: Fraction Complex Integer +--E 7 + +--S 8 of 10 +u : FR UP(x, FRAC INT) := reduce(*,[primeFactor(x+i,i) for i in 1..4]) +--R +--R +--R 2 3 4 +--R (8) (x + 1)(x + 2) (x + 3) (x + 4) +--R Type: Factored UnivariatePolynomial(x,Fraction Integer) +--E 8 + +--S 9 of 10 +partialFraction(1,u) +--R +--R +--R (9) +--R 1 1 7 17 2 139 607 3 10115 2 391 44179 +--R --- - x + -- - -- x - 12x - --- --- x + ----- x + --- x + ----- +--R 648 4 16 8 8 324 432 4 324 +--R ----- + -------- + ------------------- + --------------------------------- +--R x + 1 2 3 4 +--R (x + 2) (x + 3) (x + 4) +--R Type: PartialFraction UnivariatePolynomial(x,Fraction Integer) +--E 9 + +--S 10 of 10 +padicFraction % +--R +--R +--R (10) +--R 1 1 1 17 3 1 607 403 +--R --- - -- -- - - --- --- +--R 648 4 16 8 4 2 324 432 +--R ----- + ----- - -------- - ----- + -------- - -------- + ----- + -------- +--R x + 1 x + 2 2 x + 3 2 3 x + 4 2 +--R (x + 2) (x + 3) (x + 3) (x + 4) +--R + +--R 13 1 +--R -- -- +--R 36 12 +--R -------- + -------- +--R 3 4 +--R (x + 4) (x + 4) +--R Type: PartialFraction UnivariatePolynomial(x,Fraction Integer) +--E 10 +)spool +)lisp (bye) +@ +<>= +==================================================================== +PartialFraction examples +==================================================================== + +A partial fraction is a decomposition of a quotient into a sum of +quotients where the denominators of the summands are powers of +primes. Most people first encounter partial fractions when they are +learning integral calculus. For a technical discussion of partial +fractions, see, for example, Lang's Algebra. For example, the rational +number 1/6 is decomposed into 1/2-1/3. You can compute partial +fractions of quotients of objects from domains belonging to the +category EuclideanDomain. For example, Integer, Complex Integer, and +UnivariatePolynomial(x, Fraction Integer) all belong to EuclideanDomain. +In the examples following, we demonstrate how to decompose quotients of +each of these kinds of object into partial fractions. + +It is necessary that we know how to factor the denominator when we +want to compute a partial fraction. Although the interpreter can +often do this automatically, it may be necessary for you to include a +call to factor. In these examples, it is not necessary to factor the +denominators explicitly. + +The main operation for computing partial fractions is called partialFraction +and we use this to compute a decomposition of 1/10!. The first argument to +partialFraction is the numerator of the quotient and the second argument is +the factored denominator. + + partialFraction(1,factorial 10) + 159 23 12 1 + --- - -- - -- + - + 8 4 2 7 + 2 3 5 + Type: PartialFraction Integer + +Since the denominators are powers of primes, it may be possible to +expand the numerators further with respect to those primes. Use the +operation padicFraction to do this. + + f := padicFraction(%) + 1 1 1 1 1 1 2 1 2 2 2 1 + - + -- + -- + -- + -- + -- - -- - -- - -- - - - -- + - + 2 4 5 6 7 8 2 3 4 5 2 7 + 2 2 2 2 2 3 3 3 5 + Type: PartialFraction Integer + +The operation compactFraction returns an expanded fraction into the usual +form. The compacted version is used internally for computational efficiency. + + compactFraction(f) + 159 23 12 1 + --- - -- - -- + - + 8 4 2 7 + 2 3 5 + Type: PartialFraction Integer + +You can add, subtract, multiply and divide partial fractions. In addition, +you can extract the parts of the decomposition. numberOfFractionalTerms +computes the number of terms in the fractional part. This does not include +the whole part of the fraction, which you get by calling wholePart. In +this example, the whole part is just 0. + + numberOfFractionalTerms(f) + 12 + Type: PositiveInteger + +The operation nthFractionalTerm returns the individual terms in the +decomposition. Notice that the object returned is a partial fraction +itself. firstNumer and firstDenom extract the numerator and denominator +of the first term of the fraction. + + nthFractionalTerm(f,3) + 1 + -- + 5 + 2 + Type: PartialFraction Integer + +Given two gaussian integers, you can decompose their quotient into a +partial fraction. + + partialFraction(1,- 13 + 14 * %i) + 1 4 + - ------- + ------- + 1 + 2%i 3 + 8%i + Type: PartialFraction Complex Integer + +To convert back to a quotient, simply use a conversion. + + % :: Fraction Complex Integer + %i + - --------- + 14 + 13%i + Type: Fraction Complex Integer + +To conclude this section, we compute the decomposition of + + 1 + ------------------------------- + 2 3 4 + (x + 1)(x + 2) (x + 3) (x + 4) + + +The polynomials in this object have type +UnivariatePolynomial(x, Fraction Integer). + +We use the primeFactor operation to create the denominator in factored +form directly. + + u : FR UP(x, FRAC INT) := reduce(*,[primeFactor(x+i,i) for i in 1..4]) + 2 3 4 + (x + 1)(x + 2) (x + 3) (x + 4) + Type: Factored UnivariatePolynomial(x,Fraction Integer) + +These are the compact and expanded partial fractions for the quotient. + + partialFraction(1,u) + 1 1 7 17 2 139 607 3 10115 2 391 44179 + --- - x + -- - -- x - 12x - --- --- x + ----- x + --- x + ----- + 648 4 16 8 8 324 432 4 324 + ----- + -------- + ------------------- + --------------------------------- + x + 1 2 3 4 + (x + 2) (x + 3) (x + 4) + Type: PartialFraction UnivariatePolynomial(x,Fraction Integer) + + padicFraction % + 1 1 1 17 3 1 607 403 + --- - -- -- - - --- --- + 648 4 16 8 4 2 324 432 + ----- + ----- - -------- - ----- + -------- - -------- + ----- + -------- + x + 1 x + 2 2 x + 3 2 3 x + 4 2 + (x + 2) (x + 3) (x + 3) (x + 4) + + + 13 1 + -- -- + 36 12 + -------- + -------- + 3 4 + (x + 4) (x + 4) + Type: PartialFraction UnivariatePolynomial(x,Fraction Integer) + +See Also: +o )help Factored +o )help Complex +o )help FullPartialFractionExpansionXmpPage +o )show PartialFraction +o $AXIOM/doc/src/algebra/pfr.spad.dvi + +@ <>= )abbrev domain PFR PartialFraction ++ Author: Robert S. Sutor diff --git a/src/algebra/quat.spad.pamphlet b/src/algebra/quat.spad.pamphlet index ca56315..ebb8941 100644 --- a/src/algebra/quat.spad.pamphlet +++ b/src/algebra/quat.spad.pamphlet @@ -5233,6 +5233,245 @@ QuaternionCategory(R: CommutativeRing): Category == @ \section{domain QUAT Quaternion} +<>= +-- quat.spad.pamphlet Quaternion.input +)spool Quaternion.output +)set message test on +)set message auto off +)clear all +--S 1 of 13 +q := quatern(2/11,-8,3/4,1) +--R +--R +--R 2 3 +--R (1) -- - 8i + - j + k +--R 11 4 +--R Type: Quaternion Fraction Integer +--E 1 + +--S 2 of 13 +[real q, imagI q, imagJ q, imagK q] +--R +--R +--R 2 3 +--R (2) [--,- 8,-,1] +--R 11 4 +--R Type: List Fraction Integer +--E 2 + +--S 3 of 13 +inv q +--R +--R +--R 352 15488 484 1936 +--R (3) ------ + ------ i - ----- j - ------ k +--R 126993 126993 42331 126993 +--R Type: Quaternion Fraction Integer +--E 3 + +--S 4 of 13 +q^6 +--R +--R +--R 2029490709319345 48251690851 144755072553 48251690851 +--R (4) - ---------------- - ----------- i + ------------ j + ----------- k +--R 7256313856 1288408 41229056 10307264 +--R Type: Quaternion Fraction Integer +--E 4 + +--S 5 of 13 +r := quatern(-2,3,23/9,-89); q + r +--R +--R +--R 20 119 +--R (5) - -- - 5i + --- j - 88k +--R 11 36 +--R Type: Quaternion Fraction Integer +--E 5 + +--S 6 of 13 +q * r - r * q +--R +--R +--R 2495 817 +--R (6) - ---- i - 1418j - --- k +--R 18 18 +--R Type: Quaternion Fraction Integer +--E 6 + +--S 7 of 13 +i:=quatern(0,1,0,0) +--R +--R +--R (7) i +--R Type: Quaternion Integer +--E 7 + +--S 8 of 13 +j:=quatern(0,0,1,0) +--R +--R +--R (8) j +--R Type: Quaternion Integer +--E 8 + +--S 9 of 13 +k:=quatern(0,0,0,1) +--R +--R +--R (9) k +--R Type: Quaternion Integer +--E 9 + +--S 10 of 13 +[i*i, j*j, k*k, i*j, j*k, k*i, q*i] +--R +--R +--R 2 3 +--R (10) [- 1,- 1,- 1,k,i,j,8 + -- i + j - - k] +--R 11 4 +--R Type: List Quaternion Fraction Integer +--E 10 + +--S 11 of 13 +norm q +--R +--R +--R 126993 +--R (11) ------ +--R 1936 +--R Type: Fraction Integer +--E 11 + +--S 12 of 13 +conjugate q +--R +--R +--R 2 3 +--R (12) -- + 8i - - j - k +--R 11 4 +--R Type: Quaternion Fraction Integer +--E 12 + +--S 13 of 13 +q * % +--R +--R +--R 126993 +--R (13) ------ +--R 1936 +--R Type: Quaternion Fraction Integer +--E 13 +)spool +)lisp (bye) +@ +<>= +==================================================================== +Quaternion examples +==================================================================== + +The domain constructor Quaternion implements quaternions over +commutative rings. + +The basic operation for creating quaternions is quatern. This is a +quaternion over the rational numbers. + + q := quatern(2/11,-8,3/4,1) + 2 3 + -- - 8i + - j + k + 11 4 + Type: Quaternion Fraction Integer + +The four arguments are the real part, the i imaginary part, the j +imaginary part, and the k imaginary part, respectively. + + [real q, imagI q, imagJ q, imagK q] + 2 3 + [--,- 8,-,1] + 11 4 + Type: List Fraction Integer + +Because q is over the rationals (and nonzero), you can invert it. + + inv q + 352 15488 484 1936 + ------ + ------ i - ----- j - ------ k + 126993 126993 42331 126993 + Type: Quaternion Fraction Integer + +The usual arithmetic (ring) operations are available + + q^6 + 2029490709319345 48251690851 144755072553 48251690851 + - ---------------- - ----------- i + ------------ j + ----------- k + 7256313856 1288408 41229056 10307264 + Type: Quaternion Fraction Integer + + r := quatern(-2,3,23/9,-89); q + r + 20 119 + - -- - 5i + --- j - 88k + 11 36 + Type: Quaternion Fraction Integer + +In general, multiplication is not commutative. + + q * r - r * q + 2495 817 + - ---- i - 1418j - --- k + 18 18 + Type: Quaternion Fraction Integer + +There are no predefined constants for the imaginary i, j, and k parts, +but you can easily define them. + + i:=quatern(0,1,0,0) + i + Type: Quaternion Integer + + j:=quatern(0,0,1,0) + j + Type: Quaternion Integer + + k:=quatern(0,0,0,1) + k + Type: Quaternion Integer + +These satisfy the normal identities. + + [i*i, j*j, k*k, i*j, j*k, k*i, q*i] + 2 3 + [- 1,- 1,- 1,k,i,j,8 + -- i + j - - k] + 11 4 + Type: List Quaternion Fraction Integer + +The norm is the quaternion times its conjugate. + + norm q + 126993 + ------ + 1936 + Type: Fraction Integer + + conjugate q + 2 3 + -- + 8i - - j - k + 11 4 + Type: Quaternion Fraction Integer + + q * % + 126993 + ------ + 1936 + Type: Quaternion Fraction Integer + +See Also: +o )help Octonion +o )help Complex +o )help CliffordAlgebra +o )show Quaternion +o $AXIOM/doc/src/algebra/quat.spad.dvi + +@ <>= )abbrev domain QUAT Quaternion ++ Author: Robert S. Sutor diff --git a/src/algebra/radix.spad.pamphlet b/src/algebra/radix.spad.pamphlet index 3e536be..98364b1 100644 --- a/src/algebra/radix.spad.pamphlet +++ b/src/algebra/radix.spad.pamphlet @@ -10,6 +10,286 @@ \tableofcontents \eject \section{domain RADIX RadixExpansion} +<>= +-- radix.spad.pamphlet RadixExpansion.input +)spool RadixExpansion.output +)set message test on +)set message auto off +)clear all +--S 1 of 17 +111::RadixExpansion(5) +--R +--R +--R (1) 421 +--R Type: RadixExpansion 5 +--E 1 + +--S 2 of 17 +(5/24)::RadixExpansion(2) +--R +--R +--R __ +--R (2) 0.00110 +--R Type: RadixExpansion 2 +--E 2 + +--S 3 of 17 +(5/24)::RadixExpansion(3) +--R +--R +--R __ +--R (3) 0.012 +--R Type: RadixExpansion 3 +--E 3 + +--S 4 of 17 +(5/24)::RadixExpansion(8) +--R +--R +--R __ +--R (4) 0.152 +--R Type: RadixExpansion 8 +--E 4 + +--S 5 of 17 +(5/24)::RadixExpansion(10) +--R +--R +--R _ +--R (5) 0.2083 +--R Type: RadixExpansion 10 +--E 5 + +--S 6 of 17 +(5/24)::RadixExpansion(12) +--R +--R +--R (6) 0.26 +--R Type: RadixExpansion 12 +--E 6 + +--S 7 of 17 +(5/24)::RadixExpansion(16) +--R +--R +--R _ +--R (7) 0.35 +--R Type: RadixExpansion 16 +--E 7 + +--S 8 of 17 +(5/24)::RadixExpansion(36) +--R +--R +--R (8) 0.7I +--R Type: RadixExpansion 36 +--E 8 + +--S 9 of 17 +(5/24)::RadixExpansion(38) +--R +--R +--R _____ +--R (9) 0 . 7 34 31 25 12 +--R Type: RadixExpansion 38 +--E 9 + +--S 10 of 17 +a := (76543/210)::RadixExpansion(8) +--R +--R +--R ____ +--R (10) 554.37307 +--R Type: RadixExpansion 8 +--E 10 + +--S 11 of 17 +w := wholeRagits a +--R +--R +--R (11) [5,5,4] +--R Type: List Integer +--E 11 + +--S 12 of 17 +f0 := prefixRagits a +--R +--R +--R (12) [3] +--R Type: List Integer +--E 12 + +--S 13 of 17 +f1 := cycleRagits a +--R +--R +--R (13) [7,3,0,7] +--R Type: List Integer +--E 13 + +--S 14 of 17 +u:RadixExpansion(8):=wholeRadix(w)+fractRadix(f0,f1) +--R +--R +--R ____ +--R (14) 554.37307 +--R Type: RadixExpansion 8 +--E 14 + +--S 15 of 17 +v: RadixExpansion(12) := fractRadix([1,2,3,11], [0]) +--R +--R +--R _ +--R (15) 0.123B0 +--R Type: RadixExpansion 12 +--E 15 + +--S 16 of 17 +fractRagits(u) +--R +--R +--R _______ +--R (16) [3,7,3,0,7,7] +--R Type: Stream Integer +--E 16 + +--S 17 of 17 +a :: Fraction(Integer) +--R +--R +--R 76543 +--R (17) ----- +--R 210 +--R Type: Fraction Integer +--E 17 +)spool +)lisp (bye) +@ +<>= +==================================================================== +RadixExpansion examples +==================================================================== + +It possible to expand numbers in general bases. + +Here we expand 111 in base 5. This means + 10^2+10^1+10^0 = 4 * 5^2+2 * 5^1 + 5^0 + + 111::RadixExpansion(5) + 421 + Type: RadixExpansion 5 + +You can expand fractions to form repeating expansions. + + (5/24)::RadixExpansion(2) + __ + 0.00110 + Type: RadixExpansion 2 + + (5/24)::RadixExpansion(3) + __ + 0.012 + Type: RadixExpansion 3 + + (5/24)::RadixExpansion(8) + __ + 0.152 + Type: RadixExpansion 8 + + (5/24)::RadixExpansion(10) + _ + 0.2083 + Type: RadixExpansion 10 + +For bases from 11 to 36 the letters A through Z are used. + + (5/24)::RadixExpansion(12) + 0.26 + Type: RadixExpansion 12 + + (5/24)::RadixExpansion(16) + _ + 0.35 + Type: RadixExpansion 16 + + (5/24)::RadixExpansion(36) + 0.7I + Type: RadixExpansion 36 + +For bases greater than 36, the ragits are separated by blanks. + + (5/24)::RadixExpansion(38) + _____ + 0 . 7 34 31 25 12 + Type: RadixExpansion 38 + +The RadixExpansion type provides operations to obtain the individual +ragits. Here is a rational number in base 8. + + a := (76543/210)::RadixExpansion(8) + ____ + 554.37307 + Type: RadixExpansion 8 + +The operation wholeRagits returns a list of the ragits for the +integral part of the number. + + w := wholeRagits a + [5,5,4] + Type: List Integer + +The operations prefixRagits and cycleRagits return lists of the initial +and repeating ragits in the fractional part of the number. + + f0 := prefixRagits a + [3] + Type: List Integer + + f1 := cycleRagits a + [7,3,0,7] + Type: List Integer + +You can construct any radix expansion by giving the whole, prefix and +cycle parts. The declaration is necessary to let Axiom know the base +of the ragits. + + u:RadixExpansion(8):=wholeRadix(w)+fractRadix(f0,f1) + ____ + 554.37307 + Type: RadixExpansion 8 + +If there is no repeating part, then the list [0] should be used. + + v: RadixExpansion(12) := fractRadix([1,2,3,11], [0]) + _ + 0.123B0 + Type: RadixExpansion 12 + +If you are not interested in the repeating nature of the expansion, an +infinite stream of ragits can be obtained using fractRagits. + + fractRagits(u) + _______ + [3,7,3,0,7,7] + Type: Stream Integer + +Of course, it's possible to recover the fraction representation: + + a :: Fraction(Integer) + 76543 + ----- + 210 + Type: Fraction Integer + +See Also: +o )help DecimalExpansion +o )help BinaryExpansion +o )help HexadecimalExpansion +o )show RadixExpansion +o $AXIOM/doc/src/algebra/radix.spad.dvi + +@ <>= )abbrev domain RADIX RadixExpansion ++ Author: Stephen M. Watt diff --git a/src/algebra/reclos.spad.pamphlet b/src/algebra/reclos.spad.pamphlet index b0400ad..85889cc 100644 --- a/src/algebra/reclos.spad.pamphlet +++ b/src/algebra/reclos.spad.pamphlet @@ -901,6 +901,1192 @@ The implementation is based on interval arithmetic. Moreover, the design of this constructor and its related packages allows an easy use of other codings for real algebraic numbers. ordered field +<>= +-- reclos.spad.pamphlet RealClosure.input +)spool RealClosure.output +)set message test on +)set message auto off +)clear all +--S 1 of 67 +Ran := RECLOS(FRAC INT) +--R +--R +--R (1) RealClosure Fraction Integer +--R Type: Domain +--E 1 + +--S 2 of 67 +fourSquares(a:Ran,b:Ran,c:Ran,d:Ran):Ran==sqrt(a)+sqrt(b)-sqrt(c)-sqrt(d) +--R +--R Function declaration fourSquares : (RealClosure Fraction Integer, +--R RealClosure Fraction Integer,RealClosure Fraction Integer, +--R RealClosure Fraction Integer) -> RealClosure Fraction Integer has +--R been added to workspace. +--R Type: Void +--E 2 + +--S 3 of 67 +squareDiff1 := fourSquares(73,548,60,586) +--R +--R Compiling function fourSquares with type (RealClosure Fraction +--R Integer,RealClosure Fraction Integer,RealClosure Fraction Integer +--R ,RealClosure Fraction Integer) -> RealClosure Fraction Integer +--R +--R +---+ +--+ +---+ +--+ +--R (3) - \|586 - \|60 + \|548 + \|73 +--R Type: RealClosure Fraction Integer +--E 3 + +--S 4 of 67 +recip(squareDiff1) +--R +--R +--R (4) +--R +---+ +--+ +--+ +--+ +---+ +---+ +--R ((54602\|548 + 149602\|73 )\|60 + 49502\|73 \|548 + 9900895)\|586 +--R + +--R +--+ +---+ +--+ +---+ +--+ +--R (154702\|73 \|548 + 30941947)\|60 + 10238421\|548 + 28051871\|73 +--R Type: Union(RealClosure Fraction Integer,...) +--E 4 + +--S 5 of 67 +sign(squareDiff1) +--R +--R +--R (5) 1 +--R Type: PositiveInteger +--E 5 + +--S 6 of 67 +squareDiff2 := fourSquares(165,778,86,990) +--R +--R +--R +---+ +--+ +---+ +---+ +--R (6) - \|990 - \|86 + \|778 + \|165 +--R Type: RealClosure Fraction Integer +--E 6 + +--S 7 of 67 +recip(squareDiff2) +--R +--R +--R (7) +--R +---+ +---+ +--+ +---+ +---+ +--R ((556778\|778 + 1209010\|165 )\|86 + 401966\|165 \|778 + 144019431) +--R * +--R +---+ +--R \|990 +--R + +--R +---+ +---+ +--+ +---+ +---+ +--R (1363822\|165 \|778 + 488640503)\|86 + 162460913\|778 + 352774119\|165 +--R Type: Union(RealClosure Fraction Integer,...) +--E 7 + +--S 8 of 67 +sign(squareDiff2) +--R +--R +--R (8) 1 +--R Type: PositiveInteger +--E 8 + +--S 9 of 67 +squareDiff3 := fourSquares(217,708,226,692) +--R +--R +--R +---+ +---+ +---+ +---+ +--R (9) - \|692 - \|226 + \|708 + \|217 +--R Type: RealClosure Fraction Integer +--E 9 + +--S 10 of 67 +recip(squareDiff3) +--R +--R +--R (10) +--R +---+ +---+ +---+ +---+ +---+ +---+ +--R ((- 34102\|708 - 61598\|217 )\|226 - 34802\|217 \|708 - 13641141)\|692 +--R + +--R +---+ +---+ +---+ +---+ +---+ +--R (- 60898\|217 \|708 - 23869841)\|226 - 13486123\|708 - 24359809\|217 +--R Type: Union(RealClosure Fraction Integer,...) +--E 10 + +--S 11 of 67 +sign(squareDiff3) +--R +--R +--R (11) - 1 +--R Type: Integer +--E 11 + +--S 12 of 67 +squareDiff4 := fourSquares(155,836,162,820) +--R +--R +--R +---+ +---+ +---+ +---+ +--R (12) - \|820 - \|162 + \|836 + \|155 +--R Type: RealClosure Fraction Integer +--E 12 + +--S 13 of 67 +recip(squareDiff4) +--R +--R +--R (13) +--R +---+ +---+ +---+ +---+ +---+ +---+ +--R ((- 37078\|836 - 86110\|155 )\|162 - 37906\|155 \|836 - 13645107)\|820 +--R + +--R +---+ +---+ +---+ +---+ +---+ +--R (- 85282\|155 \|836 - 30699151)\|162 - 13513901\|836 - 31384703\|155 +--R Type: Union(RealClosure Fraction Integer,...) +--E 13 + +--S 14 of 67 +sign(squareDiff4) +--R +--R +--R (14) - 1 +--R Type: Integer +--E 14 + +--S 15 of 67 +squareDiff5 := fourSquares(591,772,552,818) +--R +--R +--R +---+ +---+ +---+ +---+ +--R (15) - \|818 - \|552 + \|772 + \|591 +--R Type: RealClosure Fraction Integer +--E 15 + +--S 16 of 67 +recip(squareDiff5) +--R +--R +--R (16) +--R +---+ +---+ +---+ +---+ +---+ +---+ +--R ((70922\|772 + 81058\|591 )\|552 + 68542\|591 \|772 + 46297673)\|818 +--R + +--R +---+ +---+ +---+ +---+ +---+ +--R (83438\|591 \|772 + 56359389)\|552 + 47657051\|772 + 54468081\|591 +--R Type: Union(RealClosure Fraction Integer,...) +--E 16 + +--S 17 of 67 +sign(squareDiff5) +--R +--R +--R (17) 1 +--R Type: PositiveInteger +--E 17 + +--S 18 of 67 +squareDiff6 := fourSquares(434,1053,412,1088) +--R +--R +--R +----+ +---+ +----+ +---+ +--R (18) - \|1088 - \|412 + \|1053 + \|434 +--R Type: RealClosure Fraction Integer +--E 18 + +--S 19 of 67 +recip(squareDiff6) +--R +--R +--R (19) +--R +----+ +---+ +---+ +---+ +----+ +--R ((115442\|1053 + 179818\|434 )\|412 + 112478\|434 \|1053 + 76037291) +--R * +--R +----+ +--R \|1088 +--R + +--R +---+ +----+ +---+ +----+ +---+ +--R (182782\|434 \|1053 + 123564147)\|412 + 77290639\|1053 + 120391609\|434 +--R Type: Union(RealClosure Fraction Integer,...) +--E 19 + +--S 20 of 67 +sign(squareDiff6) +--R +--R +--R (20) 1 +--R Type: PositiveInteger +--E 20 + +--S 21 of 67 +squareDiff7 := fourSquares(514,1049,446,1152) +--R +--R +--R +----+ +---+ +----+ +---+ +--R (21) - \|1152 - \|446 + \|1049 + \|514 +--R Type: RealClosure Fraction Integer +--E 21 + +--S 22 of 67 +recip(squareDiff7) +--R +--R +--R (22) +--R +----+ +---+ +---+ +---+ +----+ +--R ((349522\|1049 + 499322\|514 )\|446 + 325582\|514 \|1049 + 239072537) +--R * +--R +----+ +--R \|1152 +--R + +--R +---+ +----+ +---+ +----+ +---+ +--R (523262\|514 \|1049 + 384227549)\|446 + 250534873\|1049 + 357910443\|514 +--R Type: Union(RealClosure Fraction Integer,...) +--E 22 + +--S 23 of 67 +sign(squareDiff7) +--R +--R +--R (23) 1 +--R Type: PositiveInteger +--E 23 + +--S 24 of 67 +squareDiff8 := fourSquares(190,1751,208,1698) +--R +--R +--R +----+ +---+ +----+ +---+ +--R (24) - \|1698 - \|208 + \|1751 + \|190 +--R Type: RealClosure Fraction Integer +--E 24 + +--S 25 of 67 +recip(squareDiff8) +--R +--R +--R (25) +--R +----+ +---+ +---+ +---+ +----+ +--R (- 214702\|1751 - 651782\|190 )\|208 - 224642\|190 \|1751 +--R + +--R - 129571901 +--R * +--R +----+ +--R \|1698 +--R + +--R +---+ +----+ +---+ +----+ +--R (- 641842\|190 \|1751 - 370209881)\|208 - 127595865\|1751 +--R + +--R +---+ +--R - 387349387\|190 +--R Type: Union(RealClosure Fraction Integer,...) +--E 25 + +--S 26 of 67 +sign(squareDiff8) +--R +--R +--R (26) - 1 +--R Type: Integer +--E 26 + +--S 27 of 67 +relativeApprox(squareDiff8,10**(-3))::Float +--R +--R +--R (27) - 0.2340527771 5937700123 E -10 +--R Type: Float +--E 27 + +--S 28 of 67 +l := allRootsOf((x**2-2)**2-2)$Ran +--R +--R +--R (28) [%A33,%A34,%A35,%A36] +--R Type: List RealClosure Fraction Integer +--E 28 + +--S 29 of 67 +removeDuplicates map(mainDefiningPolynomial,l) +--R +--R +--R 4 2 +--R (29) [? - 4? + 2] +--RType: List Union(SparseUnivariatePolynomial RealClosure Fraction Integer,"failed") +--E 29 + +--S 30 of 67 +map(mainCharacterization,l) +--R +--R +--R (30) [[- 2,- 1[,[- 1,0[,[0,1[,[1,2[] +--RType: List Union(RightOpenIntervalRootCharacterization(RealClosure Fraction Integer,SparseUnivariatePolynomial RealClosure Fraction Integer),"failed") +--E 30 + +--S 31 of 67 +[reduce(+,l),reduce(*,l)-2] +--R +--R +--R (31) [0,0] +--R Type: List RealClosure Fraction Integer +--E 31 + +--S 32 of 67 +(s2, s5, s10) := (sqrt(2)$Ran, sqrt(5)$Ran, sqrt(10)$Ran) +--R +--R +--R +--+ +--R (32) \|10 +--R Type: RealClosure Fraction Integer +--E 32 + +--S 33 of 67 +eq1:=sqrt(s10+3)*sqrt(s5+2) - sqrt(s10-3)*sqrt(s5-2) = sqrt(10*s2+10) +--R +--R +--R +---------+ +--------+ +---------+ +--------+ +-----------+ +--R | +--+ | +-+ | +--+ | +-+ | +-+ +--R (33) - \|\|10 - 3 \|\|5 - 2 + \|\|10 + 3 \|\|5 + 2 = \|10\|2 + 10 +--R Type: Equation RealClosure Fraction Integer +--E 33 + +--S 34 of 67 +eq1::Boolean +--R +--R +--R (34) true +--R Type: Boolean +--E 34 + +--S 35 of 67 +eq2:=sqrt(s5+2)*sqrt(s2+1) - sqrt(s5-2)*sqrt(s2-1) = sqrt(2*s10+2) +--R +--R +--R +--------+ +--------+ +--------+ +--------+ +----------+ +--R | +-+ | +-+ | +-+ | +-+ | +--+ +--R (35) - \|\|5 - 2 \|\|2 - 1 + \|\|5 + 2 \|\|2 + 1 = \|2\|10 + 2 +--R Type: Equation RealClosure Fraction Integer +--E 35 + +--S 36 of 67 +eq2::Boolean +--R +--R +--R (36) true +--R Type: Boolean +--E 36 + +--S 37 of 67 +s3 := sqrt(3)$Ran +--R +--R +--R +-+ +--R (37) \|3 +--R Type: RealClosure Fraction Integer +--E 37 + +--S 38 of 67 +s7:= sqrt(7)$Ran +--R +--R +--R +-+ +--R (38) \|7 +--R Type: RealClosure Fraction Integer +--E 38 + +--S 39 of 67 +e1 := sqrt(2*s7-3*s3,3) +--R +--R +--R +-------------+ +--R 3| +-+ +-+ +--R (39) \|2\|7 - 3\|3 +--R Type: RealClosure Fraction Integer +--E 39 + +--S 40 of 67 +e2 := sqrt(2*s7+3*s3,3) +--R +--R +--R +-------------+ +--R 3| +-+ +-+ +--R (40) \|2\|7 + 3\|3 +--R Type: RealClosure Fraction Integer +--E 40 + +--S 41 of 67 +e2-e1-s3 +--R +--R +--R (41) 0 +--R Type: RealClosure Fraction Integer +--E 41 + +--S 42 of 67 +pol : UP(x,Ran) := x**4+(7/3)*x**2+30*x-(100/3) +--R +--R +--R 4 7 2 100 +--R (42) x + - x + 30x - --- +--R 3 3 +--R Type: UnivariatePolynomial(x,RealClosure Fraction Integer) +--E 42 + +--S 43 of 67 +r1 := sqrt(7633)$Ran +--R +--R +--R +----+ +--R (43) \|7633 +--R Type: RealClosure Fraction Integer +--E 43 + +--S 44 of 67 +alpha := sqrt(5*r1-436,3)/3 +--R +--R +--R +--------------+ +--R 1 3| +----+ +--R (44) - \|5\|7633 - 436 +--R 3 +--R Type: RealClosure Fraction Integer +--E 44 + +--S 45 of 67 +beta := -sqrt(5*r1+436,3)/3 +--R +--R +--R +--------------+ +--R 1 3| +----+ +--R (45) - - \|5\|7633 + 436 +--R 3 +--R Type: RealClosure Fraction Integer +--E 45 + +--S 46 of 67 +pol.(alpha+beta-1/3) +--R +--R +--R (46) 0 +--R Type: RealClosure Fraction Integer +--E 46 + +--S 47 of 67 +qol : UP(x,Ran) := x**5+10*x**3+20*x+22 +--R +--R +--R 5 3 +--R (47) x + 10x + 20x + 22 +--R Type: UnivariatePolynomial(x,RealClosure Fraction Integer) +--E 47 + +--S 48 of 67 +r2 := sqrt(153)$Ran +--R +--R +--R +---+ +--R (48) \|153 +--R Type: RealClosure Fraction Integer +--E 48 + +--S 49 of 67 +alpha2 := sqrt(r2-11,5) +--R +--R +--R +-----------+ +--R 5| +---+ +--R (49) \|\|153 - 11 +--R Type: RealClosure Fraction Integer +--E 49 + +--S 50 of 67 +beta2 := -sqrt(r2+11,5) +--R +--R +--R +-----------+ +--R 5| +---+ +--R (50) - \|\|153 + 11 +--R Type: RealClosure Fraction Integer +--E 50 + +--S 51 of 67 +qol(alpha2+beta2) +--R +--R +--R (51) 0 +--R Type: RealClosure Fraction Integer +--E 51 + +--S 52 of 67 +dst1:=sqrt(9+4*s2)=1+2*s2 +--R +--R +--R +---------+ +--R | +-+ +-+ +--R (52) \|4\|2 + 9 = 2\|2 + 1 +--R Type: Equation RealClosure Fraction Integer +--E 52 + +--S 53 of 67 +dst1::Boolean +--R +--R +--R (53) true +--R Type: Boolean +--E 53 + +--S 54 of 67 +s6:Ran:=sqrt 6 +--R +--R +--R +-+ +--R (54) \|6 +--R Type: RealClosure Fraction Integer +--E 54 + +--S 55 of 67 +dst2:=sqrt(5+2*s6)+sqrt(5-2*s6) = 2*s3 +--R +--R +--R +-----------+ +---------+ +--R | +-+ | +-+ +-+ +--R (55) \|- 2\|6 + 5 + \|2\|6 + 5 = 2\|3 +--R Type: Equation RealClosure Fraction Integer +--E 55 + +--S 56 of 67 +dst2::Boolean +--R +--R +--R (56) true +--R Type: Boolean +--E 56 + +--S 57 of 67 +s29:Ran:=sqrt 29 +--R +--R +--R +--+ +--R (57) \|29 +--R Type: RealClosure Fraction Integer +--E 57 + +--S 58 of 67 +dst4:=sqrt(16-2*s29+2*sqrt(55-10*s29)) = sqrt(22+2*s5)-sqrt(11+2*s29)+s5 +--R +--R +--R (58) +--R +--------------------------------+ +--R | +--------------+ +-----------+ +----------+ +--R | | +--+ +--+ | +--+ | +-+ +-+ +--R \|2\|- 10\|29 + 55 - 2\|29 + 16 = - \|2\|29 + 11 + \|2\|5 + 22 + \|5 +--R Type: Equation RealClosure Fraction Integer +--E 58 + +--S 59 of 67 +dst4::Boolean +--R +--R +--R (59) true +--R Type: Boolean +--E 59 + +--S 60 of 67 +dst6:=sqrt((112+70*s2)+(46+34*s2)*s5) = (5+4*s2)+(3+s2)*s5 +--R +--R +--R +--------------------------------+ +--R | +-+ +-+ +-+ +-+ +-+ +-+ +--R (60) \|(34\|2 + 46)\|5 + 70\|2 + 112 = (\|2 + 3)\|5 + 4\|2 + 5 +--R Type: Equation RealClosure Fraction Integer +--E 60 + +--S 61 of 67 +dst6::Boolean +--R +--R +--R (61) true +--R Type: Boolean +--E 61 + +--S 62 of 67 +f3:Ran:=sqrt(3,5) +--R +--R +--R 5+-+ +--R (62) \|3 +--R Type: RealClosure Fraction Integer +--E 62 + +--S 63 of 67 +f25:Ran:=sqrt(1/25,5) +--R +--R +--R +--+ +--R | 1 +--R (63) 5|-- +--R \|25 +--R Type: RealClosure Fraction Integer +--E 63 + +--S 64 of 67 +f32:Ran:=sqrt(32/5,5) +--R +--R +--R +--+ +--R |32 +--R (64) 5|-- +--R \| 5 +--R Type: RealClosure Fraction Integer +--E 64 + +--S 65 of 67 +f27:Ran:=sqrt(27/5,5) +--R +--R +--R +--+ +--R |27 +--R (65) 5|-- +--R \| 5 +--R Type: RealClosure Fraction Integer +--E 65 + +--S 66 of 67 +dst5:=sqrt((f32-f27,3)) = f25*(1+f3-f3**2) +--R +--R +--R +---------------+ +--R | +--+ +--+ +--+ +--R | |27 |32 5+-+2 5+-+ | 1 +--R (66) 3|- 5|-- + 5|-- = (- \|3 + \|3 + 1) 5|-- +--R \| \| 5 \| 5 \|25 +--R Type: Equation RealClosure Fraction Integer +--E 66 + +--S 67 of 67 +dst5::Boolean +--R +--R +--R (67) true +--R Type: Boolean +--E 67 +)spool +)lisp (bye) +@ +<>= +==================================================================== +RealClosure examples +==================================================================== + +The Real Closure 1.0 package provided by Renaud Rioboo consists of +different packages, categories and domains : + +The package RealPolynomialUtilitiesPackage which needs a Field F and a +UnivariatePolynomialCategory domain with coefficients in F. It computes +some simple functions such as Sturm and Sylvester sequences sturmSequence, +sylvesterSequence. + +The category RealRootCharacterizationCategory provides abstract +functions to work with "real roots" of univariate polynomials. These +resemble variables with some functionality needed to compute important +operations. + +The category RealClosedField provides common operations available over +real closed fiels. These include finding all the roots of a univariate +polynomial, taking square (and higher) roots, ... + +The domain RightOpenIntervalRootCharacterization is the main code that +provides the functionality of RealRootCharacterizationCategory for the +case of archimedean fields. Abstract roots are encoded with a left +closed right open interval containing the root together with a +defining polynomial for the root. + +The RealClosure domain is the end-user code. It provides usual arithmetic +with real algebraic numbers, along with the functionality of a real closed +field. It also provides functions to approximate a real algebraic number +by an element of the base field. This approximation may either be absolute, +approximate or relative (relativeApprox). + +==================================================================== +CAVEATS +==================================================================== + +Since real algebraic expressions are stored as depending on "real +roots" which are managed like variables, there is an ordering on +these. This ordering is dynamical in the sense that any new algebraic +takes precedence over older ones. In particular every creation +function raises a new "real root". This has the effect that when you +type something like sqrt(2) + sqrt(2) you have two new variables +which happen to be equal. To avoid this name the expression such as in +s2 := sqrt(2) ; s2 + s2 + +Also note that computing times depend strongly on the ordering you +implicitly provide. Please provide algebraics in the order which seems +most natural to you. + +==================================================================== +LIMITATIONS +==================================================================== + +This packages uses algorithms which are published in [1] and [2] which +are based on field arithmetics, in particular for polynomial gcd +related algorithms. This can be quite slow for high degree polynomials +and subresultants methods usually work best. Beta versions of the +package try to use these techniques in a better way and work +significantly faster. These are mostly based on unpublished algorithms +and cannot be distributed. Please contact the author if you have a +particular problem to solve or want to use these versions. + +Be aware that approximations behave as post-processing and that all +computations are done exactly. They can thus be quite time consuming when +depending on several ``real roots''. + +==================================================================== +REFERENCES +==================================================================== + + +[1] R. Rioboo : Real Algebraic Closure of an ordered Field : Implementation + in Axiom. + In proceedings of the ISSAC'92 Conference, Berkeley 1992 pp. 206-215. + +[2] Z. Ligatsikas, R. Rioboo, M. F. Roy : Generic computation of the real + closure of an ordered field. + In Mathematics and Computers in Simulation Volume 42, Issue 4-6, + November 1996. + +==================================================================== +EXAMPLES +==================================================================== + +We shall work with the real closure of the ordered field of +rational numbers. + + Ran := RECLOS(FRAC INT) + RealClosure Fraction Integer + Type: Domain + +Some simple signs for square roots, these correspond to an extension +of degree 16 of the rational numbers. Examples provided by J. Abbot. + + fourSquares(a:Ran,b:Ran,c:Ran,d:Ran):Ran==sqrt(a)+sqrt(b)-sqrt(c)-sqrt(d) + Type: Void + +These produce values very close to zero. + + squareDiff1 := fourSquares(73,548,60,586) + +---+ +--+ +---+ +--+ + - \|586 - \|60 + \|548 + \|73 + Type: RealClosure Fraction Integer + + recip(squareDiff1) + +---+ +--+ +--+ +--+ +---+ +---+ + ((54602\|548 + 149602\|73 )\|60 + 49502\|73 \|548 + 9900895)\|586 + + + +--+ +---+ +--+ +---+ +--+ + (154702\|73 \|548 + 30941947)\|60 + 10238421\|548 + 28051871\|73 + Type: Union(RealClosure Fraction Integer,...) + + sign(squareDiff1) + 1 + Type: PositiveInteger + + squareDiff2 := fourSquares(165,778,86,990) + +---+ +--+ +---+ +---+ + - \|990 - \|86 + \|778 + \|165 + Type: RealClosure Fraction Integer + + recip(squareDiff2) + +---+ +---+ +--+ +---+ +---+ + ((556778\|778 + 1209010\|165 )\|86 + 401966\|165 \|778 + 144019431) + * + +---+ + \|990 + + + +---+ +---+ +--+ +---+ +---+ + (1363822\|165 \|778 + 488640503)\|86 + 162460913\|778 + 352774119\|165 + Type: Union(RealClosure Fraction Integer,...) + + sign(squareDiff2) + 1 + Type: PositiveInteger + + squareDiff3 := fourSquares(217,708,226,692) + +---+ +---+ +---+ +---+ + - \|692 - \|226 + \|708 + \|217 + Type: RealClosure Fraction Integer + + recip(squareDiff3) + +---+ +---+ +---+ +---+ +---+ +---+ + ((- 34102\|708 - 61598\|217 )\|226 - 34802\|217 \|708 - 13641141)\|692 + + + +---+ +---+ +---+ +---+ +---+ + (- 60898\|217 \|708 - 23869841)\|226 - 13486123\|708 - 24359809\|217 + Type: Union(RealClosure Fraction Integer,...) + + sign(squareDiff3) + - 1 + Type: Integer + + squareDiff4 := fourSquares(155,836,162,820) + +---+ +---+ +---+ +---+ + - \|820 - \|162 + \|836 + \|155 + Type: RealClosure Fraction Integer + + recip(squareDiff4) + +---+ +---+ +---+ +---+ +---+ +---+ + ((- 37078\|836 - 86110\|155 )\|162 - 37906\|155 \|836 - 13645107)\|820 + + + +---+ +---+ +---+ +---+ +---+ + (- 85282\|155 \|836 - 30699151)\|162 - 13513901\|836 - 31384703\|155 + Type: Union(RealClosure Fraction Integer,...) + + sign(squareDiff4) + - 1 + Type: Integer + + squareDiff5 := fourSquares(591,772,552,818) + +---+ +---+ +---+ +---+ + - \|818 - \|552 + \|772 + \|591 + Type: RealClosure Fraction Integer + + recip(squareDiff5) + +---+ +---+ +---+ +---+ +---+ +---+ + ((70922\|772 + 81058\|591 )\|552 + 68542\|591 \|772 + 46297673)\|818 + + + +---+ +---+ +---+ +---+ +---+ + (83438\|591 \|772 + 56359389)\|552 + 47657051\|772 + 54468081\|591 + Type: Union(RealClosure Fraction Integer,...) + + sign(squareDiff5) + 1 + Type: PositiveInteger + + squareDiff6 := fourSquares(434,1053,412,1088) + +----+ +---+ +----+ +---+ + - \|1088 - \|412 + \|1053 + \|434 + Type: RealClosure Fraction Integer + + recip(squareDiff6) + +----+ +---+ +---+ +---+ +----+ + ((115442\|1053 + 179818\|434 )\|412 + 112478\|434 \|1053 + 76037291) + * + +----+ + \|1088 + + + +---+ +----+ +---+ +----+ +---+ + (182782\|434 \|1053 + 123564147)\|412 + 77290639\|1053 + 120391609\|434 + Type: Union(RealClosure Fraction Integer,...) + + sign(squareDiff6) + 1 + Type: PositiveInteger + + squareDiff7 := fourSquares(514,1049,446,1152) + +----+ +---+ +----+ +---+ + - \|1152 - \|446 + \|1049 + \|514 + Type: RealClosure Fraction Integer + + recip(squareDiff7) + +----+ +---+ +---+ +---+ +----+ + ((349522\|1049 + 499322\|514 )\|446 + 325582\|514 \|1049 + 239072537) + * + +----+ + \|1152 + + + +---+ +----+ +---+ +----+ +---+ + (523262\|514 \|1049 + 384227549)\|446 + 250534873\|1049 + 357910443\|514 + Type: Union(RealClosure Fraction Integer,...) + + sign(squareDiff7) + 1 + Type: PositiveInteger + + squareDiff8 := fourSquares(190,1751,208,1698) + +----+ +---+ +----+ +---+ + - \|1698 - \|208 + \|1751 + \|190 + Type: RealClosure Fraction Integer + + recip(squareDiff8) + +----+ +---+ +---+ +---+ +----+ + (- 214702\|1751 - 651782\|190 )\|208 - 224642\|190 \|1751 + + + - 129571901 + * + +----+ + \|1698 + + + +---+ +----+ +---+ +----+ + (- 641842\|190 \|1751 - 370209881)\|208 - 127595865\|1751 + + + +---+ + - 387349387\|190 + Type: Union(RealClosure Fraction Integer,...) + + sign(squareDiff8) + - 1 + Type: Integer + +This should give three digits of precision + + relativeApprox(squareDiff8,10**(-3))::Float + - 0.2340527771 5937700123 E -10 + Type: Float + +The sum of these 4 roots is 0 + + l := allRootsOf((x**2-2)**2-2)$Ran + [%A33,%A34,%A35,%A36] + Type: List RealClosure Fraction Integer + +Check that they are all roots of the same polynomial + + removeDuplicates map(mainDefiningPolynomial,l) + 4 2 + [? - 4? + 2] + Type: List Union( + SparseUnivariatePolynomial RealClosure Fraction Integer, + "failed") + +We can see at a glance that they are separate roots + + map(mainCharacterization,l) + [[- 2,- 1[,[- 1,0[,[0,1[,[1,2[] + Type: List Union( + RightOpenIntervalRootCharacterization( + RealClosure Fraction Integer, + SparseUnivariatePolynomial RealClosure Fraction Integer), + "failed") + +Check the sum and product + + [reduce(+,l),reduce(*,l)-2] + [0,0] + Type: List RealClosure Fraction Integer + +A more complicated test that involve an extension of degree 256. +This is a way of checking nested radical identities. + + (s2, s5, s10) := (sqrt(2)$Ran, sqrt(5)$Ran, sqrt(10)$Ran) + +--+ + \|10 + Type: RealClosure Fraction Integer + + eq1:=sqrt(s10+3)*sqrt(s5+2) - sqrt(s10-3)*sqrt(s5-2) = sqrt(10*s2+10) + +---------+ +--------+ +---------+ +--------+ +-----------+ + | +--+ | +-+ | +--+ | +-+ | +-+ + - \|\|10 - 3 \|\|5 - 2 + \|\|10 + 3 \|\|5 + 2 = \|10\|2 + 10 + Type: Equation RealClosure Fraction Integer + + eq1::Boolean + true + Type: Boolean + + eq2:=sqrt(s5+2)*sqrt(s2+1) - sqrt(s5-2)*sqrt(s2-1) = sqrt(2*s10+2) + +--------+ +--------+ +--------+ +--------+ +----------+ + | +-+ | +-+ | +-+ | +-+ | +--+ + - \|\|5 - 2 \|\|2 - 1 + \|\|5 + 2 \|\|2 + 1 = \|2\|10 + 2 + Type: Equation RealClosure Fraction Integer + + eq2::Boolean + true + Type: Boolean + +Some more examples from J. M. Arnaudies + + s3 := sqrt(3)$Ran + +-+ + \|3 + Type: RealClosure Fraction Integer + + s7:= sqrt(7)$Ran + +-+ + \|7 + Type: RealClosure Fraction Integer + + e1 := sqrt(2*s7-3*s3,3) + +-------------+ + 3| +-+ +-+ + \|2\|7 - 3\|3 + Type: RealClosure Fraction Integer + + e2 := sqrt(2*s7+3*s3,3) + +-------------+ + 3| +-+ +-+ + \|2\|7 + 3\|3 + Type: RealClosure Fraction Integer + +This should be null + + e2-e1-s3 + 0 + Type: RealClosure Fraction Integer + +A quartic polynomial + + pol : UP(x,Ran) := x**4+(7/3)*x**2+30*x-(100/3) + 4 7 2 100 + x + - x + 30x - --- + 3 3 + Type: UnivariatePolynomial(x,RealClosure Fraction Integer) + +Add some cubic roots + + r1 := sqrt(7633)$Ran + +----+ + \|7633 + Type: RealClosure Fraction Integer + + alpha := sqrt(5*r1-436,3)/3 + +--------------+ + 1 3| +----+ + - \|5\|7633 - 436 + 3 + Type: RealClosure Fraction Integer + + beta := -sqrt(5*r1+436,3)/3 + +--------------+ + 1 3| +----+ + - - \|5\|7633 + 436 + 3 + Type: RealClosure Fraction Integer + +this should be null + + pol.(alpha+beta-1/3) + 0 + Type: RealClosure Fraction Integer + +A quintic polynomial + + qol : UP(x,Ran) := x**5+10*x**3+20*x+22 + 5 3 + x + 10x + 20x + 22 + Type: UnivariatePolynomial(x,RealClosure Fraction Integer) + +Add some cubic roots + + r2 := sqrt(153)$Ran + +---+ + \|153 + Type: RealClosure Fraction Integer + + alpha2 := sqrt(r2-11,5) + +-----------+ + 5| +---+ + \|\|153 - 11 + Type: RealClosure Fraction Integer + + beta2 := -sqrt(r2+11,5) + +-----------+ + 5| +---+ + - \|\|153 + 11 + Type: RealClosure Fraction Integer + +this should be null + + qol(alpha2+beta2) + 0 + Type: RealClosure Fraction Integer + +Finally, some examples from the book Computer Algebra by Davenport, +Siret and Tournier (page 77). The last one is due to Ramanujan. + + dst1:=sqrt(9+4*s2)=1+2*s2 + +---------+ + | +-+ +-+ + \|4\|2 + 9 = 2\|2 + 1 + Type: Equation RealClosure Fraction Integer + + dst1::Boolean + true + Type: Boolean + + s6:Ran:=sqrt 6 + +-+ + \|6 + Type: RealClosure Fraction Integer + + dst2:=sqrt(5+2*s6)+sqrt(5-2*s6) = 2*s3 + +-----------+ +---------+ + | +-+ | +-+ +-+ + \|- 2\|6 + 5 + \|2\|6 + 5 = 2\|3 + Type: Equation RealClosure Fraction Integer + + dst2::Boolean + true + Type: Boolean + + s29:Ran:=sqrt 29 + +--+ + \|29 + Type: RealClosure Fraction Integer + + dst4:=sqrt(16-2*s29+2*sqrt(55-10*s29)) = sqrt(22+2*s5)-sqrt(11+2*s29)+s5 + +--------------------------------+ + | +--------------+ +-----------+ +----------+ + | | +--+ +--+ | +--+ | +-+ +-+ + \|2\|- 10\|29 + 55 - 2\|29 + 16 = - \|2\|29 + 11 + \|2\|5 + 22 + \|5 + Type: Equation RealClosure Fraction Integer + + dst4::Boolean + true + Type: Boolean + + dst6:=sqrt((112+70*s2)+(46+34*s2)*s5) = (5+4*s2)+(3+s2)*s5 + +--------------------------------+ + | +-+ +-+ +-+ +-+ +-+ +-+ + \|(34\|2 + 46)\|5 + 70\|2 + 112 = (\|2 + 3)\|5 + 4\|2 + 5 + Type: Equation RealClosure Fraction Integer + + dst6::Boolean + true + Type: Boolean + + f3:Ran:=sqrt(3,5) + 5+-+ + \|3 + Type: RealClosure Fraction Integer + + f25:Ran:=sqrt(1/25,5) + +--+ + | 1 + 5|-- + \|25 + Type: RealClosure Fraction Integer + + f32:Ran:=sqrt(32/5,5) + +--+ + |32 + 5|-- + \| 5 + Type: RealClosure Fraction Integer + + f27:Ran:=sqrt(27/5,5) + +--+ + |27 + 5|-- + \| 5 + Type: RealClosure Fraction Integer + + dst5:=sqrt((f32-f27,3)) = f25*(1+f3-f3**2) + +---------------+ + | +--+ +--+ +--+ + | |27 |32 5+-+2 5+-+ | 1 + 3|- 5|-- + 5|-- = (- \|3 + \|3 + 1) 5|-- + \| \| 5 \| 5 \|25 + Type: Equation RealClosure Fraction Integer + + dst5::Boolean + true + Type: Boolean + +See Also: +o )help RightOpenIntervalRootCharacterization +o )help RealClosedField +o )help RealRootCharacterizationCategory +o )help UnivariatePolynomialCategory +o )help Field +o )help RealPolynomialUtilitiesPackage +o )show RealClosure +o $AXIOM/doc/src/algebra/reclos.spad.dvi + +@ <>= )abbrev domain RECLOS RealClosure ++ Author: Renaud Rioboo diff --git a/src/algebra/regset.spad.pamphlet b/src/algebra/regset.spad.pamphlet index 99d0747..2a1e80c 100644 --- a/src/algebra/regset.spad.pamphlet +++ b/src/algebra/regset.spad.pamphlet @@ -1369,6 +1369,1376 @@ chains). Among them {\bf RegularTriangularSet} and by Marc Moreno Maza for computing triangular decompositions of polynomial systems. This method is refined in the package {\bf LazardSetSolvingPackage} in order to produce decompositions by means of Lazard triangular sets. +<>= +-- regset.spad.pamphlet RegularTriangularSet.input +)spool RegularTriangularSet.output +)set message test on +)set message auto off +)clear all +--S 1 of 34 +R := Integer +--R +--R +--R (1) Integer +--R Type: Domain +--E 1 + +--S 2 of 34 +ls : List Symbol := [x,y,z,t] +--R +--R +--R (2) [x,y,z,t] +--R Type: List Symbol +--E 2 + +--S 3 of 34 +V := OVAR(ls) +--R +--R +--R (3) OrderedVariableList [x,y,z,t] +--R Type: Domain +--E 3 + +--S 4 of 34 +E := IndexedExponents V +--R +--R +--R (4) IndexedExponents OrderedVariableList [x,y,z,t] +--R Type: Domain +--E 4 + +--S 5 of 34 +P := NSMP(R, V) +--R +--R +--R (5) NewSparseMultivariatePolynomial(Integer,OrderedVariableList [x,y,z,t]) +--R Type: Domain +--E 5 + +--S 6 of 34 +x: P := 'x +--R +--R +--R (6) x +--R Type: NewSparseMultivariatePolynomial(Integer,OrderedVariableList [x,y,z,t]) +--E 6 + +--S 7 of 34 +y: P := 'y +--R +--R +--R (7) y +--R Type: NewSparseMultivariatePolynomial(Integer,OrderedVariableList [x,y,z,t]) +--E 7 + +--S 8 of 34 +z: P := 'z +--R +--R +--R (8) z +--R Type: NewSparseMultivariatePolynomial(Integer,OrderedVariableList [x,y,z,t]) +--E 8 + +--S 9 of 34 +t: P := 't +--R +--R +--R (9) t +--R Type: NewSparseMultivariatePolynomial(Integer,OrderedVariableList [x,y,z,t]) +--E 9 + +--S 10 of 34 +T := REGSET(R,E,V,P) +--R +--R +--R (10) +--R RegularTriangularSet(Integer,IndexedExponents OrderedVariableList [x,y,z,t],O +--R rderedVariableList [x,y,z,t],NewSparseMultivariatePolynomial(Integer,OrderedV +--R ariableList [x,y,z,t])) +--R Type: Domain +--E 10 + +--S 11 of 34 +p1 := x ** 31 - x ** 6 - x - y +--R +--R +--R 31 6 +--R (11) x - x - x - y +--R Type: NewSparseMultivariatePolynomial(Integer,OrderedVariableList [x,y,z,t]) +--E 11 + +--S 12 of 34 +p2 := x ** 8 - z +--R +--R +--R 8 +--R (12) x - z +--R Type: NewSparseMultivariatePolynomial(Integer,OrderedVariableList [x,y,z,t]) +--E 12 + +--S 13 of 34 +p3 := x ** 10 - t +--R +--R +--R 10 +--R (13) x - t +--R Type: NewSparseMultivariatePolynomial(Integer,OrderedVariableList [x,y,z,t]) +--E 13 + +--S 14 of 34 +lp := [p1, p2, p3] +--R +--R +--R 31 6 8 10 +--R (14) [x - x - x - y,x - z,x - t] +--RType: List NewSparseMultivariatePolynomial(Integer,OrderedVariableList [x,y,z,t]) +--E 14 + +--S 15 of 34 +zeroSetSplit(lp)$T +--R +--R +--R 5 4 2 3 8 5 3 2 4 2 +--R (15) [{z - t ,t z y + 2z y - t + 2t + t - t ,(t - t)x - t y - z }] +--RType: List RegularTriangularSet(Integer,IndexedExponents OrderedVariableList [x,y,z,t],OrderedVariableList [x,y,z,t],NewSparseMultivariatePolynomial(Integer,OrderedVariableList [x,y,z,t])) +--E 15 + +--S 16 of 34 +lts := zeroSetSplit(lp,false)$T +--R +--R +--R (16) +--R 5 4 2 3 8 5 3 2 4 2 +--R [{z - t ,t z y + 2z y - t + 2t + t - t ,(t - t)x - t y - z }, +--R 3 5 2 3 2 +--R {t - 1,z - t,t z y + 2z y + 1,z x - t}, {t,z,y,x}] +--RType: List RegularTriangularSet(Integer,IndexedExponents OrderedVariableList [x,y,z,t],OrderedVariableList [x,y,z,t],NewSparseMultivariatePolynomial(Integer,OrderedVariableList [x,y,z,t])) +--E 16 + +--S 17 of 34 +[coHeight(ts) for ts in lts] +--R +--R +--R (17) [1,0,0] +--R Type: List NonNegativeInteger +--E 17 + +--S 18 of 34 +f1 := y**2*z+2*x*y*t-2*x-z +--R +--R +--R 2 +--R (18) (2t y - 2)x + z y - z +--R Type: NewSparseMultivariatePolynomial(Integer,OrderedVariableList [x,y,z,t]) +--E 18 + +--S 19 of 34 +f2:=-x**3*z+ 4*x*y**2*z+4*x**2*y*t+2*y**3*t+4*x**2-10*y**2+4*x*z-10*y*t+2 +--R +--R +--R 3 2 2 3 2 +--R (19) - z x + (4t y + 4)x + (4z y + 4z)x + 2t y - 10y - 10t y + 2 +--R Type: NewSparseMultivariatePolynomial(Integer,OrderedVariableList [x,y,z,t]) +--E 19 + +--S 20 of 34 +f3 := 2*y*z*t+x*t**2-x-2*z +--R +--R +--R 2 +--R (20) (t - 1)x + 2t z y - 2z +--R Type: NewSparseMultivariatePolynomial(Integer,OrderedVariableList [x,y,z,t]) +--E 20 + +--S 21 of 34 +f4:=-x*z**3+4*y*z**2*t+4*x*z*t**2+2*y*t**3+4*x*z+4*z**2-10*y*t- 10*t**2+2 +--R +--R +--R 3 2 2 3 2 2 +--R (21) (- z + (4t + 4)z)x + (4t z + 2t - 10t)y + 4z - 10t + 2 +--R Type: NewSparseMultivariatePolynomial(Integer,OrderedVariableList [x,y,z,t]) +--E 21 + +--S 22 of 34 +lf := [f1, f2, f3, f4] +--R +--R +--R (22) +--R 2 +--R [(2t y - 2)x + z y - z, +--R 3 2 2 3 2 +--R - z x + (4t y + 4)x + (4z y + 4z)x + 2t y - 10y - 10t y + 2, +--R 2 +--R (t - 1)x + 2t z y - 2z, +--R 3 2 2 3 2 2 +--R (- z + (4t + 4)z)x + (4t z + 2t - 10t)y + 4z - 10t + 2] +--RType: List NewSparseMultivariatePolynomial(Integer,OrderedVariableList [x,y,z,t]) +--E 22 + +--S 23 of 34 +zeroSetSplit(lf)$T +--R +--R +--R (23) +--R 2 8 6 2 3 2 +--R [{t - 1,z - 16z + 256z - 256,t y - 1,(z - 8z)x - 8z + 16}, +--R 2 2 2 +--R {3t + 1,z - 7t - 1,y + t,x + z}, +--R 8 6 2 3 2 +--R {t - 10t + 10t - 1,z,(t - 5t)y - 5t + 1,x}, +--R 2 2 +--R {t + 3,z - 4,y + t,x - z}] +--RType: List RegularTriangularSet(Integer,IndexedExponents OrderedVariableList [x,y,z,t],OrderedVariableList [x,y,z,t],NewSparseMultivariatePolynomial(Integer,OrderedVariableList [x,y,z,t])) +--E 23 + +--S 24 of 34 +lts2 := zeroSetSplit(lf,false)$T +--R +--R +--R (24) +--R 8 6 2 3 2 +--R [{t - 10t + 10t - 1,z,(t - 5t)y - 5t + 1,x}, +--R 2 8 6 2 3 2 +--R {t - 1,z - 16z + 256z - 256,t y - 1,(z - 8z)x - 8z + 16}, +--R 2 2 2 2 2 +--R {3t + 1,z - 7t - 1,y + t,x + z}, {t + 3,z - 4,y + t,x - z}] +--RType: List RegularTriangularSet(Integer,IndexedExponents OrderedVariableList [x,y,z,t],OrderedVariableList [x,y,z,t],NewSparseMultivariatePolynomial(Integer,OrderedVariableList [x,y,z,t])) +--E 24 + +--S 25 of 34 +[coHeight(ts) for ts in lts2] +--R +--R +--R (25) [0,0,0,0] +--R Type: List NonNegativeInteger +--E 25 + +--S 26 of 34 +degrees := [degree(ts) for ts in lts2] +--R +--R +--R (26) [8,16,4,4] +--R Type: List NonNegativeInteger +--E 26 + +--S 27 of 34 +reduce(+,degrees) +--R +--R +--R (27) 32 +--R Type: PositiveInteger +--E 27 + +--S 28 of 34 +u : R := 2 +--R +--R +--R (28) 2 +--R Type: Integer +--E 28 + +--S 29 of 34 +q1 := 2*(u-1)**2+ 2*(x-z*x+z**2)+ y**2*(x-1)**2- 2*u*x+ 2*y*t*(1-x)*(x-z)+_ + 2*u*z*t*(t-y)+ u**2*t**2*(1-2*z)+ 2*u*t**2*(z-x)+ 2*u*t*y*(z-1)+_ + 2*u*z*x*(y+1)+ (u**2-2*u)*z**2*t**2+ 2*u**2*z**2+ 4*u*(1-u)*z+_ + t**2*(z-x)**2 +--R +--R +--R (29) +--R 2 2 2 2 2 2 +--R (y - 2t y + t )x + (- 2y + ((2t + 4)z + 2t)y + (- 2t + 2)z - 4t - 2)x +--R + +--R 2 2 2 2 +--R y + (- 2t z - 4t)y + (t + 10)z - 8z + 4t + 2 +--R Type: NewSparseMultivariatePolynomial(Integer,OrderedVariableList [x,y,z,t]) +--E 29 + +--S 30 of 34 +q2 := t*(2*z+1)*(x-z)+ y*(z+2)*(1-x)+ u*(u-2)*t+ u*(1-2*u)*z*t+_ + u*y*(x+u-z*x-1)+ u*(u+1)*z**2*t +--R +--R +--R 2 +--R (30) (- 3z y + 2t z + t)x + (z + 4)y + 4t z - 7t z +--R Type: NewSparseMultivariatePolynomial(Integer,OrderedVariableList [x,y,z,t]) +--E 30 + +--S 31 of 34 +q3 := -u**2*(z-1)**2+ 2*z*(z-x)-2*(x-1) +--R +--R +--R 2 +--R (31) (- 2z - 2)x - 2z + 8z - 2 +--R Type: NewSparseMultivariatePolynomial(Integer,OrderedVariableList [x,y,z,t]) +--E 31 + +--S 32 of 34 +q4 := u**2+4*(z-x**2)+3*y**2*(x-1)**2- 3*t**2*(z-x)**2+_ + 3*u**2*t**2*(z-1)**2+u**2*z*(z-2)+6*u*t*y*(z+x+z*x-1) +--R +--R +--R (32) +--R 2 2 2 2 2 2 +--R (3y - 3t - 4)x + (- 6y + (12t z + 12t)y + 6t z)x + 3y + (12t z - 12t)y +--R + +--R 2 2 2 2 +--R (9t + 4)z + (- 24t - 4)z + 12t + 4 +--R Type: NewSparseMultivariatePolynomial(Integer,OrderedVariableList [x,y,z,t]) +--E 32 + +--S 33 of 34 +lq := [q1, q2, q3, q4] +--R +--R +--R (33) +--R [ +--R 2 2 2 +--R (y - 2t y + t )x +--R + +--R 2 2 2 2 +--R (- 2y + ((2t + 4)z + 2t)y + (- 2t + 2)z - 4t - 2)x + y +--R + +--R 2 2 2 +--R (- 2t z - 4t)y + (t + 10)z - 8z + 4t + 2 +--R , +--R 2 2 +--R (- 3z y + 2t z + t)x + (z + 4)y + 4t z - 7t z, (- 2z - 2)x - 2z + 8z - 2, +--R +--R 2 2 2 2 2 2 +--R (3y - 3t - 4)x + (- 6y + (12t z + 12t)y + 6t z)x + 3y +--R + +--R 2 2 2 2 +--R (12t z - 12t)y + (9t + 4)z + (- 24t - 4)z + 12t + 4 +--R ] +--RType: List NewSparseMultivariatePolynomial(Integer,OrderedVariableList [x,y,z,t]) +--E 33 + +--S 34 of 34 +zeroSetSplit(lq,true,true)$T +--R +--R[1 <4,0> -> |4|; {0}]W[2 <5,0>,<3,1> -> |8|; {0}][2 <4,1>,<3,1> -> |7|; {0}][1 <3,1> -> |3|; {0}]G[2 <4,1>,<4,1> -> |8|; {0}]W[3 <5,1>,<4,1>,<3,2> -> |12|; {0}]GI[3 <4,2>,<4,1>,<3,2> -> |11|; {0}]GWw[3 <4,1>,<3,2>,<5,2> -> |12|; {0}][3 <3,2>,<3,2>,<5,2> -> |11|; {0}]GIwWWWw[4 <3,2>,<4,2>,<5,2>,<2,3> -> |14|; {0}][4 <2,2>,<4,2>,<5,2>,<2,3> -> |13|; {0}]Gwww[5 <3,2>,<3,2>,<4,2>,<5,2>,<2,3> -> |17|; {0}]Gwwwwww[8 <3,2>,<4,2>,<4,2>,<4,2>,<4,2>,<4,2>,<5,2>,<2,3> -> |30|; {0}]Gwwwwww[8 <4,2>,<4,2>,<4,2>,<4,2>,<4,2>,<4,2>,<5,2>,<2,3> -> |31|; {0}][8 <3,3>,<4,2>,<4,2>,<4,2>,<4,2>,<4,2>,<5,2>,<2,3> -> |30|; {0}][8 <2,3>,<4,2>,<4,2>,<4,2>,<4,2>,<4,2>,<5,2>,<2,3> -> |29|; {0}][8 <1,3>,<4,2>,<4,2>,<4,2>,<4,2>,<4,2>,<5,2>,<2,3> -> |28|; {0}][7 <4,2>,<4,2>,<4,2>,<4,2>,<4,2>,<5,2>,<2,3> -> |27|; {0}][6 <4,2>,<4,2>,<4,2>,<4,2>,<5,2>,<2,3> -> |23|; {0}][5 <4,2>,<4,2>,<4,2>,<5,2>,<2,3> -> |19|; {0}]GIGIWwww[6 <5,2>,<4,2>,<4,2>,<5,2>,<3,3>,<2,3> -> |23|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4>,<3,4> -> |15|; {1}]GIW[5 <2,4>,<3,3>,<3,3>,<3,4>,<3,4> -> |14|; {1}]GG[4 <3,3>,<3,3>,<3,4>,<3,4> -> |12|; {1}][3 <3,3>,<3,4>,<3,4> -> |9|; {1}]W[3 <2,4>,<3,4>,<3,4> -> |8|; {1}][3 <1,4>,<3,4>,<3,4> -> |7|; {1}]G[2 <3,4>,<3,4> -> |6|; {1}]G[1 <3,4> -> |3|; {1}][1 <2,4> -> |2|; {1}][1 <1,4> -> |1|; {1}] +--R *** QCMPACK Statistics *** +--R Table size: 36 +--R Entries reused: 255 +--R +--R *** REGSETGCD: Gcd Statistics *** +--R Table size: 125 +--R Entries reused: 0 +--R +--R *** REGSETGCD: Inv Set Statistics *** +--R Table size: 30 +--R Entries reused: 0 +--R +--R (34) +--R [ +--R { +--R 24 23 22 +--R 960725655771966t + 386820897948702t + 8906817198608181t +--R + +--R 21 20 19 +--R 2704966893949428t + 37304033340228264t + 7924782817170207t +--R + +--R 18 17 16 +--R 93126799040354990t + 13101273653130910t + 156146250424711858t +--R + +--R 15 14 13 +--R 16626490957259119t + 190699288479805763t + 24339173367625275t +--R + +--R 12 11 10 +--R 180532313014960135t + 35288089030975378t + 135054975747656285t +--R + +--R 9 8 7 +--R 34733736952488540t + 75947600354493972t + 19772555692457088t +--R + +--R 6 5 4 +--R 28871558573755428t + 5576152439081664t + 6321711820352976t +--R + +--R 3 2 +--R 438314209312320t + 581105748367008t - 60254467992576t + 1449115951104 +--R , +--R +--R 23 +--R 26604210869491302385515265737052082361668474181372891857784t +--R + +--R 22 +--R 443104378424686086067294899528296664238693556855017735265295t +--R + +--R 21 +--R 279078393286701234679141342358988327155321305829547090310242t +--R + +--R 20 +--R 3390276361413232465107617176615543054620626391823613392185226t +--R + +--R 19 +--R 941478179503540575554198645220352803719793196473813837434129t +--R + +--R 18 +--R 11547855194679475242211696749673949352585747674184320988144390t +--R + +--R 17 +--R 1343609566765597789881701656699413216467215660333356417241432t +--R + +--R 16 +--R 23233813868147873503933551617175640859899102987800663566699334t +--R + +--R 15 +--R 869574020537672336950845440508790740850931336484983573386433t +--R + +--R 14 +--R 31561554305876934875419461486969926554241750065103460820476969t +--R + +--R 13 +--R 1271400990287717487442065952547731879554823889855386072264931t +--R + +--R 12 +--R 31945089913863736044802526964079540198337049550503295825160523t +--R + +--R 11 +--R 3738735704288144509871371560232845884439102270778010470931960t +--R + +--R 10 +--R 25293997512391412026144601435771131587561905532992045692885927t +--R + +--R 9 +--R 5210239009846067123469262799870052773410471135950175008046524t +--R + +--R 8 +--R 15083887986930297166259870568608270427403187606238713491129188t +--R + +--R 7 +--R 3522087234692930126383686270775779553481769125670839075109000t +--R + +--R 6 +--R 6079945200395681013086533792568886491101244247440034969288588t +--R + +--R 5 +--R 1090634852433900888199913756247986023196987723469934933603680t +--R + +--R 4 +--R 1405819430871907102294432537538335402102838994019667487458352t +--R + +--R 3 +--R 88071527950320450072536671265507748878347828884933605202432t +--R + +--R 2 +--R 135882489433640933229781177155977768016065765482378657129440t +--R + +--R - 13957283442882262230559894607400314082516690749975646520320t +--R + +--R 334637692973189299277258325709308472592117112855749713920 +--R * +--R z +--R + +--R 23 +--R 8567175484043952879756725964506833932149637101090521164936t +--R + +--R 22 +--R 149792392864201791845708374032728942498797519251667250945721t +--R + +--R 21 +--R 77258371783645822157410861582159764138123003074190374021550t +--R + +--R 20 +--R 1108862254126854214498918940708612211184560556764334742191654t +--R + +--R 19 +--R 213250494460678865219774480106826053783815789621501732672327t +--R + +--R 18 +--R 3668929075160666195729177894178343514501987898410131431699882t +--R + +--R 17 +--R 171388906471001872879490124368748236314765459039567820048872t +--R + +--R 16 +--R 7192430746914602166660233477331022483144921771645523139658986t +--R + +--R 15 +--R - 128798674689690072812879965633090291959663143108437362453385t +--R + +--R 14 +--R 9553010858341425909306423132921134040856028790803526430270671t +--R + +--R 13 +--R - 13296096245675492874538687646300437824658458709144441096603t +--R + +--R 12 +--R 9475806805814145326383085518325333106881690568644274964864413t +--R + +--R 11 +--R 803234687925133458861659855664084927606298794799856265539336t +--R + +--R 10 +--R 7338202759292865165994622349207516400662174302614595173333825t +--R + +--R 9 +--R 1308004628480367351164369613111971668880538855640917200187108t +--R + +--R 8 +--R 4268059455741255498880229598973705747098216067697754352634748t +--R + +--R 7 +--R 892893526858514095791318775904093300103045601514470613580600t +--R + +--R 6 +--R 1679152575460683956631925852181341501981598137465328797013652t +--R + +--R 5 +--R 269757415767922980378967154143357835544113158280591408043936t +--R + +--R 4 +--R 380951527864657529033580829801282724081345372680202920198224t +--R + +--R 3 +--R 19785545294228495032998826937601341132725035339452913286656t +--R + +--R 2 +--R 36477412057384782942366635303396637763303928174935079178528t +--R + +--R - 3722212879279038648713080422224976273210890229485838670848t +--R + +--R 89079724853114348361230634484013862024728599906874105856 +--R , +--R 3 2 3 2 +--R (3z - 11z + 8z + 4)y + 2t z + 4t z - 5t z - t, +--R 2 +--R (z + 1)x + z - 4z + 1} +--R ] +--RType: List RegularTriangularSet(Integer,IndexedExponents OrderedVariableList [x,y,z,t],OrderedVariableList [x,y,z,t],NewSparseMultivariatePolynomial(Integer,OrderedVariableList [x,y,z,t])) +--E 34 +)spool +)lisp (bye) +@ +<>= +==================================================================== +RegularTriangularSet examples +==================================================================== + +The RegularTriangularSet domain constructor implements regular +triangular sets. These particular triangular sets were introduced by +M. Kalkbrener (1991) in his PhD Thesis under the name regular chains. +Regular chains and their related concepts are presented in the paper +"On the Theories of Triangular sets" By P. Aubry, D. Lazard and +M. Moreno Maza (to appear in the Journal of Symbolic Computation). +The RegularTriangularSet constructor also provides a new method +(by the third author) for solving polynomial system by means of +regular chains. This method has two ways of solving. One has the +same specifications as Kalkbrener's algorithm (1991) and the other is +closer to Lazard's method (Discr. App. Math, 1991). Moreover, this +new method removes redundant component from the decompositions when +this is not too expensive. This is always the case with +square-free regular chains. So if you want to obtain decompositions +without redundant components just use the SquareFreeRegularTriangularSet +domain constructor or the LazardSetSolvingPackage package constructor. +See also the LexTriangularPackage and ZeroDimensionalSolvePackage for the +case of algebraic systems with a finite number of (complex) solutions. + +One of the main features of regular triangular sets is that they +naturally define towers of simple extensions of a field. This allows +to perform with multivariate polynomials the same kind of operations +as one can do in an EuclideanDomain. + +The RegularTriangularSet constructor takes four arguments. The first +one, R, is the coefficient ring of the polynomials; it must belong to +the category GcdDomain. The second one, E, is the exponent monoid of +the polynomials; it must belong to the category OrderedAbelianMonoidSup. +The third one, V, is the ordered set of variables; it must belong to the +category OrderedSet. The last one is the polynomial ring; it must belong +to the category RecursivePolynomialCategory(R,E,V). The abbreviation for +RegularTriangularSet is REGSET. See also the constructor RegularChain +which only takes two arguments, the coefficient ring and the ordered +set of variables; in that case, polynomials are necessarily built with +the NewSparseMultivariatePolynomial domain constructor. + +We shall explain now how to use the constructor REGSET and how to read +the decomposition of a polynomial system by means of regular sets. + +Let us give some examples. We start with an easy one +(Donati-Traverso) in order to understand the two ways of solving +polynomial systems provided by the REGSET constructor. + +Define the coefficient ring. + + R := Integer + Integer + Type: Domain + +Define the list of variables, + + ls : List Symbol := [x,y,z,t] + [x,y,z,t] + Type: List Symbol + +and make it an ordered set; + + V := OVAR(ls) + OrderedVariableList [x,y,z,t] + Type: Domain + +then define the exponent monoid. + + E := IndexedExponents V + IndexedExponents OrderedVariableList [x,y,z,t] + Type: Domain + +Define the polynomial ring. + + P := NSMP(R, V) + NewSparseMultivariatePolynomial(Integer,OrderedVariableList [x,y,z,t]) + Type: Domain + +Let the variables be polynomial. + + x: P := 'x + x + Type: NewSparseMultivariatePolynomial(Integer, + OrderedVariableList [x,y,z,t]) + y: P := 'y + y + Type: NewSparseMultivariatePolynomial(Integer, + OrderedVariableList [x,y,z,t]) + + z: P := 'z + z + Type: NewSparseMultivariatePolynomial(Integer, + OrderedVariableList [x,y,z,t]) + + t: P := 't + t + Type: NewSparseMultivariatePolynomial(Integer, + OrderedVariableList [x,y,z,t]) + +Now call the RegularTriangularSet domain constructor. + + T := REGSET(R,E,V,P) + RegularTriangularSet(Integer,IndexedExponents OrderedVariableList [x,y,z,t],O + rderedVariableList [x,y,z,t],NewSparseMultivariatePolynomial(Integer,OrderedV + ariableList [x,y,z,t])) + Type: Domain + +Define a polynomial system. + + p1 := x ** 31 - x ** 6 - x - y + 31 6 + x - x - x - y + Type: NewSparseMultivariatePolynomial(Integer, + OrderedVariableList [x,y,z,t]) + + p2 := x ** 8 - z + 8 + x - z + Type: NewSparseMultivariatePolynomial(Integer, + OrderedVariableList [x,y,z,t]) + + p3 := x ** 10 - t + 10 + x - t + Type: NewSparseMultivariatePolynomial(Integer, + OrderedVariableList [x,y,z,t]) + + lp := [p1, p2, p3] + 31 6 8 10 + [x - x - x - y,x - z,x - t] + Type: List NewSparseMultivariatePolynomial(Integer, + OrderedVariableList [x,y,z,t]) + +First of all, let us solve this system in the sense of Kalkbrener. + + zeroSetSplit(lp)$T + 5 4 2 3 8 5 3 2 4 2 + [{z - t ,t z y + 2z y - t + 2t + t - t ,(t - t)x - t y - z }] + Type: List RegularTriangularSet(Integer, + IndexedExponents OrderedVariableList [x,y,z,t], + OrderedVariableList [x,y,z,t], + NewSparseMultivariatePolynomial(Integer, + OrderedVariableList [x,y,z,t])) + +And now in the sense of Lazard (or Wu and other authors). + + lts := zeroSetSplit(lp,false)$T + 5 4 2 3 8 5 3 2 4 2 + [{z - t ,t z y + 2z y - t + 2t + t - t ,(t - t)x - t y - z }, + 3 5 2 3 2 + {t - 1,z - t,t z y + 2z y + 1,z x - t}, {t,z,y,x}] + Type: List RegularTriangularSet(Integer, + IndexedExponents OrderedVariableList [x,y,z,t], + OrderedVariableList [x,y,z,t], + NewSparseMultivariatePolynomial(Integer, + OrderedVariableList [x,y,z,t])) + +We can see that the first decomposition is a subset of the second. +So how can both be correct ? + +Recall first that polynomials from a domain of the category +RecursivePolynomialCategory are regarded as univariate polynomials in +their main variable. For instance the second polynomial in the first +set of each decomposition has main variable y and its initial +(i.e. its leading coefficient w.r.t. its main variable) is t z. + +Now let us explain how to read the second decomposition. Note that +the non-constant initials of the first set are t^4-t and t z. Then +the solutions described by this first set are the common zeros of +its polynomials that do not cancel the polynomials t^4-t and ty z. +Now the solutions of the input system lp satisfying these equations +are described by the second and the third sets of the decomposition. +Thus, in some sense, they can be considered as degenerated solutions. +The solutions given by the first set are called the generic points of +the system; they give the general form of the solutions. The first +decomposition only provides these generic points. This latter +decomposition is useful when they are many degenerated solutions +(which is sometimes hard to compute) and when one is only interested +in general informations, like the dimension of the input system. + +We can get the dimensions of each component of a decomposition as follows. + + [coHeight(ts) for ts in lts] + [1,0,0] + Type: List NonNegativeInteger + +Thus the first set has dimension one. Indeed t can take any value, +except 0 or any third root of 1, whereas z is completely determined +from t, y is given by z and t, and finally x is given by the other +three variables. In the second and the third sets of the second +decomposition the four variables are completely determined and thus +these sets have dimension zero. + +We give now the precise specifications of each decomposition. This +assume some mathematical knowledge. However, for the non-expert user, +the above explanations will be sufficient to understand the other +features of the RSEGSET constructor. + +The input system lp is decomposed in the sense of Kalkbrener as +finitely many regular sets T1,...,Ts such that the radical ideal +generated by lp is the intersection of the radicals of the saturated +ideals of T1,...,Ts. In other words, the affine variety associated +with lp is the union of the closures (w.r.t. Zarisky topology) of the +regular-zeros sets of T1,...,Ts. + +N. B. The prime ideals associated with the radical of the saturated +ideal of a regular triangular set have all the same dimension; +moreover these prime ideals can be given by characteristic sets with +the same main variables. Thus a decomposition in the sense of +Kalkbrener is unmixed dimensional. Then it can be viewed as a lazy +decomposition into prime ideals (some of these prime ideals being +merged into unmixed dimensional ideals). + +Now we explain the other way of solving by means of regular triangular +sets. The input system lp is decomposed in the sense of Lazard as +finitely many regular triangular sets T1,...,Ts such that the affine +variety associated with lp is the union of the regular-zeros sets of +T1,...,Ts. Thus a decomposition in the sense of Lazard is also a +decomposition in the sense of Kalkbrener; the converse is false as we +have seen before. + +When the input system has a finite number of solutions, both ways of +solving provide similar decompositions as we shall see with this +second example (Caprasse). + +Define a polynomial system. + + f1 := y**2*z+2*x*y*t-2*x-z + 2 + (2t y - 2)x + z y - z + Type: NewSparseMultivariatePolynomial(Integer, + OrderedVariableList [x,y,z,t]) + + f2:=-x**3*z+ 4*x*y**2*z+4*x**2*y*t+2*y**3*t+4*x**2-10*y**2+4*x*z-10*y*t+2 + 3 2 2 3 2 + - z x + (4t y + 4)x + (4z y + 4z)x + 2t y - 10y - 10t y + 2 + Type: NewSparseMultivariatePolynomial(Integer, + OrderedVariableList [x,y,z,t]) + + f3 := 2*y*z*t+x*t**2-x-2*z + 2 + (t - 1)x + 2t z y - 2z + Type: NewSparseMultivariatePolynomial(Integer, + OrderedVariableList [x,y,z,t]) + + f4:=-x*z**3+4*y*z**2*t+4*x*z*t**2+2*y*t**3+4*x*z+4*z**2-10*y*t- 10*t**2+2 + 3 2 2 3 2 2 + (- z + (4t + 4)z)x + (4t z + 2t - 10t)y + 4z - 10t + 2 + Type: NewSparseMultivariatePolynomial(Integer, + OrderedVariableList [x,y,z,t]) + + lf := [f1, f2, f3, f4] + 2 + [(2t y - 2)x + z y - z, + 3 2 2 3 2 + - z x + (4t y + 4)x + (4z y + 4z)x + 2t y - 10y - 10t y + 2, + 2 + (t - 1)x + 2t z y - 2z, + 3 2 2 3 2 2 + (- z + (4t + 4)z)x + (4t z + 2t - 10t)y + 4z - 10t + 2] + Type: List NewSparseMultivariatePolynomial(Integer, + OrderedVariableList [x,y,z,t]) + +First of all, let us solve this system in the sense of Kalkbrener. + + zeroSetSplit(lf)$T + 2 8 6 2 3 2 + [{t - 1,z - 16z + 256z - 256,t y - 1,(z - 8z)x - 8z + 16}, + 2 2 2 + {3t + 1,z - 7t - 1,y + t,x + z}, + 8 6 2 3 2 + {t - 10t + 10t - 1,z,(t - 5t)y - 5t + 1,x}, + 2 2 + {t + 3,z - 4,y + t,x - z}] + Type: List RegularTriangularSet(Integer, + IndexedExponents OrderedVariableList [x,y,z,t], + OrderedVariableList [x,y,z,t], + NewSparseMultivariatePolynomial(Integer, + OrderedVariableList [x,y,z,t])) + +And now in the sense of Lazard (or Wu and other authors). + + lts2 := zeroSetSplit(lf,false)$T + 8 6 2 3 2 + [{t - 10t + 10t - 1,z,(t - 5t)y - 5t + 1,x}, + 2 8 6 2 3 2 + {t - 1,z - 16z + 256z - 256,t y - 1,(z - 8z)x - 8z + 16}, + 2 2 2 2 2 + {3t + 1,z - 7t - 1,y + t,x + z}, {t + 3,z - 4,y + t,x - z}] + Type: List RegularTriangularSet(Integer, + IndexedExponents OrderedVariableList [x,y,z,t], + OrderedVariableList [x,y,z,t], + NewSparseMultivariatePolynomial(Integer, + OrderedVariableList [x,y,z,t])) + +Up to the ordering of the components, both decompositions are identical. + +Let us check that each component has a finite number of solutions. + + [coHeight(ts) for ts in lts2] + [0,0,0,0] + Type: List NonNegativeInteger + +Let us count the degrees of each component, + + degrees := [degree(ts) for ts in lts2] + [8,16,4,4] + Type: List NonNegativeInteger + +and compute their sum. + + reduce(+,degrees) + 32 + Type: PositiveInteger + +We study now the options of the zeroSetSplit operation. As we have seen +yet, there is an optional second argument which is a boolean value. If this +value is true (this is the default) then the decomposition is computed in +the sense of Kalkbrener, otherwise it is computed in the sense of Lazard. + +There is a second boolean optional argument that can be used (in that +case the first optional argument must be present). This second option +allows you to get some information during the computations. + +Therefore, we need to understand a little what is going on during the +computations. An important feature of the algorithm is that the +intermediate computations are managed in some sense like the processes +of a Unix system. Indeed, each intermediate computation may generate +other intermediate computations and the management of all these +computations is a crucial task for the efficiency. Thus any +intermediate computation may be suspended, killed or resumed, +depending on algebraic considerations that determine priorities for +these processes. The goal is of course to go as fast as possible +towards the final decomposition which means to avoid as much as +possible unnecessary computations. + +To follow the computations, one needs to set to true the second +argument. Then a lot of numbers and letters are displayed. Between a +[ and a ] one has the state of the processes at a given time. Just +after [ one can see the number of processes. Then each process is +represented by two numbers between < and >. A process consists of a +list of polynomial ps and a triangular set ts; its goal is to compute +the common zeros of ps that belong to the regular-zeros set of ts. +After the processes, the number between pipes gives the total number +of polynomials in all the sets ps. Finally, the number between braces +gives the number of components of a decomposition that are already +computed. This number may decrease. + +Let us take a third example (Czapor-Geddes-Wang) to see how this +information is displayed. + +Define a polynomial system. + + u : R := 2 + 2 + Type: Integer + + q1 := 2*(u-1)**2+ 2*(x-z*x+z**2)+ y**2*(x-1)**2- 2*u*x+ 2*y*t*(1-x)*(x-z)+_ + 2*u*z*t*(t-y)+ u**2*t**2*(1-2*z)+ 2*u*t**2*(z-x)+ 2*u*t*y*(z-1)+_ + 2*u*z*x*(y+1)+ (u**2-2*u)*z**2*t**2+ 2*u**2*z**2+ 4*u*(1-u)*z+_ + t**2*(z-x)**2} + 2 2 2 2 2 2 + (y - 2t y + t )x + (- 2y + ((2t + 4)z + 2t)y + (- 2t + 2)z - 4t - 2)x + + + 2 2 2 2 + y + (- 2t z - 4t)y + (t + 10)z - 8z + 4t + 2 + Type: NewSparseMultivariatePolynomial(Integer, + OrderedVariableList [x,y,z,t]) + + q2 := t*(2*z+1)*(x-z)+ y*(z+2)*(1-x)+ u*(u-2)*t+ u*(1-2*u)*z*t+_ + u*y*(x+u-z*x-1)+ u*(u+1)*z**2*t} + (- 3z y + 2t z + t)x + (z + 4)y + 4t z - 7t z + Type: NewSparseMultivariatePolynomial(Integer, + OrderedVariableList [x,y,z,t]) + + q3 := -u**2*(z-1)**2+ 2*z*(z-x)-2*(x-1) + (- 2z - 2)x - 2z + 8z - 2 + Type: NewSparseMultivariatePolynomial(Integer, + OrderedVariableList [x,y,z,t]) + + q4 := u**2+4*(z-x**2)+3*y**2*(x-1)**2- 3*t**2*(z-x)**2+_ + 3*u**2*t**2*(z-1)**2+u**2*z*(z-2)+6*u*t*y*(z+x+z*x-1)} + 2 2 2 2 2 2 + (3y - 3t - 4)x + (- 6y + (12t z + 12t)y + 6t z)x + 3y + (12t z - 12t)y + + + 2 2 2 2 + (9t + 4)z + (- 24t - 4)z + 12t + 4 + Type: NewSparseMultivariatePolynomial(Integer, + OrderedVariableList [x,y,z,t]) + + lq := [q1, q2, q3, q4] + [ + 2 2 2 + (y - 2t y + t )x + + + 2 2 2 2 + (- 2y + ((2t + 4)z + 2t)y + (- 2t + 2)z - 4t - 2)x + y + + + 2 2 2 + (- 2t z - 4t)y + (t + 10)z - 8z + 4t + 2 + , + 2 2 + (- 3z y + 2t z + t)x + (z + 4)y + 4t z - 7t z, (- 2z - 2)x - 2z + 8z - 2, + + 2 2 2 2 2 2 + (3y - 3t - 4)x + (- 6y + (12t z + 12t)y + 6t z)x + 3y + + + 2 2 2 2 + (12t z - 12t)y + (9t + 4)z + (- 24t - 4)z + 12t + 4 + ] + Type: List NewSparseMultivariatePolynomial(Integer, + OrderedVariableList [x,y,z,t]) + +Let us try the information option. N.B. The timing should be between +1 and 10 minutes, depending on your machine. + + zeroSetSplit(lq,true,true)$T + [1 <4,0> -> |4|; {0}]W[2 <5,0>,<3,1> -> |8|; {0}] + [2 <4,1>,<3,1> -> |7|; {0}] + [1 <3,1> -> |3|; {0}]G + [2 <4,1>,<4,1> -> |8|; {0}]W + [3 <5,1>,<4,1>,<3,2> -> |12|; {0}]GI + [3 <4,2>,<4,1>,<3,2> -> |11|; {0}]GWw + [3 <4,1>,<3,2>,<5,2> -> |12|; {0}] + [3 <3,2>,<3,2>,<5,2> -> |11|; {0}]GIwWWWw + [4 <3,2>,<4,2>,<5,2>,<2,3> -> |14|; {0}] + [4 <2,2>,<4,2>,<5,2>,<2,3> -> |13|; {0}]Gwww + [5 <3,2>,<3,2>,<4,2>,<5,2>,<2,3> -> |17|; {0}]Gwwwwww + [8 <3,2>,<4,2>,<4,2>,<4,2>,<4,2>,<4,2>,<5,2>,<2,3> -> |30|; {0}]Gwwwwww + [8 <4,2>,<4,2>,<4,2>,<4,2>,<4,2>,<4,2>,<5,2>,<2,3> -> |31|; {0}] + [8 <3,3>,<4,2>,<4,2>,<4,2>,<4,2>,<4,2>,<5,2>,<2,3> -> |30|; {0}] + [8 <2,3>,<4,2>,<4,2>,<4,2>,<4,2>,<4,2>,<5,2>,<2,3> -> |29|; {0}] + [8 <1,3>,<4,2>,<4,2>,<4,2>,<4,2>,<4,2>,<5,2>,<2,3> -> |28|; {0}] + [7 <4,2>,<4,2>,<4,2>,<4,2>,<4,2>,<5,2>,<2,3> -> |27|; {0}] + [6 <4,2>,<4,2>,<4,2>,<4,2>,<5,2>,<2,3> -> |23|; {0}] + [5 <4,2>,<4,2>,<4,2>,<5,2>,<2,3> -> |19|; {0}]GIGIWwww + [6 <5,2>,<4,2>,<4,2>,<5,2>,<3,3>,<2,3> -> |23|; {0}] + [6 <4,3>,<4,2>,<4,2>,<5,2>,<3,3>,<2,3> -> |22|; {0}]GIGI + [6 <3,4>,<4,2>,<4,2>,<5,2>,<3,3>,<2,3> -> |21|; {0}] + [6 <2,4>,<4,2>,<4,2>,<5,2>,<3,3>,<2,3> -> |20|; {0}]GGG + [5 <4,2>,<4,2>,<5,2>,<3,3>,<2,3> -> |18|; {0}]GIGIWwwwW + [6 <5,2>,<4,2>,<5,2>,<3,3>,<3,3>,<2,3> -> |22|; {0}] + [6 <4,3>,<4,2>,<5,2>,<3,3>,<3,3>,<2,3> -> |21|; {0}] + GIwwWwWWWWWWWwWWWWwwwww + [8 <4,2>,<5,2>,<3,3>,<3,3>,<4,3>,<2,3>,<3,4>,<3,4> -> |27|; {0}] + [8 <3,3>,<5,2>,<3,3>,<3,3>,<4,3>,<2,3>,<3,4>,<3,4> -> |26|; {0}] + [8 <2,3>,<5,2>,<3,3>,<3,3>,<4,3>,<2,3>,<3,4>,<3,4> -> |25|; {0}] + Gwwwwwwwwwwwwwwwwwwww + [9 <5,2>,<3,3>,<3,3>,<4,3>,<3,3>,<3,3>,<2,3>,<3,4>,<3,4> -> |29|; {0}]GI + [9 <4,3>,<3,3>,<3,3>,<4,3>,<3,3>,<3,3>,<2,3>,<3,4>,<3,4> -> |28|; {0}] + [9 <3,3>,<3,3>,<3,3>,<4,3>,<3,3>,<3,3>,<2,3>,<3,4>,<3,4> -> |27|; {0}] + [9 <2,3>,<3,3>,<3,3>,<4,3>,<3,3>,<3,3>,<2,3>,<3,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> |40|; {0}] + [13 <1,4>,<4,3>,<4,3>,<3,3>,<3,3>,<4,3>,<3,3>,<2,3>,<3,3>,<3,3>,<3,3>, + <3,4>,<3,4> -> |39|; {0}] + [13 <0,4>,<4,3>,<4,3>,<3,3>,<3,3>,<4,3>,<3,3>,<2,3>,<3,3>,<3,3>,<3,3>, + <3,4>,<3,4> -> |38|; {0}] + [12 <4,3>,<4,3>,<3,3>,<3,3>,<4,3>,<3,3>,<2,3>,<3,3>,<3,3>,<3,3>,<3,4>, + <3,4> -> |38|; {1}] + [11 <4,3>,<3,3>,<3,3>,<4,3>,<3,3>,<2,3>,<3,3>,<3,3>,<3,3>,<3,4>,<3,4> + -> |34|; {1}] + [10 <3,3>,<3,3>,<4,3>,<3,3>,<2,3>,<3,3>,<3,3>,<3,3>,<3,4>,<3,4> + -> |30|; {1}] + [10 <2,3>,<3,3>,<4,3>,<3,3>,<2,3>,<3,3>,<3,3>,<3,3>,<3,4>,<3,4> + -> |29|; {1}]GGGwwwwwwwwwwwww + [11 <3,3>,<3,3>,<4,3>,<3,3>,<3,3>,<2,3>,<3,3>,<3,3>,<3,3>,<3,4>,<3,4> + -> |33|; {1}]GGGwwwwwwwwwwwww + [12 <4,3>,<3,3>,<4,3>,<3,3>,<3,3>,<4,3>,<2,3>,<3,3>,<3,3>,<3,3>,<3,4>, + <3,4> -> |38|; {1}]Gwwwwwwwwwwwww + [12 <3,3>,<4,3>,<5,3>,<3,3>,<4,3>,<3,3>,<2,3>,<3,3>,<3,3>,<3,3>,<3,4>, + <3,4> -> |39|; {1}]GGwwwwwwwwwwwww + [13 <5,3>,<4,3>,<4,3>,<4,3>,<3,3>,<3,3>,<4,3>,<2,3>,<3,3>,<3,3>,<3,3>, + <3,4>,<3,4> -> |44|; {1}]GIGGGGIGGIW + [13 <4,4>,<4,3>,<4,3>,<4,3>,<3,3>,<3,3>,<4,3>,<2,3>,<3,3>,<3,3>,<3,3>, + <3,4>,<3,4> -> |43|; {1}]GGW + [13 <3,4>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[12 <1,4>,<4,3>,<5,3>,<3,3>,<3,3>,<4,3>,<2,3>,<3,3>,<3,3>,<3,3>,<3,4>, + <3,4> -> |37|; {1}]GGG + [11 <4,3>,<5,3>,<3,3>,<3,3>,<4,3>,<2,3>,<3,3>,<3,3>,<3,3>,<3,4>,<3,4> + -> |36|; {1}] + [10 <5,3>,<3,3>,<3,3>,<4,3>,<2,3>,<3,3>,<3,3>,<3,3>,<3,4>,<3,4> + -> |32|; {1}] + [9 <3,3>,<3,3>,<4,3>,<2,3>,<3,3>,<3,3>,<3,3>,<3,4>,<3,4> -> |27|; {1}]W + [9 <2,4>,<3,3>,<4,3>,<2,3>,<3,3>,<3,3>,<3,3>,<3,4>,<3,4> -> |26|; {1}] + [9 <1,4>,<3,3>,<4,3>,<2,3>,<3,3>,<3,3>,<3,3>,<3,4>,<3,4> -> |25|; {1}] + [8 <3,3>,<4,3>,<2,3>,<3,3>,<3,3>,<3,3>,<3,4>,<3,4> -> |24|; {1}]W + [8 <2,4>,<4,3>,<2,3>,<3,3>,<3,3>,<3,3>,<3,4>,<3,4> -> |23|; {1}] + [8 <1,4>,<4,3>,<2,3>,<3,3>,<3,3>,<3,3>,<3,4>,<3,4> -> |22|; {1}] + [7 <4,3>,<2,3>,<3,3>,<3,3>,<3,3>,<3,4>,<3,4> -> |21|; {1}]w + [7 <3,4>,<2,3>,<3,3>,<3,3>,<3,3>,<3,4>,<3,4> -> |20|; {1}] + [7 <2,4>,<2,3>,<3,3>,<3,3>,<3,3>,<3,4>,<3,4> -> |19|; {1}] + [7 <1,4>,<2,3>,<3,3>,<3,3>,<3,3>,<3,4>,<3,4> -> |18|; {1}] + [6 <2,3>,<3,3>,<3,3>,<3,3>,<3,4>,<3,4> -> |17|; {1}]GGwwwwww + [7 <3,3>,<3,3>,<3,3>,<3,3>,<3,3>,<3,4>,<3,4> -> |21|; {1}]GIW + [7 <2,4>,<3,3>,<3,3>,<3,3>,<3,3>,<3,4>,<3,4> -> |20|; {1}]GG + [6 <3,3>,<3,3>,<3,3>,<3,3>,<3,4>,<3,4> -> |18|; {1}]Gwwwwww + [7 <4,3>,<4,3>,<3,3>,<3,3>,<3,3>,<3,4>,<3,4> -> |23|; {1}]GIW + [7 <3,4>,<4,3>,<3,3>,<3,3>,<3,3>,<3,4>,<3,4> -> |22|; {1}] + [6 <4,3>,<3,3>,<3,3>,<3,3>,<3,4>,<3,4> -> |19|; {1}]GIW + [6 <3,4>,<3,3>,<3,3>,<3,3>,<3,4>,<3,4> -> |18|; {1}]GGW + [6 <2,4>,<3,3>,<3,3>,<3,3>,<3,4>,<3,4> -> |17|; {1}] + [6 <1,4>,<3,3>,<3,3>,<3,3>,<3,4>,<3,4> -> |16|; {1}]GGG + [5 <3,3>,<3,3>,<3,3>,<3,4>,<3,4> -> |15|; {1}]GIW + [5 <2,4>,<3,3>,<3,3>,<3,4>,<3,4> -> |14|; {1}]GG + [4 <3,3>,<3,3>,<3,4>,<3,4> -> |12|; {1}] + [3 <3,3>,<3,4>,<3,4> -> |9|; {1}]W + [3 <2,4>,<3,4>,<3,4> -> |8|; {1}] + [3 <1,4>,<3,4>,<3,4> -> |7|; {1}]G + [2 <3,4>,<3,4> -> |6|; {1}]G + [1 <3,4> -> |3|; {1}] + [1 <2,4> -> |2|; {1}] + [1 <1,4> -> |1|; {1}] + *** QCMPACK Statistics *** + Table size: 36 + Entries reused: 255 + + *** REGSETGCD: Gcd Statistics *** + Table size: 125 + Entries reused: 0 + + *** REGSETGCD: Inv Set Statistics *** + Table size: 30 + Entries reused: 0 + + [ + { + 24 23 22 + 960725655771966t + 386820897948702t + 8906817198608181t + + + 21 20 19 + 2704966893949428t + 37304033340228264t + 7924782817170207t + + + 18 17 16 + 93126799040354990t + 13101273653130910t + 156146250424711858t + + + 15 14 13 + 16626490957259119t + 190699288479805763t + 24339173367625275t + + + 12 11 10 + 180532313014960135t + 35288089030975378t + 135054975747656285t + + + 9 8 7 + 34733736952488540t + 75947600354493972t + 19772555692457088t + + + 6 5 4 + 28871558573755428t + 5576152439081664t + 6321711820352976t + + + 3 2 + 438314209312320t + 581105748367008t - 60254467992576t + 1449115951104 + , + + 23 + 26604210869491302385515265737052082361668474181372891857784t + + + 22 + 443104378424686086067294899528296664238693556855017735265295t + + + 21 + 279078393286701234679141342358988327155321305829547090310242t + + + 20 + 3390276361413232465107617176615543054620626391823613392185226t + + + 19 + 941478179503540575554198645220352803719793196473813837434129t + + + 18 + 11547855194679475242211696749673949352585747674184320988144390t + + + 17 + 1343609566765597789881701656699413216467215660333356417241432t + + + 16 + 23233813868147873503933551617175640859899102987800663566699334t + + + 15 + 869574020537672336950845440508790740850931336484983573386433t + + + 14 + 31561554305876934875419461486969926554241750065103460820476969t + + + 13 + 1271400990287717487442065952547731879554823889855386072264931t + + + 12 + 31945089913863736044802526964079540198337049550503295825160523t + + + 11 + 3738735704288144509871371560232845884439102270778010470931960t + + + 10 + 25293997512391412026144601435771131587561905532992045692885927t + + + 9 + 5210239009846067123469262799870052773410471135950175008046524t + + + 8 + 15083887986930297166259870568608270427403187606238713491129188t + + + 7 + 3522087234692930126383686270775779553481769125670839075109000t + + + 6 + 6079945200395681013086533792568886491101244247440034969288588t + + + 5 + 1090634852433900888199913756247986023196987723469934933603680t + + + 4 + 1405819430871907102294432537538335402102838994019667487458352t + + + 3 + 88071527950320450072536671265507748878347828884933605202432t + + + 2 + 135882489433640933229781177155977768016065765482378657129440t + + + - 13957283442882262230559894607400314082516690749975646520320t + + + 334637692973189299277258325709308472592117112855749713920 + * + z + + + 23 + 8567175484043952879756725964506833932149637101090521164936t + + + 22 + 149792392864201791845708374032728942498797519251667250945721t + + + 21 + 77258371783645822157410861582159764138123003074190374021550t + + + 20 + 1108862254126854214498918940708612211184560556764334742191654t + + + 19 + 213250494460678865219774480106826053783815789621501732672327t + + + 18 + 3668929075160666195729177894178343514501987898410131431699882t + + + 17 + 171388906471001872879490124368748236314765459039567820048872t + + + 16 + 7192430746914602166660233477331022483144921771645523139658986t + + + 15 + - 128798674689690072812879965633090291959663143108437362453385t + + + 14 + 9553010858341425909306423132921134040856028790803526430270671t + + + 13 + - 13296096245675492874538687646300437824658458709144441096603t + + + 12 + 9475806805814145326383085518325333106881690568644274964864413t + + + 11 + 803234687925133458861659855664084927606298794799856265539336t + + + 10 + 7338202759292865165994622349207516400662174302614595173333825t + + + 9 + 1308004628480367351164369613111971668880538855640917200187108t + + + 8 + 4268059455741255498880229598973705747098216067697754352634748t + + + 7 + 892893526858514095791318775904093300103045601514470613580600t + + + 6 + 1679152575460683956631925852181341501981598137465328797013652t + + + 5 + 269757415767922980378967154143357835544113158280591408043936t + + + 4 + 380951527864657529033580829801282724081345372680202920198224t + + + 3 + 19785545294228495032998826937601341132725035339452913286656t + + + 2 + 36477412057384782942366635303396637763303928174935079178528t + + + - 3722212879279038648713080422224976273210890229485838670848t + + + 89079724853114348361230634484013862024728599906874105856 + , + 3 2 3 2 + (3z - 11z + 8z + 4)y + 2t z + 4t z - 5t z - t, + 2 + (z + 1)x + z - 4z + 1} + ] + Type: List RegularTriangularSet(Integer, + IndexedExponents OrderedVariableList [x,y,z,t], + OrderedVariableList [x,y,z,t], + NewSparseMultivariatePolynomial(Integer, + OrderedVariableList [x,y,z,t])) + +Between a sequence of processes, thus between a ] and a [ you can see +capital letters W, G, I and lower case letters i, w. Each time a +capital letter appears a non-trivial computation has be performed and +its result is put in a hash-table. Each time a lower case letter +appears a needed result has been found in an hash-table. The use of +these hash-tables generally speed up the computations. However, on +very large systems, it may happen that these hash-tables become too +big to be handle by your AXIOM configuration. Then in these +exceptional cases, you may prefer getting a result (even if it takes a +long time) than getting nothing. Hence you need to know how to +prevent the RSEGSET constructor from using these hash-tables. In that +case you will be using the zeroSetSplit with five arguments. The +first one is the input system lp as above. The second one is a +boolean value hash? which is true iff you want to use hash-tables. +The third one is boolean value clos? which is true iff you want to +solve your system in the sense of Kalkbrener, the other way remaining +that of Lazard. The fourth argument is boolean value info? which is +true iff you want to display information during the computations. The +last one is boolean value prep? which is true iff you want to use some +heuristics that are performed on the input system before starting the +real algorithm. The value of this flag is true when you are using +zeroSetSplit with less than five arguments. Note that there is no +available signature for zeroSetSplit with four arguments. + +We finish this section by some remarks about both ways of solving, in +the sense of Kalkbrener or in the sense of Lazard. For problems with +a finite number of solutions, there are theoretically equivalent and +the resulting decompositions are identical, up to the ordering of the +components. However, when solving in the sense of Lazard, the +algorithm behaves differently. In that case, it becomes more +incremental than in the sense of Kalkbrener. That means the +polynomials of the input system are considered one after another +whereas in the sense of Kalkbrener the input system is treated more +globally. + +This makes an important difference in positive dimension. Indeed when +solving in the sense of Kalkbrener, the Primeidealkettensatz of Krull +is used. That means any regular triangular containing more +polynomials than the input system can be deleted. This is not +possible when solving in the sense of Lazard. This explains why +Kalkbrener's decompositions usually contain less components than those +of Lazard. However, it may happen with some examples that the +incremental process (that cannot be used when solving in the sense of +Kalkbrener) provide a more efficient way of solving than the global +one even if the Primeidealkettensatz is used. Thus just try both, +with the various options, before concluding that you cannot solve your +favorite system with zeroSetSplit. There exist more options at the +development level that are not currently available in this public +version. + +See Also: +o )help GcdDomain +o )help OrderedAbelianMonoidSup +o )help OrderedSet +o )help RecursivePolynomialCategory +o )help RegularChain +o )help NewSparseMultivariatePolynomial +o )help ZeroDimensionalSolvePackage +o )help LexTriangularPackage +o )help LazardSetSolvingPackage +o )help SquareFreeRegularTriangularSet +o )show RegularTriangularSet +o $AXIOM/doc/src/algebra/regset.spad.dvi + +@ <>= )abbrev domain REGSET RegularTriangularSet ++ Author: Marc Moreno Maza diff --git a/src/algebra/seg.spad.pamphlet b/src/algebra/seg.spad.pamphlet index 63036d6..7d6026b 100644 --- a/src/algebra/seg.spad.pamphlet +++ b/src/algebra/seg.spad.pamphlet @@ -88,6 +88,176 @@ SegmentExpansionCategory(S: OrderedRing, L: StreamAggregate(S)): Category == @ \section{domain SEG Segment} +<>= +-- seg.spad.pamphlet Segment.input +)spool Segment.output +)set message test on +)set message auto off +)clear all +--S 1 of 10 +s := 3..10 +--R +--R +--R (1) 3..10 +--R Type: Segment PositiveInteger +--E 1 + +--S 2 of 10 +lo s +--R +--R +--R (2) 3 +--R Type: PositiveInteger +--E 2 + +--S 3 of 10 +hi s +--R +--R +--R (3) 10 +--R Type: PositiveInteger +--E 3 + +--S 4 of 10 +t := 10..3 by -2 +--R +--R +--R (4) 10..3 by - 2 +--R Type: Segment PositiveInteger +--E 4 + +--S 5 of 10 +incr s +--R +--R +--R (5) 1 +--R Type: PositiveInteger +--E 5 + +--S 6 of 10 +incr t +--R +--R +--R (6) - 2 +--R Type: Integer +--E 6 + +--S 7 of 10 +l := [1..3, 5, 9, 15..11 by -1] +--R +--R +--R (7) [1..3,5..5,9..9,15..11 by - 1] +--R Type: List Segment PositiveInteger +--E 7 + +--S 8 of 10 +expand s +--R +--R +--R (8) [3,4,5,6,7,8,9,10] +--R Type: List Integer +--E 8 + +--S 9 of 10 +expand t +--R +--R +--R (9) [10,8,6,4] +--R Type: List Integer +--E 9 + +--S 10 of 10 +expand l +--R +--R +--R (10) [1,2,3,5,9,15,14,13,12,11] +--R Type: List Integer +--E 10 +)spool +)lisp (bye) +@ +<>= +==================================================================== +Segment examples +==================================================================== + +The Segment domain provides a generalized interval type. + +Segments are created using the .. construct by indicating the +(included) end points. + + s := 3..10 + 3..10 + Type: Segment PositiveInteger + +The first end point is called the lo and the second is called hi. + + lo s + 3 + Type: PositiveInteger + +These names are used even though the end points might belong to an +unordered set. + + hi s + 10 + Type: PositiveInteger + +In addition to the end points, each segment has an integer "increment". +An increment can be specified using the "by" construct. + + t := 10..3 by -2 + 10..3 by - 2 + Type: Segment PositiveInteger + +This part can be obtained using the incr function. + + incr s + 1 + Type: PositiveInteger + +Unless otherwise specified, the increment is 1. + + incr t + - 2 + Type: Integer + +A single value can be converted to a segment with equal end points. +This happens if segments and single values are mixed in a list. + + l := [1..3, 5, 9, 15..11 by -1] + [1..3,5..5,9..9,15..11 by - 1] + Type: List Segment PositiveInteger + +If the underlying type is an ordered ring, it is possible to perform +additional operations. The expand operation creates a list of points +in a segment. + + expand s + [3,4,5,6,7,8,9,10] + Type: List Integer + +If k > 0, then expand(l..h by k) creates the list [l, l+k, ..., lN] +where lN <= h < lN+k. If k < 0, then lN >= h > lN+k. + + expand t + [10,8,6,4] + Type: List Integer + +It is also possible to expand a list of segments. This is equivalent +to appending lists obtained by expanding each segment individually. + + expand l + [1,2,3,5,9,15,14,13,12,11] + Type: List Integer + +See Also: +o )help UniversalSegment +o )help SegmentBinding +o )show Segment +o $AXIOM/doc/src/algebra/seg.spad.dvi + +@ <>= )abbrev domain SEG Segment ++ Author: Stephen M. Watt @@ -216,6 +386,118 @@ SegmentFunctions2(R:Type, S:Type): public == private where @ \section{domain SEGBIND SegmentBinding} +<>= +-- seg.spad.pamphlet SegmentBinding.input +)spool SegmentBinding.output +)set message test on +)set message auto off +)clear all +--S 1 of 5 +x = a..b +--R +--R +--R (1) x= a..b +--R Type: SegmentBinding Symbol +--E 1 + +--S 2 of 5 +sum(i**2, i = 0..n) +--R +--R +--R 3 2 +--R 2n + 3n + n +--R (2) ------------- +--R 6 +--R Type: Fraction Polynomial Integer +--E 2 + +--S 3 of 5 +sb := y = 1/2..3/2 +--R +--R +--R 1 3 +--R (3) y= (-)..(-) +--R 2 2 +--R Type: SegmentBinding Fraction Integer +--E 3 + +--S 4 of 5 +variable(sb) +--R +--R +--R (4) y +--R Type: Symbol +--E 4 + +--S 5 of 5 +segment(sb) +--R +--R +--R 1 3 +--R (5) (-)..(-) +--R 2 2 +--R Type: Segment Fraction Integer +--E 5 +)spool +)lisp (bye) +@ +<>= +==================================================================== +SegmentBinding examples +==================================================================== + +The SegmentBinding type is used to indicate a range for a named symbol. + +First give the symbol, then an = and finally a segment of values. + + x = a..b + x= a..b + Type: SegmentBinding Symbol + +This is used to provide a convenient syntax for arguments to certain +operations. + + sum(i**2, i = 0..n) + 3 2 + 2n + 3n + n + ------------- + 6 + Type: Fraction Polynomial Integer + + draw(x**2, x = -2..2) + TwoDimensionalViewport: "x*x" + Type: TwoDimensionalViewport + + +The left-hand side must be of type Symbol but the right-hand side can +be a segment over any type. + + sb := y = 1/2..3/2 + 1 3 + y= (-)..(-) + 2 2 + Type: SegmentBinding Fraction Integer + +The left- and right-hand sides can be obtained using the variable and +segment operations. + + variable(sb) + y + Type: Symbol + + segment(sb) + 1 3 + (-)..(-) + 2 2 + Type: Segment Fraction Integer + +See Also: +o )help Segment +o )help UniversalSegment +o )show SegmentBinding +o $AXIOM/doc/src/algebra/seg.spad.dvi + +@ <>= )abbrev domain SEGBIND SegmentBinding ++ Author: diff --git a/src/algebra/sets.spad.pamphlet b/src/algebra/sets.spad.pamphlet index 5f373d4..0a348b4 100644 --- a/src/algebra/sets.spad.pamphlet +++ b/src/algebra/sets.spad.pamphlet @@ -10,6 +10,314 @@ \tableofcontents \eject \section{domain SET Set} +<>= +-- sets.spad.pamphlet Set.input +)spool Set.output +)set message test on +)set message auto off +)clear all +--S 1 of 20 +s := set [x**2-1, y**2-1, z**2-1] +--R +--R +--R 2 2 2 +--R (1) {x - 1,y - 1,z - 1} +--R Type: Set Polynomial Integer +--E 1 + +--S 2 of 20 +t := set [x**i - i+1 for i in 2..10 | prime? i] +--R +--R +--R 2 3 5 7 +--R (2) {x - 1,x - 2,x - 4,x - 6} +--R Type: Set Polynomial Integer +--E 2 + +--S 3 of 20 +i := intersect(s,t) +--R +--R +--R 2 +--R (3) {x - 1} +--R Type: Set Polynomial Integer +--E 3 + +--S 4 of 20 +u := union(s,t) +--R +--R +--R 2 3 5 7 2 2 +--R (4) {x - 1,x - 2,x - 4,x - 6,y - 1,z - 1} +--R Type: Set Polynomial Integer +--E 4 + +--S 5 of 20 +difference(s,t) +--R +--R +--R 2 2 +--R (5) {y - 1,z - 1} +--R Type: Set Polynomial Integer +--E 5 + +--S 6 of 20 +symmetricDifference(s,t) +--R +--R +--R 3 5 7 2 2 +--R (6) {x - 2,x - 4,x - 6,y - 1,z - 1} +--R Type: Set Polynomial Integer +--E 6 + +--S 7 of 20 +member?(y, s) +--R +--R +--R (7) false +--R Type: Boolean +--E 7 + +--S 8 of 20 +member?((y+1)*(y-1), s) +--R +--R +--R (8) true +--R Type: Boolean +--E 8 + +--S 9 of 20 +subset?(i, s) +--R +--R +--R (9) true +--R Type: Boolean +--E 9 + +--S 10 of 20 +subset?(u, s) +--R +--R +--R (10) false +--R Type: Boolean +--E 10 + +--S 11 of 20 +gs := set [g for i in 1..11 | primitive?(g := i::PF 11)] +--R +--R +--R (11) {2,6,7,8} +--R Type: Set PrimeField 11 +--E 11 + +--S 12 of 20 +complement gs +--R +--R +--R (12) {1,3,4,5,9,10,0} +--R Type: Set PrimeField 11 +--E 12 + +--S 13 of 20 +a := set [i**2 for i in 1..5] +--R +--R +--R (13) {1,4,9,16,25} +--R Type: Set PositiveInteger +--E 13 + +--S 14 of 20 +insert!(32, a) +--R +--R +--R (14) {1,4,9,16,25,32} +--R Type: Set PositiveInteger +--E 14 + +--S 15 of 20 +remove!(25, a) +--R +--R +--R (15) {1,4,9,16,32} +--R Type: Set PositiveInteger +--E 15 + +--S 16 of 20 +a +--R +--R +--R (16) {1,4,9,16,32} +--R Type: Set PositiveInteger +--E 16 + +--S 17 of 20 +b := b0 := set [i**2 for i in 1..5] +--R +--R +--R (17) {1,4,9,16,25} +--R Type: Set PositiveInteger +--E 17 + +--S 18 of 20 +b := union(b, {32}) +--R +--R +--R (18) {1,4,9,16,25,32} +--R Type: Set PositiveInteger +--E 18 + +--S 19 of 20 +b := difference(b, {25}) +--R +--R +--R (19) {1,4,9,16,32} +--R Type: Set PositiveInteger +--E 19 + +--S 20 of 20 +b0 +--R +--R +--R (20) {1,4,9,16,25} +--R Type: Set PositiveInteger +--E 20 +)spool +)lisp (bye) +@ +<>= +==================================================================== +Set examples +==================================================================== + +The Set domain allows one to represent explicit finite sets of values. +These are similar to lists, but duplicate elements are not allowed. + +Sets can be created by giving a fixed set of values ... + + s := set [x**2-1, y**2-1, z**2-1] + 2 2 2 + {x - 1,y - 1,z - 1} + Type: Set Polynomial Integer + +or by using a collect form, just as for lists. In either case, the +set is formed from a finite collection of values. + + t := set [x**i - i+1 for i in 2..10 | prime? i] + 2 3 5 7 + {x - 1,x - 2,x - 4,x - 6} + Type: Set Polynomial Integer + +The basic operations on sets are intersect, union, difference, and +symmetricDifference. + + i := intersect(s,t) + 2 + {x - 1} + Type: Set Polynomial Integer + + u := union(s,t) + 2 3 5 7 2 2 + {x - 1,x - 2,x - 4,x - 6,y - 1,z - 1} + Type: Set Polynomial Integer + +The set difference(s,t) contains those members of s which are not in t. + + difference(s,t) + 2 2 + {y - 1,z - 1} + Type: Set Polynomial Integer + +The set symmetricDifference(s,t) contains those elements which are +in s or t but not in both. + + symmetricDifference(s,t) + 3 5 7 2 2 + {x - 2,x - 4,x - 6,y - 1,z - 1} + Type: Set Polynomial Integer + +Set membership is tested using the member? operation. + + member?(y, s) + false + Type: Boolean + + member?((y+1)*(y-1), s) + true + Type: Boolean + +The subset? function determines whether one set is a subset of another. + + subset?(i, s) + true + Type: Boolean + + subset?(u, s) + false + Type: Boolean + +When the base type is finite, the absolute complement of a set is +defined. This finds the set of all multiplicative generators of +PrimeField 11---the integers mod 11. + + gs := set [g for i in 1..11 | primitive?(g := i::PF 11)] + {2,6,7,8} + Type: Set PrimeField 11 + +The following values are not generators. + + complement gs + {1,3,4,5,9,10,0} + Type: Set PrimeField 11 + +Often the members of a set are computed individually; in addition, +values can be inserted or removed from a set over the course of a +computation. + +There are two ways to do this: + + a := set [i**2 for i in 1..5] + {1,4,9,16,25} + Type: Set PositiveInteger + +One is to view a set as a data structure and to apply updating operations. + + insert!(32, a) + {1,4,9,16,25,32} + Type: Set PositiveInteger + + remove!(25, a) + {1,4,9,16,32} + Type: Set PositiveInteger + + a + {1,4,9,16,32} + Type: Set PositiveInteger + +The other way is to view a set as a mathematical entity and to +create new sets from old. + + b := b0 := set [i**2 for i in 1..5] + {1,4,9,16,25} + Type: Set PositiveInteger + + b := union(b, {32}) + {1,4,9,16,25,32} + Type: Set PositiveInteger + + b := difference(b, {25}) + {1,4,9,16,32} + Type: Set PositiveInteger + + b0 + {1,4,9,16,25} + Type: Set PositiveInteger + +See Also: +o )help List +o )show Set +o $AXIOM/doc/src/algebra/sets.spad.dvi + +@ <>= )abbrev domain SET Set ++ Author: Michael Monagan; revised by Richard Jenks diff --git a/src/algebra/variable.spad.pamphlet b/src/algebra/variable.spad.pamphlet index 0f50171..994aa3b 100644 --- a/src/algebra/variable.spad.pamphlet +++ b/src/algebra/variable.spad.pamphlet @@ -10,6 +10,101 @@ \tableofcontents \eject \section{domain OVAR OrderedVariableList} +<>= +-- variable.spad.pamphlet OrderedVariableList.input +)spool OrderedVariableList.output +)set message test on +)set message auto off +)clear all +--S 1 +ls:List Symbol:=['x,'a,'z] +--R +--R +--R (1) [x,a,z] +--R Type: List Symbol +--E 1 + +--S 2 +Z:=OVAR ls +--R +--R +--R (2) OrderedVariableList [x,a,z] +--R Type: Domain +--E 2 + +--S 3 +size()$Z +--R +--R +--R (3) 3 +--R Type: NonNegativeInteger +--E 3 + +--S 4 +lv:=[index(i::PI)$Z for i in 1..size()$Z] +--R +--R Compiling function G1408 with type Integer -> Boolean +--R Compiling function G1572 with type NonNegativeInteger -> Boolean +--R +--R (4) [x,a,z] +--R Type: List OrderedVariableList [x,a,z] +--E 4 + +--S 5 +sorted?(>,lv) +--R +--R +--R (5) true +--R Type: Boolean +--E 5 +)spool +)lisp (bye) +@ +<>= +==================================================================== +OrderedVariableList examples +==================================================================== + +The domain OrderedVariableList provides symbols which are restricted +to a particular list and have a definite ordering. Those two features +are specified by a List Symbol object that is the argument to the +domain. + +This is a sample ordering of three symbols. + + ls:List Symbol:=['x,'a,'z] + [x,a,z] + Type: List Symbol + +Let's build the domain + + Z:=OVAR ls + OrderedVariableList [x,a,z] + Type: Domain + +How many variables does it have? + + size()$Z + 3 + Type: NonNegativeInteger + +They are (in the imposed order) + + lv:=[index(i::PI)$Z for i in 1..size()$Z] + [x,a,z] + Type: List OrderedVariableList [x,a,z] + +Check that the ordering is right + + sorted?(>,lv) + true + Type: Boolean + +See Also: +o )show OrderedVariableList +o $AXIOM/doc/src/algebra/variable.spad.dvi + +@ <>= )abbrev domain OVAR OrderedVariableList ++ Description: diff --git a/src/doc/spadhelp.pamphlet b/src/doc/spadhelp.pamphlet index 024164b..3275622 100644 --- a/src/doc/spadhelp.pamphlet +++ b/src/doc/spadhelp.pamphlet @@ -1513,9 +1513,15 @@ MappingPackage1 (MAPPKG1) MappingPackage2 (MAPPKG2) MappingPackage3 (MAPPKG3) Matrix (MATRIX) Multiset (MSET) MultivariatePolynomial (MPOLY) None (NONE) Octonion (OCT) -OneDimensionalArray (ARRAY1) +OneDimensionalArray (ARRAY1) Operator (OP) +OrderedVariableList (OVAR) OrderlyDifferentialPolynomial (ODPOL) +PartialFraction (PFR) Permanent (PERMAN) +Polynomial (POLY) Quaternion (QUAT) +RadixExpansion (RADIX) RealClosure (RECLOS) PlaneAlgebraicCurvePlot (ACPLOT) RealSolvePackage (REALSOLV) -RomanNumeral (ROMAN) TwoDimensionalViewport (VIEW2D) +RegularTriangularSet (REGSET) RomanNumeral (ROMAN) +Segment (SEG) SegmentBinding (SEGBIND) +Set (SET) TwoDimensionalViewport (VIEW2D) @