I have trouble understanding this proof from Humpreys: Linear Algebraic Groups page 104.
Theroem
Let $G$ be a connected and diagonalizable linear algebraic group (i.e. there exists a closed embedding into a torus $D_n(\mathbb C)$). Then $G$ is a torus.
Proof
The inclusion $G \to D_n$ induces a surjection $\mathbb C[D_n] \to \mathbb C[G]$ (restriction map) which induces a surjection $\chi(D_n) \to \chi(G)$ (restriction map) between the group characters. Since $D_n$ is a torus $\chi(D_n) = \mathbb Z^n$, and since $G$ is diagonalizable and connected $\chi(G) = \mathbb Z^r$. Thus $$ \mathbb Z^n = \chi(D_n) \to \chi(G) = \mathbb Z^r $$ gives us a decomposition $$ \chi(D_n) = Ker(\to) \oplus\mathbb Z^r. $$ We can then pick a basis for the summands, $\chi_1, \cdots, \chi_{n-r}$ and $\chi_{n-r+1}, \cdots, \chi_n$.
Then I can't understand the conclusion.
Thanks!