# Commutation of a partial trace with an operator

Let the partial trace $\mathrm{tr}_B$ be a mapping from an endomorphism End$\left( H_A\otimes H_B \right)$ onto an endomorphism End$\left( H_A \right)$. Then the partial trace is defined as

$$\mathrm{tr}_B:\; S\otimes T \mapsto \mathrm{tr}(T)S$$

with $S\in$ End$\left( H_A \right)$ and $T\in$ End$\left( H_B \right)$. Now it is stated that the partial trace commutes with (left and right) multiplication of an operator $T_A \otimes \mathrm{id}_B$ with $T_A\in$ End$\left( H_A \right)$ and $S_{AB}\in$ End$\left( H_A\otimes H_B \right)$ such that

$$\mathrm{tr}_B\left( S_{AB} \left(T_A \otimes \mathrm{id}_B \right) \right)=\mathrm{tr}_B\left( S_{AB} \right)T_A.$$

Here, I am not quite sure what is happening. I would expect, that there should appear the dimension of B, so

$$\mathrm{tr}_B\left(T_A \otimes \mathrm{id}_B\right)= \mathrm{dim}_B T_A.$$

Intuitively, I see that the operator does only act non-trivially on End$\left( H_A \right)$ therefore the result looks reasonable. However, I am somewhat not able to express this mathematically.

Note that $S_{AB}$ can be expressed in the form $$S_{AB} = \sum_{k=1}^N S_A^{(k)} \otimes S_B^{(k)}$$ for some operators $S_A^{(k)},S_B^{(k)}$ (we could be a bit more specific, but this will do). We then have $$\operatorname{tr}_B(S_{AB} (T_A \otimes \operatorname{id}_B)) = \\ \operatorname{tr}_B\left(\sum_{k=1}^N (S_A^{(k)} \otimes S_B^{(k)}) (T_A \otimes \operatorname{id}_B)\right) =\\ \sum_{k=1}^N\operatorname{tr}_B\left( (S_A^{(k)} \otimes S_B^{(k)}) (T_A \otimes \operatorname{id}_B)\right) = \\ \sum_{k=1}^N\operatorname{tr}_B\left( (S_A^{(k)} T_A) \otimes S_B^{(k)} \right) = \\ \sum_{k=1}^N \operatorname{tr}(S_B^{(k)})S_A^{(k)} T_A =\\ \left(\sum_{k=1}^N \operatorname{tr}(S_B^{(k)})S_A^{(k)}\right) T_A =\\ \operatorname{tr}_B(S_{AB}) T_A$$ as desired.