Define an $S_n$-invariant polynomial $f$ of $\mathbb{Z}[x_1,\cdots, x_n]$ so that $f(x_1,\cdots, x_n) = f(x_{\sigma(1)},\cdots, x_{\sigma(n)})$ for any permutation $\sigma\in S_n$, the set of permutations from $\{1,\cdots, n\}$ to $\{1,\cdots, n\}$. Show that if the total degree (i.e. maximum sum of exponents of a single term) of an $S_n$-invariant polynomial $f(x_1,\cdots, x_n)$ in n variables is less than or equal to the number of variables, then the expression for $f(x_1,\cdots, x_{n-1},0)$ in terms of $s_i(x_1,\cdots, x_{n-1})$ gives the right formula for $f(x_1,\cdots, x_n)$ in terms of $s_i(x_1,\cdots, x_n)$, where $s_j := \sum_{1\leq i_1<i_2<\cdots < i_j\leq n} x_{i_1}\cdots x_{i_j}$ is the jth elementary symmetric polynomial.
I know that irreducible polynomials are prime (i.e. if $p$ is irreducible and $ p | fg$ for polynomials $f,g, p | f $ or $p | g$). Essentially, I need to show that if $f(x_1,\cdots, x_{n-1}, 0) = P(s_1(x_1,\cdots, x_{n-1}),\cdots, s_{n-1}(x_1,\cdots, x_{n-1}))$ for some polynomial $P$, then $f(x_1,\cdots, x_n) = P(s_1(x_1,\cdots, x_n),\cdots, s_{n-1}(x_1,\cdots, x_n))$. Clearly $s_i(x_1,\cdots, x_{n-1}, 0) = s_i(x_1,\cdots, x_{n-1})$ for any $1\leq i < n$. So $P(s_1(x_1,\cdots, 0),\cdots, s_{n-1}(x_1,\cdots, 0) )= P(s_1(x_1,\cdots, x_{n-1}),\cdots, s_{n-1}(x_1,\cdots, x_{n-1})).$ We know $f(x_1,\cdots, x_n) - f(x_1,\cdots, x_{n-1},0)$ gives the sum of the terms of $f$ containing $x_n$. But how can I use the claim about the total degree to show the required result?
Hint. The difference $f(x_1,\cdots,x_n)-P(s_1,\cdots,s_{n-1})$ is symmetric and divisible by $x_n$.
You'll also want to explain why $P(s_1,\cdots,s_{n-1})$ has the same degree as $P(\bar{s}_1,\cdots,\bar{s}_{n-1})$, where $s_i$ are elementary symmetric polynomials in the $n$ variables and $\bar{s}_i$ in the first $n-1$ variables.