h*      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~0.3.0.0#Multivariate polynomials on a ring.(c) Stphane Laurent, 2023GPL-3laurent_step@outlook.fr Safe-Inferred3ihsprayA RatioOfSprays a object represents a fraction of two multivariate polynomials whose coefficients are of type a, which represents a field. These two polynomials are represented by two Spray a objects. Generally we do not use this constructor to build a ratio of sprays: we use the  operator instead, because it always returns an irreducible ratio of sprays, meaning that its corresponding fraction of polynomials is irreducible, i.e. its numerator and its denominator are coprime. You can use this constructor if you are sure that the numerator and the denominator are coprime. This can save some computation time, but unfortunate consequences can occur if the numerator and the denominator are not coprime. An arithmetic operation on ratios of sprays always returns an irreducible ratio of sprays under the condition that the ratios of sprays it involves are irreducible. Moreover, it never returns a ratio of sprays with a constant denominator other than the unit spray. If you use this constructor with a constant denominator, always set this denominator to the unit spray (by dividing the numerator by the constant value of the denominator).hsprayA spray represents a multivariate polynomial so it has some variables. We introduce a class because it will be assigned to the ratios of sprays too.hspray&The type of the coefficients (this is a for both Spray a and RatioOfSprays a)hspray#The type of the variables (this is Spray a for both Spray a and RatioOfSprays a)hsprayNumber of variableshsprayPermutes the variablesf :: Spray Rational -> Spray Rational -> Spray Rational -> Spray Rationalf p1 p2 p3 = p1^**^4 ^+^ (2*^p2^**^3) ^+^ (3*^p3^**^2) ^-^ (4*^unitSpray)x1 = lone 1 :: Spray Rationalx2 = lone 2 :: Spray Rationalx3 = lone 3 :: Spray Rationalspray = f x1 x2 x3.permuteVariables [3, 1, 2] spray == f x3 x1 x2 hspraySwaps two variables 6swapVariables (1, 3) x == permuteVariables [3, 2, 1] x!hspray Derivative x = lone 1 :: Spray Inty = lone 2 :: Spray Intspray = 2*^x ^-^ 3*^y^**^8spray' = derivative 1 spray putStrLn $ prettyNumSpray spray'2"hspray3Evaluation (replacing the variables by some values)x = lone 1 :: Spray Inty = lone 2 :: Spray Intspray = 2*^x^**^2 ^-^ 3*^yevaluate spray [2, 1]5#hsprayFlipped version of evaluatex = lone 1 :: Spray Inty = lone 2 :: Spray Intspray = 2*^x^**^2 ^-^ 3*^yevaluateAt [2, 1] spray5$hspray!Substitution (partial evaluation)x1 = lone 1 :: Spray Intx2 = lone 2 :: Spray Intx3 = lone 3 :: Spray Int+spray = x1^**^2 ^-^ x2 ^+^ x3 ^-^ unitSpray3spray' = substitute [Just 2, Nothing, Just 3] spray*putStrLn $ prettyNumSprayX1X2X3 "x" spray'-x2 + 6 %hsprayChange variablesx = lone 1 :: Spray Inty = lone 2 :: Spray Intspray = x ^*^ y1spray' = changeVariables spray [x ^+^ y, x ^-^ y]!putStrLn $ prettyNumSpray' spray' X^2 - Y^2&hsprayWhether an object of class  is constant'hsprayWhether an object of class  is univariate; it is considered that it is univariate if it is constant(hsprayWhether an object of class  is bivariate; it is considered that it is bivariate if it is univariate)hsprayWhether an object of class  is trivariate; it is considered that it is trivariate if it is bivariate*hspray,Divides by a scalar in a module over a field+hspray5Scale by an integer (I do not find this operation in numeric-prelude)53 .^ x == x Algebra.Additive.+ x Algebra.Additive.+ x,hsprayIdentify a rational to a  A Rational' element-hspray3Scale a ratio of univariate polynomials by a scalar.hsprayConstant univariate polynomial/hsprayUnivariate polynomial from its coefficients (ordered by increasing degrees)0hsprayThe variable of a univariate polynomial; it is called "soleParameter" because this it represents the parameter of a  spray1hspray'Constant rational univariate polynomialimport Number.Ratio ( (%) )constQPoly (2 % 3)-constQPoly (2 % 3) == qpolyFromCoeffs [2 % 3]2hspray0Rational univariate polynomial from coefficientsimport Number.Ratio ( (%) )!qpolyFromCoeffs [2 % 3, 5, 7 % 4]3hsprayThe variable of a univariate rational polynomial; it is called "qsoleParameter" because it represents the parameter of a  spray (qsoleParameter == qpolyFromCoeffs [0, 1]hsprayidentify a `Polynomial a` to a `Spray a`, in order to apply the show spray functions to the univariate polynomialshsprayhelper function for prettyRatioOfPolynomials (and prettyOneParameterSpray)4hsprayPretty form of a ratio of univariate polynomials with rational coefficientshsprayhelper function for prettyRatioOfPolynomials (and prettyOneParameterSpray)hsprayhelper function for prettyRatioOfPolynomials (and prettyOneParameterSpray)5hspray0Pretty form of a ratio of univariate polynomials6hspray+Evaluates a ratio of univariate polynomials7hsprayPretty form of a one-parameter spray, using a string (typically a letter) followed by an index to denote the variables8hsprayPretty form of a one-parameter spray, using some given strings (typically some letters) to denote the variables if possible, i.e. if enough letters are provided; otherwise this function behaves exactly like  prettyOneParameterQSprayX1X2X3 a where a is the first provided letter9hsprayPretty form of a one-parameter spray; see the definition below and see 8prettyOneParameterSpray a spray == prettyOneParameterSprayXYZ a ["x","y","z"] spray:hsprayPretty form of a one-parameter spray; see the definition below and see 8prettyOneParameterSpray' a spray == prettyOneParameterSprayXYZ a ["X","Y","Z"] spray;hsprayPretty form of a one-parameter rational spray, using a string (typically a letter) followed by an index to denote the variables<hsprayPretty form of a one-parameter rational spray, using some given strings (typically some letters) to denote the variables if possible, i.e. if enough letters are provided; otherwise this function behaves exactly like  prettyOneParameterQSprayX1X2X3 a where a is the first provided letter=hspray5Pretty form of a one-parameter rational spray, using "x", "y" and "z" for the variables if possible; i.e. if the spray does not have more than three variables, otherwise "x1", "x2"&, ... are used to denote the variablesprettyOneParameterQSpray a == prettyOneParameterQSprayXYZ a ["x","y","z"]>hspray5Pretty form of a one-parameter rational spray, using X, Y and Z for the variables if possible; i.e. if the spray does not have more than three variables, otherwise X1, X2, ... are used prettyOneParameterQSpray' a = prettyOneParameterQSprayXYZ a ["X","Y","Z"]?hspraySubstitutes a value to the parameter of a one-parameter spray (the variable occuring in the coefficients)@hspraySubstitutes a value to the parameter of a one-parameter spray as well as some values to the variables of this sprayhspray+helper function for evalOneParameterSpray''AhspraySubstitutes some values to the variables of a one-parameter sprayhsprayappend trailing zeroshspray,append trailing zeros to get the same lengthhspraydrop trailing zeroshsprayaddition of two sprayshsprayopposite sprayhsprayscale a spray by a scalarhspraymultiply two monomialshspraymultiply two spraysBhsprayAddition of two spraysChspraySubstraction of two spraysDhsprayMultiply two spraysEhsprayPower of a sprayFhspray.Scales a spray by a scalar; if you import the Algebra.Module+ module then it is the same operation as (*>) from this moduleGhspray6Divides a spray by a scalar; you can equivalently use *- if the type of the scalar is not ambiguoushspray,drop trailing zeros in the powers of a sprayhspray0simplify powers and remove zero terms of a sprayhspray0simplify powers and remove zero terms of a sprayHhsprayThe n-th polynomial variable x_n as a spray; one usually builds a spray by introducing these variables and combining them with the arithmetic operationsx = lone 1 :: Spray Inty = lone 2 :: Spray Intspray = 2*^x^**^2 ^-^ 3*^yputStrLn $ prettyNumSpray spray 2*x^2 - 3*ylone 0 == unitSprayIhsprayThe n-th polynomial variable for rational sprays; this is just a specialization of HJhsprayThe unit sprayspray ^*^ unitSpray == sprayKhsprayThe null sprayspray ^+^ zeroSpray == sprayhspraywhether the spray is zeroLhsprayConstant spray!constantSpray 3 == 3 *^ unitSprayMhspray%Get coefficient of a term of a spray x = lone 1 :: Spray Inty = lone 2 :: Spray Intz = lone 3 :: Spray Int=p = 2 *^ (2 *^ (x^**^3 ^*^ y^**^2)) ^+^ 4*^z ^+^ 5*^unitSpraygetCoefficient [3, 2, 0] p4getCoefficient [0, 4] p0Nhspray Get the constant term of a spray(getConstantTerm p == getCoefficient [] pOhspray%Whether a spray is constant; same as &hspray5helper function to unify evalSpray and evalSpraySprayPhsprayEvaluates a spray; same as "x = lone 1 :: Spray Inty = lone 2 :: Spray Intspray = 2*^x^**^2 ^-^ 3*^yevalSpray spray [2, 1]5QhsprayEvaluates the coefficients of a spray with spray coefficients; same as hsprayspray from monomialRhspray>Substitutes some variables in a spray by some values; same as $x1 = lone 1 :: Spray Intx2 = lone 2 :: Spray Intx3 = lone 3 :: Spray Int'p = x1^**^2 ^-^ x2 ^+^ x3 ^-^ unitSpray0p' = substituteSpray [Just 2, Nothing, Just 3] p&putStrLn $ prettyNumSprayX1X2X3 "x" p'-x2 + 6 ShsprayConverts a spray with rational coefficients to a spray with double coefficients (useful for evaluation)Thspray>Sustitutes the variables of a spray with some sprays; same as %x = lone 1 :: Spray Inty = lone 2 :: Spray Intz = lone 3 :: Spray Int p = x ^+^ y%q = composeSpray p [z, x ^+^ y ^+^ z]putStrLn $ prettyNumSpray' q X + Y + 2*ZUhspray$Creates a spray from a list of termsVhsprayPrints a spray; this function is exported for possible usage in other packagesWhsprayPrints a spray, with monomials shown as "x.z^2", and with a user-defined showing function for the coefficientsXhspray(Prints a spray, with monomials shown as "x.z^2", and with a user-defined showing function for the coefficients; this is the same as the function W with the pair of braces  ("(", ")")YhsprayPretty form of a spray with monomials displayed in the style of "x.z^2"; you should rather use b or g# if your coefficients are numericx = lone 1 :: Spray Inty = lone 2 :: Spray Intz = lone 3 :: Spray Int$p = 2*^x ^+^ 3*^y^**^2 ^-^ 4*^z^**^3+putStrLn $ prettySprayXYZ ["X", "Y", "Z"] p(2)*X + (3)*Y^2 + (-4)*Z^3&putStrLn $ prettySprayXYZ ["X", "Y"] p(2)*X1 + (3)*X2^2 + (-4)*X3^3ZhsprayPretty form of a spray, with monomials shown as "x1.x3^2", and with a user-defined showing function for the coefficients[hsprayPretty form of a spray, with monomials shown as "x1.x3^2", and with a user-defined showing function for the coefficients; this is the same as the function Z with the pair of braces  ("(", ")")# used to enclose the coefficients\hsprayPretty form of a spray with monomials displayed in the style of  "x1.x3^2"; you should rather use a or e# if your coefficients are numericx = lone 1 :: Spray Inty = lone 2 :: Spray Intz = lone 3 :: Spray Int(spray = 2*^x ^+^ 3*^y^**^2 ^-^ 4*^z^**^3&putStrLn $ prettySprayX1X2X3 "X" spray(2)*X1 + (3)*X2^2 + (-4)*X3^3]hsprayPretty form of a spray with monomials displayed in the style of "x.z^2"; you should rather use m or i4 if you deal with sprays with numeric coefficientsx = lone 1 :: Spray Inty = lone 2 :: Spray Intz = lone 3 :: Spray Int$p = 2*^x ^+^ 3*^y^**^2 ^-^ 4*^z^**^3putStrLn $ prettySpray p(2)*x + (3)*y^2 + (-4)*z^3%putStrLn $ prettySpray (p ^+^ lone 4)"(2)*x1 + (3)*x2^2 + (-4)*x3^3 + x49prettySpray spray == prettySprayXYZ ["x", "y", "z"] spray^hspray0Pretty form of a spray, with monomials shown as  "x1.x3^2"; use \ to change the letter (or a or e! if the coefficients are numeric)x = lone 1 :: Spray Inty = lone 2 :: Spray Intz = lone 3 :: Spray Int$p = 2*^x ^+^ 3*^y^**^2 ^-^ 4*^z^**^3putStrLn $ prettySpray' p(2)*x1 + (3)*x2^2 + (-4)*x3^3 hspray+showMonomialOld "x" [0, 2, 1] = x^(0, 2, 1)_hspray1Pretty form of a spray; you will probably prefer ] or ^x = lone 1 :: Spray Inty = lone 2 :: Spray Intz = lone 3 :: Spray Int$p = 2*^x ^+^ 3*^y^**^2 ^-^ 4*^z^**^3putStrLn $ prettySpray'' "x" p+(2)*x^(1) + (3)*x^(0, 2) + (-4)*x^(0, 0, 3)`hsprayShow a spray with numeric coefficients; this function is exported for possible usage in other packageshsprayshowMonomialX1X2X3 X [0, 2, 1] = "X2^2.X3"hsprayshowMonomialsX1X2X3 X# [[0, 2, 1], [1, 2]] = ["X2^2.X3", X1.X2]hsprayshowMonomialXYZ [X, Y, Z,] 3 [1, 2, 1] = X.Y^2.Z showMonomialXYZ [X, Y, Z"] 3 [1, 2, 1, 2] = X1.X2^2.X3.X4^2hsprayshowMonomialsXYZ [X, Y, Z*] [[0, 2, 1], [1, 2]] = ["Y^2.Z", "X.Y^2"]ahsprayPretty form of a spray with numeric coefficients, printing monomials as  "x1.x3^2"x = lone 1 :: Spray Inty = lone 2 :: Spray Intz = lone 3 :: Spray Int$p = 2*^x ^+^ 3*^y^**^2 ^-^ 4*^z^**^3%putStrLn $ prettyNumSprayX1X2X3 "x" p2*x1 + 3*x2^2 - 4*x3^3 bhsprayPretty form of a spray with numeric coefficients, printing monomials as "x.z^2" if possible, i.e. if enough letters are provided, otherwise as  "x1.x3^2"x = lone 1 :: Spray Inty = lone 2 :: Spray Intz = lone 3 :: Spray Intw = lone 4 :: Spray Int$p = 2*^x ^+^ 3*^y^**^2 ^-^ 4*^z^**^3,putStrLn $ prettyNumSprayXYZ ["x","y","z"] p2*x + 3*y^2 - 4*z^3 4putStrLn $ prettyNumSprayXYZ ["x","y","z"] (p ^+^ w)2*x1 + 3*x2^2 - 4*x3^3 + x44putStrLn $ prettyNumSprayXYZ ["a","b","c"] (p ^+^ w)2*a1 + 3*a2^2 - 4*a3^3 + a4hsprayhelper function for showQSprayhspray helper function for showQSpray' chspray Prints a  =; for internal usage but exported for usage in other packagesdhspray Prints a  =; for internal usage but exported for usage in other packagesehsprayPretty form of a spray with rational coefficients, printing monomials in the style of  "x1.x3^2"x = lone 1 :: QSprayy = lone 2 :: QSprayz = lone 3 :: QSpray(p = 2*^x ^+^ 3*^y^**^2 ^-^ (4%3)*^z^**^3#putStrLn $ prettyQSprayX1X2X3 "x" p2*x1 + 3*x2^2 - (4/3)*x3^3 fhspraySame as e but for a   sprayghsprayPretty form of a spray with rational coefficients, printing monomials in the style of "x.z^2" with the provided letters if possible, i.e. if enough letters are provided, otherwise in the style  "x1.x3^2", taking the first provided letter to denote the non-indexed variablesx = lone 1 :: QSprayy = lone 2 :: QSprayz = lone 3 :: QSpray(p = 2*^x ^+^ 3*^y^**^2 ^-^ (4%3)*^z^**^3*putStrLn $ prettyQSprayXYZ ["x","y","z"] p2*x + 3*y^2 - (4/3)*z^3 &putStrLn $ prettyQSprayXYZ ["x","y"] p2*x1 + 3*x2^2 - (4%3)*x3^3&putStrLn $ prettyQSprayXYZ ["a","b"] p2*a1 + 3*a2^2 - (4/3)*a3^3hhspraySame as g but for a   sprayihsprayPretty printing of a spray with rational coefficients prop> prettyQSpray == prettyQSprayXYZ ["x", "y", "z"]jhsprayPretty printing of a spray with rational coefficients prop> prettyQSpray'' == prettyQSprayXYZ [X, Y, Z]khsprayPretty printing of a spray with rational coefficients prop> prettyQSpray' == prettyQSprayXYZ' ["x", "y", "z"]lhsprayPretty printing of a spray with rational coefficients prop> prettyQSpray''' == prettyQSprayXYZ' [X, Y, Z]mhsprayPretty printing of a spray with numeric coefficients prop> prettyNumSpray == prettyNumSprayXYZ ["x", "y", "z"]nhsprayPretty printing of a spray with numeric coefficients prop> prettyNumSpray' == prettyNumSprayXYZ [X, Y, Z]ohsprayTerms of a sprayphspraySpray as a listqhspray>Bombieri spray (for internal usage in the 'scubature' library)rhspray2Whether two sprays are equal up to a scalar factorhsprayindex of the maximum of a listshsprayLeading term of a spray hspray+whether a monomial divides another monomialhspray:quotient of monomial Q by monomial p, assuming P divides QthsprayRemainder of the division of a spray by a list of divisors, using the lexicographic ordering of the monomialsuhsprayDivision of a spray by a sprayhsprayslight modification of t to speed up groebner00hspray+groebner basis, not minimal and not reducedhspray'groebner basis, minimal but not reducedvhsprayReduces a Groebner basiswhspray2Grbner basis, always minimal and possibly reducedgroebner sprays True == reduceGroebnerBasis (groebner sprays False)hspray'combinations of k elements among a listhspray/generates all permutations of a binary sequencexhsprayElementary symmetric polynomial*putStrLn $ prettySpray' (esPolynomial 3 2)(1)*x1x2 + (1)*x1x3 + (1)*x2x3yhsprayPower sum polynomialzhsprayWhether a spray is a symmetric polynomial, an inefficient algorithm (use the function with the same name in the jackpolynomials" package if you need efficiency){hsprayWhether a spray can be written as a polynomial of a given list of sprays (the sprays in the list must belong to the same polynomial ring as the spray); this polynomial is returned if this is truex = lone 1 :: Spray Rationaly = lone 2 :: Spray Rational p1 = x ^+^ y p2 = x ^-^ y p = p1 ^*^ p23isPolynomialOf p [p1, p2] == (True, Just $ x ^*^ y)hspraysylvester matrixhspray"truncated" Sylvester matrixhspraythe coefficients of a spray as a univariate spray in x_1 with spray coefficients|hsprayResultant of two  univariate sprays}hspraySubresultants of two  univariate sprays~hsprayResultant of two sprayshspraySubresultants of two sprayshsprayResultant of two sprays with coefficients in a field; this function is more efficient than the function ~hspraythe coefficients of a spray as a univariate spray in x_n with spray coefficientshspraythe degree of a spray as a univariate spray in x_n with spray coefficientshspraythe degree and the leading coefficient of a spray as a univariate spray in x_n with spray coefficientshspray9Pseudo-division of two sprays, assuming degA >= degB >= 0hsprayrecursive GCD functionhsprayGreatest common divisor of two sprays with coefficients in a fieldhsprayDeterminant of a matrix with entries in a ring by using Laplace expansion (this is slow); the numeric-prelude package provides some stuff to deal with matrices over a ring but it does not provide the determinanthsprayDeterminant of a matrix over a ring by using Laplace expansion; this is the same as  but for a matrix from the numeric-prelude packagehspray,Characteristic polynomial of a square matrix&import Data.Matrix (Matrix, fromLists)m = fromLists [ [12, 16, 4] , [16, 2, 8], [8, 18, 10] ] :: Matrix Int"spray = characteristicPolynomial mputStrLn $ prettyNumSpray spray-x^3 + 24*x^2 + 268*x - 1936hspray0division of two sprays assuming the divisibilityhsprayirreducible fraction of sprayshspray&set denominator to 1 if it is constanthspray2Ratio of sprays from numerator and denominator, without reducing the fractionhsprayIrreducible ratio of sprays from numerator and denominator; alias of (^/^)hsprayIrreducible ratio of sprays from numerator and denominator; alias of (%//%)hsprayDivision of a ratio of sprays by a spray; the result is an irreducible fractionhspray/Whether a ratio of sprays is constant; same as &hsprayWhether a ratio of sprays actually is polynomial, that is, whether its denominator is a constant spray (and then it should be the unit spray) x = qlone 1 y = qlone 2p = x^**^4 ^-^ y^**^4 q = x ^-^ y$isPolynomialRatioOfSprays $ p %//% qTrue#isPolynomialRatioOfSprays $ p %:% qFalsehsprayThe null ratio of sprayshsprayThe null ratio of sprayshsprayThe unit ratio of sprayshsprayThe unit ratio of sprayshsprayConstant ratio of sprayshspray%Evaluates a ratio of sprays; same as "hspray9Substitutes some variables in a ratio of sprays; same as $hspray$Coerces a spray to a ratio of sprayshspray4Converts a ratio of polynomials to a ratio of sprayshsprayConverts a ratio of rational polynomials to a ratio of rational sprays; this is not a specialization of  because RatioOfQPolynomials is RatioOfPolynomials a with  a = Rational' , not with  a = RationalhsprayGeneral function to print a  objecthspray2Prints a ratio of sprays with numeric coefficientshspray3Prints a ratio of sprays with rational coefficientshspray2Prints a ratio of sprays with numeric coefficientshspray2Prints a ratio of sprays with numeric coefficientshspray3Prints a ratio of sprays with rational coefficientshspray3Prints a ratio of sprays with rational coefficientshsprayPrints a ratio of sprays hsprayPrints a ratio of sprays hsprayPrints a ratio of sprays hsprayPrints a ratio of sprays hspray3Prints a ratio of sprays with rational coefficientshspray3Prints a ratio of sprays with rational coefficientsprettyRatioOfQSprays rOS == prettyRatioOfQSpraysXYZ ["x","y","z"] rOShspray3Prints a ratio of sprays with rational coefficientsprettyRatioOfQSprays' rOS == prettyRatioOfQSpraysXYZ ["X","Y","Z"] rOShsprayPrints a ratio of sprays with rational coefficients, printing the monomials in the style of "x1^2.x2.x3^3"hspray2Prints a ratio of sprays with numeric coefficientshspray2Prints a ratio of sprays with numeric coefficientsprettyRatioOfNumSprays rOS == prettyRatioOfNumSpraysXYZ ["x","y","z"] rOShspray2Prints a ratio of sprays with numeric coefficientsprettyRatioOfNumSprays' rOS == prettyRatioOfNumSpraysXYZ ["X","Y","Z"] rOShsprayPrints a ratio of sprays with numeric coefficients, printing the monomials in the style of "x1^2.x2.x3^3"hspray*Number of parameters in a parametric spray'numberOfParameters (jacobiPolynomial 4)2hsprayApply polynomial transformations to the parameters of a parametric spray; e.g. you have a two-parameters polynomial P_{a, b}(X, Y, Z) and you want to get P_{a^2, b^2}(X, Y, Z)$, or the one-parameter polynomial P_{a, a}(X, Y, Z)jp = jacobiPolynomial 4 a = qlone 1 b = qlone 2$changeParameters jp [a^**^2, b^**^2]hspray?Substitutes some values to the parameters of a parametric sprayjacobi3 = jacobiPolynomial 3*legendre3 = substituteParameters jp [0, 0]hspray'helper function for evalParametricSprayhspray>Substitutes some values to the variables of a parametric sprayhsprayWhether the coefficients of a parametric spray polynomially depend on their parameters; I do not know why, but it seems to be the case for the Jacobi polynomials 5canCoerceToSimpleParametricSpray (jacobiPolynomial 8)TruehsprayCoerces a parametric spray to a simple parametric spray, without checking this makes sense with hsprayCoerces a parametric spray to a simple parametric spray, after checking this makes sense with hspray?Converts a `OneParameterSpray a` spray to a `ParametricSpray a`hspray Converts a  spray to a hsprayConverts a parametric spray to a one-parameter spray, without checking the conversion makes sensehsprayConverts a rational parametric spray to a rational one-parameter spray, without checking the conversion makes sensehspray 4https://en.wikipedia.org/wiki/Gegenbauer_polynomialsGegenbauer polynomials5; we mainly provide them to give an example of the SimpleParametricSpray typegp = gegenbauerPolynomial 3*putStrLn $ prettySimpleParametricQSpray gp8{ (4/3)*a^3 + 4*a^2 + (8/3)*a }*X^3 + { -2*a^2 - 2*a }*X7putStrLn $ prettyQSpray'' $ substituteParameters gp [1] 8*X^3 - 4*Xhspray 0https://en.wikipedia.org/wiki/Jacobi_polynomialsJacobi polynomial; the n;-th Jacobi polynomial is a univariate polynomial of degree n, with two parameters, except for the case n=0 where it has no parameterhsprayPretty form of a parametric rational spray, using some given strings (typically some letters) to denote the parameters and some given strings (typically some letters) to denote the variables type PQS = ParametricQSpray:{/f :: (QSpray, QSpray) -> (PQS, PQS, PQS) -> PQSf (a, b) (x, y, z) =(a %:% (a ^+^ b)) *^ x^**^2 ^+^ (b %:% (a ^+^ b)) *^ (y ^*^ z):} a = qlone 1 b = qlone 2x = lone 1 :: PQSy = lone 2 :: PQSz = lone 3 :: PQSpqs = f (a, b) (x, y, z)putStrLn $ prettyParametricQSprayABCXYZ ["a","b"] ["X","Y","Z"] pqs;{ [ a ] %//% [ a + b ] }*X^2 + { [ b ] %//% [ a + b ] }*Y.Zhspray*Pretty form of a parametric rational sprayhsprayPretty form of a simple parametric rational spray, using some given strings (typically some letters) to denote the parameters and some given strings (typically some letters) to denote the variables "type SPQS = SimpleParametricQSpray:{3f :: (QSpray, QSpray) -> (SPQS, SPQS, SPQS) -> SPQSf (a, b) (x, y, z) =:(a ^+^ b) *^ x^**^2 ^+^ (a^**^2 ^+^ b^**^2) *^ (y ^*^ z):} a = qlone 1 b = qlone 2x = lone 1 :: SPQSy = lone 2 :: SPQSz = lone 3 :: SPQSspqs = f (a, b) (x, y, z)putStrLn $ prettySimpleParametricQSprayABCXYZ ["a","b"] ["X","Y","Z"] spqs!{ a + b }*X^2 + { a^2 + b^2 }*Y.Zhspray1Pretty form of a simple parametric rational sprayhspray permutation hspray+the object whose variables will be permutedhspray"the object with permuted variables hspray;the indices of the variables to be swapped (starting at 1) hspray*the object whose variables will be swappedhspray!the object with swapped variables!hspray8index of the variable of differentiation (starting at 1)hspraythe object to be derivatedhspraythe derivated object%hspray%object with variables such as a sprayhspraylist of new variables4hspray&a string to denote the variable, e.g. "a" 5hspray>string (usually a single letter) to denote the variable, e.g. "a"6hspray,the value at which the evaluation is desired7hspray2string to denote the parameter of the spray, e.g. "a"hspray7typically a letter, to denote the non-indexed variableshspraya one-parameter spray; note that this function does not simplify it8hspray2string to denote the parameter of the spray, e.g. "a"hspray4typically some letters, to denote the main variableshspraya one-parameter spray; note that this function does not simplify it9hspray2string to denote the parameter of the spray, e.g. "a"hspraya one-parameter spray; note that this function does not simplify it:hspray2string to denote the parameter of the spray, e.g. "a"hspraya one-parameter spray; note that this function does not simplify it;hspray=usually a letter, to denote the parameter of the spray, e.g. "a"hsprayusually a letter, to denote the non-indexed variables of the sprayhspraya one-parameter rational spray; note that this function does not simplify it<hspray=usually a letter, to denote the parameter of the spray, e.g. "a"hspray:usually some letters, to denote the variables of the sprayhspraya one-parameter rational spray; note that this function does not simplify it=hspray=usually a letter, to denote the parameter of the spray, e.g. "a"hspraythe one-parameter rational spray to be printed; note that this function does not simplify it>hspray=usually a letter, to denote the parameter of the spray, e.g. "a"hspraythe one-parameter rational spray to be printed; note that this function does not simplify it@hspray#one-parameter spray to be evaluatedhspraya value for the parameterhspraysome values for the variables Vhspray6function mapping a coefficient to a string, typically hspray*pair of braces to enclose the coefficientshsprayfunction mapping a list of exponents to a list of strings representing the monomials corresponding to these exponentshspraythe spray to be printedWhspray6function mapping a coefficient to a string, typically hspray:used to enclose the coefficients, usually a pair of braceshspray.typically some letters, to print the variableshspraythe spray to be printedXhspray6function mapping a coefficient to a string, typically hspray.typically some letters, to print the variableshspraythe spray to be printedYhspray.typically some letters, to print the variableshspraythe spray to be printedZhspray6function mapping a coefficient to a string, typically hspray used to enclose the coefficientshspray6typically a letter, to print the non-indexed variableshspraythe spray to be printed[hspray1function mapping a coefficient to a string, e.g. hspray6typically a letter, to print the non-indexed variableshspraythe spray to be printed\hspray6typically a letter, to print the non-indexed variableshspraythe spray to be printed_hspray)a string denoting the variables, e.g. "x"hspray the spray`hsprayfunction mapping a list of monomial exponents to a list of strings representing the monomialshspray3function mapping a positive coefficient to a stringahsprayusually a letter such as "x"$ to denote the non-indexed variablesbhspray,usually some letters, denoting the variableschsprayfunction printing monomialsdhsprayfunction mapping a list of monomials exponents to a list of stringsehsprayusually a letter such as "x"%, to denote the non-indexed variablesfhsprayusually a letter such as "x"%, to denote the non-indexed variablesghspray-usually some letters, to denote the variableshhspray-usually some letters, to denote the variablesuhspray dividend hspraydivisorhspray(quotient, remainder)whspraylist of sprays hspray#whether to return the reduced basisxhspraynumber of variableshsprayindexyhspraynumber of variableshspraypower~hsprayindicator of the variable with respect to which the resultant is desired (e.g. 1 for x)hsprayindicator of the variable with respect to which the subresultants are desired (e.g. 1 for x)hsprayindicator of the variable with respect to which the resultant is desired (e.g. 1 for x)hspraynumber of variableshsprayAhsprayBhspray)(c, (Q, R)) such that c^*^A = B^*^Q ^+^ Rhsprayfunction which prints a pair of sprays that will be applied to the numerator and the denominatorhspray;pair of braces to enclose the numerator and the denominatorhsprayrepresents the quotient barhspray6function mapping a coefficient to a string, typically hspray:used to enclose the coefficients, usually a pair of braceshspray.typically some letters, to print the variableshspraythe two sprays to be printedhspray6function mapping a coefficient to a string, typically hspray:used to enclose the coefficients, usually a pair of braceshspray6typically a letter, to print the non-indexed variableshspraythe two sprays to be printedhspray3function mapping a positive coefficient to a stringhsprayprints the monomialshspraythe two sprays to be printedhsprayprints the monomialshspraythe two sprays to be printedhspray3function mapping a positive coefficient to a stringhspray.typically some letters, to print the variableshspraythe two sprays to be printedhspray.typically some letters, to print the variableshspraythe two sprays to be printedhspray3function mapping a positive coefficient to a stringhspray5typically a letter, to print the non-indexed variablehspraythe two sprays to be printedhspray6typically a letter, to print the non-indexed variableshspraythe two sprays to be printedhspray3function mapping a positive coefficient to a stringhsprayprints the monomialshspray;pair of braces to enclose the numerator and the denominatorhsprayrepresents the quotient barhsprayprints the monomialshspray;pair of braces to enclose the numerator and the denominatorhsprayrepresents the quotient barhspray3function mapping a positive coefficient to a stringhspray.typically some letters, to print the variableshspray;pair of braces to enclose the numerator and the denominatorhsprayrepresents the quotient barhspray3function mapping a positive coefficient to a stringhspray*typically a letter, to print the variableshspray;pair of braces to enclose the numerator and the denominatorhsprayrepresents the quotient barhspray.typically some letters, to print the variableshspray;pair of braces to enclose the numerator and the denominatorhsprayrepresents the quotient barhspray*typically a letter, to print the variableshspray;pair of braces to enclose the numerator and the denominatorhsprayrepresents the quotient barhspray2typically some letters, to represent the variableshspray6function mapping a coefficient to a string, typically hspray:used to enclose the coefficients, usually a pair of braceshspray;pair of braces to enclose the numerator and the denominatorhsprayrepresents the quotient barhspray2typically some letters, to represent the variableshspray6function mapping a coefficient to a string, typically hspray.typically a letter, to represent the variableshspray6function mapping a coefficient to a string, typically hspray:used to enclose the coefficients, usually a pair of braceshspray;pair of braces to enclose the numerator and the denominatorhsprayrepresents the quotient barhspray.typically a letter, to represent the variableshspray6function mapping a coefficient to a string, typically hspray2typically some letters, to represent the variableshspray:typically a letter, to represent the non-indexed variableshspray2typically some letters, to represent the variableshspray.typically a letter, to represent the variableshspray;usually some letters, to denote the parameters of the sprayhspray:usually some letters, to denote the variables of the sprayhspraya parametric rational sprayhspray;usually some letters, to denote the parameters of the sprayhspray:usually some letters, to denote the variables of the sprayhspraya parametric rational spray" !#$%&'()  HIJKLFGBCDE]^_Y\VWXZ[`cdaefbghmnijkl,54-./01236789:;<=>?@AMNOoPRTQutwvxyz~|}+*UpSs{qr" !#$%&'()  HIJKLFGBCDE]^_Y\VWXZ[`cdaefbghmnijkl,54-./01236789:;<=>?@AMNOoPRTQutwvxyz~|}+*UpSs{qr *7+7-7B6C6D7E8F7G77777      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~%hspray-0.3.0.0-7le8Il8QAXf6vVBufLuuZvMath.Algebra.HsprayhsprayParametricQSprayParametricSpraySimpleParametricQSpraySimpleParametricSprayRatioOfQSprays RatioOfSprays _numerator _denominatorQSpray'QSpraySprayMonomialPowers exponents nvariablesOneParameterQSprayOneParameterSprayRatioOfQPolynomials QPolynomialRatioOfPolynomials PolynomialQ Rational'A HasVariablesBaseRing VariablesTypenumberOfVariablespermuteVariables swapVariables derivativeevaluate evaluateAt substitutechangeVariables isConstant isUnivariate isBivariate isTrivariate/>.^scalarQ*. constPolypolyFromCoeffs soleParameter constQPolyqpolyFromCoeffsqsoleParameterprettyRatioOfQPolynomialsprettyRatioOfPolynomialsevalRatioOfPolynomialsprettyOneParameterSprayX1X2X3prettyOneParameterSprayXYZprettyOneParameterSprayprettyOneParameterSpray'prettyOneParameterQSprayX1X2X3prettyOneParameterQSprayXYZprettyOneParameterQSprayprettyOneParameterQSpray'evalOneParameterSprayevalOneParameterSpray'evalOneParameterSpray''^+^^-^^*^^**^*^/^loneqlone unitSpray zeroSpray constantSpraygetCoefficientgetConstantTermisConstantSpray evalSprayevalSpraySpraysubstituteSprayfromRationalSpray composeSprayfromList showSpray showSprayXYZ showSprayXYZ'prettySprayXYZshowSprayX1X2X3showSprayX1X2X3'prettySprayX1X2X3 prettySpray prettySpray' prettySpray'' showNumSprayprettyNumSprayX1X2X3prettyNumSprayXYZ showQSpray showQSpray'prettyQSprayX1X2X3prettyQSprayX1X2X3'prettyQSprayXYZprettyQSprayXYZ' prettyQSprayprettyQSpray'' prettyQSpray'prettyQSpray'''prettyNumSprayprettyNumSpray' sprayTermstoList bombieriSpraycollinearSprays leadingTermsprayDivisionRemainder sprayDivisionreduceGroebnerBasisgroebner esPolynomial psPolynomialisSymmetricSprayisPolynomialOf resultant1subresultants1 resultant subresultants resultant'gcdSpray detLaplace detLaplace'characteristicPolynomial%:%%//%^/^%/%isConstantRatioOfSpraysisPolynomialRatioOfSprayszeroRatioOfSprayszeroROSunitRatioOfSpraysunitROSconstantRatioOfSpraysevalRatioOfSprayssubstituteRatioOfSpraysasRatioOfSpraysfromRatioOfPolynomialsfromRatioOfQPolynomialsshowRatioOfSpraysshowRatioOfNumSpraysshowRatioOfQSpraysshowRatioOfSpraysXYZshowRatioOfSpraysXYZ'showRatioOfSpraysX1X2X3showRatioOfSpraysX1X2X3'prettyRatioOfQSpraysXYZprettyRatioOfQSpraysprettyRatioOfQSprays'prettyRatioOfQSpraysX1X2X3prettyRatioOfNumSpraysXYZprettyRatioOfNumSpraysprettyRatioOfNumSprays'prettyRatioOfNumSpraysX1X2X3numberOfParameterschangeParameterssubstituteParametersevalParametricSpray canCoerceToSimpleParametricSprayasSimpleParametricSprayUnsafeasSimpleParametricSprayfromOneParameterSprayfromOneParameterQSpray"parametricSprayToOneParameterSpray$parametricQSprayToOneParameterQSpraygegenbauerPolynomialjacobiPolynomialprettyParametricQSprayABCXYZprettyParametricQSpray"prettySimpleParametricQSprayABCXYZprettySimpleParametricQSpray$fCA$fHasVariablesT$fCTT$fCAT$fHasVariablesT0$fHashablePowers $fEqPowers $fCHashMap $fCaHashMap $fCaHashMap0 $fCHashMap0$fHasVariablesHashMap $fCTHashMap$fCRatioOfSprays$fCRatioOfSprays0$fCHashMapRatioOfSprays$fCHashMapRatioOfSprays0$fCaRatioOfSprays$fCaRatioOfSprays0$fCRatioOfSprays1$fEqRatioOfSprays$fHasVariablesRatioOfSprays $fCaHashMap1 $fCaHashMap2$fCHashMapHashMap$fCHashMapHashMap0 $fCaHashMap3 $fCaHashMap4$fShowRatioOfSprays $fShowPowers$fEqA$fShowA$fCA0$fCA1$fCA2polynomialToSprayshowRatioOfPolynomialsshowQpolshowQpolysRatioevalOneParameterMonomial growSequence harmonizesimplifyPowers addSprays negateSpray scaleSpray multMonomial multSprays simplifySprayremoveZeroTerms cleanSpray isZeroSprayevalSprayHelper fromMonomialshowMonomialsOldshowMonomialX1X2X3showMonomialsX1X2X3showMonomialXYZshowMonomialsXYZ showRatio showRatio'maxIndexdividesquotientsprayDivisionRemainder' groebner00 groebner0combinationsOfpermutationsBinarySequencesylvesterMatrixsylvesterMatrix'sprayCoefficientssprayCoefficients'degreedegreeAndLeadingCoefficientpseudoDivision gcdKX1dotsXn exactDivisionirreducibleFractionadjustFractionshowRatioOfNumSpraysXYZshowRatioOfNumSpraysX1X2X3showRatioOfQSpraysXYZshowRatioOfQSpraysX1X2X3 evalMonomial'baseGHC.ShowshowshowTwoSpraysXYZshowTwoSpraysX1X2X3showTwoNumSpraysshowTwoQSpraysshowTwoNumSpraysXYZshowTwoQSpraysXYZshowTwoNumSpraysX1X2X3showTwoQSpraysX1X2X3