Primary Decomposition Theorem; proof? I am a self learner and have attempted to prove the Primary Decomposition Theorem below. Any help either saying it's correct or highlighting something that's wrong or any misunderstanding would be really appreciated. Many thanks!
Theorem: Let $T:V→V$ be linear operator whose minimal polynomial factors into monic, irreducible, pairwise coprime polynomials: $m_T (t)=p_1 (t)\cdots p_k (t)$. Then:

*

*$V$ decomposes as a direct sum of the $W_i$, $V=W_1 \oplus \cdots \oplus W_k$


*The $W_i$ are $T$-invariant


*$p_i$ is the minimal polynomial of $T_i$, where $T_i$ is $T$ restricted to the image $W_i$
Proof of 1
To prove $V=W_1 \oplus \cdots \oplus W_k$ we must show: (i) $V=W_1+ \cdots +W_k$ (ii) $v=w_1+ \cdots +w_k$ is unique.
(i) We define ${f_i(t)=\frac{\prod\limits_{j=1}^k p_j(t)}{p_i(t)}}$. By assumption the $p_i$'s are coprime and therefore the $f_i$'s are coprime. As the $f_i$'s are coprime, there are polynomials $q_i$ such that $f_1(t)q_1(t)+\cdots+f_k(t)q_k(t)=1$.
We substitute $T$ for $t$, then $f_1(T)q_1(T)+\cdots+f_k(T)q_k(T)=I$. Therefore $f_1(T)q_1(T)v+\cdots+f_k(T)q_k(T)v=Iv=v$.
We define $w_1=f_1(T)q_1(T)v,...,w_k=f_k(T)q_k(T)v$ as $f_i(T)q_i(T)v$ is an image of $v$ and therefore can equal $w_i$. Then $v=w_1+\cdots+w_k$ and $V=W_1+ \cdots +W_k$.
(ii) To prove $v=w_1+ \cdots +w_k$ is unique, let's assume $v=u_1+ \cdots +u_k$, where $u_i∈W_i=$ Ker$\space p_i(T)$. To prove $v=w_1+ \cdots +w_k$ is unique we must show $u_1=w_1,...,u_k=w_k$ or equivalently $u_i=w_i$.
By (i), $w_i=f_i(T)q_i(T)v$, therefore $w_i=f_i(T)q_i(T)(u_1+\cdots+u_k)$. Also by (i), ${f_i(t)=\frac{\prod\limits_{j=1}^k p_j(t)}{p_i(t)}}$, therefore for $j \neq i, f_i(T)q_i(T)u_j=0$ and therefore $w_i=f_i(T)q_i(T)u_i$. By (i), $f_i(T)q_i(T)$ is the identity map transformation, therefore $w_i=u_i$ and $v=w_1+ \cdots +w_k$ is unique.
By (i) $V=W_1+ \cdots +W_k$ and by (ii) $v=w_1+ \cdots +w_k$ is unique, therefore by definition of a direct sum, $V=W_1 \oplus \cdots \oplus W_k$.
Proof of 2
$w_i=f_i(T)q_i(T)v={\frac{\prod\limits_{j=1}^k p_j(T)}{p_i(T)}} q_i(T)v$, therefore $p_i(T)w_i=p_i(T){\frac{\prod\limits_{j=1}^k p_j(T)}{p_i(T)}} q_i(T)v={\prod\limits_{j=1}^k p_j(T)} q_i(T)v=m_T(T)q_i(T)v$.
As $m_T$ is the minimal polynomial of $T$, $m_T(T)=0$, therefore $p_i(T)w_i=m_T(T)q_i(T)v=0$. As $p_i(T)w_i=0$, $w_i∈$ Ker$\space p_i(T)=W_i$. By the theorem that if $TS=ST$ then Ker$S$ is $T$-invariant and $Tp_i(T)=p_i(T)T$, Ker$\space p_i(T)$ is $T$-invariant. Therefore the $W_i$ are $T$-invariant.
Proof of 3
To be the minimal polynomial of $T_i$, $p_i$ must be satisfied by $T_i$. From part 2 of the theorem, $W_i$=Ker $p_i (T)$ and $p_i (T)w_i=0$. $p_i(T)$ restricted to $W_i$ is $p_i(T_i)$, so $p_i(T_i)w_i=0$ and $p_i(T_i)$ is the zero operator for $W_i$. As $p_i(T_i)$ is the zero operator, $p_i(T_i)=0$ and $p_i$ is satisfied by $T_i$.
We take a polynomial $g$ such that $g(T_i)w_i=0$, then $g(T_i)$ is a zero operator for $W_i$ and $g(T_i)=0$. Now we take ${f_j=\frac{\prod\limits_{j=1}^k p_j}{p_i}}$ and $f_j(T)w_j$ can be expanded to show $f_j(T)w_j=0$ for any $j \neq i$, for example $f_j(T)w_k= (\frac {p_1(T) \cdots p_k(T)}{p_i(T)}) w_k=0$, as $w_k∈W_k=$ Ker$\space p_k(T)$.
By $1(i)$, $v=w_1+\cdots+w_k$ therefore $f_j(T)v=f_j(T)(w_1+ \cdots +w_k)=f_j(T)(0+ \cdots +w_i+ \cdots 0)=f_j(T)w_i$.
By part 2 of the theorem, $W_i$ is $T$-invariant, therefore $f_j(T)w_i∈W_i$. $g(T_i)$ is the zero operator for $W_i$, therefore $g(T_i)f_j(T)w_i=0$. As $g(T_i)$ is $g(T)$ restricted to $W_i$, $g(T)f_j(T)w_i=0$ and equivalently $g(T)f_j(T)v=0$. Therefore $g(T)f_j(T)$ is the zero operator for $V$ and $gf_j$ is satisfied by $T$.
By definition, $m_T$ divides any polynomial that is satisfied by $T$, therefore $m_T \space|\space gf_j$. Also, $m_T=p_i f_j$, therefore $p_i f_j \space|\space gf_j$, therefore $p_i \space|\space g$ and $p_i$ is the minimal polynomial of $T_i$.
 A: Your proof has some issues and can be made significantly shorter.  After you prove that there exist $q_j$ for which $f_1(T)q_1(T)v+\cdots+f_k(T)q_k(T)v=Iv=v$, I suggest that you that the space $W_i$, which you define as the image $f_i(T)q_i(T)$, is equal to both the image of $f_i(T)$ and the kernel of $p_i(T)$.
