During my studies of composite quantum systems I find some expressions that leave me with a little doubt. For example: Let K be a linear operator defined in the Hilbert space H. Where H is given by $H = H_{a}\otimes H_{b}$. If I want to perform the trace of $K$ in $H$ space, I use the following expression $$ \mathrm{Tr}(K) = \sum_{j=1}^{n}\langle\psi_j|K|\psi_j\rangle $$ where {$|\psi_j\rangle$} is some basis on $H$. With that, if i want to perform the partial trace of this operator over some basis of $H_b$ given by {$|b_j\rangle$}, i use the following expression:
$$
\mathrm{Tr}_b(K) = \sum_{j}(I_a\otimes\langle b_j|)K(I_a\otimes|b_j\rangle)\tag{1}
$$
I have doubts in this expression:
Is $I_a$ is the identity operator given by $\sum_{i}|a_i\rangle\langle a_i|$?(where $\{|a_i\rangle\}$ is some basis on $H_a$). Where did expression (1) come from?, If I knew the expression for $K$, would expression (1) be equivalent to applying $\mathrm{Tr}_b(K)$ = $\sum_{j}\langle b_j|K|b_j\rangle$?
Following the same reasoning, but now in the context of measurements in a composite system ($H = H_{a}\otimes H_{b}$). After measurement of an observable $A = \sum_{a}a|a\rangle\langle a| = \sum_{a}aA_a$ , where $A_a=|a\rangle\langle a|$ is the projector and $\{a\}$ is the discrete spectrum, the state collapses to $$\rho_a = (A_a\otimes I_b)\rho(A_a\otimes I_b)/p_a \tag{2} $$ with $p_a$ the probability of obtaining (a) when a measurement is taken.
Likewise, I would like to know where equation $(2)$ came from. Do equations $(1)$ and $(2)$ have any relationship?