How do I prove that $$tr_B(\rho^{AB})=\sum_{i}(I_A\otimes \langle i|)\rho^{AB}(I_A\otimes |i\rangle)\\\quad\quad\quad\text{ where }\quad (tr_B(\rho^{AB}))_{aa'}=\sum_{b}\rho^{AB}_{ab,a'b}=\rho^{A}_{aa'}$$
The trace of $\rho^A\in\mathcal{L}(\mathbb{C}^d)$ is defined as $tr(\rho^A)=\sum_i\langle i|\rho^A|i\rangle=\sum_j\langle j|\rho^A|j\rangle$ were $\{i\}$ and $\{j\}$ are any set of orthonormal basis for $\mathbb{C}^d$.
We define the partial trace by extending this idea, except that we only apply it to one subsystem.i.e., for $\rho^{AB}\in\mathcal{L}(\mathbb{C}^{d_1}\otimes\mathbb{C}^{d_2})$ we can define
$tr_B(\rho^{AB})=\sum_{i=1}^{d_2}\sum_{i}(I_A\otimes \langle i|)\rho^{AB}(I_A\otimes |i\rangle)=\sum_{j=1}^{d_2}\sum_{j}(I_A\otimes \langle j|)\rho^{AB}(I_A\otimes |j\rangle)$ were $\{i\}$ and $\{j\}$ are any set of orthonormal basis for $\mathbb{C}^{d_2}$.
Note: Refer to Understanding the Expression $tr\Big(\rho(X\otimes I)\Big)=\sum_{a,b,a',b'} \rho_{ab,a'b'}X_{a,a'}\delta_{b,b'}$ for the definition of $\rho_{aba'b'}^{AB}$
Quoting my Reference
In my reference it is defined that $\rho^{A}_{aa'}=(tr_B(\rho^{AB}))_{aa'}=\sum_{b}\rho^{AB}_{ab,a'b}$ but how do I fit it into the original definition $tr_B(\rho^{AB})=\sum_{i=1}^{d_2}\sum_{i}(I_A\otimes \langle i|)\rho^{AB}(I_A\otimes |i\rangle)$ ?
Note : $\rho^{A},\rho^{AB}$ are positive definite.
