I am studying Quantum error correction that is based on some aspects on classical error correction.
I am reading some very basics around linear error correcting codes.
I consider a linear code [n,k]: thus it encodes k bits of information into n bits.
My question: I don't understand why the parity check matrix has $n-k$ lines.
What I understand from the topic.
If I call $x$ the column vector of the information bits I want to encode in the n-bits, I define $G$ the generator matrix such that:
$$ y = G x $$
Where $y$ is my encoded information.
The $H$ matrix is built such that its kernel is the code space. Thus, its kernel must be composed of the column vectors of $G$ as the code space is spanned by the column vectors of $G$.
All this means that the line vectors of $H$ must be orthogonal to the column vectors of $G$.
But why do we have to take $n-k$ lines in $H$, why not $n$ lines, or $2$ lines ? I guess it is a way to ensure us that the Kernel of $H$ is exactly the code space but I don't understand why this number of lines ensure this.