{
  "index": "1999-A-2",
  "type": "ALG",
  "tag": [
    "ALG",
    "ANA",
    "NT"
  ],
  "difficulty": "",
  "question": "Let $p(x)$ be a polynomial that is nonnegative for all real $x$.  Prove that\nfor some $k$, there are polynomials $f_1(x),\\dots,f_k(x$) such that\n\\[p(x) =  \\sum_{j=1}^k (f_j(x))^2.\\]",
  "solution": "First solution:\nFirst factor $p(x) = q(x) r(x)$, where $q$ has all real roots and $r$ has\nall complex roots. Notice that each root of $q$ has even\nmultiplicity, otherwise $p$ would have a sign change at that root.\nThus $q(x)$ has a square root $s(x)$.\n\nNow write $r(x) = \\prod_{j=1}^k (x - a_j)(x - \\overline{a_j})$\n(possible because $r$ has roots in complex conjugate pairs).\nWrite $\\prod_{j=1}^k (x - a_j) = t(x) + i u(x)$ with $t,x$\nhaving real coefficients. Then for $x$ real,\n\\begin{align*}\np(x) &= q(x) r(x) \\\\\n&= s(x)^2 (t(x) + iu(x)) (\\overline{t(x) + iu(x)}) \\\\\n&= (s(x)t(x))^2 + (s(x)u(x))^2.\n\\end{align*}\n(Alternatively, one can factor $r(x)$ as a product of quadratic\npolynomials with real coefficients, write each as a sum of squares, then\nmultiply together to get a sum of many squares.)\n\nSecond solution:\nWe proceed by induction on the degree of $p$, with base case where $p$\nhas degree 0. As in the first solution, we may reduce to a smaller degree\nin case $p$ has any real roots, so assume it has none. Then $p(x) > 0$\nfor all real $x$, and since $p(x) \\to \\infty$ for $x \\to \\pm \\infty$, $p$\nhas a minimum value $c$. Now $p(x) - c$ has real roots, so as above, we\ndeduce that $p(x) - c$ is a sum of squares. Now add one more square,\nnamely $(\\sqrt{c})^2$, to get $p(x)$ as a sum of squares.",
  "vars": [
    "x",
    "p",
    "q",
    "r",
    "s",
    "t",
    "u",
    "j",
    "a_j",
    "f_1",
    "f_j",
    "f_k"
  ],
  "params": [
    "k",
    "c"
  ],
  "sci_consts": [
    "i"
  ],
  "variants": {
    "descriptive_long": {
      "map": {
        "x": "realvar",
        "p": "polypos",
        "q": "realfact",
        "r": "complfact",
        "s": "sqrtpoly",
        "t": "realpart",
        "u": "imagpart",
        "j": "genericidx",
        "a_j": "rootcoef",
        "f_1": "squareone",
        "f_j": "squareidx",
        "f_k": "squaremax",
        "k": "polycount",
        "c": "minimval"
      },
      "question": "Let $polypos(realvar)$ be a polynomial that is nonnegative for all real $realvar$.  Prove that\nfor some $polycount$, there are polynomials $squareone(realvar),\\dots,squaremax(realvar$) such that\n\\[polypos(realvar) =  \\sum_{genericidx=1}^{polycount} (squareidx(realvar))^2.\\]",
      "solution": "First solution:\nFirst factor $polypos(realvar) = realfact(realvar) \\, complfact(realvar)$, where $realfact$ has all real roots and $complfact$ has\nall complex roots. Notice that each root of $realfact$ has even\nmultiplicity, otherwise $polypos$ would have a sign change at that root.\nThus $realfact(realvar)$ has a square root $sqrtpoly(realvar)$.\n\nNow write $complfact(realvar) = \\prod_{genericidx=1}^{polycount} (realvar - rootcoef)(realvar - \\overline{rootcoef})$\n(possible because $complfact$ has roots in complex conjugate pairs).\nWrite $\\prod_{genericidx=1}^{polycount} (realvar - rootcoef) = realpart(realvar) + i\\, imagpart(realvar)$ with $realpart,imagpart$\nhaving real coefficients. Then for $realvar$ real,\n\\begin{align*}\npolypos(realvar) &= realfact(realvar)\\, complfact(realvar) \\\\\n&= sqrtpoly(realvar)^2 \\bigl(realpart(realvar) + i\\, imagpart(realvar)\\bigr) \\bigl(\\overline{realpart(realvar) + i\\, imagpart(realvar)}\\bigr) \\\\\n&= \\bigl(sqrtpoly(realvar) \\, realpart(realvar)\\bigr)^2 + \\bigl(sqrtpoly(realvar)\\, imagpart(realvar)\\bigr)^2.\n\\end{align*}\n(Alternatively, one can factor $complfact(realvar)$ as a product of quadratic\npolynomials with real coefficients, write each as a sum of squares, then\nmultiply together to get a sum of many squares.)\n\nSecond solution:\nWe proceed by induction on the degree of $polypos$, with base case where $polypos$\nhas degree 0. As in the first solution, we may reduce to a smaller degree\nin case $polypos$ has any real roots, so assume it has none. Then $polypos(realvar) > 0$\nfor all real $realvar$, and since $polypos(realvar) \\to \\infty$ for $realvar \\to \\pm \\infty$, $polypos$\nhas a minimum value $minimval$. Now $polypos(realvar) - minimval$ has real roots, so as above, we\ndeduce that $polypos(realvar) - minimval$ is a sum of squares. Now add one more square,\nnamely $(\\sqrt{minimval})^2$, to get $polypos(realvar)$ as a sum of squares."
    },
    "descriptive_long_confusing": {
      "map": {
        "x": "pineapple",
        "p": "rainstorm",
        "q": "blackbird",
        "r": "snowflake",
        "s": "lighthouse",
        "t": "buttercup",
        "u": "windflower",
        "j": "honeycomb",
        "a_j": "dragonfly",
        "f_1": "blueberry",
        "f_j": "strawberry",
        "f_k": "raspberry",
        "k": "salamander",
        "c": "watermelon"
      },
      "question": "Let $rainstorm(pineapple)$ be a polynomial that is nonnegative for all real $pineapple$.  Prove that\nfor some $salamander$, there are polynomials $blueberry(pineapple),\\dots,raspberry(pineapple$) such that\n\\[\nrainstorm(pineapple) =  \\sum_{honeycomb=1}^{salamander} (strawberry(pineapple))^2.\n\\]",
      "solution": "First solution:\nFirst factor $rainstorm(pineapple) = blackbird(pineapple) snowflake(pineapple)$, where $blackbird$ has all real roots and $snowflake$ has\nall complex roots. Notice that each root of $blackbird$ has even\nmultiplicity, otherwise $rainstorm$ would have a sign change at that root.\nThus $blackbird(pineapple)$ has a square root $lighthouse(pineapple)$.\n\nNow write $snowflake(pineapple) = \\prod_{honeycomb=1}^{salamander} (pineapple - dragonfly)(pineapple - \\overline{dragonfly})$\n(possible because $snowflake$ has roots in complex conjugate pairs).\nWrite $\\prod_{honeycomb=1}^{salamander} (pineapple - dragonfly) = buttercup(pineapple) + i windflower(pineapple)$ with $buttercup,pineapple$\nhaving real coefficients. Then for $pineapple$ real,\n\\begin{align*}\nrainstorm(pineapple) &= blackbird(pineapple) snowflake(pineapple) \\\\\n&= lighthouse(pineapple)^2 (buttercup(pineapple) + i windflower(pineapple)) (\\overline{buttercup(pineapple) + i windflower(pineapple)}) \\\\\n&= (lighthouse(pineapple) buttercup(pineapple))^2 + (lighthouse(pineapple) windflower(pineapple))^2.\n\\end{align*}\n(Alternatively, one can factor $snowflake(pineapple)$ as a product of quadratic\npolynomials with real coefficients, write each as a sum of squares, then\nmultiply together to get a sum of many squares.)\n\nSecond solution:\nWe proceed by induction on the degree of $rainstorm$, with base case where $rainstorm$\nhas degree 0. As in the first solution, we may reduce to a smaller degree\nin case $rainstorm$ has any real roots, so assume it has none. Then $rainstorm(pineapple) > 0$\nfor all real $pineapple$, and since $rainstorm(pineapple) \\to \\infty$ for $pineapple \\to \\pm \\infty$, $rainstorm$\nhas a minimum value $watermelon$. Now $rainstorm(pineapple) - watermelon$ has real roots, so as above, we\ndeduce that $rainstorm(pineapple) - watermelon$ is a sum of squares. Now add one more square,\nnamely $(\\sqrt{watermelon})^2$, to get $rainstorm(pineapple)$ as a sum of squares."
    },
    "descriptive_long_misleading": {
      "map": {
        "x": "constantval",
        "p": "rationalfun",
        "q": "imagfactor",
        "r": "realpoly",
        "s": "squarepower",
        "t": "imaginaryterm",
        "u": "realterm",
        "j": "aggregate",
        "a_j": "peakvalue",
        "f_1": "lastfunction",
        "f_j": "specificfunc",
        "f_k": "firstfunction",
        "k": "infinitecount",
        "c": "maximumvalue"
      },
      "question": "Let $rationalfun(constantval)$ be a polynomial that is nonnegative for all real $constantval$.  Prove that\nfor some $infinitecount$, there are polynomials $lastfunction(constantval),\\dots,firstfunction(constantval$) such that\n\\[rationalfun(constantval) =  \\sum_{aggregate=1}^{infinitecount} (specificfunc(constantval))^2.\\]",
      "solution": "First solution:\nFirst factor $rationalfun(constantval) = imagfactor(constantval) realpoly(constantval)$, where $imagfactor$ has all real roots and $realpoly$ has\nall complex roots. Notice that each root of $imagfactor$ has even\nmultiplicity, otherwise $rationalfun$ would have a sign change at that root.\nThus $imagfactor(constantval)$ has a square root $squarepower(constantval)$.\n\nNow write $realpoly(constantval) = \\prod_{aggregate=1}^{infinitecount} (constantval - peakvalue)(constantval - \\overline{peakvalue})$\n(possible because $realpoly$ has roots in complex conjugate pairs).\nWrite $\\prod_{aggregate=1}^{infinitecount} (constantval - peakvalue) = imaginaryterm(constantval) + i realterm(constantval)$ with $imaginaryterm,constantval$\nhaving real coefficients. Then for $constantval$ real,\n\\begin{align*}\nrationalfun(constantval) &= imagfactor(constantval) realpoly(constantval) \\\\\n&= squarepower(constantval)^2 (imaginaryterm(constantval) + i realterm(constantval)) (\\overline{imaginaryterm(constantval) + i realterm(constantval)}) \\\\\n&= (squarepower(constantval)imaginaryterm(constantval))^2 + (squarepower(constantval)realterm(constantval))^2.\n\\end{align*}\n(Alternatively, one can factor $realpoly(constantval)$ as a product of quadratic\npolynomials with real coefficients, write each as a sum of squares, then\nmultiply together to get a sum of many squares.)\n\nSecond solution:\nWe proceed by induction on the degree of $rationalfun$, with base case where $rationalfun$\nhas degree 0. As in the first solution, we may reduce to a smaller degree\nin case $rationalfun$ has any real roots, so assume it has none. Then $rationalfun(constantval) > 0$\nfor all real $constantval$, and since $rationalfun(constantval) \\to \\infty$ for $constantval \\to \\pm \\infty$, $rationalfun$\nhas a minimum value $maximumvalue$. Now $rationalfun(constantval) - maximumvalue$ has real roots, so as above, we\ndeduce that $rationalfun(constantval) - maximumvalue$ is a sum of squares. Now add one more square,\nnamely $(\\sqrt{maximumvalue})^2$, to get $rationalfun(constantval)$ as a sum of squares."
    },
    "garbled_string": {
      "map": {
        "x": "qzxwvtnp",
        "p": "hjgrksla",
        "q": "mnlkpqrs",
        "r": "zdvtrnma",
        "s": "vbcnxlaq",
        "t": "rhuigywe",
        "u": "pkjasdle",
        "j": "twoduicb",
        "a_j": "fweoritz",
        "f_1": "lughnabx",
        "f_j": "zxcvbnml",
        "f_k": "poiuytre",
        "k": "qwerdfgh",
        "c": "aslkdjfh"
      },
      "question": "Let $hjgrksla(qzxwvtnp)$ be a polynomial that is nonnegative for all real $qzxwvtnp$.  Prove that\nfor some $qwerdfgh$, there are polynomials $lughnabx(qzxwvtnp),\\dots,poiuytre(qzxwvtnp$) such that\n\\[hjgrksla(qzxwvtnp) =  \\sum_{twoduicb=1}^{qwerdfgh} (zxcvbnml(qzxwvtnp))^2.\\]",
      "solution": "First solution:\nFirst factor $hjgrksla(qzxwvtnp) = mnlkpqrs(qzxwvtnp) zdvtrnma(qzxwvtnp)$, where $mnlkpqrs$ has all real roots and $zdvtrnma$ has\nall complex roots. Notice that each root of $mnlkpqrs$ has even\nmultiplicity, otherwise $hjgrksla$ would have a sign change at that root.\nThus $mnlkpqrs(qzxwvtnp)$ has a square root $vbcnxlaq(qzxwvtnp)$.\n\nNow write $zdvtrnma(qzxwvtnp) = \\prod_{twoduicb=1}^{qwerdfgh} (qzxwvtnp - fweoritz)(qzxwvtnp - \\overline{fweoritz})$\n(possible because $zdvtrnma$ has roots in complex conjugate pairs).\nWrite $\\prod_{twoduicb=1}^{qwerdfgh} (qzxwvtnp - fweoritz) = rhuigywe(qzxwvtnp) + i pkjasdle(qzxwvtnp)$ with $rhuigywe,qzxwvtnp$\nhaving real coefficients. Then for $qzxwvtnp$ real,\n\\begin{align*}\nhjgrksla(qzxwvtnp) &= mnlkpqrs(qzxwvtnp) zdvtrnma(qzxwvtnp) \\\\\n&= vbcnxlaq(qzxwvtnp)^2 (rhuigywe(qzxwvtnp) + i pkjasdle(qzxwvtnp)) (\\overline{rhuigywe(qzxwvtnp) + i pkjasdle(qzxwvtnp)}) \\\\\n&= (vbcnxlaq(qzxwvtnp) rhuigywe(qzxwvtnp))^2 + (vbcnxlaq(qzxwvtnp) pkjasdle(qzxwvtnp))^2.\n\\end{align*}\n(Alternatively, one can factor $zdvtrnma(qzxwvtnp)$ as a product of quadratic\npolynomials with real coefficients, write each as a sum of squares, then\nmultiply together to get a sum of many squares.)\n\nSecond solution:\nWe proceed by induction on the degree of $hjgrksla$, with base case where $hjgrksla$\nhas degree 0. As in the first solution, we may reduce to a smaller degree\nin case $hjgrksla$ has any real roots, so assume it has none. Then $hjgrksla(qzxwvtnp) > 0$\nfor all real $qzxwvtnp$, and since $hjgrksla(qzxwvtnp) \\to \\infty$ for $qzxwvtnp \\to \\pm \\infty$, $hjgrksla$\nhas a minimum value $aslkdjfh$. Now $hjgrksla(qzxwvtnp) - aslkdjfh$ has real roots, so as above, we\ndeduce that $hjgrksla(qzxwvtnp) - aslkdjfh$ is a sum of squares. Now add one more square,\nnamely $(\\sqrt{aslkdjfh})^2$, to get $hjgrksla(qzxwvtnp)$ as a sum of squares."
    },
    "kernel_variant": {
      "question": "Let $n\\ge 1$ and let \n\\[\n      p(x_1,\\dots ,x_n)\\;\\in\\;\\mathbb R[x_1,\\dots ,x_n],\\qquad \n      p\\not\\equiv 0,\n\\]\nbe a polynomial that satisfies  \n\\[\n      p(x_1,\\dots ,x_n)\\;\\ge\\;0\n      \\qquad\\text{for every }(x_1,\\dots ,x_n)\\in\\mathbb R^{\\,n}.\n\\]\n\nProve that there exist  \n\n$\\bullet$ an integer $N\\ge 0$, and  \n\n$\\bullet$ real–coefficient polynomials $F_1(x_1,\\dots ,x_n),\\dots ,F_{M}(x_1,\\dots ,x_n)$  \n\nsuch that  \n\\[\n      \\bigl(1+x_1^{2}+\\dots +x_n^{2}\\bigr)^{\\,N}\\,p(x_1,\\dots ,x_n)\n      \\;=\\;\n      \\sum_{j=1}^{M}F_{j}(x_1,\\dots ,x_n)^{2},\n      \\tag{$\\ast$}\n\\]\n\nwhere the number of squares can be chosen not larger than  \n\\[\n      M \\;=\\;\\binom{n+\\deg p+2N}{\\,n}.\n\\]\n\nMoreover,\n\\[\n      \\deg F_{j}\\;\\le\\;\\deg p+2N\n      \\qquad(j=1,\\dots ,M).\n\\]\n\n(The problem deliberately imposes no a–priori bound on $N$ in terms of $\\deg p$; in fact, such a bound is known not to exist when $n\\ge 3$.)\n\n──────────────────────────────────────",
      "solution": "Throughout all polynomials are assumed to have real coefficients.\n\nNotation. Put  \n\\[\n      S:=x_0^{2}+x_1^{2}+\\dots +x_n^{2},\n      \\qquad \n      \\Sigma:=1+x_1^{2}+\\dots +x_n^{2}\\;(\\text{that is }S\\text{ with }x_0=1).\n\\]\n\n------------------------------------------------------------------\nStep 1.  Homogenisation and positivity of the form $P$.\n------------------------------------------------------------------\n\nLet $d:=\\deg p$ and introduce a new variable $x_0$.  \nDefine the homogeneous form of degree $d$\n\\[\n      P(x_0,x_1,\\dots ,x_n)\n      :=x_0^{d}\\,p\\!\\bigl(x_1/x_0,\\dots ,x_n/x_0\\bigr),\n\\]\nextended continuously to $x_0=0$.  \nBecause $p$ is non–negative on $\\mathbb R^{\\,n}$, one has  \n\\[\n      P(x_0,\\dots ,x_n)\\;\\ge\\;0\n      \\quad\\text{for every }(x_0,\\dots ,x_n)\\in\\mathbb R^{\\,n+1}.\n\\]\n\n------------------------------------------------------------------\nStep 2.  A rational sum–of–squares representation (Artin).\n------------------------------------------------------------------\n\nBy Artin’s solution of Hilbert’s seventeenth problem there exist\n$r_1,\\dots ,r_m\\in\\mathbb R(x_0,\\dots ,x_n)$ such that  \n\\[\n      P=r_1^{2}+\\dots +r_m^{2}.\n\\]\nWriting $r_i=g_i/q_i$ with $g_i,q_i\\in\\mathbb R[x_0,\\dots ,x_n]$ and setting\n$q:=q_1\\cdots q_m$, clearing denominators yields  \n\\[\n      q^{\\,2}\\,P\n      \\;=\\;\n      g_1^{2}+\\dots +g_m^{2}.\n      \\tag{2.1}\n\\]\n\n------------------------------------------------------------------\nStep 3.  A polynomial sum of squares: Reznick’s uniform–denominator theorem.\n------------------------------------------------------------------\n\nThe extraneous factor $q^{\\,2}$ in (2.1) can be removed with a power of the\nquadratic form $S$.  Precisely:\n\nTheorem 3.1 (Reznick, 1995, Theorem 3.14).  \nFor every non–negative homogeneous polynomial $P\\in\\mathbb R[x_0,\\dots ,x_n]$\nthere exists an integer $k\\ge 0$ and homogeneous polynomials\n$C_1,\\dots ,C_w$ such that  \n\\[\n      S^{\\,k}\\,P \\;=\\; C_1^{2}+\\dots +C_{w}^{2}.\n      \\tag{3.2}\n\\]\n\nFix such a $k$ and a representation (3.2).\n\n------------------------------------------------------------------\nStep 4.  De–homogenisation.\n------------------------------------------------------------------\n\nPut $N:=k$ and set $x_0=1$ in (3.2).  Denoting  \n\\[\n      \\widetilde C_\\ell(x_1,\\dots ,x_n)\n      :=C_\\ell(1,x_1,\\dots ,x_n),\n\\]\nwe obtain  \n\\[\n      \\Sigma^{\\,N}\\,p(x_1,\\dots ,x_n)\n      \\;=\\;\n      \\sum_{\\ell=1}^{w}\\bigl(\\widetilde C_\\ell(x_1,\\dots ,x_n)\\bigr)^{2}.\n      \\tag{4.1}\n\\]\n\n------------------------------------------------------------------\nStep 5.  Compressing the number of squares via the Gram matrix method.\n------------------------------------------------------------------\n\nLet \n\\[\n      D\\;:=\\;\\deg p+2N,\\qquad\n      V_{D}:=\\{\\,f\\in\\mathbb R[x_1,\\dots ,x_n]\\mid\\deg f\\le D\\,\\}.\n\\]\nThe vector space $V_{D}$ has dimension  \n\\[\n      \\dim V_{D}=\\binom{n+D}{n}.\n\\tag{5.1}\n\\]\n\nEach $\\widetilde C_\\ell$ in (4.1) has degree $\\le D$, hence lies in $V_{D}$.\nChoose a monomial basis $\\{m_1,\\dots ,m_{M}\\}$ of $V_{D}$, where\n$M=\\dim V_{D}$ as in (5.1).  Write every $\\widetilde C_\\ell$ as\n\\[\n      \\widetilde C_\\ell\n      \\;=\\;\n      \\sum_{i=1}^{M} a_{i\\ell}\\,m_{i},\\qquad a_{i\\ell}\\in\\mathbb R.\n\\]\nFormula (4.1) then becomes\n\\[\n      \\Sigma^{\\,N}\\,p\n      \\;=\\;\n      \\sum_{\\ell=1}^{w}\\Bigl(\\sum_{i=1}^{M} a_{i\\ell}\\,m_{i}\\Bigr)^{2}\n      \\;=\\;\n      \\sum_{i,j=1}^{M} \\Bigl(\\sum_{\\ell=1}^{w}a_{i\\ell}a_{j\\ell}\\Bigr)\n                       m_{i}m_{j}.\n\\]\nIntroduce the symmetric positive–semidefinite matrix  \n\\[\n      G:=\\bigl(g_{ij}\\bigr)_{1\\le i,j\\le M},\n      \\qquad\n      g_{ij}:=\\sum_{\\ell=1}^{w}a_{i\\ell}a_{j\\ell}.\n\\]\nSince $G$ is positive semidefinite, it admits a Cholesky (or spectral)\nfactorisation $G=B^{\\mathsf T}B$, where $B$ is an $r\\times M$ matrix with\n$r=\\operatorname{rank}G\\le M$.  Writing the $k$–th row of $B$ as\n$(b_{k1},\\dots ,b_{kM})$ and putting  \n\\[\n      F_k:=\\sum_{i=1}^{M} b_{ki}\\,m_{i}\\;\\in V_{D},\n\\qquad k=1,\\dots ,r,\n\\]\nwe obtain the {\\em Gram representation}\n\\[\n      \\Sigma^{\\,N}\\,p\n      \\;=\\;\n      \\sum_{k=1}^{r} F_k^{2}.\n\\]\nTherefore (4.1) has been converted into a sum of at most  \n\\[\n      r\\;\\le\\;M=\\binom{n+D}{n}\n\\]\nsquares of polynomials, all of degree $\\le D$.  \nRenumbering if necessary, we rename $r$ by $M$ and denote the polynomials\nby $F_1,\\dots ,F_{M}$.  This establishes the identity ($\\ast$) in the\nstatement.\n\n------------------------------------------------------------------\nStep 6.  Degree estimate.\n------------------------------------------------------------------\n\nBecause $\\deg\\Sigma^{\\,N}=2N$, we have  \n\\[\n      \\deg\\bigl[\\Sigma^{\\,N}p\\bigr]=2N+\\deg p=D.\n\\]\nEach summand $F_j^{2}$ has degree $2\\deg F_j$, hence\n$\\deg F_j\\le D=\\deg p+2N$ for every $j$, as required.\n\n------------------------------------------------------------------\nRemarks.\n------------------------------------------------------------------\n\n1.  The proof uses only classical results:\n    Artin’s theorem, Reznick’s uniform–denominator theorem\n    and the elementary Gram–matrix argument of Hilbert.\n    No unproved assertion about the Pythagoras number of\n    $\\mathbb R[x_1,\\dots ,x_n]$ is invoked.\n\n2.  The bound $M=\\binom{n+\\deg p+2N}{\\,n}$ is certainly far from optimal,\n    but it is uniform (depends only on $n$, $\\deg p$ and the\n    particular $N$ produced by Reznick’s theorem) and is known to hold.\n    Any substantial improvement in this bound, even for $n=2$,\n    is a major open problem.\n\n3.  When $n=1$ one may take $N=0$ and $M\\le 2$,\n    recovering the familiar fact that every non–negative univariate\n    polynomial is a sum of {\\em two} squares of polynomials.\n\n──────────────────────────────────────",
      "metadata": {
        "replaced_from": "harder_variant",
        "replacement_date": "2025-07-14T19:09:31.763980",
        "was_fixed": false,
        "difficulty_analysis": "1. More variables & higher dimension: the problem passes from a single real variable to an arbitrary dimension \\(n\\).  \n2. Additional constraints: The representation must hold after multiplication by a *power of the squared Euclidean norm*, and we must exhibit both an **upper bound on that power** (\\(N\\le\\deg p\\)) and an **upper bound on the number of squares** (\\(2^{\\,n-1}\\)).  \n3. Sophisticated structures: The solution invokes Artin’s solution to Hilbert’s 17-th problem, the Positivstellensatz of real algebraic geometry, and Pfister’s theory of quadratic forms—far beyond the elementary factorisation used in the original single-variable proof.  \n4. Deeper theory: Tools from homogeneous forms, localisation, and quadratic form theory are essential; elementary calculus or algebra is no longer sufficient.  \n5. Multiple interacting concepts: Homogenisation ⇄ de-homogenisation, valuation-style denominator clearing, Pfister’s 2-adic identities, and degree bookkeeping must all be coordinated to satisfy the simultaneous bounds requested.\n\nCollectively these additions raise the task from an Olympiad-level exercise to a graduate-level exploration in real algebraic geometry and the algebraic theory of quadratic forms."
      }
    },
    "original_kernel_variant": {
      "question": "Let $n\\ge 1$ and let \n\\[\n      p(x_1,\\dots ,x_n)\\;\\in\\;\\mathbb R[x_1,\\dots ,x_n],\\qquad \n      p\\not\\equiv 0,\n\\]\nbe a polynomial that satisfies  \n\\[\n      p(x_1,\\dots ,x_n)\\;\\ge\\;0\n      \\qquad\\text{for every }(x_1,\\dots ,x_n)\\in\\mathbb R^{\\,n}.\n\\]\n\nProve that there exist  \n\n$\\bullet$ an integer $N\\ge 0$, and  \n\n$\\bullet$ real–coefficient polynomials $F_1(x_1,\\dots ,x_n),\\dots ,F_{M}(x_1,\\dots ,x_n)$  \n\nsuch that  \n\\[\n      \\bigl(1+x_1^{2}+\\dots +x_n^{2}\\bigr)^{\\,N}\\,p(x_1,\\dots ,x_n)\n      \\;=\\;\n      \\sum_{j=1}^{M}F_{j}(x_1,\\dots ,x_n)^{2},\n      \\tag{$\\ast$}\n\\]\n\nwhere the number of squares can be chosen not larger than  \n\\[\n      M \\;=\\;\\binom{n+\\deg p+2N}{\\,n}.\n\\]\n\nMoreover,\n\\[\n      \\deg F_{j}\\;\\le\\;\\deg p+2N\n      \\qquad(j=1,\\dots ,M).\n\\]\n\n(The problem deliberately imposes no a–priori bound on $N$ in terms of $\\deg p$; in fact, such a bound is known not to exist when $n\\ge 3$.)\n\n──────────────────────────────────────",
      "solution": "Throughout all polynomials are assumed to have real coefficients.\n\nNotation. Put  \n\\[\n      S:=x_0^{2}+x_1^{2}+\\dots +x_n^{2},\n      \\qquad \n      \\Sigma:=1+x_1^{2}+\\dots +x_n^{2}\\;(\\text{that is }S\\text{ with }x_0=1).\n\\]\n\n------------------------------------------------------------------\nStep 1.  Homogenisation and positivity of the form $P$.\n------------------------------------------------------------------\n\nLet $d:=\\deg p$ and introduce a new variable $x_0$.  \nDefine the homogeneous form of degree $d$\n\\[\n      P(x_0,x_1,\\dots ,x_n)\n      :=x_0^{d}\\,p\\!\\bigl(x_1/x_0,\\dots ,x_n/x_0\\bigr),\n\\]\nextended continuously to $x_0=0$.  \nBecause $p$ is non–negative on $\\mathbb R^{\\,n}$, one has  \n\\[\n      P(x_0,\\dots ,x_n)\\;\\ge\\;0\n      \\quad\\text{for every }(x_0,\\dots ,x_n)\\in\\mathbb R^{\\,n+1}.\n\\]\n\n------------------------------------------------------------------\nStep 2.  A rational sum–of–squares representation (Artin).\n------------------------------------------------------------------\n\nBy Artin’s solution of Hilbert’s seventeenth problem there exist\n$r_1,\\dots ,r_m\\in\\mathbb R(x_0,\\dots ,x_n)$ such that  \n\\[\n      P=r_1^{2}+\\dots +r_m^{2}.\n\\]\nWriting $r_i=g_i/q_i$ with $g_i,q_i\\in\\mathbb R[x_0,\\dots ,x_n]$ and setting\n$q:=q_1\\cdots q_m$, clearing denominators yields  \n\\[\n      q^{\\,2}\\,P\n      \\;=\\;\n      g_1^{2}+\\dots +g_m^{2}.\n      \\tag{2.1}\n\\]\n\n------------------------------------------------------------------\nStep 3.  A polynomial sum of squares: Reznick’s uniform–denominator theorem.\n------------------------------------------------------------------\n\nThe extraneous factor $q^{\\,2}$ in (2.1) can be removed with a power of the\nquadratic form $S$.  Precisely:\n\nTheorem 3.1 (Reznick, 1995, Theorem 3.14).  \nFor every non–negative homogeneous polynomial $P\\in\\mathbb R[x_0,\\dots ,x_n]$\nthere exists an integer $k\\ge 0$ and homogeneous polynomials\n$C_1,\\dots ,C_w$ such that  \n\\[\n      S^{\\,k}\\,P \\;=\\; C_1^{2}+\\dots +C_{w}^{2}.\n      \\tag{3.2}\n\\]\n\nFix such a $k$ and a representation (3.2).\n\n------------------------------------------------------------------\nStep 4.  De–homogenisation.\n------------------------------------------------------------------\n\nPut $N:=k$ and set $x_0=1$ in (3.2).  Denoting  \n\\[\n      \\widetilde C_\\ell(x_1,\\dots ,x_n)\n      :=C_\\ell(1,x_1,\\dots ,x_n),\n\\]\nwe obtain  \n\\[\n      \\Sigma^{\\,N}\\,p(x_1,\\dots ,x_n)\n      \\;=\\;\n      \\sum_{\\ell=1}^{w}\\bigl(\\widetilde C_\\ell(x_1,\\dots ,x_n)\\bigr)^{2}.\n      \\tag{4.1}\n\\]\n\n------------------------------------------------------------------\nStep 5.  Compressing the number of squares via the Gram matrix method.\n------------------------------------------------------------------\n\nLet \n\\[\n      D\\;:=\\;\\deg p+2N,\\qquad\n      V_{D}:=\\{\\,f\\in\\mathbb R[x_1,\\dots ,x_n]\\mid\\deg f\\le D\\,\\}.\n\\]\nThe vector space $V_{D}$ has dimension  \n\\[\n      \\dim V_{D}=\\binom{n+D}{n}.\n\\tag{5.1}\n\\]\n\nEach $\\widetilde C_\\ell$ in (4.1) has degree $\\le D$, hence lies in $V_{D}$.\nChoose a monomial basis $\\{m_1,\\dots ,m_{M}\\}$ of $V_{D}$, where\n$M=\\dim V_{D}$ as in (5.1).  Write every $\\widetilde C_\\ell$ as\n\\[\n      \\widetilde C_\\ell\n      \\;=\\;\n      \\sum_{i=1}^{M} a_{i\\ell}\\,m_{i},\\qquad a_{i\\ell}\\in\\mathbb R.\n\\]\nFormula (4.1) then becomes\n\\[\n      \\Sigma^{\\,N}\\,p\n      \\;=\\;\n      \\sum_{\\ell=1}^{w}\\Bigl(\\sum_{i=1}^{M} a_{i\\ell}\\,m_{i}\\Bigr)^{2}\n      \\;=\\;\n      \\sum_{i,j=1}^{M} \\Bigl(\\sum_{\\ell=1}^{w}a_{i\\ell}a_{j\\ell}\\Bigr)\n                       m_{i}m_{j}.\n\\]\nIntroduce the symmetric positive–semidefinite matrix  \n\\[\n      G:=\\bigl(g_{ij}\\bigr)_{1\\le i,j\\le M},\n      \\qquad\n      g_{ij}:=\\sum_{\\ell=1}^{w}a_{i\\ell}a_{j\\ell}.\n\\]\nSince $G$ is positive semidefinite, it admits a Cholesky (or spectral)\nfactorisation $G=B^{\\mathsf T}B$, where $B$ is an $r\\times M$ matrix with\n$r=\\operatorname{rank}G\\le M$.  Writing the $k$–th row of $B$ as\n$(b_{k1},\\dots ,b_{kM})$ and putting  \n\\[\n      F_k:=\\sum_{i=1}^{M} b_{ki}\\,m_{i}\\;\\in V_{D},\n\\qquad k=1,\\dots ,r,\n\\]\nwe obtain the {\\em Gram representation}\n\\[\n      \\Sigma^{\\,N}\\,p\n      \\;=\\;\n      \\sum_{k=1}^{r} F_k^{2}.\n\\]\nTherefore (4.1) has been converted into a sum of at most  \n\\[\n      r\\;\\le\\;M=\\binom{n+D}{n}\n\\]\nsquares of polynomials, all of degree $\\le D$.  \nRenumbering if necessary, we rename $r$ by $M$ and denote the polynomials\nby $F_1,\\dots ,F_{M}$.  This establishes the identity ($\\ast$) in the\nstatement.\n\n------------------------------------------------------------------\nStep 6.  Degree estimate.\n------------------------------------------------------------------\n\nBecause $\\deg\\Sigma^{\\,N}=2N$, we have  \n\\[\n      \\deg\\bigl[\\Sigma^{\\,N}p\\bigr]=2N+\\deg p=D.\n\\]\nEach summand $F_j^{2}$ has degree $2\\deg F_j$, hence\n$\\deg F_j\\le D=\\deg p+2N$ for every $j$, as required.\n\n------------------------------------------------------------------\nRemarks.\n------------------------------------------------------------------\n\n1.  The proof uses only classical results:\n    Artin’s theorem, Reznick’s uniform–denominator theorem\n    and the elementary Gram–matrix argument of Hilbert.\n    No unproved assertion about the Pythagoras number of\n    $\\mathbb R[x_1,\\dots ,x_n]$ is invoked.\n\n2.  The bound $M=\\binom{n+\\deg p+2N}{\\,n}$ is certainly far from optimal,\n    but it is uniform (depends only on $n$, $\\deg p$ and the\n    particular $N$ produced by Reznick’s theorem) and is known to hold.\n    Any substantial improvement in this bound, even for $n=2$,\n    is a major open problem.\n\n3.  When $n=1$ one may take $N=0$ and $M\\le 2$,\n    recovering the familiar fact that every non–negative univariate\n    polynomial is a sum of {\\em two} squares of polynomials.\n\n──────────────────────────────────────",
      "metadata": {
        "replaced_from": "harder_variant",
        "replacement_date": "2025-07-14T01:37:45.585913",
        "was_fixed": false,
        "difficulty_analysis": "1. More variables & higher dimension: the problem passes from a single real variable to an arbitrary dimension \\(n\\).  \n2. Additional constraints: The representation must hold after multiplication by a *power of the squared Euclidean norm*, and we must exhibit both an **upper bound on that power** (\\(N\\le\\deg p\\)) and an **upper bound on the number of squares** (\\(2^{\\,n-1}\\)).  \n3. Sophisticated structures: The solution invokes Artin’s solution to Hilbert’s 17-th problem, the Positivstellensatz of real algebraic geometry, and Pfister’s theory of quadratic forms—far beyond the elementary factorisation used in the original single-variable proof.  \n4. Deeper theory: Tools from homogeneous forms, localisation, and quadratic form theory are essential; elementary calculus or algebra is no longer sufficient.  \n5. Multiple interacting concepts: Homogenisation ⇄ de-homogenisation, valuation-style denominator clearing, Pfister’s 2-adic identities, and degree bookkeeping must all be coordinated to satisfy the simultaneous bounds requested.\n\nCollectively these additions raise the task from an Olympiad-level exercise to a graduate-level exploration in real algebraic geometry and the algebraic theory of quadratic forms."
      }
    }
  },
  "checked": true,
  "problem_type": "proof"
}