Homogeneous sum of squares representation (source code)

= Homogeneous sum of squares representation

If a degree-$2d$ <homogeneous polynomial> is a <sum of squares polynomial>, it has a representation as squares of degree-$d$ <homogeneous polynomials>. In any sum of squares, the highest-degree terms cannot cancel, since their homogeneous part is itself a sum of squares. Likewise the lowest nonzero degree cannot cancel. Thus every nonzero summand has only degree $d$.