# rank of a matrix if one component of each row is a linear combination of the others

I am sure that this problem is really simple but now I can not see the solution. Let $$A$$ be a matrix $$m\times m$$ with full rank. Then, we change all the components $$A(j,j)$$ by $$-\sum_{k,k\neq j} A(j,k)$$, where $$j$$ is the row number. I have made simulations with random matrix and after the change the rank of the new matrix is $$m-1$$. Why?. I see that in every row we have a term that is a linear combination of the term from the other rows. But I do not see how to demonstrate the reduction of the rank.

Denote column $$i$$ by $$A_i$$. The matrix has full rank, so it's columns are linearly independent. Namely $$\sum_i A_i \neq 0$$, where $$0$$ is the zero vector.
Now for every diagonal entry $$A(j,j)$$, replace it with negative the sum of all other entries in that row, call this new matrix $$B$$. Then clearly $$\sum_i B_i = 0$$ (can you see why?). This means that the columns are no longer linearly independent. In other words, $$A$$ has reduced in rank when it becomes $$B$$: $$rank(B) < m .$$
To compute the rank exactly, we apply elementary column operations to kill the last column. Recall that the rank of a matrix is unchanged by elementary operations on rows or columns: $$\begin{cases} \mbox{Add column } 1 \mbox{ to column } m \\ \mbox{Add column } 2 \mbox{ to column } m \\ \dots \\ \mbox{Add column } m-1 \mbox{ to column } m \end{cases}$$
Check yourself that $$B$$ now has columns $$B_1 , B_2 , B_{m-1}, 0$$. But the first $$m-1$$ columns are linearly independent, since the columns of $$A$$ were linearly independent. To see this, assume there were coefficients $$\beta_1, ..., \beta_{m-1}$$, not all $$0$$, such that $$\sum_{i=1}^{m-1} \beta_i B_i = 0 .$$ This would mean that the first row of $$B$$ sums to $$0$$: $$\beta_1 B(1,1) + \beta_2 B(1,2) + \dots + \beta_{m-1} B(1, m-1) = 0$$ $$\implies - \beta_1 \left( \sum_{k=2}^{m} A(1,k) \right) + \beta_2 A(1,2) + \dots + \beta_{m-1} A(1, m-1) = 0$$ $$\implies - \beta_1 A(1,m) + \sum_{k=1}^{m-1} \beta_k A(1,k) = 0$$
By full rankness of $$A$$, this last equality is true if and only if the coefficients were all $$0$$, a contradiction.
Therefore the first $$m-1$$ columns of $$B$$ are linearly independent. Namely, $$rank(B)=m-1 .$$