Put r=n−k. We construct column vectors h1,…,hn∈Fqr such that
every d−1 of them are linearly independent.
Take h1=0. Suppose h1,…,hj have been chosen, 1≤j≤n−1, with
every d−1 of them linearly independent. A vector v is a forbidden choice for
hj+1 if it is a linear combination of at most d−2 of the chosen columns, since
exactly then v together with those columns would form a dependent set of at most
d−1 columns. The number of linear combinations of exactly i columns with nonzero
coefficients is at most (ij)(q−1)i, so the number of forbidden vectors,
including 0, is at most
i=0∑d−2(ij)(q−1)i≤i=0∑d−2(in−1)(q−1)i<qr.
Hence some vector of Fqr is not forbidden; choose it as hj+1. Every
d−1 of h1,…,hj+1 are then linearly independent: a dependent set not
containing hj+1 is excluded by the induction hypothesis, and one containing it would
express hj+1, or a dependence among earlier columns, through at most d−2
earlier columns.
After n steps let H be the r×n matrix with columns h1,…,hn and
C=kerH. No d−1 columns of H are dependent, so by the
characterisation of the minimum distance
C has distance at least d. Its dimension is n−rankH≥n−r=k.