  In a recent paper Petrov and Pohoata developed a new algebraic method which
combines the Croot-Lev-Pach Lemma from additive combinatorics and Sylvester's
Law of Inertia for real quadratic forms. As an application, they gave a simple
proof of the Bannai-Bannai-Stanton bound on the size of $s$-distance sets
(subsets $\mbox{$\cal A$}\subseteq {\mathbb R}^n$ which determine at most $s$
different distances). In this paper we extend their work and prove upper bounds
for the size of $s$-distance sets in various real algebraic sets. This way we
obtain a novel and short proof for the bound of Delsarte-Goethals-Seidel on
spherical $s$-distance sets and a generalization of a bound by
Bannai-Kawasaki-Nitamizu-Sato on $s$-distance sets on unions of spheres. In our
arguments we use the method of Petrov and Pohoata together with some Gr\"obner
basis techniques.
