minimum distance of $\mathcal{C}_{U,G}$ is $n-\iota$.

For any $\mathbf{v},\mathbf{w}\in V$, we have $\Gamma_{\mathbf{v}}=\Gamma_{\mathbf{w}}$ if and only if $\mathbf{v}=\mathbf{w}$. In fact, if $\Gamma_{\mathbf{v}}=\Gamma_{\mathbf{w}}$, then $G(\lambda(\mathbf{v}-\mathbf{w}))=\mathbf{0}$ for every $\lambda\in{\mathbb{F}_{q^n}}$, whence $\dim_{{{\mathbb F}_{q}}}(U\cap\langle\mathbf{v}-\mathbf{w}\rangle_{{\mathbb{F}_{q^n}}})=n>\iota$ and hence $\mathbf{v}=\mathbf{w}$. Therefore, $\dim_{{{\mathbb F}_{q}}}(\mathcal{C}_{U,G})=rn$.

Finally, for any $\alpha\in{\mathbb{F}_{q^n}}$ and $\mathbf{v}\in V$ we have $\Gamma_{\mathbf{v}}\circ \omega_{\alpha}=\Gamma_{\alpha\mathbf{v}}$. Then $R(\mathcal{C}_{U,G})$ contains $\mathcal{F}_n$.

We now characterize the codes $\mathcal{C}_{U,G}$ which are MRD.

\[th:MRDiff\] Let $V=V(r,q^n)$ and $W=V(rn-k,q)$. Let $U=V(k,q)$ be an ${{\mathbb F}_{q}}$-subspace of $V$, $G:V\to W$ be an ${{\mathbb F}_{q}}$-linear map with $\ker(G)=U$, $\iota=\max\{\dim_{{{\mathbb F}_{q}}}(U\cap\langle\mathbf{v}\rangle_{{\mathbb{F}_{q^n}}}) \colon \mathbf{v}\in V^*  \}$ with $\iota<n$, and $\mathcal{C}_{U,G}=\left\{ \Gamma_{\mathbf{v}} \colon \mathbf{v} \in V \right\}$.

Then $\mathcal{C}_{U,G}$ is an ${{\mathbb F}_{q}}$-linear MRD code if and only if $$(\iota+1)\mid rn\quad\textrm{and}\quad k=\frac{\iota rn}{\iota+1}\leq(r-1)n.$$ In this case,

-   the parameters of $\mathcal{C}_{U,G}$ are $\left(\,\frac{rn}{\iota+1}\,,\,n\,,\,q\,;\,n-\iota\,\right)$;

-   the right idealiser of $\mathcal{C}_{U,G}$ is $\mathcal{F}_n$;

-   the weight distribution of $\mathcal{C}_{U,G}$ is $$A_{n-s}={n \brack s}_q \sum_{j=0}^{\iota-s} (-1)^{j}{n-s \brack j}_q q^{\binom{j}{2}}\left(q^\frac{rn(\iota-s-j+1)}{\iota+1}-1\right),$$ for $s \in \{0,1,\ldots,\iota\}$.

If $k>(r-1)n$, then for every $\mathbf{v}\in V^*$ we have $\dim_{{{\mathbb F}_{q}}}(U\cap\langle\mathbf{v}\rangle_{{\mathbb{F}_{q^n}}})\geq1$ and hence $\dim_{{{\mathbb F}_{q}}}(\ker(\Gamma_{\mathbf{v}}))=\dim_{{{\mathbb F}_{q}}}(U\cap\langle\mathbf{v}\rangle_{{\mathbb{F}_{q^n}}})\geq1$, so that $\mathcal{C}_{U,G}$ has no elements of rank $n$. Thus, by Lemma \[lemma:weight\], $\mathcal{C}_{U,G}$ is not an MRD code.

Suppose $k\leq (r-1)n$. Then $rn-k\geq n$ and the Singleton-like bound of Theorem \[th:Singleton\] reads 