f = g
Two rational functions f and g are equal if the product Numerator(f )*Denominator(g ) equals Numerator(g )*Denominator(f ).
gap> x:=Indeterminate(Rationals,"x");;y:=Indeterminate(Rationals,"y");; gap> f:=3+x*y+x^5;;g:=5+x^2*y+x*y^2;; gap> a:=g/f;; gap> b:=(g*f)/(f^2);; gap> a=b; true
f < g
The ordering of rational functions is defined in several steps. Monomials (products of indeterminates) are sorted first by total-degree and then lexicographically (see MonomialTotalDegreeLess). Products of monomials with ring elements (``terms'') are compared first by their monomials and then by their coefficients.
gap> x<y; true gap> x^2*y<x*y^2; true gap> x*y<x^2*y; true gap> x^2*y < 5* y*x^2; truePolynomials are compared by comparing the largest terms in turn until they differ.
gap> x+y<y; false gap> x<x+1; trueRational functions are compared by comparing the polynomial Numerator(f )*Denominator(g ) with the polynomial Numerator(g )*Denominator(f ). (As the ordering of monomials used by GAP is invariant under multiplication this is independent of common factors in numerator and denominator.)
gap> f/g<g/f; false gap> f/g<(g*g)/(f*g); false
For univariate polynomials this reduces to an ordering first by total degree and then lexicographically on the coefficients.
[Top] [Previous] [Up] [Next] [Index]
GAP 4 manual