Symmetric polynomials, step by step
An algorithmic proof of the fundamental theorem of symmetric polynomials, with interactive examples from power sums to the discriminant.
A polynomial in is symmetric when permuting the variables leaves it unchanged: and are, is not, since swapping and turns it into . The fundamental theorem of symmetric polynomials says that, over a field , every symmetric polynomial can be written in exactly one way as a polynomial in a few basic ones, the elementary symmetric polynomials :
Here is the set , is the ring of symmetric polynomials in with coefficients in , and is a ring of polynomials in new variables. The equality says that every symmetric polynomial is a polynomial in the ; the isomorphism, which sends each to , that it is one in exactly one way.
The usual proof is an algorithm, and a short one. I first implemented it in 2022, in a SageMath archive notebook; here it runs in your browser.
The elementary symmetric polynomials
Fix , the number of variables. The elementary symmetric polynomial of degree is the sum of all the products of distinct variables,
and . With three variables, for instance,
and for every , as there are not enough variables to choose from.
Ordering the monomials
The algorithm needs to know which term of a polynomial comes first. A monomial is written , with , and monomials are ordered by the degree lexicographic order (deglex): first by total degree , then, between monomials of the same degree, by the exponent of , then by that of , and so on. So , and in general . The leading term of a non-zero polynomial is its term with the largest monomial, and that monomial is its leading monomial.
Deglex is not just any way of ordering monomials: it is a monomial order, that is, a total order on the monomials such that
- it is compatible with multiplication: if , then for every monomial ;
- it is a well-order: every non-empty set of monomials has a smallest element. Equivalently, there is no infinite strictly decreasing sequence of monomials .
Deglex has both properties. Multiplying by adds the same amount to the degrees of and and the same exponents to both, so neither comparison changes. And below any monomial there are only finitely many others, those of degree no larger than its own, so a strictly decreasing sequence has to stop.
The first property is what makes leading terms behave: the leading term of a product is the product of the leading terms. Every other product of a term of by a term of involves at least one smaller monomial, and multiplying keeps it smaller. The second property is what will make the algorithm stop.
One more fact is specific to symmetric polynomials: their leading monomial has non-increasing exponents, . If appears with , swapping and gives another monomial of the polynomial, and a larger one: so was not the leading monomial.
Cancelling the leading term
Let be symmetric, with leading term . The idea of the proof is to remove this term with a product of elementary symmetric polynomials: to find a finite sequence of exponents such that
has the same leading monomial . Then in the two leading terms cancel.
Since leading terms multiply, the leading term of is the product of those of its factors, and the leading term of is , with coefficient . The variable occurs in it exactly when , so
For this to be , the exponents have to match, and must solve a triangular system:
Subtracting each equation from the one above it leaves , and the last one gives . So there is exactly one candidate, which we call :
It is a valid sequence of exponents, with no negative entries, exactly when , which is what the leading monomial of a symmetric polynomial always satisfies. For instance, with and leading monomial , gives , and indeed has leading monomial .
The algorithm
Given a symmetric polynomial :
- if is or a constant, it already is a polynomial in the , and there is nothing to do;
- otherwise, let be its leading term in deglex, and . Then is plus the expression in the of , where is expanded in the ; this one is found by running the algorithm again.
The polynomial is still symmetric, being a difference of symmetric polynomials, and its leading monomial is smaller than : the two leading terms cancel, and every other term of and of has a smaller monomial. Running the algorithm thus produces symmetric polynomials whose leading monomials strictly decrease. Deglex being a well-order, such a sequence cannot go on forever: after finitely many steps what is left is , and the terms collected along the way add up to .
The expression is also unique. Suppose for two polynomials . Their difference then satisfies , and it is enough to show that this forces , that is, that no non-zero polynomial vanishes when the are substituted for its variables (the are algebraically independent). Write
where is the finite set of exponents whose coefficient is not zero, and suppose is not empty. Each has leading term , with coefficient and , and distinct give distinct , since is recovered from as . Among the finitely many monomials with there is therefore a largest one, , reached by a single . It occurs in with coefficient ; every other has only monomials up to its own leading monomial , which is smaller than , so it does not contain at all. The coefficient of in is then , against . So is empty, , and .
The calculator below shows each step: the leading term, and , and what is left, . To keep long polynomials readable, they are grouped into orbits: is the sum of the distinct monomials whose exponents are a rearrangement of , so that with
A polynomial is symmetric exactly when it is a combination of the , with ; the calculator lists them from the largest down, so the first one contains the leading term. The calculator also computes this way: it never expands a product , but multiplies by each directly on the coefficients of the orbits.
Try it
Write x_1 or x1, with + - * / ^ and brackets; 2x1x2 is a product too. e(k), p(k) and h(k) are the elementary, power sum and complete homogeneous polynomials of degree .
The polynomial must be symmetric. If it is not, the algorithm cannot end successfully: if it did, the polynomial would be a combination of symmetric polynomials, and so symmetric itself, ↯. The Not symmetric example shows where it breaks down: sooner or later the leading term has exponents that are not in non-increasing order, has a negative entry, and no product of the has that leading term.
Sums of powers
For the power sums there is a more direct route, the Newton–Girard identities archive. They give , for , in terms of the and of the previous power sums:
where for every (and , since ). Computing , then , and so on up to , each from the ones before it, gives one expression; the general algorithm applied to gives another. By uniqueness they must be the same polynomial, and their difference is indeed zero:
Try it
The discriminant
Now let
have roots in , each listed as many times as its multiplicity, so that . The discriminant of is the product
and it tells whether has a repeated root:
It is easy to check that is a symmetric polynomial in the roots. Every permutation is a composition of transpositions, so it is enough to check that swapping two roots and leaves it unchanged:
- the factors that contain neither of them are untouched;
- the factors that contain only one of them are exchanged in pairs, with , at most with the sign of the base changed, which the square takes away;
- the factor that contains both changes the sign of its base, becoming , and is unchanged once squared.
So, by the fundamental theorem, can be written in exactly one way in terms of the elementary symmetric polynomials of the roots. But these are nothing but the coefficients of , up to sign: expanding and comparing with ,
for , with . Running the algorithm on and substituting for each thus gives the discriminant of every monic polynomial of degree in terms of its coefficients, without knowing its roots. For it is the familiar ; for ,
which for reduces to .
A polynomial whose leading coefficient is not has the same roots as , which is monic; its discriminant is usually defined as . The factor makes it a polynomial in with integer coefficients, and it is zero exactly when is.
Below, the formula for the degree of the polynomial you type is computed with the algorithm and then evaluated at its coefficients. The first example, , has a double root, so its discriminant is zero; the second, , has three distinct roots, and a discriminant that is not zero.
Try it
Rational coefficients; products and powers are expanded, as in (x - 1)^2 (x + 3).