I am trying to write the correct expression for a translated quantum field operator. There appear to be conflicting expressions given in this PSE post, and this one. In the former linked PSE post, the following is stated:
$$\hat\phi(x+a)=U(a)^\dagger \, \hat\phi(x)\,U(a)$$
where $U(a)=\exp(-i a\cdot \hat P)$ is the unitary translation operator, and $P_\mu=i\partial_\mu$. In explicit-component notation, this is
$$U(a)=\exp\left(-i\left(-a^0 H + \vec a \cdot \vec P \right)\right)$$
The second post however states that
$$\hat\phi(\vec x + \vec a)=U(\vec a)\, \hat\phi(\vec x)\,U(\vec a)^\dagger$$
My question is, which is right?
Here is my attempt at answering it. Suppose $|x\rangle = \hat\phi (x)|0\rangle$ is the state with one $\phi$-particle at point $x$. Suppose that these states form a suitable orthogonal basis for the single-particle Hilbert space in our theory. The full Hilbert space is the Fock-space built out of these.
$$|f\rangle = \sum_{i=\textrm{# of particles}}\int \prod_i d^4x_i\,f_i(\{x_i\})\,|x_1,x_2,\ldots,x_i\rangle$$
Let's act with $\hat\phi(x+a)$ on this state. In the following equations, $\color{red}{\textrm{red}}$ indicates important changes relative to the previous line.
$$\begin{align} \hat\phi(x+a)|f\rangle &= \hat\phi(x+a)\sum_{i=\textrm{# of particles}}\int \prod_i d^4x_i\,f_i(\{x_i\})\,|x_1,x_2,\ldots,x_i\rangle\\ &=\sum_{i=\textrm{# of particles}}\int \prod_i d^4x_i\,f_i(\{x_i\})\,\color{red}{\hat\phi (x+a)}|x_1,x_2,\ldots,x_i\rangle\\ &=\sum_{i=\textrm{# of particles}}\int \prod_i d^4x_i\,f_i(\{x_i\})\,|\color{red}{x+a},x_1,x_2,\ldots,x_i\rangle\\ &=\sum_{i=\textrm{# of particles}}\int \prod_i d^4x_i\,f_i(\{x_i\})\,\color{red}{U(a)|x,x_1-a,x_2-a,\ldots,x_i-a\rangle}\\ &=\sum_{i=\textrm{# of particles}}\int \prod_i d^4x_i\,f_i(\{x_i\})\,U(a)\color{red}{\phi(x)|x_1-a,x_2-a,\ldots,x_i-a\rangle}\\ &=\sum_{i=\textrm{# of particles}}\int \prod_i d^4x_i\,f_i(\{x_i\})\,U(a)\phi(x)\color{red}{U(-a)|x_1,x_2,\ldots,x_i\rangle}\\ &=U(a)\hat\phi(x)U(-a) |f\rangle\\ &=U(a)\hat\phi(x)U(a)^\dagger |f\rangle\\ &\\ \implies & \boxed{\hat\phi(x+a) = U(a)\hat\phi(x)U(a)^\dagger} \end{align}$$
I have been a bit loose with notation but I hope my logic is clear. Please let me know if anything is vague or incorrect.