simplify/siderels
simplify with respect to side relations
Calling Sequence
Parameters
Description
Examples
References
simplify(expr, eqns)
simplify(expr, eqns, vars)
simplify(expr, eqns, tord)
simplify(expr, eqns, 'mindeg')
expr
-
expression
eqns
set or list of equations (an expression e is understood as the equation e=0)
vars
(optional) set or list of variables appearing in eqns
tord
(optional) a monomial order in the variables appearing in eqns
Simplification of expr with respect to the side relations eqns is performed. The result is an expression which is mathematically equivalent to expr but which is in normal form with respect to the specified side relations.
In all cases simplify computes a Groebner basis for the set of side relations. This basis contains all the algebraic consequences of eqns, so that if an expression can be rewritten in terms of the relations simplify will reduce it to zero. Otherwise, simplify returns a remainder in which none of the terms are reducible.
To ensure a finite division process simplify imposes a total order on terms which can appear. This order, called a monomial order, is used for both the Groebner basis computation and the division. The monomial order can be specified by an optional third argument, and different orders can drastically affect a non-zero result:
If a list of variables vars is specified then pure lexicographic (plex) order is used and the leftmost variables are eliminated first.
If a set of variables vars is given then a total degree (tdeg) order is used and terms with the highest degree in all the variables are eliminated first. Terms with the same total degree are ordered heuristically.
If no third argument was specified then lexicographic order is used and variables appearing on the left hand side of any equation in eqns are eliminated first.
If a monomial order tord is specified then that order is used for all computations. See Groebner[MonomialOrders] for a list of the available monomial orders.
If expr is a rational expression then one of three algorithms can be used. If a list or set of variables vars is specified or if the third argument is omitted then simplification is applied to the numerator and denominator separately. This method is very fast, however no attempt is made to simplify the ratio of the numerator and denominator so simpler representations of the fraction may be missed.
If a monomial order tord is specified then the largest monomial appearing in the numerator and denominator is minimized with respect to tord. The result is a simplified canonical form with respect to the monomial order. Note that in some cases a common factor may be introduced to satisfy this requirement, as in example 2 below. If the denominator is invertible or if it divides the numerator modulo the side relations then a quotient is computed and it is returned instead.
The optional argument mindeg minimizes the sum of the degrees of the resulting fraction. It uses a global search to find an equivalent fraction ab with deg⁡a+deg⁡b minimal. The result is not canonical, but in some cases the output may be preferable to a canonical form, as in example 3 below. In general the search is exponential time in deg⁡a+deg⁡b.
If the expression is neither a polynomial nor a rational function in the variables, simplify will recurse on the input expr and apply the normalization to any subexpressions which are rational functions in the variables.
Example 1: trigonometric polynomials
eqns≔sin⁡x2+cos⁡x2=1:
e≔sin⁡x3−11⁢sin⁡x2⁢cos⁡x+3⁢cos⁡x3−sin⁡x⁢cos⁡x+2
simplify⁡e,eqns
14⁢cos⁡x3−cos⁡x2⁢sin⁡x+−sin⁡x−11⁢cos⁡x+sin⁡x+2
simplify⁡e,eqns,sin⁡x,cos⁡x
simplify⁡e,eqns,cos⁡x,sin⁡x
−14⁢sin⁡x2−sin⁡x+3⁢cos⁡x+sin⁡x3+2
f≔8⁢sin⁡x4⁢cos⁡x+15⁢sin⁡x2⁢cos⁡x3−15⁢sin⁡x2⁢cos⁡x+7⁢cos⁡x5−14⁢cos⁡x3+7⁢cos⁡x
simplify⁡f,eqns
0
r≔1−cos⁡x2+sin⁡x⁢cos⁡xsin⁡x⁢cos⁡x+cos⁡x2
simplify⁡r,eqns
1−cos⁡x2+sin⁡x⁢cos⁡xcos⁡x⁢cos⁡x+sin⁡x
simplify⁡r,eqns,mindeg
sin⁡xcos⁡x
Example 2: reducing fractions to a canonical form
eqns2≔x⁢y5−x−y
r≔y5+x+yx−y
simplify⁡r,eqns2,tdeg⁡x,y
x+1⁢x+yx⁢x−y
simplify⁡r,eqns2,plex⁡x,y
−y4⁢y5+y−1y5−2
simplify⁡r,eqns2,mindeg
r2≔−x3−y⁢x2−x4−y⁢x3+2⁢x⁢y4+2⁢y4+y5+x+yy⁢x3−x4+2⁢x⁢y4−4+x−y
r2≔2⁢x⁢y4+y5−x4−y⁢x3+2⁢y4−x3−y⁢x2+x+y2⁢x⁢y4−x4+y⁢x3+x−y−4
simplify⁡r2,eqns2
−2⁢x⁢y4−y5+x4+y⁢x3−2⁢y4+x3+y⁢x2−x−y−2⁢x⁢y4+x4−y⁢x3−x+y+4
simplify⁡r2,eqns2,tdeg⁡x,y
Example 3: the canonical form algorithm may increase total degree
eqns3≔x5+x⁢y−1
r≔x3⁢y3−x4+x−1x2−y2+1
simplify⁡r,eqns3,tdeg⁡x,y
x3+y−1⁢x2+−y4−1⁢x+y3x2⁢x2−y2+1
simplify⁡r,eqns3,mindeg
x3⁢y3−x4+x−1x2−y2+1
Example 4: the side relations define a field
eqns4≔x+y=z,z3−z2−z⁢y+2⁢y2=1,z3+y2=1,z2+z⁢y−y2=0
eqns4≔x+y=z,z3+y2=1,−y2+z⁢y+z2=0,z3+2⁢y2−z⁢y−z2=1
h1≔36⁢z4⁢y2+36⁢z⁢y4−36⁢z⁢y2−12⁢z2+z⁢y−12⁢y2+12⁢x⁢z−12⁢x⁢y+23⁢z4+43⁢z3⁢y−23⁢z2⁢y2−43⁢z⁢y3+23⁢y4
simplify⁡h1,eqns4
h2≔z⁢y2+z3⁢y3−3⁢z2⁢y+233+56⁢z2+73⁢z⁢y−116⁢y2+12⁢x⁢z−12⁢x⁢y+23⁢z4+43⁢z3⁢y−23⁢z2⁢y2−43⁢z⁢y3+23⁢y4
h2≔z⁢y2+y3⁢z3−3⁢z2⁢y+233+56⁢z2+73⁢z⁢y−116⁢y2+12⁢x⁢z−12⁢x⁢y+23⁢z4+43⁢z3⁢y−23⁢z2⁢y2−43⁢z⁢y3+23⁢y4
simplify⁡h2,eqns4,x,y,z
−343+2⁢8−17⁢y⁢z2+2⁢4+7⁢y⁢z+13⁢y
simplify⁡h2,eqns4,lexdeg⁡x,z,y
293−y5−2⁢y2
h2inv≔simplify⁡1h2,eqns4,tdeg⁡x,z,y
h2inv≔447375252342772565971+252548433⁢y342772565971+815384160⁢y242772565971+9⁢35711723+4097948⁢z⁢y42772565971+236183994⁢z42772565971
simplify⁡h2⁢h2inv,eqns4
1
Example 5: a difficult example that can not be handled by other methods
eqns5≔y2−x3+x⁢y−1
eqns5≔−x3+x⁢y+y2−1
algcurvesparametrization⁡op⁡eqns5,x,y,t
Error, (in `algcurves/ratpar`) genus is not zero
r≔−y3+1−2⁢y⁢x2−x2⁢y5−2⁢x⁢y2−y6⁢x−y7+y6y3−2⁢y2+1
r≔−x2⁢y5−x⁢y6−y7+y6−2⁢y⁢x2−2⁢y2⁢x−y3+1y3−2⁢y2+1
simplify⁡r,eqns5,tdeg⁡x,y
y5+x+yx−y
Cox, D.; Little, J.; and O'Shea, D. Ideals, Varieties, and Algorithms. 2nd ed. Springer-Verlag, 1997.
Monagan, M., and Pearce, R. "Rational Simplification Modulo a Polynomial Ideal." ISSAC 2006 proceedings.
See Also
algcurves[parametrization]
Groebner[Basis]
Groebner[MonomialOrders]
Groebner[NormalForm]
Download Help Document