I have the following equations. I want to solve it for $\forall x.N(x)$
$\forall x.(N(x)-A+Y=0)$
$\forall x.(N(x)^2-2A+A^2=0)$
Where $A,Y$ are integer constants. $N$ is a function return an integer. $x$ is an integer variable.
How to solve the quantified equation?
The property $\forall x. (N(x) - A + Y = 0)$ can be rewritten as $\forall x. (N(x) = A - Y)$, which tells you that $N(x)$ is constantly equal to $A - Y$.
By replacing $N(x)$ with $A - Y$ in the second property, you obtain the equality $(A - Y)^2 - 2A + A^2 = 0$, which can be rewritten as $Y = A \pm \sqrt{2A - A^2}$.
In order for $Y$ to be well-defined, we must have $2A - A^2 \ge 0$, i.e. $0 \le A \le 2$. Since $A \in \mathbb Z$, there are three possibilities: