This is a very basic question about understanding dimension (and codimension).
I was given that the definition for codimension is:
Let $W\subset X$ be a subspace. Then $\operatorname{codim} W=\dim(X\setminus W)$.
But there is a definition on a book saying that:
Given a linear space $X$, a proper linear subspace $M$ is called a linear space of codimension one if for a given $x_{0}\in X\setminus M$, every $x\in X$ can be represented as in the form
$$x=\alpha x_{0}+y$$ where $y$ is a scalar and $y\in M$.
And also, I have seen that many people use this representation (and its uniqueness) to show that the codimension of continuous linear non-zero functional is 1.
But I don't quite understand why this implies $\operatorname{codim}=1$ based on the definition in the very beginning? I think that I need to compute the dimension of the set of $x_{0}$, that is $x_{0}=(x-y)/\alpha$. Then I try to compute the basis for this, but then I get stuck.
Could someone explain this to me or help me understand dimension in a more sensible way?
Thanks a lot!