Non-closed subspace of a Banach space

There is a regular method to produce a lot of non-closed subspaces in arbitrary infinite dimensional Banach space.

Take any countable linearly independent family of vectors $\{w_i:i\in\mathbb{N}\}\subset V$ and define $W=\mathrm{span}\{w_i:i\in\mathbb{N}\}$. Then, $W$ is not closed.

Indeed, assume that $W$ is closed. Recall that $V$ is a Banach space, then $W$ is also Banach as closed subspace of Banach space. Linear dimension of $W$ is countable, but by corollary of Baire category theorem, Banach space can not have countable linear dimension. Contradiction, so $W$ is not closed.

This general result was demonstrated in Kevin's and J.J.'s answers. I'll show another one.

Consider Banach space $V=(C([0,1]),\Vert\cdot\Vert_\infty)$ of continuous functions with $\sup$ norm. Let $W=(P([0,1]),\Vert\cdot\Vert_\infty)$ be its proper subspace consisting of polynomials. It is of countable dimension because $W=\mathrm{span}\{x^k:k\in\mathbb{Z}_+\}$. From result given above it follows that $W$ is not closed.

But there is another proof. By Weierstrass theorem $W$ is dense in $V$, i.e. $\overline{W}=V\neq W$. Thus $W$ is not closed, thought it is dense in $V$.


A simple example, which gets at the difference between orthonormal and Hamel bases in infinite dimensions, is to take $H$ a separable infinite-dimensional Hilbert space and consider the span of its basis vectors $e_i, i \in \mathbb{N}$. This span, taken algebraically, certainly isn't the entire space because, for instance, $v=\sum_{i\in \mathbb{N}} \frac{1}{2^i} e_i$ isn't in it. Remember that spans are defined via finite linear combinations of the spanning set. But $v$ must be in the Hilbert space, because the partial sums define a Cauchy sequence and Hilbert spaces are complete.


Take $V$ to be the space of sequences $(a_1,a_2,\dots)$ of real numbers with norm $\|(a_1,a_2,\dots)\| = \sum_{k=1}^\infty |a_1|$. Consider the subspace of $W \subset V$ consisting of sequences with only finitely many of $a_1,a_2,\dots$ being non-zero. Then $A_k = (1,\frac{1}{2},\dots,\frac{1}{2^k},0,0,\dots)$, $k=1,2,\dots$, gives a sequence of elements of $W$, but the limit of this sequence is not in $W$.