  We confirm a conjecture of Guth concerning the maximal number of
$\delta$-tubes, with $\delta$-separated directions, contained in the
$\delta$-neighborhood of a real algebraic variety. Modulo a factor of
$\delta^{-\varepsilon}$, we also prove Guth and Zahl's generalized version for
semialgebraic sets. Although the applications are to be found in harmonic
analysis, the proof will employ deep results from algebraic and differential
geometry, including Tarski's projection theorem and Gromov's algebraic lemma.
