# Help with proof about maximum number of eigenvalues

I'm working my way through Linear Algebra Done Right. To help with one proof, I want to prove the following:

Given $\mathbf{V}$, a vector space and $T$, a linear operator on it, then:

If $\mathbf{W}_1$ and $\mathbf{W}_2$ are subspaces of $\mathbf{V}$ such that:

1. $\mathbf{V}$ is a direct sum of $\mathbf{W}_1$ and $\mathbf{W}_2$.

2. $\mathbf{W}_1$ and $\mathbf{W}_2$ are invariant under $T$.

3. The restriction of $T$ to $\mathbf{W}_1$ has at most $k$ eigenvalues.

4. The restriction of $T$ to $\mathbf{W}_2$ has at most $p$ eigenvalues.

Then $T$ has at most $k+p$ eigenvalues.

I've done a sketch of a proof using determinants, but it was based on old knowledge about the properties of determinants with regards to eigenvalues, so it may not be correct. The book doesn't emphasize using them though, and maybe there's a proof of this without using determinants.

I've tried a proof by contradiction, trying to find something weird by assuming that T can have more than $k+p$ eigenvalues, but I haven't been able to find anything.

Any help would be appreciated.

-