$W_i$ is the kernel of $p_i(T)$: Because $p_i(T)f_i(T) = 0$, it is clear that $W_i$ is a subspace of this kernel. Conversely, if $x \in \ker p_i(T)$, then we note that $p_i(t) \mid f_j(t)$ for all $i \neq j$, which means that $f_j(T)x = 0$. Thus, we have
$$
\begin{align}
x &= f_1(T)q_1(T)x+\cdots+f_k(T)q_k(T)x
\\ & = f_i(T)q_i(T)x + \sum_{j \neq i} q_j(T)[f_j(T)x] = f_i(T)q_i(T)x.
\end{align}
$$
This immediately shows 2: for any polynomial $f(t)$, $\ker f(T)$ is a $T$-invariant subspace.
Another useful observation:
$p_i(T)|_{V_j}$ is invertible: For any $i,j$, there exist polynomials $r_i,r_j$ for which $p_i(t)r_i(t) + p_j(t)r_j(t) = 1$. It follows that
$$
I = r_i(T)p_i(T) + r_j(T)p_j(T)x = r_j(T)p_j(T).
$$
Now, we show that the $W_i$ are disjoint subspaces: suppose that $x \in \ker p_i(T)$ and $x \in \bigoplus_{j \neq i} V_j$. By the above observation,
$$
p_i(T)x = 0 \implies x = p_i(T)|_{\bigoplus_{j \neq i} V_j}^{-1} 0 = 0.
$$
Now, we have shown that 1 holds.
For 3, it is clear that $T|_{\ker p_i(T)}$ has a minimal polynomial that divides $p_i$. On the other hand, if $p(T) = 0$ with $p\mid p_i$ and $p \neq p_i$, then $p(T)f_i(T)$ is zero over each $V_i$, so $p(T)f_i(T) = 0$. This contradicts the fact that $m_T$  was the minimal polynomial.
