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.
Could you confirm if my below understanding is fine?
Let $E$ be an infinite-dimensional Banach space. Let $G$ be a closed subspace of $E$. Let $L$ be a (topological) complement of $G$, i.e., $L$ is a closed subspace of $E$ such that $G\cap L = \{0\}$ and $G+L=E$.
- By cardinal arithmetic, $\dim G +\dim L = \dim E$. This identity implies a result (for Hilbert spaces) in this question.
- By rank-nullity theorem, $\operatorname{codim} L + \dim L = \dim E$.
Then $\dim G = \operatorname{codim} L$ follows from below Lemma.
Lemma Let $A, B, C$ be non-empty sets. If $|A|+|B| = |A|+|C|$, then $|B|=|C|$. Here $|A|$ is the cardinality of $A$.
As indicated in a comment, above Lemma is not true. I would like to ask if $\dim G = \operatorname{codim} L$ still holds.