codes, i.e. ${{\mathbb F}_{q}}$-subspaces of ${{\mathbb F}_{q}}^{m\times n}$. Delsarte showed in [@Delsarte] that the parameters of these codes must obey a Singleton-like bound.

\[th:Singleton\] If $\operatorname{\mathcal{C}}$ is an RM code of ${{\mathbb F}}_q^{m\times n}$ with minimum distance $d$, then $$|\operatorname{\mathcal{C}}| \leq q^{\max\{m,n\}(\min\{m,n\}-d+1)}.$$

When equality holds, we call $\operatorname{\mathcal{C}}$ a *maximum rank distance* (*MRD* for short) code. Examples of MRD codes are resumed in [@PZ; @sheekey_newest_preprint], see also the paper [@SheekeyLondon].

For an RM code ${{\mathcal C}}\subseteq {{\mathbb F}}_{q}^{m \times n}$, the *adjoint code* of $\operatorname{\mathcal{C}}$ is $$\operatorname{\mathcal{C}}^\top =\{C^t \colon C \in \operatorname{\mathcal{C}}\},$$ where $C^t$ is the transpose matrix of $C$. Define the symmetric bilinear form $\langle\cdot,\cdot\rangle$ on ${{\mathbb F}}_q^{m \times n}$ by $$\langle M,N \rangle= \mathrm{Tr}(MN^t).$$ The *Delsarte dual code* of an ${{\mathbb F}}_q$-linear RM code $\operatorname{\mathcal{C}}\subseteq {{\mathbb F}}_{q}^{m \times n}$ is $$\operatorname{\mathcal{C}}^\perp = \{ N \in {{\mathbb F}}_q^{m\times n} \colon \langle M,N \rangle=0 \; \text{for each} \; M \in \operatorname{\mathcal{C}}\}.$$

\[rk:dualMRD\] If $\mathcal{C}\subseteq {{\mathbb F}}_{q}^{m \times n}$ is an MRD code with minimum distance $d$, then $\operatorname{\mathcal{C}}^\top$ and $\mathcal{C^\perp}$ are MRD codes with minimum distances $d$ and $\min\{m,n\}-d+2$, respectively; see [@Delsarte; @Ravagnani].

Given an RM code $\mathcal{C}$ in $\mathbb{F}_{q}^{m\times n}$ and an integer $i \in \mathbb{N}$, define $A_i=|\{M \in 