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.

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$.
