Hyperplane is a convex I am not too sure how to prove that a hyperplane in $\mathbb{R}^{n}$ is convex? So far I know the definition of what convex is, but how do we add that hyperplane in $\mathbb{R}^{n}$ is convex?
Thanks in advance!
 A: Roughly speaking, you need to show that any two points of the hyperplane of $\mathbb{R}^n$ can be joined by a line segment.
First, lets define what this hyperplane $H$ is:
$$
H=\left\{ \pmatrix{x_1\\ \vdots\\ x_n} \in \mathbb{R}^n \;|\;
a_1x_1+\cdots+a_n x_n = c \right\}
$$
where $a_1,\cdots,a_n \neq 0$ and $c\in \mathbb{R}$.
So you need to show that 
$$
\forall X,Y \in H, \; \lambda X+(1-\lambda)Y \in H, \; 0\le \lambda \le 1
$$
Lets do it:
$$
\lambda X+(1-\lambda)Y =\pmatrix{\color{red}{\lambda x_1+(1-\lambda)y_1}\\ \vdots \\ \color{red}{\lambda x_n+(1-\lambda)y_n}}
$$
Since $X,Y \in H$, we can write
$$
\begin{cases}
a_1x_1+\cdots+a_n x_n = c \\
a_1y_1+\cdots+a_n y_n = c
\end{cases}
$$
and so $\forall \lambda \in [0,1]$:
$$
\begin{cases}
\lambda a_1x_1+\cdots+\lambda a_n x_n = \lambda c \\
(1-\lambda)a_1y_1+\cdots+(1-\lambda)a_n y_n = (1-\lambda)c
\end{cases}
$$
Summing these two equations yields
\begin{align}
&\lambda a_1x_1+(1-\lambda)a_1y_1+\cdots+\lambda a_n x_n+(1-\lambda)a_n y_n = \lambda c+(1-\lambda)c \\
\Rightarrow \quad &a_1\left(\color{red}{\lambda x_1+(1-\lambda)y_1}\right)+\cdots+a_n\left(\color{red}{\lambda x_n+(1-\lambda)y_n}\right)= c \\
\Rightarrow \quad &\lambda X+(1-\lambda)Y \in H
\end{align}
A: Here is another elegant way of proving that a hyperplance $\mathcal{H}_n \subset \mathbb{R}^n $ is a convex set (while going through some important results in the theory of convex sets).
Claim 1: Every hyperplane given by $a^Tx = c$ can be viewed as the intersection of two (closed) halfspaces given by $a^Tx \leq c$ and $a^Tx \geq c$. (Easily seen!)
Claim 2: Every halfspace $a^Tx \leq c$ is convex.
Proof: Let $x_1, x_2$ be any two points in the halfspace $\mathcal{H}$ : $a^Tx \leq c$. Then, $\forall \theta \in [0,1]$, we can see that
$$ a^T(\theta x_1 + (1-\theta) x_2) = \theta a^Tx_1 + (1-\theta) a^Tx_2 \leq \theta c + (1-\theta)c = c$$
i.e. $\theta x_1 + (1-\theta) x_2 \in \mathcal{H}$.
Claim 3: Arbitrary intersection of convex sets is convex. (can be proved similarly by using first principles)
Combining the above arguments, it immediately follows that a hyperplane is indeed a convex set.
