TITLE: Is there a nullstellensatz for trigonometric polynomials?
QUESTION [45 upvotes]: Let
$$ f(x) = \sum_{j=1}^n c_j e^{2\pi i\alpha_j x}, g(x) = \sum_{k=1}^m d_k e^{2\pi i\beta_k x}$$
be two (quasi-periodic) trigonometric polynomials, where the coefficients $c_j, d_k$ are complex and the frequencies $\alpha_j,\beta_k$ are real (but are not necessarily commensurable).  Suppose that $f,g$ have infinitely many zeroes in common, thus $f(x)=g(x)=0$ for infinitely many reals $x$.  Does this imply that $f,g$ have a non-trivial common factor (in the ring of trigonometric polynomials)?  In the commensurable case (so that $f,g$ have a common period) this is clear from the factor theorem, but my interest is in the incommensurable case.  I would also be interested in the special case when $f,g$ are both real-valued, though I suspect that this restriction does not materially impact the question.
Here is a closely related question.  Let $G = \{ (e^{2\pi i \alpha_1 x}, \dots, e^{2\pi i \alpha_k x}): x \in {\bf R} \}$ be a one-parameter subgroup of the torus $(S^1)^k$ for some reals $\alpha_1,\dots,\alpha_k$ that are linearly independent over ${\bf Q}$ (so that $G$ is dense in $(S^1)^k$). Is it true that every codimension two real subvariety of $(S^1)^k$ intersects $G$ in at most finitely many points?  Note that if one specialises to the subvarieties $\{ z \in (S^1)^k: P(z)=Q(z)=0\}$ for two polynomials $P,Q$ with no common factor one basically obtains a version of the first question.
I'm somewhat aware of the literature on exponential polynomials (e.g., Ritt's theorem), but I couldn't find quite the appropriate tool; results in transcendental number theory (e.g., the six exponentials theorem) also seem vaguely relevant, but again it's not quite a perfect fit.

REPLY [31 votes]: I'm converting the comment above to an answer:
Shapiro made the following conjecture in the paper "The expansion of mean-periodic functions in series of exponentials" Comm. Pure and Appl. Math. 11 (1958) 1–22:

If two exponential polynomials have infinitely many zeros in common they are both multiples of some third (entirely transcendental) exponential polynomial.

In the paper "On common zeros of exponential polynomials" Enseignement Math. (2) 21 (1975), no. 1, 57–67, van der Poorten and Tijdeman prove a special case of Shapiro's conjecture for the case when one of the polynomials has rational frequencies. They observe that in a certain sense this statement is equivalent to the Skolem–Mahler–Lech theorem.
More recently, in the paper  "From Schanuel’s Conjecture to Shapiro’s Conjecture", D'Aquino, Macintyre, and Terzo show that the general conjecture can be proven assuming Schanuel's conjecture.