Let $u\_1, u\_2, u\_3 \in \mathbb{Z}$ such that $u\_1^2 + u\_2^2 = u\_3^2$.


Is $(u\_3 + \frac{u\_1 + u\_2}{\sqrt{2}})^2$ bounded from below?


The irrationality of $\sqrt{2}$ certainly precludes zero, but can we say more?
How should I think about such problems in general? It looks like an interplay between equations over rationals, with quadratic constraints on the integer solutions. Is there some kind of marriage of Diophantine equations and geometry?



Is this bounded from below?
This will answer your questions in the comments, and a question that combines them into something else.


First, the most trivial one: to minimize $(u\_4 + \frac{u\_1 + u\_2+u\_3}{\sqrt{2}})^2$, given that you already have solutions for fewer variables, the solution is to set $u\_3=0$ and use your previous answer.


Second, you cannot make $(u\_3 + \frac{u\_1 + u\_2}{\sqrt{3}})^2$ close to zero. This is covered in a more general case, so let's get to that.


Suppose we have $x\_1^2 + \cdots + x\_k^2 = y^2$, with $x\_1 \leq x\_2 \leq \cdots \leq x\_k$. Then the rational numbers $a\_i=x\_i/x\_1$ are increasing, and $a\_1=1$. We have $y^2 = x^2\left(\sum\_{i=1}^ka\_i^2\right)$, and we want $y$ to be very close to $x\left(\sum\_{i=1}^ka\_i\right)/\sqrt{n}$. Simplifying, this means we want $n\left(\sum\_{i=1}^ka\_i^2\right)$ to be close to $\left(\sum\_{i=1}^ka\_i\right)^2$. By Chebyshev's sum inequality, we have 


$$
\left(\sum\_{i=1}^ka\_i\right)^2 \leq k\left(\sum\_{i=1}^ka\_i^2\right) < n\left(\sum\_{i=1}^ka\_i^2\right)
$$


when $k < n$. Since each $a\_i$ is at least $1$, the final inequality is separated by at least $k(n-k)$, so they won't be close.


Now let's suppose we want to minimize the expression for $\left(y - \frac{x\_1+\cdots +x\_n}{\sqrt{n}}\right)^2$ for some non-square $n$. Chebyshev's inequality is equal when all terms are equal, so we will try to make all of our terms nearly equal, setting all but one of them to $x$, and the last to $x+1$. Hence, we are trying to solve $nx^2+2x+1=y^2$, or after completing the square, $(nx+1)^2 + (n-1) = y^2$, or equivalently, $X^2 - nY^2 = 1-n$. This is a generalized Pell equation, and has one obvious solution, hence has infinitely many.


We could has also asked for one smaller value, and $n-1$ larger ones, so that $y^2 = (x-1)^2 + x^2 + \cdots x^2$ and we would have the same final equation to solve. Solutions for $n=3$ can be found in the OEIS, A122770 and A081065. For $n=5$, the $y$ values are odd terms in the Fibonacci sequence, and the $x$ values are listed at A081018, and A081016. The equation with two smaller and three larger values, or vice versa, has no solutions (by congruence mod $4$). For $n=6$, you can find values for one larger at A220755, and you can derive values for one smaller from the sequence A080806. The other cases have no solutions, considering two larger or smaller mod $8$, and three of each mod $9$. I didn't look up any more values, but you can certainly derive them from the Pell equation. Here's a nice one for those who like to jump to the conclusion:
$$
11481^2 + 11481^2 + 11481^2 + 11481^2 + 11481^2 + 11482^2 = 790903129 = 28123^2
$$
and
$$
(11481 + 11481 + 11481 + 11481 + 11481 + 11482)/28123 = 2.449489741 \ldots \\ \sqrt{6} = 2.4494897427\ldots
$$


