# Are two $f, g \in \mathbb{C}[x_1, \ldots, x_n]$ equal if $f(\mathbf{a}) = g(\mathbf{a})$ for all $\mathbf{a} \in \mathbb{R}^n$?

Suppose I have two polynomials of equal degree $$f, g \in \mathbb{C}[x_1, \ldots, x_n]$$ that satisfy $$f(\mathbf{a}) = g(\mathbf{a})$$ for all $$\mathbf{a} \in \mathbb{R}^n$$. Does this imply $$f = g$$? I know this is true if the values are equal for all $$\mathbb{C}^n$$, but was not sure about this case. Thank you!

• Standard trick: Polynomials being equal means their difference is zero. Polynomials being zero is much easier to work with, generally. Jul 27 '20 at 11:51
• If there are infinite sets $S_1,S_2,\ldots,S_n$ of $\mathbb{C}$ such that $f(\textbf{a})=g(\textbf{a})$ for all $\textbf{a}\in S_1\times S_2\times\ldots\times S_n$, then it already follows that $f\equiv g$. If you know that the degree of $x_i$ in both $f$ and $g$ is less than a certain positive integer $d_i$, you can even require that $|S_i|\geq d_i$ for each $i=1,2,\ldots,n$. Jul 27 '20 at 11:52
• @Batominovski How do you prove this? Jul 27 '20 at 11:59
• @JohnnyT. See Theorem 1.2 and Lemma 2.1 of this article: cs.tau.ac.il/~nogaa/PDFS/null2.pdf. Jul 27 '20 at 12:01

Yes, this is true. For simplicity, let's study the polynomial $$h=f-g$$, as a function $$\Bbb R^n\to\Bbb C$$. It is constantly equal to $$0$$.
The function $$h$$ may be Taylor expanded at, say, the origin. As it is the zero function, the Taylor expansion is trivial. But any polynomial is equal to its finite Taylor expansion. Thus $$h$$ must be given by the zero polynomial.
One might object and say "But expanding $$h$$ to a polynomial function $$\Bbb C^n\to \Bbb C$$ might give you more room to manoeuvre and make other polynomials". To address this, note that the real partial derivatives of $$h$$ as a function $$\Bbb R^n\to\Bbb C$$ are always equal to the partial derivatives of $$h$$ as a function $$\Bbb C^n\to\Bbb C$$. So expanding the domain of $$h$$ in this way cannot change the Taylor expansion.
Let us write $$f = f_1 + i f_2$$ and $$g = g_1 + i g_2$$ where $$f_1, f_2, g_1, g_2 \in \mathbb{R}[x_1, \ldots, x_n]$$. Then for any $$\mathbf{a} \in \mathbb{R}^n$$ the real part of $$f(\mathbf{a})$$ is $$f_1(\mathbf{a})$$ and the imaginary part $$f_2(\mathbf{a})$$ and similarly for $$g$$. Therefore $$f_1 - g_1$$ and $$f_2 - g_2$$ are real polynomials which vanish at all values of $$\mathbb{R}^n$$, hence they are the zero polynomials. Thus $$f = g$$.