Can the mass of a hydrogen atom be calculated in a gauge-invariant way? Please excuse the lengthy question. It involves an interesting controversy which has arisen in discussions on this site:


*

*Energy/mass of Quantum Vacuum

*Relative potential energy vs Absolute potential energy
The mass of one atom of $^1H$ is well known to be slightly less than the mass of a proton plus the mass of an electron.
Let's work in terms of rest energies rather than masses, because the numbers will be more familiar.
The rest energy of a hydrogen atom in its ground state is 938,783,066.5 eV. (Sources: Wikipedia's "Isotopes of Hydrogen" for the value in atomic mass units; Wikipedia's "Atomic mass unit" for the conversion between amu and MeV.)
The rest energy of a proton is 938,272,081.3 eV (Source: Wikipedia's "Proton").
The rest energy of an electron is 510,998.9 eV (Source: Wikipedia's "Electron")
Thus the rest energy of a hydrogen is less than the rest energy of a proton and electron by 13.7 eV.
My explanation for this, which is the very conventional one I learned at MIT and Stanford, is simple: The rest energy of a system is its total energy, consisting of the rest energy of its constituents, plus their kinetic energy, plus the potential energy of their interaction. Therefore
$$\tag{1}E_{0,H} = E_{0,p} + E_{0,e} + \langle K\rangle + \langle U\rangle$$
where $\langle K\rangle$ is the expectation value of the kinetic energy,
$$\tag{2}\langle K\rangle = \left\langle-\frac{\hbar^2}{2\mu}\nabla^2\right\rangle = \frac{1}{2}\mu c^2\alpha^2 = 13.6\;\text{eV}$$
and $\langle U\rangle$ is the expectation value of the electrostatic potential energy between the proton and electron,
$$\tag{3}\langle U\rangle = \langle -\frac{k e^2}{r}\rangle = -\mu c^2\alpha^2 = -27.6\;\text{eV}$$
For the measured precision of the rest energies, it suffices to use nonrelativistic quantum mechanics in the form of the Schrodinger equation with the potential energy $U(r)=-ke^2/r$. The expectation values are for the ground 1s state.
In the above equations, $\hbar$ is the reduced Planck constant, $c$ is the speed of light, $k$ is the Coulomb constant, $e$ is the magnitude of the charge of the proton and electron, $\alpha=ke^2/\hbar c$ is the fine structure constant, and $\mu=m_p m_e/(m_p+m_e)$ is the reduced mass of the system.
Obviously this calculation explains the observed rest mass of hydrogen to within experimental error.
However, it relies on the fact that we have assumed (as everyone conventionally does) that the potential energy is well-defined as
$$\tag{4}U = -\frac{ke^2}{r}$$
and goes to zero at infinity.
Some people in this forum have disputed this on the basis that the electrostatic potential is not gauge-invariant and assuming that it goes to 0 at infinity is merely a convention. This raises the question of what is the correct gauge-invariant calculation of the mass of hydrogen?
Some people in this forum have claimed that the invariant mass $m=\sqrt{E^2-p^2}$ (in units with $c=1$) is not a gauge invariant concept.
This seems absurd to me. If it were true, why would we say that the mass of a proton, or anything else, is a particular number?
Some people in this forum have claimed  that the kinetic energy contributes to the rest energy but the potential energy does not.
This might be true if one moves to considering electrostatic energy as being field energy. (For example, the energy-momentum-stress tensor for 
a particle in an electromagnetic field separates into a "pure particle" term involving only rest energy and kinetic energy, plus a "pure field" term representing the interaction energy,) But the field energy for point particles diverges and requires renormalization, so how exactly does one get 938.783,066.5 eV for the mass of a hydrogen atom?
Some people in this forum have claimed that we cannot define mass without defining the energy of the vacuum and "boundary conditions". This seems to ignore the fact that we can measure mass simply using force and acceleration, under non-relativistic conditions.
My conventional explanation above for the mass of hydrogen has actually been downvoted in other threads multiple times as being simply "wrong". I challenge the downvoters to provide an alternate calculation.
So my main question is: Can one make a gauge-invariant calculation of the mass of a hydrogen atom, and, if so, how exactly?
 A: As I said before, energy is not a gauge invariant quantity - loosely speaking it is "energy differences" that are, as explained in the field theory textbook I linked to you in an earlier thread.
When these neat arguments about adding masses/energies are taught in undergrad, obviously the correct thing for professors to do is gloss over the subtleties of correctly defining gauge invariant quantities. The argument you've given for the mass of the hydrogen atom is fine actually, it's just that all the things there are strictly speaking energy differences.
Firstly, it is perfectly legal to shift the Hamiltonian by a constant, and therefore formally shift the ground state energy of the hydrogen atom to be whatever you want. But recall that there are both bound state solutions to the coulomb problem, and continuum (or "scattering") states. A gauge invariant statement that will stay the same no matter what you do is: "the gap between the highest energy bound state and the first continuum state is 13.6 eV."
So no matter how you define the absolute values of the energy levels themselves, it's a gauge invariant fact that you've got 13.6 eV less when you're bound than when you're free.
Regarding the masses of the proton/electrons themselves, this is a slightly more subtle point. The reason it's confusing is that "an electron" and "a proton" are actually not gauge invariant objects, because they are charged. Creating a proton/electron out of the ground state (without worrying about the "true" microscopic origins of protons, which only show up at high energies - let's just imagine they're positive test charges) requires you to create an electon-positron (or proton-antiproton) pair. The 0.5 MeV is half the energy of an electron-positron pair, and this is also a gauge invariant quantity.
So we are summing two energy differences. The first is the difference in energy between having a single electron/proton, and having no particles. The second is the difference in energy between those two particles being bound, and them being free. Both quantities are gauge invariant: the first gives us the masses of the proton and electron, the sum of them gives us the mass of the hydrogen atom.
