The problem I am working on is:
Let $ Y = \{{y_1,y_2,y_3,...y_n\}}$ and $c=median(Y)$. Prove that: $$ \text{min}\left[\sum_{i=1}^n \lvert y_{i}-c\rvert\right]=c $$
My question is:
Is the $\text{min}\left[\right]$ function here, asking for the which $y_i$ the distance between $y_i$ and $c$, $\lvert y_{i}-c\rvert$ is the smallest? Or is it asking, for the literal minimum of the arugments its given, like $\text{min}\left[99,1,4,7,121\right]=1$?
What I have tried so far:
1. First I tried an example to get a feel for things:
Let $ Y = \{{1,2,3,4,5\}}$ and $c=3$. Then we have:
$$\begin{align} \sum_{i=1}^5 \lvert y_{i}-3\rvert & = \lvert 1-3\rvert = 2 \\ & = \lvert 1-3\rvert = 2 \\ & = \lvert 2-3\rvert = 1 \\ & = \lvert 3-3\rvert = 0 \\ & = \lvert 4-3\rvert = 1 \\ & = \lvert 5-3\rvert = 2 \\ & = 2+1+0+1+2=6 \end{align}$$ So,
$$ \text{min}\left[\sum_{i=1}^5 \lvert y_{i}-3\rvert\right]=\text{min}\left[6\right]=6 $$
Since this would now be acounterexample to the statement I am supposed to prove, I must be having a misunderstanding?
2. If the $\text{min}\left[\right]$ function works the other way, I tried the following proof:
Proof:
Since the distance between a point and itself is $0$, $\left[c-c\right]=0$ and the fact that there can only be one median $c$ for a given set of $y$, clearly $\left[c-c\right] \lt \left[y_i-c\right]$ for all $y_i.$
Is this correct if thats the case?