I need show this exercise:
**
If $Y\neq 0$ is a vectorial subspace of $X$ so that $\dim (X/ Y)=1$ then exist a lineal functional $f:X\to \mathbb{K}$ so that $Y=\ker f$.
**
I already showed this in the case that $X$ has a finite dimension (using bases). This is my proof for finite case:
If $Y$ is a subspace of $X$ of codimension $1$ and $\dim X=n$, let $\{y_1, \ldots, y_{n-1}\}$ be a basis of $Y$ and let $y_n\in X$ so that $\{y_1, \ldots, y_n\}$ is a basis de of $X$. Clearly the linear functional $f :X \to \mathbb{K}$ so that $f(y_i)=0$ for $i=1, \ldots, n-1$ and $f(y_n)=1$ satisfies that $Y=\ker f$.
How can I show my exercise without using finite dimension of X?
By assumption there is a vector $x_0\in X\setminus Y$ such that $X/Y=span\{x_0+Y\}$. So now define $f:X\to \mathbb{K}$ by $f(x)=\lambda$ where $x+Y=\lambda x_0+Y$. This is clearly a well defined linear functional, and we have $f(x)=0$ if and only if $x+Y=0+Y$, which happens if and only if $x\in Y$.