Let $S$ be a convex non empty set in $\mathbb{R}^n$. Let $f:\mathbb{R}^n\to \mathbb{R}$ be a function defined by
$$f(y) = \min \{|y-x|, x\in S\}$$
This function is convex. Prove this affirmation when
$$S = \{x\in\mathbb{R}^2|ax_1 + bx_2 = c\}$$
Interpret geometrically
So $f$ at $y$ is simply the point of the line $ax_1+bx_2=c$ which is the closest to $y$. Normally I'd write the convex function definition and try to look at it to see some relation:
$$f(\lambda x + (1-\lambda) y) \le \lambda f(x) + (1-\lambda)f(y)$$
so I'd have to come up with something like this:
$$\min\{|\lambda x + (1-\lambda)y-z|, z\in S\}\le \lambda \min\{|x-z|, z\in S\} + (1-\lambda)\min\{|y-z|, z\in S\}$$
I tried using the triangular inequation:
$$|\lambda x + (1-\lambda)y-z|\le \lambda|x|+(1-\lambda)|y|+|z|$$
but I don't think anything useful comes from this.
The $\min$ should be an $\inf$ since a minimiser need not exist.
Let $d_S(x) = \inf_{s \in S} |s-x|$, note that it is the distance from $x$ to the set $S$ (or rather its closure).
Let $\epsilon>0$. Pick $x_k$ ($k=1,2$) and then select $s_k \in S$ such that $|x_k-s_k| \le d_S(x_k) +\epsilon$. Then, with $t \in [0,1]$ we have \begin{eqnarray} d_S(tx_1+(1-t)x_2) &\le& |tx_1+(1-t)x_2 - (ts_1+(1-t)s_2)| \\ &\le& t|x_1-s_1|+(1-t)|x_2-s_2| \\ &\le& t d_S(x_1) + (1-t) d_S(x_2) + \epsilon \end{eqnarray} Since this is true for all $\epsilon>0$ we have the desired result.
Note that convexity of $S$ is needed above to conclude that $ts_1+(1-t)s_2 \in S$.
This is a very useful function in convex and non differentiable analysis.