Do two distinct level sets determine a non-constant complex polynomial?

Let $f$ and $g$ be non-constant complex polynomials in one variable. Let $a\neq b$ be complex numbers and suppose $f^{-1}(a)=g^{-1}(a)$ and $f^{-1}(b)=g^{-1}(b)$. Does this imply $f=g$?

If we think of entire functions instead of polynomials, the answer is negative: take $e^{-z}$ and $e^{z}$ and they share the same level sets for 0 and 1. More generally, Nevanlinna’s 5-values theorem says that 5 level sets completely determine a non-constant meromorphic function. Can we lower this number when dealing with polynomials?

Solutions Collecting From Web of "Do two distinct level sets determine a non-constant complex polynomial?"

HINT: How many zeroes does the polynomial $f-g$ have?

EDIT: Suppose $\deg(f)\ge \deg(g)$. Consider how many roots $f’$ has. Account for how many distinct roots $f-g$ can have.

FURTHER EDIT: OK, let’s say $\deg f = n \ge \deg g$. Say there are $k$ elements in $f^{-1}(a)=g^{-1}(a)$ and $\ell$ elements in $f^{-1}(b)=g^{-1}(b)$. Assuming $f\ne g$, $f-g$ has degree $n$. Since $f-g$ has at least $k+\ell$ roots (with various multiplicities), we infer that $k+\ell\le n$.

On the other hand, each solution of $f=a$ or $f=b$ with multiplicity $\mu>1$ contributes a zero of order $\mu-1$ for $f’$. Therefore, we have
$$\deg f’ = n-1\ge (n-k)+(n-\ell), \tag{$\star$}$$
and so $n\le k+\ell-1$. This contradiction gives us the conclusion that $f=g$.

To justify ($\star$), write, for example, $f(z)-a = \prod\limits_{j=1}^k (z-\alpha_j)^{\mu_j}$. Then $\sum\limits_{j=1}^k \mu_j = n$ and $\sum\limits_{j=1}^k (\mu_j-1) = n-k$.

A polynomial of degree $n \geqslant 1$ attains each complex value exactly $n$ times, counting multiplicities. So if neither $a$ nor $b$ is attained with multiplicity $> 1$ in any point, the set $f^{-1}(a) \cup f^{-1}(b)$ has $2\deg f$ elements. How many fewer can it have if $a$ or $b$ is attained with multiplicity $> 1$ in some point(s)?

There is a very nice and short proof. Without loss of generality, let’s assume that $\deg f \ge \deg g$, $a = 0$, $b = 1$. The expression

$$\frac{f’ (f-g)}{f(f-1)}$$
is a polynomial (!), but because degree of numerator is strictly smaller than degree of denominator. Thus numerator is (identically) zero and $f’ = 0 \implies f$ is constant or $f \equiv g$.