Independence of shifted squares mod p Given an odd prime $p$, let $S\subseteq \mathbb F_p$ be the set of quadratic residues modulo $p$. Given $a,b\in \mathbb F_p$ we write $aS+b$ for the set $$aS+b:=\{t\in\mathbb F_p:\ t=ax^2+b \text{ for some $x\in\mathbb F_p$}\}.$$

What is the cardinality of $S\cap ((S+1)\cup (2-S))$?

I would say that they are $\frac 3 8 p+ o(p)$, because of the following heuristic: 


*

*the residues of the form $x^2$ are $\sim \frac p 2$ out of $p$;

*there's small correlation between a residue mod p being of the form $x^2$ or $1+y^2$;

*so $\# S\cap (S+1)$ should be $\sim p/4$.


This in fact is quickly provable in a number of ways.


*

*similar reasoning for the equation $\# S\cap (2-S)$.


Now, one would guess that, given random $x,y,z$, the equalities $x^2=1+y^2$ and $x^2=2-z^2$ are achieved for $1/4$ of the $x^2$s. So by Inclusion-Exclusion we get the heuristic.
I expect this to be provable in finite time by standard computations and the error term would be related to Weil's bound, aka Riemann Hypothesis on finite fields.

But how is it possible to make the above heuristic reasoning rigorous up to (1+o(1)), in a simple, direct and general way? 

In other words, how to make oneself safe to assume the approximate independence of equations as above when doing this sort of ballpark estimates?
Let's restrict to linear equations between quadratic residues or to the specific example above, in this question. But of course the same question is interesting for other sets of residues that should "distribute randomly" modulo p, for example sets related to sums of characters.
Possible approaches so far: 


*

*Estimate $\# S\cap S\cap(S+1)\cap(2-S)$ via Inclusion-Exclusion after counting precisely enough the solutions of the equation $(x^2-1-y^2)(x^2-2+z^2)=0$.

*Compute first effectively the expected Weil error bound, then compute the cardinality numerically for a large enough prime.

*Transform the problem into character sums as in Jyrki Lahtonen comment below.


$S \cap (S+1)$ is approximately $\frac 14 \operatorname{Card}\{(x,y) \in \Bbb F_p^2 \mid x^2 = y^2+1 \}$.
This set is an algebraic curve of dimension $1$ (and of genus $0$) so it has $p+O(1)$ points. And so $\operatorname{Card}(S \cap (S+1)) = p/4+O(1)$
Similarly, $S \cap (2-S)$ will be related to the curve $x^2 = 2-y^2$ and $(S+1) \cap (2-S)$ to $x^2+1 = 2-y^2$. They are all curves of genus $0$ so those intersections also have $p/4 + O(1)$ elements.
Finally, $S \cap (S+1) \cap (2-S)$ corresponds to a spatial curve, the intersection of $x^2 = y^2+1$ and $x^2 = 2-z^2$. At a glance, this is an elliptic curve, so the curve has $p + 2\sqrt p u(p) + O(1)$ points, where $|u(p)| \le 1$, and then the intersection has $p/8 + \sqrt p u(p)/4 + O(1)$ elements.
Gathering up everything, you get :
$\operatorname{Card}(S \cap ((S+1) \cup (2-S))) = \\
\operatorname{Card}(S \cap (S+1)) + \operatorname{Card}(S \cap (2-S)) - \operatorname{Card}(S \cap (S+1) \cap (2-S)) = \\
3p/8 - \sqrt p u(p)/4 + O(1)$
where $|u(p)| \le 1$
Note that this doesn't require $p$ to be prime, this is valid over any finite field $\Bbb F_q$
