I want to show that the sample median $\tilde{x}$ minimizes the sum of absolute deviations,
i.e., $\tilde{x} = \underset{a}{argmin}\sum_{i=1}^{n}\begin{vmatrix} x_i-a\end{vmatrix}$
To show this, so far I have:
Sum of absolute deviation about a is
$=\sum_{i=1}^{n}\begin{vmatrix} x_i-a\end{vmatrix}$
Assume that $x_1\leq x_2\leq ...\leq x_n$
CASE 1: When n is ODD (n = 2m + 1)
We get,
$x_1\leq x_2\leq ... \leq x_m\leq x_{m+1}\leq ... \leq x_{2m} \leq x_{2m+1}$
From this we can see that
$\begin{vmatrix} x_1-a\end{vmatrix} + \begin{vmatrix} x_{2m+1}-a\end{vmatrix}$ is least when $x_1\leq a \leq x_{2m+1}$
$\begin{vmatrix} x_2-a\end{vmatrix} + \begin{vmatrix} x_{2m}-a\end{vmatrix}$ is least when $x_2\leq a \leq x_{2m}$
...
Thus,
$\begin{vmatrix} x_{m+1}-a\end{vmatrix}$ is least when $a=x_{m+1}=median$
CASE 2: When n is EVEN (n = 2m) We get,
$x_1\leq x_2\leq ... \leq x_m\leq x_{m+1}\leq ... \leq x_{2m-1} \leq x_{2m}$
From this we can see that
$\begin{vmatrix} x_1-a\end{vmatrix} + \begin{vmatrix} x_{2m}-a\end{vmatrix}$ is least when $x_1\leq a \leq x_{2m}$
...
Thus,
$\begin{vmatrix} x_{m}-a\end{vmatrix} + \begin{vmatrix} x_{m+1}-a\end{vmatrix}$ is least when $x_m\leq a \leq x_{m+1}$
Is this enough to show that sample median minimizes the sum of absolute deviations?