Artificial intelligent assistant

A peasant and his cows > A peasant owns $2n+1$ cows. When he separates a cow from the rest of the herd, he can split the $2n$ remaining ones into two groups of $n$ cows such that the sum of weights of each group are equal. > > Prove that the cows all have the same weight. This was given at an oral examination. I think some linear algebra is at stake, although I haven't solved the riddle yet.

I think user Blue outlined a nice proof in his comment. Let me turn it into an answer.

Let $x_1,\ldots,x_{2n+1}$ be the weights of the cows. Let $X=(x_1,\ldots,x_{2n+1})$. For a given $i\in\\{1,\ldots,2n+1\\}$, there are some disjoint subsets of $\\{1,\ldots,2n+1\\}\setminus\\{i\\}$, say $I$ and $J$ such that $\sum_{k\in I}x_k=\sum_{k\in J}x_k$. We rewrite this as $\sum_{j=1}^{2n+1}a_{ij}x_j=0$ where $a_{ii}=0$, $a_{ij}=1$ if $j\in I$ and $a_{ij}=-1$ if $j\in J$. This defines a matrix $A$ such that $AX=0$

It remains to prove that $A$'s null-space is one-dimensional. This can be done by remarking that it has a non-zero $2n\times 2n$ leading principal minor. Thus $\operatorname{rank}A\geq 2n$, but $(1,\ldots,1)\in \operatorname{Ker}A$. Hence $\operatorname{rank}A= 2n$, and $A$'s null-space is one-dimensional.

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy b74350bd6381188061bbc07b51b7102f