To show that two operators $\hat{A}$ and $\hat{B}$ commute, we can check whether $\hat{A}\hat{B}f(x)$ = $\hat{B}\hat{A}f(x)$.
My question is regarding the function $f(x)$. To check that $\hat{A}$ and $\hat{B}$ commute, can we use any function? Or are there requirements on the function we "test" commutativity with?
This relates to an exercise in a textbook which asks me to show why two operators in quantum chemistry commute. Both operators act on functions of multiple electron coordinates, e.g. $\Psi(\mathbf{x}_{1},\mathbf{x}_{2},\ldots,\mathbf{x}_{N})$, where $\mathbf{x}_{i}$ is the vector coordinate of electron $i$. One of the operators, $\hat{P}_{n}$ permutes the coordinates of the electrons (swapping the positions of two electrons, for $N$ electrons, there are $N!$ permutations), the other, $\hat{H}_{0}$, is a sum over one-electron operators, $\sum_{i}^{N} \hat{f}(i)$, where $\hat{f}(i)$ only acts on electron $i$. Whilst I know how $\hat{P}_{n}$ will act on any general function over multiple electron coordinates, I only know the outcome of the action of $\hat{H}_{0}$ on $\Psi$ which are made up of one-electron eigenfunctions, $\chi_{j}(\mathbf{x}_{i})$, of the operators $\hat{f}(i)$, e.g. determinants or products of these one-electron eigenfunctions.
If I can show that the operators commute using a test function $\Psi$ of this specific form, does this imply the operators have the general property that they commute?