# Wolfram Language & System 10.0 (2014)|Legacy Documentation

# Polynomial Orderings

The leading term of a polynomial can be chosen in many different ways. For multivariate polynomials, sorting by the total degree of the monomials is often useful.

MonomialList[poly] | get the list of monomials |

CoefficientRules[poly] | represent the monomials by exponent vectors and coefficients |

FromCoefficientRules[list] | construct a polynomial from a list of rules |

Different representations of polynomials.

In[1]:= |

Out[1]= |

In[2]:= |

Out[2]= |

In[3]:= |

Out[3]= |

In[4]:= |

Out[4]= |

In[5]:= |

Out[5]= |

If the second argument to MonomialList or CoefficientRules is omitted, the variables are taken in the order in which they are returned by the function Variables.

In[6]:= |

Out[6]= |

In[7]:= |

Out[7]= |

In[8]:= |

Out[8]= |

By default, the monomials are sorted lexicographically and given in the decreasing order. In the previous example, (corresponding to ) is taken to precede (corresponding to ) by the second element.

An order is described by defining how two vectors of exponents and are sorted. For the lexicographic order,

An order can also be described by giving a weight matrix. In that case the exponent vectors are multiplied by the weight matrix and the results are sorted lexicographically, also in the decreasing order. The matrices for different orderings are given as follows.

Weight matrices corresponding to different orderings.

For functions such as GroebnerBasis and PolynomialReduce, it is necessary that the order be well-founded, which ensures that any decreasing sequence of elements is finite (the elements being the vectors of non-negative exponents). In order for that condition to hold, the first nonzero value in each column of the weight matrix must be positive.

The default sorting used for polynomial terms in an expression corresponds to the negative lexicographic ordering with variables sorted in the reversed order. This is commonly known as reverse lexicographic ordering.

In[9]:= |

Out[9]//FullForm= | |

In[10]:= |

Out[10]= |

In[11]:= |

Out[11]= |

In[12]:= |

Out[12]= |

In[13]:= |

Out[13]= |

TraditionalForm tries to arrange the terms in an order close to the lexicographic ordering.

In[14]:= |

Out[14]//TraditionalForm= | |

In[15]:= |

Out[15]= |

In[16]:= |

Out[16]= |

The option tells TraditionalForm which variables should be excluded from the ordering.

In[17]:= |

Out[17]//TraditionalForm= | |

In[18]:= |

Out[18]//TraditionalForm= | |

One can obtain additional orderings from the six orderings used in MonomialList simply by reversing the resulting list. This is effectively equivalent to negating the exponent vectors. In a commutative setting, one can also obtain other orderings by reversing the order of the variables.

This diagram illustrates the relations between various orderings. Red lines indicate reversing the list of variables and blue lines indicate negating the power vectors.