Prove $(tr_B(\rho^{AB}))_{aa'}=\sum_{b}\rho^{AB}_{ab,a'b}=\rho^{A}_{aa'}$ 
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
Refer to Page 18


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.
 A: Write
$$
\rho^{AB} = \sum_{a,a',b,b'} \rho^{AB}_{a,a',b,b'} |a\rangle \langle a'| \otimes |b\rangle \langle b'|
$$
where we've chosen some orthonormal basis to express the state in. Now we take the partial trace of the $B$ system in the orthonormal basis $\{|b\rangle\}$ that we chose above.
Then we have
$$
\begin{aligned}
\sum_{i}(I_A\otimes \langle i|)\rho^{AB}(I_A\otimes |i\rangle) &=\sum_{i}(I_A\otimes \langle i|)\left(\sum_{a,a',b,b'} \rho^{AB}_{a,a',b,b'} |a\rangle \langle a'| \otimes |b\rangle \langle b'|\right)(I_A\otimes |i\rangle) \\
&= \sum_{a,a',b,b', i} \rho^{AB}_{a,a',b,b'} |a\rangle \langle a'| \otimes \langle i|b\rangle \langle b'|i\rangle \\
&= \sum_{a,a',b,b',i} \rho^{AB}_{a,a',b,b'} |a\rangle \langle a'| \delta_{ib}\delta_{b'i} \\
&= \sum_{a,a',b} \rho^{AB}_{a,a',b,b} |a\rangle \langle a'|
\end{aligned}
$$
where $\delta_{ij}$ is the Kronecker delta. This is the same as what you get up to how I defined $\rho^{AB}_{a,a',b,b}$ in the definition of the state, you didn't provide a definition in the question so I picked one (it appears to be slightly different from the one your reference used but the logic is exactly the same).
