The key steps of the proof that the zero problem is undecidable — computed live in your browser.
Click on the plot to choose a target point — the applet will find the nearest point of the curve for $t \le T$.
The curve $\Gamma_2(t) = (h(t), g(t))$, where $h(t) = t\sin t$ and $g(t) = t\sin t^3$, is the image of one real variable. The first coordinate changes slowly: $|h'(t)| \le 1 + t$. The second oscillates faster and faster, because the phase $t^3$ has derivative $3t^2$: while $t$ runs through an interval of length $2\pi/(3t^2)$, the coordinate $h$ changes by at most $2\pi(1+t)/(3t^2) \to 0$, whereas $g$ sweeps the whole interval $[-t, t]$.
Hence density: the image $\Gamma_2((M, \infty))$ meets every open subset of the plane (rigorous proof — tab 2). At the same time, the image of a smooth curve has measure zero: the curve does not pass through every point. In the proof, density is enough, because the set $\{F < 1\}$ is open — the curve does not have to hit a zero of the function $F$; it suffices that it enters a neighborhood of it.
Ranges: $|a|, |b| \le 100$, $0.01 \le \delta \le 1$.
Lifting lemma. For any $a, b \in \mathbb{R}$, $\delta > 0$ and $M \ge 0$ there exists $w > M$ such that $|h(w) - a| < \delta$ and $g(w) = b$ — exactly.
Proof (this is exactly what the applet computes): choose $R > \max\{1, |b|, 4\pi/\delta, M\}$ and $v > \sqrt{R^2 + \delta/2}$ with $h(v) = a$ — such a $v$ exists by the Darboux property, because $h(2\pi k + \tfrac{\pi}{2}) = 2\pi k + \tfrac{\pi}{2}$ and $h(2\pi k + \tfrac{3\pi}{2}) = -(2\pi k + \tfrac{3\pi}{2})$. Set $u = \sqrt{v^2 - \delta/2}$, so that $(v-u)(v+u) = \delta/2$. Then:
Values computed in double-double arithmetic (about 32 digits). The last two columns: the same point $w$ rounded to an ordinary double, with everything computed in float64.
Ranges: $|a_i| \le 20$, $0.05 \le \delta \le 1$.
Higher-dimensional curves are defined recursively: $\Gamma_{n+1}(t) = \big(h(t),\ \Gamma_n(g(t))\big)$, e.g. $\Gamma_3(t) = \big(h(t),\ h(g(t)),\ g(g(t))\big)$. Induction: for the “tail” $(a_2, a_3)$ we find $w^*$ with $|h(w^*) - a_2| < \delta$ and $g(w^*) = a_3$; then the lifting lemma for the target $(a_1, w^*)$ gives $w$ with $|h(w) - a_1| < \delta$ and $g(w) = w^*$ exactly. Then $\Gamma_3(w) = \big(h(w),\ \Gamma_2(w^*)\big)$ — the errors of the tail do not grow, because the last coordinate is hit exactly, not approximately.
Numerically this is delicate: $g'(t) = \sin t^3 + 3t^3\cos t^3$ is of order $3t^3$, so even a rounding error in $g(w)$ gets amplified enormously in $g(g(w))$. That is why the applet computes in double-double arithmetic; the float64 columns show what would happen without it. In mathematics (exact computation) there is no problem — this is precisely the advantage of an exact last coordinate.
For $N \ge 2$ the polynomial $P_N$ has no nonnegative integer root (because $Nm - 1 = 0$ gives $m = 1/N$).
The unweighted penalty $r(x) = P_N(x)^2 + \sin^2(\pi x)$ vanishes exactly at the integer roots of $P_N$ — of which there are none. Even so, its minimum is of order $\sin^2(\pi/N) \to 0$: no fixed threshold separates “there are solutions” from “there are no solutions”, because $P_N$ becomes more and more sensitive to shifts.
Richardson multiplies the term $\sin^2(\pi x)$ by $k(x)^4$, where $k$ is a local majorant of the derivative $Q' = (P^2)'$: $|Q'(z)| < k(x)$ for $|z - x| \le 1$. The majorant is built recursively, directly from the expression: $c \mapsto c^2 + 2$, $x \mapsto x^2 + 2$, sum and difference $\mapsto$ sum of the majorants, product $\mapsto$ product, $\exp A \mapsto \exp M_A$, $\sin A \mapsto 2$. For $Q'(x) = 2N\cdot(N\cdot x - 1)$ this gives $k(x) = (4N^2 + 2)\big((N^2 + 2)(x^2 + 2) + 3\big)$.
Rounding theorem: if $f(x) = (n+1)^4\,[P^2 + \sin^2(\pi x)\,k(x)^4] \le 1$ (here $n = 1$), then for the nearest integer $m$ and $d = |x - m|$ we have $d \le |\sin \pi x|^{1/2}$, so $d\,k(x) \le \tfrac12$, and by the mean value theorem $P(m)^2 \le \tfrac1{16} + \tfrac12 < 1$. An integer value smaller than $1$ must be zero: $P(m) = 0$. For $P_N$ this is impossible — hence $f > 1$ everywhere, as the plot shows.
Allowed: $t$, numbers, $+\,-\,*\,/$, powers (^ or **), sin, cos, exp, sqrt, pi. Interval: $t \in [-5, 5]$.
For a real number $u$ we have $|u| - u = 0$ when $u \ge 0$, and $|u| - u = -2u > 0$ when $u < 0$. Hence $B = |A| - A$ is identically zero exactly when $A$ takes no negative values anywhere. An algorithm deciding “is $B \equiv 0$?” would therefore decide “does $\exists t\ A(t) < 0$ hold?” — and that is undecidable (the first part of Richardson’s theorem, for $A = G_a - 1$). Hence the identity problem is undecidable when the language contains $|\cdot|$.
The plot and the sampling are only an experiment, not a proof: the “trap” example is negative only on an interval of length $0.002$, which the 1,001-point grid does not notice. For expressions without $|\cdot|$ (analytic functions) this proof does not settle the identity problem.
Let $U \subseteq \mathbb{N}$ be an undecidable set of the form $\{a : \exists \mathbf{m} \in \mathbb{N}^n\ P(a, \mathbf{m}) = 0\}$ (Davis–Putnam–Robinson; in modern form, Matiyasevich), where $P$ takes integer values at integer points. The construction is effective, and for every $a \in \mathbb{N}$:
$$\begin{aligned} a \in U &\iff \exists \mathbf{m} \in \mathbb{N}^n\ \ P(a, \mathbf{m}) = 0 &&\text{(arithmetic)}\\ &\iff \exists \mathbf{u} \in \mathbb{R}^n\ \ F(a, \mathbf{u}) = 0 &&\text{(weights and squares — tab 4)}\\ &\iff \exists t \in \mathbb{R}\ \ G_a(t) = F(a, \Gamma_n(t)) < 1 &&\text{(dense curve — tabs 1–3)}\\ &\iff A_a = G_a - 1 \ \text{takes a negative value}\\ &\iff B_a = |A_a| - A_a \not\equiv 0 &&\text{(absolute value — tab 5).} \end{aligned}$$If there were an algorithm deciding the identity $B \equiv 0$, it would decide membership in $U$ — a contradiction. The applet illustrates the steps with computations (this is an experiment, not a proof); the full proof with all the details is in the course book.