Exchange operator with position and momentum I need to prove that for a  given exchange operator $\hat{P}_{12}$ such that,
$$\hat{P}_{12}|x_1,x_2\rangle = |x_2,x_1\rangle $$
$\hat{P}_{12}\hat{X}_1\hat{P}_{12}=x_2$ and $\hat{P}_{12}\hat {P}_1\hat{P}_{12}=p_2$ where $\hat{X}_i$ is the position and $\hat{P}_i$ is the momentum operator. It looks so simple but I could not figure it out how to approach the problem...Any ideas
Note: It seems that my mistake was seeing $x_i$ is just as a position and not as an operator...
 A: Let us suppose that the vectors $|\alpha_1,\alpha_2\rangle$ form a basis of your Hilbert space and that ${\cal O}_1$ and ${\cal O}_2$ are operators such that $${\cal O}_1|\alpha_1,\alpha_2\rangle=\alpha_1|\alpha_1,\alpha_2\rangle,\quad {\cal O}_2|\alpha_1,\alpha_2\rangle=\alpha_2|\alpha_1,\alpha_2\rangle.$$
You want to evaluate $P_{12}{\cal O}_iP_{12}$. Since an operator is defined by its action on a basis, we apply this to the basis. First use the definition of $P_{12}$.
$$P_{12}{\cal O}_iP_{12}|\alpha_1,\alpha_2\rangle= P_{12} {\cal O}_i |\alpha_2,\alpha_1\rangle$$
Now notice that ${\cal O}_1|\alpha_2,\alpha_1\rangle=\alpha_2$ and ${\cal O}_2|\alpha_2,\alpha_1\rangle=\alpha_1|\alpha_2,\alpha_1\rangle$. For that reason we have $$P_{12}{\cal O}_1P_{12}|\alpha_1,\alpha_2\rangle= \alpha_2P_{12}|\alpha_2,\alpha_1\rangle=\alpha_2|\alpha_1,\alpha_2\rangle={\cal O}_2|\alpha_1,\alpha_2\rangle,$$
and likewise $$P_{12}{\cal O}_2P_{12}|\alpha_1,\alpha_2\rangle=\alpha_1P_{12}|\alpha_2,\alpha_1\rangle=\alpha_1|\alpha_1,\alpha_2\rangle={\cal O}_1|\alpha_1,\alpha_2\rangle.$$
We therefore observe that $P_{12}{\cal O}_1P_{12}={\cal O}_2$ and $P_{12}{\cal O}_2P_{12}={\cal O}_1$ because the operators in the LHS and the operators on the RHS agree when acting on a basis.
Now you can apply this result with ${\cal O}_i = X_i$ or with ${\cal O}_i=P_i$ or any other operators you want.
A: I'll change the notation a bit to make everything clearer. In fact, the problem is very easy, once we have introduced a proper notation. In the following, we omit the discussion of some possible mathematical problems, i.e. the following is not completely rigorous.
Let $H$ and $\mathscr H=H\otimes H $ denote some Hilbert spaces. For $u,v\in H$ and thus $u\otimes v\in\mathscr H$, we define the exchange operator as
$$  \mathrm{Ex}\, u\otimes v := v\otimes u \quad .\tag{1}$$
Now consider an operator $A$ on $H$; we can "lift" this operator to $\mathscr H$ by defining $A_1 := A\otimes \mathbb I$ and $A_2 := \mathbb I\otimes A$, where $\mathbb I$ denotes the identity operator on $H$. These expression mean that
\begin{align}
 A_1 \,u\otimes v &:= Au\otimes v \quad \tag{2a}\\
 A_2 \,u\otimes v &:= u\otimes Av \quad \tag{2b} \quad .
\end{align}
The desired equality now trivially follows by examining the action of $\mathrm{Ex}\,A_1 \mathrm{Ex}$ and $A_2$ on $u\otimes v$ and showing that both agree for all $u,v\in H$:
$$ \mathrm{Ex}\,A_1\mathrm{Ex}\, u\otimes v\overset{(1)}{=}\mathrm{Ex}\,A_1\, v\otimes u \overset{(2\mathrm a)}{=} \mathrm{Ex}\, Av\otimes u \overset{(1)}{=} u\otimes Av \overset{(2\mathrm b)}{=} A_2 \, u\otimes v \quad ,\tag{3}$$
which, since this holds for all $u\otimes v \in \mathscr H$ and hence for all vectors in $\mathscr H$, as an equality of operators means $\mathrm{Ex}\,A_1\mathrm{Ex} = A_2$. Moreover, as $\mathrm{Ex}^2 = \mathbb I\otimes \mathbb I$, we immediately obtain $\mathrm{Ex}\,A_2\mathrm{Ex} = A_1$.
As a final note, let us stress that for all of this to make sense we needed that $\mathscr H = H\otimes H$ and not e.g. $\mathscr H = H_1 \otimes H_2$ with $H_1$ different from $H_2$.
Edit: To translate it in the notation used in the question, simply substitute $u\otimes v$ with e.g. $|x_1,x_2\rangle$ and $A_i$ with e.g. $X_i$ and, well, $\mathrm{Ex}$ with $P_{12}$.
