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. I'm trying to prove that
Let $N$ be a $p$-dimensional subspace of $E^*$ and $$ G := N^\perp := \{x \in E : \langle f, x \rangle =0 \text{ for all } f \in N\}. $$ Then $p = \operatorname{codim} G := \dim(E/G)$.
Could you have a check on my attempt?
Let $\{f_1, \ldots, f_p\}$ be a basis of $N$. We consider the function $$ \Phi:E \to \mathbb R^p, x \mapsto (\langle f_1, x \rangle, \ldots, \langle f_p, x \rangle). $$
Then $\Phi$ is a continuous linear map with $\ker \Phi = G$. Let's prove that $\Phi$ is surjective. Suppose not; then there is $\alpha =(\alpha_1, \ldots, \alpha_p) \in \mathbb R^p \setminus \operatorname{im} \Phi$. Because $\dim (\operatorname{im} \Phi) <\infty$, we get $\operatorname{im} \Phi$ is closed. By Hahn–Banach theorem, there are real numbers $\lambda_1 < \lambda_2$ and a vector $\beta =(\beta_1, \ldots, \beta_p) \in \mathbb R^p \setminus \{0\}$ such that $$ \sum_{i=1}^p \beta_i \langle f_i, x \rangle < \lambda_1 < \lambda_2 < \sum_{i=1}^p \beta_i \alpha_i, $$ which is a contradiction. Hence $\Phi$ is surjective. By first isomorphism theorem for groups, $$ \operatorname{im} \Phi \cong E / \ker \Phi. $$
It follows that $\mathbb R^p \cong E/G$. The claim then follows.