Minimal polynomials and the primary decomposition theorem.

Let $$V$$ be a finite dimensional vector space and let $$T:V\to V$$ be a linear transformation. Suppose $$f(T)=0$$ and $$f(x)=a(x)b(x)$$ for some co-prime non-constant $$a(x)$$, $$b(x)$$. Then from Primary Decomposition Theorem, we know that $$V=ker(a(x))\oplus ker(b(x))$$. Prove that $$f=m_T(x)$$ if and only if $$a(x)$$ is the minimal polynomial for $$T|_{ker(a(x))}$$ and $$b(x)$$ is the minimal polynomial for $$T|_{ker(b(x))}$$.

The forward argument is solvable for me. However, in the reverse argument, I only deduced that $$m_T(x)=a(x)$$ or $$m_T(x)=b(x)$$ or $$m_T(x)=f(x).$$ I am not entirely sure how to eliminate the first two options. I guess one way is to show that neither $$ker(a(x))$$ and $$ker(b(x))$$ is trivial but I have no idea on how to do that either.

In the reverse argument, $$m_T(x)$$ must vanish $$T_{|\ker{a(T)}}$$, so $$a(x)|m_T(x)$$. Similarly, $$b(x)|m_T(x)$$, which entails ($$a,b$$ coprime) $$f(x)=a(x)b(x)|m_T(x)$$, whence $$m_T(x)=f(x)$$.