URGENT I'm trying to show that $X$ is an hyperplane iff it is a maximal non-spanning set. If I assume that $X$ is an hyperplane, I know that it must be of $rk(M)-1$ (with $M$ a matroid), so it follows directly that it's a non-spanning set. However, I'm struggling with the proof of its maximality. For the other implication, if it's a non-spanning set, then we have $r(X)<r(M)$, but I need to prove (I think with maximality) that the rank it's $r(X)-1$, such that it can be an hyperplane.
EDIT
The question is from the book named "Matroid Theory" by James Oxley, second edition, section 4, chapter 1.
If $H$ is a hyperplane, then it is a flat of rank $r(H)=r(M)-1$.
Assume $H$ is a hyperplane, then it is non-spanning as $r(H)<r(M)$ and suppose its not maximal, so $H\subset H'$ such that $r(H')<r(M)$ but, because $H$ is flat, if $a\in H'\setminus H$ then $r(H\cup \{a\})=r(H)+1=r(M)$ which is a contradiction, so $H$ is maximal.
Suppose $H$ is non-spanning and maximal. We have that $H\subseteq cl(H)$, so if $H\subset cl(H)$, and we know $r(H)=r(cl(H))<r(M)$ then $cl(H)$ is non-spanning, so $H$ wouldn't be maximal. This implies that $H$ is a flat. Suppose that $r(H)<r(M)-1$, then for $a\not \in H$ $r(H\cup \{a\})<r(M)$ because $H$ is flat, and this contradicts maximality too, hence $r(H)=r(M)-1$ and so $H$ is a hyperplane.