This is a question about generalizing trace defined for positive operators to trace class operators, in the terminology below, in the context of functional analysis.
Let $T \in B(H)$ (i.e. $T$ is a bounded linear operator on a Hilbert space $H$). Say $T$ is positive (denoted $T \geq 0$) if $T$ is self-adjoint and $\langle Tx, x\rangle \geq 0$ for all $x$ (where $\langle\cdot ,\cdot \rangle$ is the inner product on $H$). Define $$\mathrm{tr}(T)=\sum_j \left<Te_j, e_j \right>$$
the trace of $T$ for $T$ positive, where $e_j$ is an orthonormal basis for $H$. This definition is independent of the choice of basis. Let $B_0(H)$ be the compact operators in $B(H)$. Define
$B^1(H) = \mathrm{span} \{ T \in B_0(H) : T \geq 0, \mathrm{tr}\,T<\infty \}$
the trace class operators. Why is it that for $T \in B^1(H)$, $T=\sum_0^3 i^k T_k$ for some $T_k \geq 0$ (where $i \in \mathbb{C}$), and why is the extension of trace to $B^1(H)$ defined as
$\mathrm{tr}\,T = \sum_0^3 i^k \mathrm{tr} T_k$
well-defined? (This is from Pedersen, Analysis Now.)
Because any $T\in B(H)$ can be written as $T=\sum_{k=0}^3i^k T_k$ with $T_k\geq0$.
Maybe it helps to see this first in the complex numbers: given $z\in\mathbb C$, you are used to write it $a+ib$ with $a,b\in\mathbb R$. We can write $a=a_0-a_2$, $b=a_1-a_3$, with $a_0,a_1,a_2,a_3\geq0$, and then $$ z=a+ib=a_0+ia_1-a_2-ia_3=\sum_{k=0}^3i^ka_k. $$ In the case of $T$, we can take $$\text{Re}\,T=\frac{T+T^*}2,\ \ \ \ \ \text{Im}\,T=\frac{T-T^*}{2i},$$ and then $T=\text{Re}\,T+i\,\text{Im}\,T$, with $\text{Re},\text{Im}\,T$ selfadjoint. As any selfadjoint operator can be written as the difference of two positive operators, we can write $$ \text{Re}\,T=T_0-T_2,\ \ \ \ \text{Im}\,T=T_1-T_3 $$ with $T_0,T_1,T_2,T_3$ positive. Then $$ T=\sum_{k=0}^3i^kT_k. $$