Why rank of an $n \times n$ matrix after subtracting its column mean is $n-1$?

Given a $n \times n$ matrix $A = \begin{bmatrix} a_1 & a_2 & \dots & a_n \end{bmatrix}$, where each $a_i$ are columns of $A$ for $i = 1 \dots n$.

Column mean is calculated by $\bar{a} =(a_1 + a_2 + \dots + a_n)/n$.

Then, define:

$B = \begin{bmatrix} a_1 - \bar{a} & a_2 - \bar{a}& \dots & a_n - \bar{a} \end{bmatrix}$.

May I know why the rank$(B)$ is $n-1$?

I did try many times with computer program to prove but I want a proof of this.

• Would the reason be as simple as $\text{rank}(\hat{P}_b) \leq l < k$? – Empiricist Aug 21 '15 at 7:43
• $\widehat{\mathbf{P}}_{b}$ should be $l\times l$, not $k\times k$. – hermes Aug 21 '15 at 7:52
• @hermes I agree. I think it is a typo. $\widehat{\mathbf{P}}_{b}$ should be $l \times l$. But if $\mathbf{X}_{b}$ has $k$ columns, do you know why rank of $\widehat{\mathbf{P}}_{b}$ is $k-1$? – nam Aug 21 '15 at 10:56
We observe that the sum of all columns in $\mathbf{B}$ is equal to zero. That means one column can be rewritten as a linear combination of all the others. Hence the rank is at most $n-1$.