This seems to be a trivial question but I can't find a proof for it: Let $P$ and $Q$ be polynomials and $\Pi$ their product, $\Pi = PQ$. If $\Pi$ can be written as $(X - \lambda_1)\cdot\dots\cdot(X-\lambda_r)$, $P$ can also be written as a product of the form $(X - \mu_1)\cdot\dots\cdot(X - \mu_r)$. Or, in other words, if $\Pi$ factors into linear factors with no repeated roots, so does $P$.
Background: I am trying to proof that if $T$ is a diagonalizable linear map then its restriction to an invariant subspace is also diagonalizable. To prove this proposition, I use the minimal polynom. I showed that the minimal polynom of the restriction, $P$, divides the minimal polynom of $T$, $\Pi$, i.e. $\Pi = PQ$. To conclude, I need to argue why $P$ factors into linear factors with no repeated roots.
let $k$ be the field we are working over. Because $k[X]$ is a UFD, every monic polynomial $P \in k[X]$ is a unique product of monic irreducible polynomials. Let $P = P_1 \cdots P_t$ be the factorization into monic irreducibles, allowing repetition, and similarly $Q = Q_1 \cdots Q_s$. Then $\Pi = P_1 \cdots P_t Q_1 \cdots Q_s$. But the factorization of $\Pi$ into monic irreducibles is unique up to permutation, and by assumption its irreducible factors have degree $1$. Thus it must be that $P_1, \ldots, P_t$ and $Q_1, \ldots, Q_s$ all have degree $1$.