TITLE: If a vector space and one subspace are both infinite-dimensional. Are they equal?
QUESTION [8 upvotes]: From linear algebra I know this theorem:
If V is a finite-dimensional vector space and W is a subspace of V, then
$$
i)~ dim~ W \leq dim ~V\\
ii) ~dim~ W = dim~ V \longrightarrow W=V
$$
As a lemma: If $dim ~W = \infty$ $\longrightarrow$ $dim~V = \infty$
My question is: Being W a subspace of V, Is this valid?
$$
dim~W=dim~V = \infty \longrightarrow W = V
$$
My tentative answer is no. If V is the vector space of continuous functions, and W is the vector space of polynomials, then W is a subspace of V and is infinite-dimensional, as well as V (by the last lemma). Here $dim~W=dim~V=\infty$ but $W\neq V$.
I would like to ensure this proof is correct, thanks.

REPLY [4 votes]: The comments above have given examples where $V\not=W$. In fact we can do even better - we need not even have $V\cong W$ at all!
This is guaranteed to happen if $\vert V\vert>\vert W\vert$, since then there is no bijection between $V$ and $W$ in the first place. "Nice" infinite-dimensional vector spaces like the spaces $\mathsf{ContFunc}$ or $\mathsf{DiffFunc}$ of all continuous or differentiable functions respectively tend to have the same cardinality (namely $2^{\aleph_0}$ - checking this in the case of the previous two examples is a good exercise); however, the space $\mathsf{AllFunc}$ of all functions $\mathbb{R}\rightarrow\mathbb{R}$ is much bigger (it has cardinality $2^{2^{\aleph_0}}$). So taking $V=\mathsf{AllFunc}$ and $W=\mathsf{ContFunc}$ (say) gives an example where even isomorphism fails.
The above example may be uncomfortably large at first; we can get a smaller example, at the cost of a somewhat harder proof, by setting (for example) $V=\mathsf{ContFunc}$ and look at the subspace $\mathsf{PolyFunc}$ of polynomial functions. The point is that $W$ has dimension $\aleph_0$ while $V$ has dimension $2^{\aleph_0}$; checking each fact is a good exercise. Note that we do have to do this analysis since the spaces have the same cardinality (namely $2^{\aleph_0}$) so the idea of the previous paragraph doesn't work here.

Conversely, it's worth noting that we do get isomorphism if $V$ and $W$ have the same dimension (but "$=\infty$" is too vague here since there are lots of different infinite cardinalities): the standard proof for finite-dimensional spaces lifts without change to the infinite-dimensional case, since any bijection between bases extends uniquely to an isomorphism. However, it's worth noting that the axiom of choice plays a crucial role here, and in fact even saying that all vector spaces have bases is equivalent to the axiom of choice!
{"set_name": "stack_exchange", "score": 8, "question_id": 4159142}