I'm trying to understand a proof of Cochran's theorem
Let $X_1, X_2, \ldots, X_n$ be a random sample from an $N(0,1)$ distribution and let $x$ represent the vector of these observations. Suppose $$x^\top x = \sum_{i=1}^k x^\top Q_i x$$ where $Q_i$ is PSD with rank $r_i$. The $k$ quadratic forms in the sum are independent and $x^\top Q_i x\sim \chi^2(r_i), \, i=1,2,\ldots,k$ if and only if $\sum_{i=1}^k r_i=n$.
In the first few lines, the proof I'm reading says if $\sum_{i=1}^k r_i = n$, then $I= \sum_{i=1}^k Q_i$. I don't see why this is at all true nor can I prove it. Can someone provide some intuition/explanation for this?