Prove that if $\sum_{i=1}^n\lambda_i|x-a_i|=0$ then $\lambda_1=\lambda_2=\cdots \lambda_n=0$ Let $ n\in \Bbb N $ and $ (a_1,a_2,\cdots,a_n)\in \Bbb R^n $ such that
$$a_1<a_2<\cdots <a_n$$
Prove that if there exist $(\lambda_1,\lambda_2,\cdots,\lambda_n)\in \Bbb R^n $ satifying
$$(\forall x\in\Bbb R)\; \sum_{i=1}^n\lambda_i|x-a_i|=0$$
then
$$\lambda_1=\lambda_2=...=\lambda_n=0$$
I tried induction in vain. Any idea will be appreciated.
 A: Notice that if $ax+b=0$ for some interval $x\in(u,v)$, then $a=b=0$.
Therefore, we have, for $x\in(a_k,a_{k+1})$ (denote $a_0=-\infty$ and $a_{n+1}=+\infty$), we have
$$\sum_{i=1}^{k}\lambda_i(x-a_i)+\sum_{i=k+1}^{n}-\lambda_i(x-a_i)=0$$
Consider the $x$'s coefficient, we have
$$\sum_{i=1}^{k}\lambda_i+\sum_{i=k+1}^{n}-\lambda_i=0$$
Comparing the case when $x\in (a_{k+1},a_{k+2})$, that is
$$\sum_{i=1}^{k+1}\lambda_i+\sum_{i=k+2}^{n}-\lambda_i=0$$
We know that $\lambda_{k+1}=0$. Let $k=0,1,\dots,n-1$, we can arrive at all $\lambda_i$'s are zero.
A: Denote $P(x)$ as the function $\sum_{i=1}^n \lambda_i |x-a_i|$.
For each $i\in [n]$, there exists some $\epsilon_i>0$ such that $a_i-\epsilon_i>a_{i+1}$ and $a_i+\epsilon_i=a_{i+1}$ (where we can treat $a_0$ and $a_{n+1}$ as very small and large numbers). For example something like $\epsilon_i=\text{min}\left(\frac{a_{i+1}-a_i}{2},\frac{a_i-a_{i-1}}{2}\right)$. We can deduce that
$$P(a_i+\epsilon_i)-P(a_i-\epsilon_i)=2\lambda_i\epsilon_i=0$$
So it follows that $\forall i\in [n], \lambda_i=0$
A: To prove this, let $x>a_n$. In this case, we have that
$$\sum_{i=1}^n\lambda_i|x-a_i|=\sum_{i=1}^n\lambda_i(x-a_i).$$
For this to hold for all $x>a_n$, we need to have that $\sum_{i=1}^n\lambda_i=0$.
Now pick $x\in(a_{n-1},a_n)$. This yields
$$\sum_{i=1}^n\lambda_i|x-a_i|=\sum_{i=1}^{n-1}\lambda_i(x-a_i)-\lambda_n(x-a_n).$$
For this to hold for all $x\in(a_{n-1},a_n)$, we need to have that $\sum_{i=1}^{n-1}\lambda_i-\lambda_n=0$.
Doing this successively, we obtain the expressions
$$\sum_{i=1}^m\lambda_i(x-a_i)-\sum_{i=m+1}^n\lambda_i(x-a_i),$$
which yield $\sum_{i=1}^m\lambda_i-\sum_{i=m+1}^n\lambda_i=0$ for $m\ge1$.
We can therefore build the following system of linear equations
$$\begin{bmatrix}
1 & 1 & \ldots & 1\\
1 & 1 & \ldots & -1\\
\vdots & & & \vdots\\
1 & -1 & \ldots & -1
\end{bmatrix}\lambda=0.$$
All we need to do now is to prove that the determinant of this matrix is nonzero. To show that we can do some row operations and build a matrix where the first row is the first row of the above matrix, the second row is the sum of the first and second rows divided by two, the third row is the sum of the first and third rows divided by two, etc. We then obtain the matrix
$$\begin{bmatrix}
1 & 1 & \ldots & 1\\
1 & 1 & \ldots & 0\\
\vdots & & & \vdots\\
1 & 0 & \ldots &0
\end{bmatrix}$$
for which it is immediate to see that it is full row rank. Therefore, the matrix is invertible and the only solution is $\lambda=0$.
A: Take the case 1) $\lambda_1|x-a_1|=0$, then chossing $x=2a_1$ we get $\lambda_1|a_1|=0$ if $a_1\neq 0$, then clearly $\lambda_1=0$, if $a_1=0$ you can take any value for $x$.
case 2) $\lambda_1|x-a_1|+\lambda_2|x-a_2|=0$, now take $x=a_2$ then  $\lambda_1|a_2-a_1|=0$, so $\lambda_1=0$ and therefore commingback to case 1) $\lambda_2|x-a_2|=0$, we get that $\lambda_2=0$.
General case. Suppose by induction that for sums of large $n-1$  it is true.
Now move $x$ to $x+a_n$, then $\displaystyle \sum_{i=1}^n\lambda_i|x-a_i|=0$ becomes in $\displaystyle \sum_{i=1}^{n-1}\lambda_i|x-(a_i-a_n)|=0$, by the condiction $a_1<\dots<a_n$ then $a_1-a_n<a_2-a_n<\dots <a_{n-1}-a_n$, so we are in the case  $n-1$, therefore $\lambda_1=\dots=\lambda_{n-1}=0$, and by the case 1) $\lambda_n=0$, too.
