I'm a little confused by the solution of Example 2.41 in Linear Algebra Done Right 3th edition
Example 2.41 Show that $1,(x-5)^2,(x-5)^3$ is a basis of the subspace $U$ of $\mathcal P_3(\mathbb R)$ defined by $U=\{p\in \mathcal P_3(\mathbb R): p'(5)=0\}$. $\mathcal P_n$ means the vector space of polynomial functions of degree at most $n$, $\mathbb R$ means the set of real numbers.
The last paragraph of the proof is:
Thus $\dim U\ge3$. Because $U$ is a subspace of $\mathcal P_3(\mathbb R)$, we know that $\dim U\le\dim\mathcal P_3(\mathbb R)=4$ (by 2.38). However, $\dim U$ cannot equal 4, because otherwise when we extend a basis of $U$ to a basis of $\mathcal P_3(\mathbb R)$ we would get a list with length greater than 4. Hence $\dim U=3$. Thus 2.39 implies that the linearly independent list $1,(x-5)^2,(x-5)^3$ is a basis of $U$.
I can understand the list $1,(x-5)^2,(x-5)^3$ is linearly independent. But I don't understand the sentence starting from "However"...
Theorem 2.38 If $V$ is finite-dimensional and $U$ is a subspace of $V$, then $\dim U \le \dim V$.
Theorem 2.39 Suppose $V$ is finite-dimensional. Then every linearly independent list of vectors in $V$ with length $\dim V$ is a basis of $V$.