Two Hamel bases of the same vector space have the same cardinality, so we define the dimension of a vector space as the cardinality of one of its Hamel basis.
Let $E$ be an infinite-dimensional Banach space. Let $G$ be a closed subspace of $E$. A subset $L$ of $E$ is said to be a (topological) complement of $G$ if $L$ is a closed subspace of $E$ such that $G\cap L = \{0\}$ and $G+L=E$.
I would like to confirm that
If $G$ has finite codimension, then $G$ has a complement.
Could you have a check on my below understanding?
Let $n := \operatorname{codim} G < \infty$. By rank-nullity theorem, $n + \dim G = \dim E$. Let $(e_i)_{i\in I}$ be a Hamel basis of $G$. Then there is a linearly independent set $(e'_i)_{i=1}^n$ such that $(e_i)_{i\in I} \cup (e'_i)_{i=1}^n$ is a Hamel basis of $E$. Let $L := \operatorname{span} (\{e'_1, \ldots, e'_n\})$. Then $L$ is the required complement of $G$.