---
abstract: |
    Reducible codes for the rank metric were introduced for cryptographic purposes. They have fast encoding and decoding algorithms, include maximum rank distance (MRD) codes and can correct many rank errors beyond half of their minimum rank distance, which makes them suitable for error-correction in network coding. In this paper, we study their security behaviour against information leakage on networks when applied as coset coding schemes, giving the following main results: 1) we give lower and upper bounds on their generalized rank weights (GRWs), which measure worst-case information leakage to the wire-tapper, 2) we find new parameters for which these codes are MRD (meaning that their first GRW is optimal), and use the previous bounds to estimate their higher GRWs, 3) we show that all linear (over the extension field) codes whose GRWs are all optimal for fixed packet and code sizes but varying length are reducible codes up to rank equivalence, and 4) we show that the information leaked to a wire-tapper when using reducible codes is often much less than the worst case given by their (optimal in some cases) GRWs. We conclude with some secondary related properties: Conditions to be rank equivalent to cartesian products of linear codes, conditions to be rank degenerate, duality properties and MRD ranks.\
author:
- 'Umberto Mart[í]{}nez-Peñas,  [^1]'
title: 'Generalized rank weights of reducible codes, optimal cases and related properties'
---

[Shell : Bare Demo of IEEEtran.cls for Journals]{}

Generalized rank weight, rank-metric codes, rank distance, rank equivalent codes, reducible codes, secure network coding.

Introduction
============

network coding was first studied in [@ahlswede; @linearnetwork], further formalized in [@Koetter2003], and provides higher throughput than storing and forwarding messages on the network. Two of the *main problems* in this context are error and erasure correction, and security against information leakage to a wire-tapper, which were first studied in [@cai-yeung] and [@secure-network], respectively.

Rank-metric codes were found to be universally suitable (meaning independently of the underlying network code) for error and erasure correction in linear network coding in [@on-metrics], used as forward error-correcting codes, and they were found to be universally suitable against information leakage in [@silva-universal], used in the form of coset coding. Both constructions can be treated separately and applied together in a concatenated way (see [@silva-universal Sec. VII-B]).

On the security side, generalized rank weights (GRWs) of codes that are linear over the extension field were introduced in [@rgrw; @oggier] to measure the worst-case information leakage for a given number of wire-tapped links. Later, GRWs were extended in [@ravagnaniweights] and [@allertonversion] to codes that are linear over the base field, where they are called Delsarte generalized weights and generalized matrix weights, respectively. We will use the term GRWs for the latter parameters, which were also found to measure the worst-case information leakage for codes that are linear over the base field [@allertonversion Th. 3].

Gabidulin codes [@gabidulin] constitute a family of maximum rank distance (MRD) codes that cover all cases when the number of outgoing links $ n $ is not larger than the packet length $ m $, and all of their GRWs are optimal (meaning largest possible).

Cartesian products of these codes are proposed in [@silva-universal Sec. VII.C] for the case $ n > m $ both for error correction and security against information leakage. A generalization of these codes, called reducible codes, were introduced earlier in [@reducible] as an alternative to Gabidulin codes [@gabidulin] to improve the security of rank-based public key cryptosystems [@ideals]. On the error correction side, it was shown in [@reducible] that reducible codes have fast encoding and rank error-correcting algorithms, their minimum rank distance is not worse than that of cartesian products of codes [@silva-universal Sec. VII.C], being actually MRD in some cases, and they can correct many rank errors beyond half of their minimum rank distance (even in the MRD cases). Therefore they seem to be the best known codes for error correction in linear network coding when $ n > m $.

However, on the security side, only the existence of codes with optimal first GRW (MRD codes) has been studied in the case $ n > m $ [@allertonversion Sec. IV-B], but no bounds nor estimates of higher GRWs of rank-metric codes or other properties related to their worst-case information leakage are known when $ n > m $, except for cyclic codes with minimal GRWs [@oggiercyclic].

In this paper, we study the security provided by reducible codes in linear network coding when used for coset coding as in [@silva-universal] by studying their GRWs and showing their optimality in several cases. In particular, we study for the first time the GRWs of a concrete family of rank-metric codes with $ n > m $, which moreover include MRD codes for several parameters.

Main contributions
------------------

Our main contributions are the following:

1.  We give lower and upper bounds on GRWs of reducible codes, and exact values for cartesian products, giving a first step in the open problem of estimating or bounding the GRWs of a family of rank-metric codes for $ n > m $.

2.  We give new families of parameters for which reducible codes are MRD (some were given in [@reducible]), meaning that their first GRW is optimal and thus they are optimal regarding zero information leakage among all linear (over the extension or the base field) codes, by [@allertonversion Th. 3]. Using the estimates and exact values of GRWs of these codes in the previous item, we also give a first step in the open problem of finding the GRWs of a family of MRD codes for $ n > m $.

3.  We show that all linear (over the extension field) codes whose GRWs are all optimal for fixed packet and code sizes, but varying length, lie in the family of reducible codes from the previous item, up to rank equivalence.

4.  Finally, we show that information leakage when using reducible codes is often much less than the worst case given by their GRWs. In particular, they often provide strictly higher security than the known security provided by other MRD codes [@allertonversion Sec. IV-B].

Organization of the paper
-------------------------

After some preliminaries in Section II, the paper is organized as follows: In Section III, we give lower and upper bounds on the GRWs of reducible codes, extending the lower bound on the minimum rank distance given in [@reducible], and see that the given upper bound on the minimum rank distance can be reached by some reduction. In Section IV, we obtain new parameters for which reducible codes are MRD (or close to MRD) and with MRD components, and obtain explicit estimates on their GRWs, including those MRD codes found in [@reducible] and considered for secure network coding in [@silva-universal]. In Section V, we obtain all linear codes whose GRWs are all optimal, for all fixed packet and code sizes, up to rank equivalence. In Section VI, we see that the actual information leakage occuring when using reducible codes is often much less than the worst case given by their GRWs, providing higher security than other known MRD codes. Finally, in Section VII, we study secondary but related properties: Conditions to be rank equivalent to cartesian products and conditions to be rank degenerate. We study their duality properties and MRD ranks. Finally, we propose alternative constructions to the classical $ (\mathbf{u}, \mathbf{u} + \mathbf{v}) $ construction.

Definitions and preliminaries
=============================

Rank-metric codes
-----------------

Fix a prime power $ q $ and positive integers $ m $ and $ n $, and let $ \mathbb{F}_q $ and $ \mathbb{F}_{q^m} $ denote the finite fields with $ q $ and $ q^m $ elements, respectively. We may identify vectors in $ \mathbb{F}_{q^m}^n $ with $ m \times n $ matrices over $ \mathbb{F}_q $: Fix a basis $ \alpha_1, \alpha_2, \ldots, \alpha_m $ of $ \mathbb{F}_{q^m} $ over $ \mathbb{F}_q $. If $ \mathbf{c} = (c_1, c_2, \ldots, c_n) \in \mathbb{F}_{q^m}^n $, $ c_j = \sum_{i = 1}^m \alpha_i c_{i,j} $, and $ c_{i,j} \in \mathbb{F}_q $, for $ i = 1,2, \ldots, m $ and $ j = 1,2, \ldots, n $, we may identify $ \mathbf{c} $ with the matrix $$M(\mathbf{c}) = \left( c_{i,j} \right)_{1 \leq j \leq n}^{1 \leq i \leq m}.
\label{eq def matrix representation}$$ The rank weight of a vector $ \mathbf{c} \in \mathbb{F}_{q^m}^n $ is defined as the rank of the matrix $ M(\mathbf{c}) $ and denoted by $ {\rm wt_R}(\mathbf{c}) $. In this paper, a code is a subset of $ \mathbb{F}_{q^m}^n $. The term *rank-metric code* is used for codes with the rank metric.

Universal secure linear network coding {#subsec universal secure}
--------------------------------------

We consider a network with several sources and several sinks as in [@ahlswede; @linearnetwork]. In this model, a given source wants to transmit $ k $ packets in $ \mathbb{F}_q^m $ to one or several sink nodes, and does so by encoding them into a vector, $ \mathbf{c} \in \mathbb{F}_{q^m}^n $, which can be seen as $ n $ packets in $ \mathbb{F}_q^m $ by (\[eq def matrix representation\]), being $ n $ the number of outgoing links from the source.

In *linear network coding*, as considered in [@ahlswede] and [@linearnetwork], the nodes in the network forward linear combinations of received packets (see [@Koetter2003 Definition 1]), achieving higher throughput than just storing and forwarding. This means that a given sink is assumed to receive the vector $$\mathbf{y} = \mathbf{c} A^T \in \mathbb{F}_{q^m}^N,$$ for some matrix $ A \in \mathbb{F}_q^{N \times n} $, called a transfer matrix.

Two of the *main problems* in linear network coding considered in the literature are the following:

1.  Error correction [@cai-yeung]: Several packets are injected on some links in the network, hence the sink receives $$\mathbf{y} = \mathbf{c} A^T + \mathbf{e} \in \mathbb{F}_{q^m}^N,$$ for an error vector $ \mathbf{e} \in \mathbb{F}_{q^m}^N $.

2.  Information leakage [@secure-network]: A wire-tapper listens to $ \mu > 0 $ links in the network, obtaining $$\mathbf{z} = \mathbf{c} B^T \in \mathbb{F}_{q^m}^{\mu},$$ for a matrix $ B \in \mathbb{F}_q^{\mu \times n} $.

In [@on-metrics], it is proven that rank-metric codes are suitable for error correction when used as forward error-correcting codes, and in [@silva-universal], it is proven that they are also suitable to protect messages from information leakage when used as coset coding schemes, which were introduced in [@wyner] and [@ozarow]. Both coding techniques can be treated separately and applied together in a concatenated way (see [@silva-universal Sec. VII-B]).

Moreover, rank-metric codes are *universal* [@silva-universal] in the sense that they correct a given number of errors and erasures, and protect against a given number of wire-tapped links, independently of the matrices $ A $ and $ B $, respectively.

We consider the particular coding schemes in [@silva-universal Sec. V-B] with uniform distributions:

\[**[@silva-universal]**\] \[definition ozarow\] Given an $ \mathbb{F}_{q^m} $-linear code $ C \subseteq \mathbb{F}_{q^m}^n $ with generator matrix $ G \in \mathbb{F}_{q^m}^{k \times n} $, we define its coset coding scheme as follows: For $ \mathbf{x} \in \mathbb{F}_{q^m}^k $, its coset encoding is a vector $ \mathbf{c} \in \mathbb{F}_{q^m}^n $ chosen uniformly at random and such that $ \mathbf{x} = \mathbf{c} G^T $.

This type of encoding has been recently extended to $ \mathbb{F}_q $-linear codes in [@allertonversion Sec. II-D].

In this paper we will focus on rank-metric codes used for security against information leakage in the form of coset coding.

Generalized rank weights and information leakage {#subsec GRWs and leakage}
------------------------------------------------

The information leaked to a wire-tapping adversary when using coset coding schemes was obtained in [@silva-universal Lemma 6], then generalized in [@rgrw Lemma 7] to $ \mathbb{F}_{q^m} $-linear nested coset coding schemes [@zamir], and in [@allertonversion Prop. 4] to $ \mathbb{F}_q $-linear coset coding schemes.

We need the concept of Galois closed spaces [@stichtenoth]:

Denote $ [i] = q^i $ for an integer $ i \geq 0 $. If $ C \subseteq \mathbb{F}_{q^m}^n $ is $ \mathbb{F}_{q^m} $-linear, we denote $$C^{[i]} = \{ (c_1^{[i]}, c_2^{[i]}, \ldots, c_n^{[i]}) \mid (c_1, c_2, \ldots, c_n) \in C \},$$ we define the Galois closure of $ C $ as $ C^* = \sum_{i=0}^{m-1} C^{[i]} $, and we say that it is Galois closed if $ C = C^* $.

The next lemma is [@silva-universal Lemma 6]. Throughout the paper, $ I(X;Y) $ denotes the mutual information of the random variables $ X $ and $ Y $, taking logarithms with base $ q^m $.

\[lemma silva\] Denote by $ S $ the uniform random variable in $ \mathbb{F}_{q^m}^k $, $ X $ its coset encoding using an $ \mathbb{F}_{q^m} $-linear code $ C \subseteq \mathbb{F}_{q^m}^n $ according to Definition \[definition ozarow\], and denote $ W = XB^T $, where $ B \in \mathbb{F}_q^{\mu \times n} $. Then $$\label{leaked info}
I(S;W) = \dim(C \cap V),$$ where $ V \subseteq \mathbb{F}_{q^m}^n $ is the $ \mathbb{F}_{q^m} $-linear vector space with generator matrix $ B $.

Since Galois closed spaces in $ \mathbb{F}_{q^m}^n $ are those $ \mathbb{F}_{q^m} $-linear spaces with a generator matrix over $ \mathbb{F}_q $ [@stichtenoth Lemma 1], the previous lemma motivates the definition of generalized rank weights, introduced independently in [@oggier] for $ n \leq m $, and in [@rgrw Def. 2] for the general case:

Given an $ \mathbb{F}_{q^m} $-linear code $ C \subseteq \mathbb{F}_{q^m}^n $ of dimension $ k $, we define its $ r $-th generalized rank weight (GRW), for $ 1 \leq r \leq k $, as $$\begin{split}
d_{R,r}(C) = \min \{ & \dim (V) \mid V \subseteq \mathbb{F}_{q^m}^n, \mathbb{F}_{q^m} \textrm{-linear and} \\
 & V=V^*, \dim(C \cap V) \geq r \}.
\end{split}$$ We also define $ d_{R,0}(C) = 0 $ for convenience.

Hence $ d_{R,r}(C) $ is the minimum number of links that a wire-tapper needs to listen to in order to obtain at least the amount of information contained in $ r $ packets. In other words, $ r-1 $ packets is the *worst-case information leakage* when at most $ d_{R,r}(C)-1 $ links are wire-tapped.

The next lemma corresponds to [@slides Th. 16, Cor. 17]:

\[equivalent definition slides\] Given an $ \mathbb{F}_{q^m} $-linear code $ C \subseteq \mathbb{F}_{q^m}^n $ of dimension $ k $ and $ 1 \leq r \leq k $, it holds that $$\begin{split}
d_{R,r}(C) = \min \{ & {\rm wt_R}(D) \mid D \subseteq C, \mathbb{F}_{q^m} \textrm{-linear and} \\
 & \dim(D) = r \},
\end{split}$$ where $ {\rm wt_R}(D) = \dim(D^*) $ for an $ \mathbb{F}_{q^m} $-linear $ D \subseteq \mathbb{F}_{q^m}^n $.

In particular, it is shown in [@rgrw Cor. 1] that $ d_{R,1}(C) $ is the minimum rank distance of the code $ C $ (also denoted by $ d_R(C) $). Thus the minimum rank distance is of particular importance, since it gives the maximum number of wire-tapped links that guarantee zero information leakage, and we may evaluate the code’s optimality among all rank-metric codes (linear and non-linear) in this sense using the Singleton bound [@delsartebilinear Th. 6.3]: $$\label{singleton bound}
\# C \leq q^{\max \{ m,n \} (\min \{ m,n \} - d_R(C) + 1)},$$ where $ C \subseteq \mathbb{F}_{q^m}^n $ is an arbitrary rank-metric code. Codes attaining this bound are called maximum rank distance (MRD) codes.

Existing MRD code constructions {#existing code constructions}
-------------------------------

We briefly revisit two existing code constructions that have already been considered in the literature:

1.  Assume $ n \leq m $ and $ 1 \leq k \leq n $: Take elements $ \beta_1, \beta_2, \ldots, \beta_n \in \mathbb{F}_{q^m} $ that are linearly independent over $ \mathbb{F}_q $. The $ \mathbb{F}_{q^m} $-linear code $ C_{Gab} \subseteq \mathbb{F}_{q^m}^n $ generated by the matrix $$\left( \begin{array}{cccc}
    \beta_1 & \beta_2 & \ldots & \beta_n \\
    \beta_1^{[1]} & \beta_2^{[1]} & \ldots & \beta_n^{[1]} \\
    \vdots & \vdots & \ddots & \vdots \\
    \beta_1^{[k-1]} & \beta_2^{[k-1]} & \ldots & \beta_n^{[k-1]} \\
    \end{array} \right)$$ has dimension $ k $ and minimum rank distance $ d_{R}(C_{Gab}) = n - k + 1 $, and hence is MRD. These codes are known as Gabidulin codes and were introduced in [@gabidulin]. Their GRWs were given in [@rgrw Cor. 2]: $$d_{R,r}(C_{Gab}) = n - k + r.$$

2.  Assume $ n = lm $ and $ k = lk^\prime $, for some positive integers $ l $ and $ k^\prime \leq m $: The $ \mathbb{F}_{q^m} $-linear code $ C \subseteq \mathbb{F}_{q^m}^n $ defined as $ C = C_1 \times C_2 \times \cdots \times C_l $, where each $ C_i \subseteq \mathbb{F}_{q^m}^m $ is a $ k^\prime $-dimensional Gabidulin code, has dimension $ k $ and minimum rank distance $ d_{R}(C) = m - k^\prime + 1 $, and hence is also MRD. These codes were introduced in [@reducible Cor. 1] and considered in [@silva-universal Sec. VII-C] for secure network coding. In contrast with Gabidulin codes, although a first analysis of these codes is given in [@silva-universal], their GRWs are still not known. We will find all of them in Section \[estimates on their\].

The two previous constructions are particular cases of reducible codes, introduced in [@reducible], which we will study in the rest of the paper.

In [@allertonversion], MRD $ \mathbb{F}_q $-linear codes obtained by transposing the matrix representations of codewords in a Gabidulin code are proposed for the case $ n > m $. However no exact values or lower bounds are known for any code in this case ($ n > m $).

Reducible codes and reductions {#subsec reducible}
------------------------------

Consider positive integers $ l, n_1, n_2, \ldots, n_l $ and $ \mathbb{F}_{q^m} $-linear codes $ C_1 \subseteq \mathbb{F}_{q^m}^{n_1}, C_2 \subseteq \mathbb{F}_{q^m}^{n_2}, \ldots, C_l \subseteq \mathbb{F}_{q^m}^{n_l} $ of dimensions $ k_1 $, $ k_2, \ldots, k_l $, respectively. Consider matrices $ G_{i,j} \in \mathbb{F}_{q^m}^{k_i \times n_j} $, for $ i =1,2, \ldots, l $ and $ j = i,i+1, \ldots, l $, where $ G_{i,i} $ generates $ C_i $.

\[**[@reducible]**\] \[def reducible\] We say that an $ \mathbb{F}_{q^m} $-linear code $ C \subseteq \mathbb{F}_{q^m}^n $ is reducible with reduction $ \mathcal{R} = (G_{i,j})_{1 \leq i \leq l}^{i \leq j \leq l} $ if it has a generator matrix of the form $$G = \left(
\begin{array}{cccccc}
G_{1,1} & G_{1,2} & G_{1,3} & \ldots & G_{1, l-1} & G_{1,l} \\
0 & G_{2,2} & G_{2,3} & \ldots & G_{2, l-1} & G_{2,l} \\
0 & 0 & G_{3,3} & \ldots & G_{3, l-1} & G_{3,l} \\
\vdots & \vdots & \vdots & \ddots & \vdots & \vdots \\
0 & 0 & 0 & \ldots & G_{l-1,l-1} & G_{l-1,l} \\
0 & 0 & 0 & \ldots & 0 & G_{l,l} \\
\end{array} \right).$$

The length of the code $ C $ is $ n = n_1 + n_2 + \cdots + n_l $ and its dimension is $ k = k_1 + k_2 + \cdots + k_l $. $ C $ is the cartesian product of the codes $ C_1, C_2, \ldots, C_l $ if $ G_{i,j} = 0 $, for all $ j > i $.

For a given reduction $ \mathcal{R} $ as in the previous definition, we define its main components as the codes $ C_1, C_2, \ldots, C_l $, its row components as the $ \mathbb{F}_{q^m} $-linear codes $ C_i^\prime \subseteq \mathbb{F}_{q^m}^n $ with generator matrices $$\label{row components}
G_i^\prime = (0, \ldots, 0, G_{i,i}, G_{i,i+1}, \ldots, G_{i,l}),$$ for $ i = 1,2, \ldots, l $, and its column components as the $ \mathbb{F}_{q^m} $-linear codes $ \widehat{C}_j \subseteq \mathbb{F}_{q^m}^{n_j} $ generated by the matrices $$\label{column components}
\widehat{G}_j = (G_{1,j}, G_{2,j}, \ldots, G_{j,j})^T,$$ for $ j = 1,2, \ldots, l $, which need not have full rank.

It holds that $ k_i = \dim(C_i^\prime) $, $ \widehat{k}_j = \dim(\widehat{C}_j) \geq k_j $, $ C = C_1^\prime \oplus C_2^\prime \oplus \cdots \oplus C_l^\prime $ and $ C \subseteq \widehat{C} = \widehat{C}_1 \times \widehat{C}_2 \times \cdots \times \widehat{C}_l $.

Different reductions always have the same main components if their block sizes are the same. See Appendix \[app 1\] for a discussion on the uniqueness of reductions of a reducible code.

Bounds on GRWs of reducible codes and exact values {#sec bounds on GRWs}
==================================================

With notation as in Subsection \[subsec reducible\], it is proven in [@reducible Lemma 2] that $$\label{bound min distance}
d_{R,1}(C) \geq \min \{ d_{R,1}(C_1), d_{R,1}(C_2), \ldots, d_{R,1}(C_l) \}.$$ We now present the main result of this section, which generalizes (\[bound min distance\]) to higher GRWs and also gives upper bounds. As observed below, it gives the exact values for cartesian products.

\[grw bounds\] With notation as in Subsection \[subsec reducible\], for every $ r = 1,2, \ldots, k $, we have that $$\label{lower bound}
\begin{split}
d_{R,r}(C) \geq \min \{ & d_{R,r_1}(C_1) + d_{R,r_2}(C_2) + \cdots + d_{R,r_l}(C_l) \\
 & \mid r = r_1 + r_2 + \cdots + r_l, 0 \leq r_i \leq k_i \},
\end{split}$$ and $$\label{upper bound}
\begin{split}
d_{R,r}(C) \leq \min \{ & d_{R,r_1}(C_1^\prime) + d_{R,r_2}(C_2^\prime) + \cdots + d_{R,r_l}(C_l^\prime) \\
 & \mid r = r_1 + r_2 + \cdots + r_l, 0 \leq r_i \leq k_i \}.
\end{split}$$

The proof can be found at the end of the section. We now elaborate on some particular cases of interest.

First, observe that the bound (\[lower bound\]) gives the bound (\[bound min distance\]) for the minimum rank distance (the case $ r=1 $), and the bound (\[upper bound\]) gives the following (immediate) upper bound: $$\label{upper bound min distance}
d_{R,1}(C) \leq \min \{ d_{R,1}(C_1^\prime), d_{R,1}(C_2^\prime), \ldots, d_{R,1}(C_l^\prime) \}.$$

The previous theorem also gives the following corollary for cartesian products:

\[exact grw product\] If $ C = C_1 \times C_2 \times \cdots \times C_l $ and $ 1 \leq r \leq k $, with notation as before, then $$\begin{split}
d_{R,r}(C) = \min \{ & d_{R,r_1}(C_1) + d_{R,r_2}(C_2) + \cdots + d_{R,r_l}(C_l) \\
 & \mid r = r_1 + r_2 + \cdots + r_l \}.
\end{split}$$ \[grw product\]

Now we illustrate Theorem \[grw bounds\] with the following example that includes the MRD $ \mathbb{F}_{q^m} $-linear codes in Subsection \[existing code constructions\], item 2, for $ l = 2 $:

\[example computation\] With notation as in Theorem \[grw bounds\], assume that $ l = 2 $, $ n_1, n_2 \leq m $, $ k_1 \leq k_2 $ and take $ C_1 $ and $ C_2 $ as MRD codes (the matrix $ G_{1,2} $ can be arbitrary). In particular, $ d_{R,r_i}(C_i) = n_i - k_i + r_i $ [@rgrw] as in Subsection \[existing code constructions\], $ 1 \leq r_i \leq k_i $, $ i = 1,2 $. We estimate $ d_{R,r}(C) $ considering three cases:

1.  Assume $ 1 \leq r \leq k_1 $: The bounds (\[lower bound\]) and (\[upper bound\]) give $$\min \{ n_1 - k_1, n_2 - k_2 \} + r \leq d_{R,r}(C) \leq n_2 - k_2 + r.$$

2.  Assume $ k_1 < r \leq k_2 $ (if $ k_1 < k_2 $): In this case, in both bounds in Theorem \[grw bounds\], it is necessary that $ r_2 > 0 $. Hence, these bounds coincide and give the value $ d_{R,r}(C) = n_2 - k_2 + r $.

3.  Assume $ k_2 < r \leq k $: As in the previous case, now it is necessary that $ r_1 > 0 $ and $ r_2 > 0 $, and thus Theorem \[grw bounds\] gives the value $ d_{R,r}(C) = n - k +r $, which is optimal by the Singleton bound [@rgrw Proposition 1].

Finally, it is natural to ask whether different reductions (see Definition \[def reducible\]) may give different bounds in Theorem \[grw bounds\]. In Appendix \[app 1\], we show that all reductions have the same main components, thus (\[lower bound\]) remains unchanged. We now show that (\[upper bound min distance\]) can always be attained by some particular reduction. Other cases where (\[upper bound\]) may be attained by some reduction are open.

\[proposition exact for one red\] With notation as in Subsection \[subsec reducible\], there exists a reduction $ \overline{\mathcal{R}} = (\overline{G}_{i,j})_{1 \leq i \leq l}^{i \leq j \leq l} $ of $ C $ such that the bound (\[upper bound min distance\]) is an equality.

Assume that the minimum rank distance is attained by $ {\rm wt_R}(\mathbf{c}) = d_{R,1}(C) $, for $ \mathbf{c} \in C $. It holds that $ \mathbf{c} = \mathbf{c}_1^\prime + \mathbf{c}_2^\prime + \cdots + \mathbf{c}_l^\prime $, with $ \mathbf{c}_i^\prime \in C_i^\prime $, and $ \mathbf{c}_i^\prime = \mathbf{x}_i G_{i,i}^\prime $ (recall (\[row components\])), for some $ \mathbf{x}_i \in \mathbb{F}_{q^m}^{k_i} $ and all $ i = 1,2, \ldots, l $.

We may assume without loss of generality that $ \mathbf{x}_1 \neq \mathbf{0} $. We just need to define $ \overline{G}_{i,i} = G_{i,i} $ and choose matrices $ A_{1,j} \in \mathbb{F}_{q^m}^{k_1 \times k_j} $ and $ \overline{G}_{i,j} \in \mathbb{F}_{q^m}^{k_i \times n_j} $, for $ 1 \leq i \leq l-1 $ and $ i+1 \leq j \leq l $, such that the $ k \times k $ matrix $$A = \left(
\begin{array}{cccccc}
I & A_{1,2} & A_{1,3} & \ldots & A_{1, l-1} & A_{1,l} \\
0 & I & 0 & \ldots & 0 & 0 \\
0 & 0 & I & \ldots & 0 & 0 \\
\vdots & \vdots & \vdots & \ddots & \vdots & \vdots \\
0 & 0 & 0 & \ldots & I & 0 \\
0 & 0 & 0 & \ldots & 0 & I \\
\end{array} \right)$$ satisfies that $ G = A \overline{G} $, where $ \overline{G} $ is the generator matrix of $ C $ corresponding to $ \overline{\mathcal{R}} = (\overline{G}_{i,j})_{1 \leq i \leq l}^{i \leq j \leq l} $, and $$\mathbf{x}_1 A_{1,j} = - \mathbf{x}_j,$$ for $ j = 2,3, \ldots, l $. It is possible to choose such matrices $ A_{1,j} $ because $ \mathbf{x}_1 \neq \mathbf{0} $. Then $ \mathbf{c} = (\mathbf{x} A) \overline{G} $ lies in the first row component of the reduction $ \overline{\mathcal{R}} $ and hence $ d_{R,1}(C) = {\rm wt_R}(\mathbf{c}) \geq d_{R,1}(\overline{C}_1^\prime) $, implying the result.

We conclude the section with the proof of Theorem \[grw bounds\]. We need the following lemma:

\[lemma D generators\] With notation as in Subsection \[subsec reducible\], define the sets $$A_i = \{ 0 \}^{n_1} \times \cdots \times \{ 0 \}^{n_{i-1}} \times (\mathbb{F}_{q^m}^{n_i} \setminus \{ \mathbf{0} \}) \times \mathbb{F}_{q^m}^{n_{i+1}} \times \cdots \times \mathbb{F}_{q^m}^{n_l},$$ for $ i = 1,2, \ldots, l $. For an $ \mathbb{F}_{q^m} $-linear vector space $ D \subseteq \mathbb{F}_{q^m}^n $, there exist subspaces $ D_i^\prime \subseteq \langle D \cap A_i \rangle $, for $ i $ satisfying $ D \cap A_i \neq \varnothing $, such that $ D = \bigoplus_{D \cap A_i \neq \varnothing} D^\prime_i $ and $ D^\prime_i \cap A_j = \varnothing $ for $ j > i $.

We may prove it by induction on the number of indices $ i $ such that $ D \cap A_i \neq \varnothing $. If such number is $ 1 $, the result is trivial by taking $ D^\prime_i = D $, since $ D = \langle D \cap A_i \rangle $.

Assume that it is larger than $ 1 $ and $ i $ is the smallest index such that $ D \cap A_i \neq \varnothing $. Define $ \widetilde{D} = \sum_{j = i+1}^l \langle D \cap A_j \rangle \neq \{ \mathbf{0} \} $, and let $ D^\prime_i \neq \{ \mathbf{0} \} $ by one of its complementaries in $ D $. It follows that $ D^\prime_i \subseteq \langle D \cap A_i \rangle $ and $ D^\prime_i \cap A_j = \varnothing $, for $ j > i $.

Now, by induction hypothesis, $ \widetilde{D} $ has a decomposition as in the theorem, which together with $ D^\prime_i $ gives the desired decomposition of $ D $.

\[Proof of Theorem \[grw bounds\]\] We first prove (\[lower bound\]). Take an $ r $-dimensional $ \mathbb{F}_{q^m} $-linear subspace $ D \subseteq C $. With notation as in Lemma \[lemma D generators\], define $ D_i \subseteq C_i $ as the projection of $ D^\prime_i $ onto the $ i $-th main component, for $ i $ such that $ D \cap A_i \neq \varnothing $. We see that $ \dim(D_i) = \dim(D^\prime_i) $, since $ D_i^\prime \subseteq \langle D \cap A_i \rangle $ and $ D^\prime_i \cap A_j = \varnothing $ for $ j > i $, and by collecting the preimages in $ D^* $ by the projection map of bases of $ D_i^* $, for $ i $ such that $ D \cap A_i \neq \varnothing $, we see that $${\rm wt_R}(D) \geq \sum_{D \cap A_i \neq \varnothing} {\rm wt_R}(D_i),$$ and the result follows by Lemma \[equivalent definition slides\].

To prove (\[upper bound\]), take a decomposition $ r = r_1 + r_2 + \cdots + r_l $, with $ 0 \leq r_i \leq k_i $, for $ i = 1,2, \ldots, l $, and take $ \mathbb{F}_{q^m} $-linear subspaces $ D_i \subseteq C_i^\prime $ with $ \dim(D_i) = r_i $ and $ {\rm wt_R}(D_i) = d_{R,r_i}(C_i^\prime) $. Then define the $ \mathbb{F}_{q^m} $-linear subspace $ D = D_1 \oplus D_2 \oplus \cdots \oplus D_l \subseteq C $, which satisfies $ \dim(D) = r $. By definition, it holds that $ D^* = D_1^* + D_2^* + \cdots + D_l^* $. Hence $$\begin{split}
{\rm wt_R}(D) & \leq {\rm wt_R}(D_1) + {\rm wt_R}(D_2) + \cdots + {\rm wt_R}(D_l) \\
 & = d_{R,r_1}(C_1^\prime) + d_{R,r_2}(C_2^\prime) + \cdots + d_{R,r_l}(C_l^\prime),
\end{split}$$ and the result follows again by Lemma \[equivalent definition slides\].

Observe that the bound (\[upper bound\]) is valid with the same proof for a general $ \mathbb{F}_{q^m} $-linear code that can be decomposed as a direct sum of $ \mathbb{F}_{q^m} $-linear subcodes $ C = C_1^\prime \oplus C_2^\prime \oplus \cdots \oplus C_l^\prime $.

\[remark exact grw product\] In the general setting of Theorem \[grw bounds\], the same result as in Corollary \[exact grw product\] holds whenever $ C_i $ and $ C_i^\prime $ are rank equivalent (see Section \[sec all optimal\]), for each $ i = 1,2, \ldots, l $, since in that case it holds that $ d_{R,r}(C_i) = d_{R,r}(C_i^\prime) $ for all $ i =1,2, \ldots, l $ and all $ r = 1,2, \ldots, k_i $.

MRD reducible codes with MRD main components, and their GRWs
============================================================

Among all GRWs, the first weight (the minimum rank distance) is of special importance, as explained at the end of Subsection \[subsec GRWs and leakage\]. Therefore, it is of interest to study the GRWs of a family of MRD codes, that is, codes that are already optimal for the first weight.

In this section, we find new parameters for which reducible codes are MRD or close to MRD when $ n > m $, extending the family of MRD codes in [@reducible] (see Subsection \[existing code constructions\]), and then give bounds on their GRWs and exact values in the cartesian product case, using the results in the previous section. Hence we give for the first time estimates and exact values of the GRWs of a family of MRD codes with $ n > m $. We will also compare the performance of these codes with those $ \mathbb{F}_q $-linear MRD codes obtained by transposing the matrix representations of codewords in a Gabidulin code [@allertonversion Sec. IV-B].

Definition of the codes {#sec MRD reducible}
-----------------------

Assume $ n > m $ and fix an integer $ 1 \leq k \leq n $. In view of the bound (\[bound min distance\]), we will consider a reducible code $ C_{red} \subseteq \mathbb{F}_{q^m}^n $ of dimension $ k $ whose main components $ C_1, C_2, \ldots, C_l $ (with notation as in Subsection \[subsec reducible\]) have as similar parameters as possible. This will allow to obtain reducible codes with minimum rank distance as large as allowed by (\[singleton bound\]).

First we need the following parameters:

1.  There exist unique $ l > 0 $ and $ 0 \leq t \leq m-1 $ such that $$n = lm - t.$$

2.  There exist unique $ k^\prime > 0 $ and $ 0 \leq s \leq l-1 $ such that $$k = lk^\prime - s.$$

3.  Define then $$a = \left\lceil \frac{km}{n} \right\rceil - k^\prime, \quad \textrm{and} \quad b = \left\lceil \frac{t}{l} \right\rceil - 1.$$

4.  Finally, define $$t^\prime = l(m-b) - n,$$ which satisfies $ 0 < t^\prime \leq l $.

We need the next inequalities to define the desired codes:

It holds that $ k^\prime \leq m-b $ if $ b \geq 0 $, and $ k^\prime \leq m $ if $ b=-1 $.

For $ b = -1 $, we have that $ t = 0 $ and $ k = lk^\prime - s \leq n = lm $ implies that $ k^\prime \leq m + s/l $. Since $ s < l $, the result holds in this case.

Now assume that $ b \geq 0 $. We have that $ k+s \leq n+l $. Writing $ k $ and $ n $ as above, this inequality reads $$(lk^\prime - s) + s \leq (lm - t) +l,$$ that is, $ lk^\prime + t \leq l(m+1) $ and, dividing by $ l $, it is equivalent to $$k^\prime + \frac{t}{l} - 1 \leq m.$$ The result follows by the definition of $ b $.

Finally, we give the construction, distinguishing three cases:

\[definition tilde code\] Define the reducible code $ C_{red} \subseteq \mathbb{F}_{q^m}^n $ of dimension $ k $ with MRD main components $ C_1, C_2, \ldots, C_l $ as follows:

1.  If $ t = 0 $ (i.e. $ b = -1 $): Choose $ C_1, C_2, \ldots, C_l $ such that $ l-s $ of them have length $ m $ and dimension $ k^\prime $, and $ s $ of them have length $ m $ and dimension $ k^\prime -1 $. By (\[bound min distance\]), we have that $$d_{R,1}(C_{red}) \geq m - k^\prime + 1.$$

2.  If $ t > 0 $ and $ t^\prime \leq s $: Choose $ C_1, C_2, \ldots, C_l $ such that $ l-s $ of them have length $ m-b $ and dimension $ k^\prime $, $ s-t^\prime $ of them have length $ m-b $ and dimension $ k^\prime -1 $, and $ t^\prime $ of them have length $ m-b-1 $ and dimension $ k^\prime -1 $. By (\[bound min distance\]), we have that $$d_{R,1}(C_{red}) \geq m - b - k^\prime + 1.$$

3.  If $ t > 0 $ and $ t^\prime > s $: Choose $ C_1, C_2, \ldots, C_l $ such that $ l-t^\prime $ of them have length $ m-b $ and dimension $ k^\prime $, $ t^\prime-s $ of them have length $ m-b-1 $ and dimension $ k^\prime $, and $ s $ of them have length $ m-b-1 $ and dimension $ k^\prime -1 $. By (\[bound min distance\]), we have that $$d_{R,1}(C_{red}) \geq m - b - k^\prime.$$

The next theorem is the first main result of this section, and it gives families of parameters $ m $, $ n $ and $ k $ such that $ C_{red} $ is MRD or almost MRD:

\[new found MRD\] Assume that $ 0 \leq t \leq l $ or $ n \geq m^2 $. The following holds:

1.  If $ t \leq s $ or $ tk^\prime > ms $, then $$d_{R,1}(C_{red}) = \left\lfloor \frac{m}{n}(n-k) + 1 \right\rfloor,$$ attaining (\[singleton bound\]) if $ n $ divides $ mk $.

2.  If $ t > s $ and $ tk^\prime \leq ms $, then $$d_{R,1}(C_{red}) \geq \left\lfloor \frac{m}{n}(n-k) \right\rfloor.$$

First we see that we only need to assume $ 0 \leq t \leq l $. Assume that $ n \geq m^2 $. Since $ n = lm - t \geq m^2 $ and $ t \geq 0 $, it holds that $ l \geq m $. Therefore $ t \leq m-1 \leq l-1 $.

Next we observe that $$\left\lfloor \frac{m}{n} \left(n - k \right) + 1 \right\rfloor = m - a - k^\prime + 1.
\label{eq first observe}$$

Before considering the different cases, we will see that $ a \geq 0 $, and $ a = 0 $ if and only if $ k^\prime t \leq sm $.

First it holds that $ -1 < km/n - k^\prime $ if and only if $$(k^\prime - 1)n < km.$$ Using that $ n = lm - t $ and $ k = lk^\prime -s $, and rearranging terms, this inequality reads $$sm + (k^\prime - 1)t < lm + n,$$ which is always true since $ s < l $ and $ k^\prime t \leq k \leq n $. Hence $ a \geq 0 $. On the other hand, $ km/n - k^\prime \leq 0 $ if and only if $$nk^\prime \geq km.$$ Using again that $ n = lm - t $ and $ k = lk^\prime -s $, and rearranging terms, this inequality reads $ k^\prime t \leq sm $. This is then the case when $ a = 0 $.

Now we prove item 1 in the theorem:

Assume first that $ t=0 $, then $ d_{R,1}(C_{red}) \geq m - k^\prime + 1 $ and $ a = 0 $, hence the result follows in this case by (\[eq first observe\]).

Now assume that $ 0 < t \leq s $. Then $ d_{R,1}(C_{red}) \geq m - k^\prime + 1 $ (since $ b=0 $) and $ k^\prime t \leq sm $ holds, since $ k^\prime \leq m $. Then $ a = 0 $ and the result follows in this case by (\[eq first observe\]).

Next assume that $ tk^\prime > ms $. Then we know that $ a \geq 1 $ and $$\left\lfloor \frac{m}{n} \left(n - k \right) + 1 \right\rfloor \leq m - k^\prime.$$ Since $ b=0 $, we know that $ d_{R,1}(C_{red}) \geq m-k^\prime $, hence the result follows in this case by (\[eq first observe\]).

Finally, we prove item 2:

Assume that $ t > s $ and $ tk^\prime \leq ms $. Then we know that $ a = b = 0 $ and $ d_{R,1}(C_{red}) \geq m - b -k^\prime $. Therefore the result follows also in this case by (\[eq first observe\]) and we are done.

Observe that the MRD reducible codes in Subsection \[existing code constructions\], item 2, are the subfamily of the codes $ C_{red} $ obtained by choosing $ t=s=0 $, and hence are particular cases of the codes in the previous theorem.

Observe that the conditions $ 0 \leq t \leq l $ and $ n \geq m^2 $ only depend on $ m $ and $ n $, but not on $ k $. Hence, for the previous families of values of $ n $ and $ m $, we have obtained MRD or almost MRD codes for all dimensions.

In general, the difference $ b-a $ will be big if $ t $ is much bigger than $ l $. As $ n $ grows, the fact $ t > l $ happens for fewer values of $ t $. Hence the codes $ C_{red} $ are far from optimal when $ n $ is small compared to $ m $ (still $ n > m $) and $ t $ is much bigger than $ l $.

Estimates and exact values of their GRWs {#estimates on their}
----------------------------------------

The next theorem is the second main result in this section, and it gives estimates of the GRWs of the MRD (or almost MRD) reducible codes $ C_{red} $ from Theorem \[new found MRD\], using the lower bound (\[lower bound\]).

\[estimates on their theorem\] Let the parameters be as in Theorem \[new found MRD\].

Assume first that $ t \leq s $.

1.  If $ 1 \leq j \leq l- s $ and $ (j-1)k^\prime < r \leq jk^\prime $, or if $ l-s < j \leq l-s+t $ and $ (j-1)(k^\prime-1)+l-s < r \leq j(k^\prime - 1) + l - s $, then $$d_{R,r}(C_{red}) \geq j(m - k^\prime) + r.$$

2.  If $ l - s +t < j \leq l $ and $ (j-1)(k^\prime-1)+l-s < r \leq j(k^\prime - 1) + l - s $, then $$d_{R,r}(C_{red}) \geq j(m - k^\prime) + r + (j-l+s-t).$$

Assume now that $ t > s $.

1.  If $ 1 \leq j \leq t-s $ and $ (j-1)k^\prime < r \leq jk^\prime $, then $$d_{R,r}(C_{red}) \geq j(m - k^\prime-1) + r.$$

2.  If $ t-s < j \leq l-s $ and $ (j-1)k^\prime < r \leq jk^\prime $, or if $ l-s < j \leq l $ and $ (j-1)(k^\prime - 1) +l-s < r \leq j(k^\prime - 1) + l -s $, then $$d_{R,r}(C_{red}) \geq j(m - k^\prime) + r -t+s.$$

These cases cover all $ r = 1,2, \ldots, k $ and moreover, if $ C_{red} $ is the cartesian product of its main components $ C_1, C_2, \ldots, C_l $, then all the previous lower bounds are equalities.

The result follows from Theorem \[grw bounds\]. To see it, we just have to use that $ d_{R,r_i}(C_i) = n_i - k_i + r_i $ and see in which way we have to choose $ r_i = 0 $ or $ r_i > 0 $ to obtain the minimum in the bound (\[lower bound\]), for $ i = 1,2, \ldots, l $. This is a straightforward extension of the calculations in Example \[example computation\].

Comparison with other MRD codes {#subsec comparison with other MRD}
-------------------------------

In this subsection, we will compare the codes $ C_{red} \subseteq \mathbb{F}_{q^m}^n $ from Definition \[definition tilde code\] with the $ \mathbb{F}_q $-linear MRD codes $ C_{Gab}^T \subseteq \mathbb{F}_{q^m}^n $ obtained by transposing the matrix represenations (see (\[eq def matrix representation\])) of the codewords in a given $ \mathbb{F}_{q^n} $-linear Gabidulin code $ C_{Gab} \subseteq \mathbb{F}_{q^n}^m $ (see Subsection \[existing code constructions\]), when $ n > m $.

The codes $ C_{Gab}^T $ were obtained previously by Delsarte [@delsartebilinear Th. 6] and have been recently considered for universal secure linear network coding in [@allertonversion Sec. IV-B].

We next argue the advantages of the codes $ C_{red} $ over the codes $ C_{Gab}^T $:

1.  *Generalized rank weights*: Although GRWs have recently been extended to $ \mathbb{F}_q $-linear codes [@ravagnaniweights; @allertonversion] and its connection to worst-case information leakage has been obtained [@allertonversion Th. 3], little is known about them for codes that are not linear over $ \mathbb{F}_{q^m} $. In particular, the GRWs of the codes $ C_{Gab}^T $ are not known yet, except for their minimum rank distance.

2.  *Encoding and decoding complexity*: The complexity of coset encoding and decoding with an $ \mathbb{F}_{q^m} $-linear code, as in Definition \[definition ozarow\], is equivalent to the complexity of encoding with one of its generator matrices.

    If $ k_{red} $ denotes the dimension of $ C_{red} $ over $ \mathbb{F}_q $, then the complexity of encoding with a generator matrix coming from one of its reductions is $ O(k_{red} m^2) $ operations over $ \mathbb{F}_{q^m} $, whereas if $ k_{Gab} $ denotes the dimension of $ C_{Gab} $ over $ \mathbb{F}_q $, then the complexity of encoding with one of its generator matrices is $ O(k_{Gab} n^2) $ operations over $ \mathbb{F}_{q^n} $. Therefore it is a higher complexity since $ n > m $, and the difference between both complexities becomes higher the bigger $ n $ is with respect to $ m $.

3.  *Possible parameters obtained*: Since the codes $ C_{Gab}^T $ are obtained from $ \mathbb{F}_{q^n} $-linear codes, their sizes are of the form $ q^N $, where $ N $ is some multiple of $ n $, whereas the sizes of the codes $ C_{red} $ are of the form $ q^M $, where $ M $ is some multiple of $ m $.

    Since we are assuming $ n > m $, in a given interval of positive integers, there are more possible parameters attained by the codes $ C_{red} $ than by the codes $ C_{Gab}^T $.

4.  *Stronger security*: The information leakage for a given number of wire-tapped links when using the codes $ C_{red} $ is often much less than the worst case given by their GRWs, as we will see in Section \[stronger section\]. In particular, looking at their first GRW, we will see that more links can be wire-tapped and still guarantee zero information leakage when using $ C_{red} $ than when using $ C_{Gab}^T $.

All $ \mathbb{F}_{q^m} $-linear codes with optimal GRWs for all fixed packet and code sizes {#sec all optimal}
===========================================================================================

In this section, we obtain all $ \mathbb{F}_{q^m} $-linear codes whose GRWs are all optimal for fixed packet and code sizes ($ m $ and $ k $, respectively), but varying length, $ n $, up to rank equivalence. These codes are particular cases of the codes $ C_{red} $ in the previous section.

\[def optimal all grws\] For fixed $ k $ and $ m $, and for a basis $ \alpha_1, \alpha_2, \ldots, \alpha_m $ of $ \mathbb{F}_{q^m} $ over $ \mathbb{F}_q $, define the $ \mathbb{F}_{q^m} $-linear code $ C_{opt} = C_1 \times C_2 \times \cdots \times C_k \subseteq \mathbb{F}_{q^m}^{km} $, where all $ C_i $ are equal and generated by the vector $ (\alpha_1, \alpha_2, \ldots, \alpha_m) \in \mathbb{F}_{q^m}^m $.

To claim the above mentioned optimality of these codes, we need the following bounds given in [@similarities Lemma 6]:

\[mono\] Given an $ \mathbb{F}_{q^m} $-linear code $ C \subseteq \mathbb{F}_{q^m}^n $ of dimension $ k $, for each $ r = 1,2, \ldots, k-1 $, it holds that $$\label{eq general upper bound monotonicity}
1 \leq d_{R,r+1}(C) - d_{R,r}(C) \leq m.$$ As a consequence, for each $ r = 1,2, \ldots, k $, it holds that $$\label{eq general upper bound}
d_{R,r}(C) \leq rm.$$

Observe that these bounds only depend on the packet and code sizes ($ m $ and $ k $, respectively), and they do not depend on the length $ n $.

We first show that the codes $ C_{opt} $ attain the previous bounds, and then prove that they are the only ones with this property:

\[product gabidulin one dime\] Let $ C_{opt} \subseteq \mathbb{F}_{q^m}^{km} $ be the $ \mathbb{F}_{q^m} $-linear code in Definition \[def optimal all grws\] for given $ k $ and $ m $. Then $ \dim(C_{opt}) = k $ and $ d_{R,r}(C_{opt}) = rm $, for $ r = 1,2, \ldots, k $.

It holds that $ d_{R,1}(C_i) = m $, for $ i = 1,2, \ldots, k $, since these codes are one-dimensional Gabidulin codes in $ \mathbb{F}_{q^m}^m $ (see Subsection \[existing code constructions\]). Hence, by Corollary \[exact grw product\], we have that $$d_{R,k}(C_{opt}) = \sum_{i=1}^k d_{R,1}(C_i) = km.$$ By (\[eq general upper bound monotonicity\]), it holds that $ d_{R,r}(C_{opt}) = rm $, for $ r = 1,2, \ldots, k $.

We will use the definition of rank equivalences from [@similarities Def. 8], which are stronger than vector space isomorphisms that preserve rank weights:

\[**[@similarities]**\] If $ V \subseteq \mathbb{F}_{q^m}^n $ and $ V^\prime \subseteq \mathbb{F}_{q^m}^{n^\prime} $ are $ \mathbb{F}_{q^m} $-linear Galois closed spaces, we say that a map $ \phi : V \longrightarrow V^\prime $ is a rank equivalence if it is a vector space isomorphism and $ {\rm wt_R}(\phi(\mathbf{c})) = {\rm wt_R}(\mathbf{c}) $, for all $ \mathbf{c} \in V $.

We say that two codes $ C $ and $ C^\prime $ are rank equivalent if there exists a rank equivalence between $ \mathbb{F}_{q^m} $-linear Galois closed spaces $ V $ and $ V^\prime $ that contain $ C $ and $ C^\prime $, respectively, and mapping bijectively $ C $ to $ C^\prime $.

Finally, we show that the codes $ C_{opt} $ are the only $ \mathbb{F}_{q^m} $-linear codes attaining (\[eq general upper bound\]) for fixed packet and code sizes up to rank equivalence:

\[uniqueness\] Let $ C \subseteq \mathbb{F}_{q^m}^n $ be an $ \mathbb{F}_{q^m} $-linear code of dimension $ k $ such that $ d_{R,r}(C) = rm $, for every $ r = 1,2, \ldots, k $.

Then, for every basis $ \alpha_1, \alpha_2, \ldots, \alpha_m $ of $ \mathbb{F}_{q^m} $ over $ \mathbb{F}_q $, the code $ C $ is rank equivalent to the code $ C_{opt} \subseteq \mathbb{F}_{q^m}^{km} $ in Definition \[def optimal all grws\]. Moreover, the rank equivalence can be explicitly constructed in polynomial time from any basis of $ C $.

We need some preliminary lemmas to prove this result. We start by the following characterization of rank equivalences, which is a particular case of [@similarities Th. 5]:

\[rank equivalences\] Let $ \phi : V \longrightarrow V^\prime $ be an $ \mathbb{F}_{q^m} $-linear vector space isomorphism, where $ V \subseteq \mathbb{F}_{q^m}^n $ and $ V^\prime \subseteq \mathbb{F}_{q^m}^{n^\prime} $ are $ \mathbb{F}_{q^m} $-linear Galois closed spaces.

It is a rank equivalence if and only if there exist bases $ \mathbf{v}_1, \mathbf{v}_2, \ldots, \mathbf{v}_t \in \mathbb{F}_q^n $ and $ \mathbf{w}_1, \mathbf{w}_2, \ldots, \mathbf{w}_t \in \mathbb{F}_q^{n^\prime} $ of $ V $ and $ V^\prime $, respectively, and a non-zero element $ \beta \in \mathbb{F}_{q^m} $, such that $ \phi (\mathbf{v}_i) = \beta \mathbf{w}_i $, for $ i = 1,2, \ldots, t $.

We now introduce some notation. For a given vector $ \mathbf{c} = (c_1, c_2, \ldots, c_n) \in \mathbb{F}_{q^m}^n $, define $ \mathbf{c}^{[i]} = (c_1^{[i]}, c_2^{[i]}, \ldots, c_n^{[i]}) $, for all integers $ i \geq 0 $. Then define the trace map $ {\rm Tr} : \mathbb{F}_{q^m}^n \longrightarrow \mathbb{F}_q^n $ of the extension $ \mathbb{F}_q \subseteq \mathbb{F}_{q^m} $ as follows $${\rm Tr}(\mathbf{c}) = \mathbf{c} + \mathbf{c}^{[1]} + \mathbf{c}^{[2]} + \cdots + \mathbf{c}^{[m-1]},$$ for all $ \mathbf{c} \in \mathbb{F}_{q^m}^n $. We have the following two lemmas:

\[matrix gabidulin\] For a basis $ \alpha_1, \alpha_2, \ldots, \alpha_m $ of $ \mathbb{F}_{q^m} $ over $ \mathbb{F}_q $, the matrix $ A = (\alpha_i^{[j-1]})_{1 \leq i,j \leq m} $ over $ \mathbb{F}_{q^m} $ is invertible.

Well-known. See for instance [@gabidulin].

\[two bases\] For a basis $ \alpha_1, \alpha_2, \ldots, \alpha_m $ of $ \mathbb{F}_{q^m} $ over $ \mathbb{F}_q $ and the matrix $ A = (\alpha_i^{[j-1]})_{1 \leq i,j \leq m} $, define $$(\beta_1, \beta_2, \ldots, \beta_m) = \mathbf{e}_1 A^{-1},$$ where $ \mathbf{e}_1 \in \mathbb{F}_{q^m}^m $ is the first vector in the canonical basis. Then $ \beta_1, \beta_2, \ldots, \beta_m $ is also a basis of $ \mathbb{F}_{q^m} $ over $ \mathbb{F}_q $.

Moreover, if $ B = (\beta_i^{[j-1]})_{1 \leq i,j \leq m} $, then $$(\alpha_1, \alpha_2, \ldots, \alpha_m) = \mathbf{e}_1 B^{-1}.$$

Write $ \boldsymbol\beta = (\beta_1, \beta_2, \ldots, \beta_m) $. Then $ \boldsymbol\beta A = \mathbf{e}_1 $, which means that $ \sum_{i=1}^m \beta_i \alpha_i^{[j-1]} = \delta_{j,1} $, where $ \delta $ is the Kronecker delta. By raising this equation to the power $ [l-1] = q^{l-1} $ and using that $ \delta_{j,l} $ is $ 0 $ or $ 1 $, we see that $ \sum_{i=1}^m \beta_i^{[l-1]} \alpha_i^{[j-1]} = \delta_{j,l} $, that is, $ \boldsymbol\beta^{[l-1]} A = \mathbf{e}_l $, for $ l = 1,2, \ldots, m $.

Let $ \boldsymbol\lambda \in \mathbb{F}_q^m $ be such that $ \boldsymbol\lambda \cdot \boldsymbol\beta = 0 $. By raising this equation to the power $ [l-1] $, for $ l = 1,2, \ldots, m $, we see that $ \boldsymbol\lambda \cdot \boldsymbol\beta^{[l-1]} = 0 $ or, equivalently, $ \boldsymbol\lambda \cdot (\mathbf{e}_l A^{-1}) = 0 $, since $ \boldsymbol\lambda \in \mathbb{F}_q^m $.

Write $ \boldsymbol\mu = (\mu_1, \mu_2, \ldots, \mu_m) = \boldsymbol\lambda (A^{-1})^T $. It holds that $$0 = \boldsymbol\lambda \cdot (\mathbf{e}_l A^{-1}) = (\boldsymbol\lambda (A^{-1})^T) \cdot \mathbf{e}_l = \boldsymbol\mu \cdot \mathbf{e}_l = \mu_l,$$ for $ l = 1,2, \ldots, m $. Therefore, $ \boldsymbol\mu = \mathbf{0} $, thus $ \boldsymbol\lambda = \mathbf{0} $. Hence the elements $ \beta_1, \beta_2, \ldots, \beta_m $ are linearly independent over $ \mathbb{F}_q $.

Finally, since $ \sum_{i=1}^m \beta_i^{[l-1]} \alpha_i^{[j-1]} = \delta_{j,l} $, it holds that $ \sum_{i=1}^m \alpha_i \beta_i^{[j-1]} = \delta_{1,j} = \delta_{j,1} $, which means that $ (\alpha_1, \alpha_2, \ldots, \alpha_m)B = \mathbf{e}_1 $, and we are done.

We may now prove Theorem \[uniqueness\]:

Choose any basis $ \mathbf{b}_1, \mathbf{b}_2, \ldots, \mathbf{b}_k $ of $ C $. Since $ \dim (C^*) = km $ and $ C^* $ is generated by the elements $ \mathbf{b}_s^{[j-1]} $, for $ s = 1,2, \ldots, k $ and $ j = 1,2, \ldots, m $, it follows that these elements are linearly independent over $ \mathbb{F}_{q^m} $.

Define the vector $ \boldsymbol\beta = (\beta_1, \beta_2, \ldots, \beta_m) = \mathbf{e}_1 A^{-1} $, with notation as in the previous lemma. By that lemma, $ \beta_1, \beta_2, \ldots, \beta_m $ constitute a basis of $ \mathbb{F}_{q^m} $ over $ \mathbb{F}_q $, and $ (\alpha_1, \alpha_2, \ldots, \alpha_m) = \mathbf{e}_1 B^{-1} $.

Consider the vectors $ \mathbf{v}_{s,i} = {\rm Tr}(\beta_i \mathbf{b}_s) \in \mathbb{F}_q^n $, for $ s = 1,2, \ldots, k $ and $ i = 1,2, \ldots, m $. Assume that there exist $ \lambda_{s,i} \in \mathbb{F}_q $ such that $ \sum_{s=1}^k \sum_{i=1}^m \lambda_{s,i} \mathbf{v}_{s,i} = \mathbf{0} $. Then it holds that $$\sum_{j=1}^{m} \sum_{s=1}^k \left( \sum_{i=1}^m \lambda_{s,i} \beta_i^{[j-1]} \right) \mathbf{b}_s^{[j-1]} = \mathbf{0}.$$ Hence $ \sum_{i=1}^m \lambda_{s,i} \beta_i^{[j-1]} = 0 $, for $ s = 1,2, \ldots, k $ and $ j = 1,2, \ldots, m $, which implies that $ \lambda_{s,i} = 0 $, for $ s = 1,2, \ldots, k $ and $ i = 1,2, \ldots, m $.

Therefore, the elements $ \mathbf{v}_{s,i} $, for $ s = 1,2, \ldots, k $ and $ i = 1,2, \ldots, m $, constitute a basis of $ C^* $ and are vectors in $ \mathbb{F}_q^n $. Now define the $ \mathbb{F}_{q^m} $-linear vector space isomorphism $ \psi : C^* \longrightarrow \mathbb{F}_{q^m}^{km} $ by $ \psi(\mathbf{v}_{s,i}) = \mathbf{e}_{(s-1)m + i} $, for $ s = 1,2, \ldots, k $ and $ i = 1,2, \ldots, m $. By Lemma \[rank equivalences\], $ \psi $ is a rank equivalence and, moreover, $$\mathbf{b}_s = \sum_{j=1}^m \sum_{i=1}^m \alpha_i \beta_i^{[j-1]} \mathbf{b}_s^{[j-1]} = \sum_{i=1}^m \alpha_i {\rm Tr}(\beta_i \mathbf{b}_s) = \sum_{i=1}^m \alpha_i \mathbf{v}_{s,i}.$$ It follows that $ \mathbf{v}_s = \psi (\mathbf{b}_s) = \sum_{i=1}^m \alpha_i \mathbf{e}_{(s-1)m + i} $, and the vectors $ \mathbf{v}_s $, for $ s = 1,2, \ldots, k $, constitute a basis of $ \psi(C) $. Finally, this means that $ \psi(C) = C_{opt} $ and we are done.

As explained in Subsection \[subsec universal secure\], given an $ \mathbb{F}_{q^m} $-linear code $ C \subseteq \mathbb{F}_{q^m}^n $ of dimension $ k $, the parameter $ m $ represents the packet length, $ k $ represents the number of linearly independent packets that we may send using $ C $, or its size, and $ n $ represents the number of outgoing links from the source.

Due to the bounds (\[eq general upper bound\]), if $ m $ and $ k $ are fixed and $ n $ is not restricted, then the code $ C_{opt} $ is the only $ \mathbb{F}_{q^m} $-linear code whose GRWs are all optimal, and hence is the only $ \mathbb{F}_{q^m} $-linear optimal code regarding information leakage in the network, up to rank equivalence.

The codes $ C_{opt} \subseteq \mathbb{F}_{q^m}^{km} $ do not only have optimal GRWs, but the difference between two consecutive weights is the largest possible by (\[eq general upper bound monotonicity\]): $$d_{R,r+1}(C_{opt}) = d_{R,r}(C_{opt}) + m,$$ for $ r = 1,2, \ldots, k-1 $. However, for a Gabidulin code $ C_{Gab} $ as in Subsection \[existing code constructions\], the difference between two consecutive weights is the smallest possible by (\[eq general upper bound monotonicity\]): $$d_{R,r+1}(C_{Gab}) = d_{R,r}(C_{Gab}) + 1,$$ for $ r = 1,2, \ldots, k-1 $.

Therefore, when using $ C_{opt} $, an adversary that obtains $ r $ packets of information, by listening to the smallest possible number of links, needs to listen to at least $ m $ more links in order to obtain one more packet of information. However, when using $ C_{Gab} $, the adversary only needs to listen to one more link to obtain one more packet of information.

Stronger security of reducible codes {#stronger section}
====================================

On the error correction side, it is well-known that reducible codes can correct a substantial amount of rank errors beyond half of their minimum rank distance [@reducible Sec. III.A].

The aim of this section is to show that, on the security side, when using a reducible code $ C $, an eavesdropper may in many cases obtain less than $ r $ packets of information even if he or she wire-taps at least $ d_{R,r}(C) $ links in the network (see Subsection \[subsec GRWs and leakage\]).

Setting $ r=1 $ and using an MRD reducible code (as in Section \[sec MRD reducible\]), this means that the eavesdropper obtains no information even when wire-tapping strictly more links than those allowed by other MRD codes ($ \mathbb{F}_{q^m} $-linear or $ \mathbb{F}_q $-linear), by [@allertonversion Th. 3].

The above mentioned stronger security is obtained by upper bounding the dimensions of the code intersected with Galois closed spaces, due to Equation (\[leaked info\]). We explain this in the remarks at the end of the section.

The following is the main result of this section, where we denote by $ \pi_i : \mathbb{F}_{q^m}^n \longrightarrow \mathbb{F}_{q^m}^{n_i} $ the projection map onto the coordinates corresponding to the $ i $-th main component $ C_i \subseteq \mathbb{F}_{q^m}^{n_i} $, for $ i = 1,2, \ldots, l $, with notation as in Subsection \[subsec reducible\].

\[theorem main stronger security\] Let $ V \subseteq \mathbb{F}_{q^m}^n $ be an $ \mathbb{F}_{q^m} $-linear Galois closed space and assume that, for each $ i = 1,2, \ldots, l $, there exists $ 0 \leq r_i \leq k_i $ such that $ \dim(\pi_i(V)) \leq d_{R,r_i}(C_i) $, with notation as in Subsection \[subsec reducible\]. Then $$\dim(C \cap V) \leq \left( \sum_{i=1}^l r_i \right) - \# \{ i \mid \dim(\pi_i(V)) < d_{R,r_i}(C_i) \}.$$ In particular, if $ \dim(\pi_i(V)) < d_{R,1}(C_i) $, for $ i = 1,2, \ldots, l $, then $$\dim(C \cap V) = 0.$$

Before proving this theorem, we give two consequences of interest. In the first, we give a sufficient condition for the eavesdropper to obtain less than $ r $ packets of information, for a given $ r $, as in the second paragraph of this section:

\[corollary stronger security 2\] Let the notation be as in Subsection \[subsec reducible\], let $ 1 \leq r \leq k $ and let $ V \subseteq \mathbb{F}_{q^m}^n $ be an $ \mathbb{F}_{q^m} $-linear Galois closed space. Assume that $ r = \sum_{i=1}^l r_i $, where $ 1 \leq r_i \leq k_i $ and $ \dim(\pi_i(V)) \leq d_{R,r_i}(C_i) $, for $ i = 1,2, \ldots, l $, and for some $ j $ it holds that $ \dim(\pi_j(V)) < d_{R,r_j}(C_j) $. Then $$\dim(C \cap V) < r.$$

The second consequence is just the previous theorem applied to the codes in Definition \[def optimal all grws\]:

\[corollary stronger security 1\] Let $ C_{opt} \subseteq \mathbb{F}_{q^m}^{km} $ be the code in Definition \[def optimal all grws\], and let $ V \subseteq \mathbb{F}_{q^m}^{km} $ be an $ \mathbb{F}_{q^m} $-linear Galois closed space. Then $$\dim(C_{opt} \cap V) \leq \# \{ i \mid \pi_i(V) = \mathbb{F}_{q^m}^m \}.$$

Finally, we prove Theorem \[theorem main stronger security\]. We need the following lemma:

Let $ V \subseteq \mathbb{F}_{q^m}^n $ be an $ \mathbb{F}_{q^m} $-linear Galois closed space, and let the notation be as in Subsection \[subsec reducible\]. It holds that $$\dim(C \cap V) \leq \sum_{i=1}^l \dim(C_i \cap \pi_i(V)).$$

Let $ D = C \cap V \subseteq C $ and let the notation be as in Lemma \[lemma D generators\]. Since $ D = \bigoplus_{D \cap A_i \neq \varnothing} D^\prime_i $, we just need to show that $ \dim(D^\prime_i) \leq \dim(C_i \cap \pi_i(V)) $, for $ i $ such that $ D \cap A_i \neq \varnothing $.

Fix such an index $ i $, and let $ \rho_i : D^\prime_i \longrightarrow C_i \cap \pi_i(V) $ be the restriction of $ \pi_i $ to $ D^\prime_i $. It is well-defined since $ \pi_i(D^\prime_i) \subseteq \pi_i(V) $ by definition of $ D $, and $ \pi_i(D^\prime_i) \subseteq C_i $ since $ D^\prime_i \subseteq \langle C \cap A_i \rangle $.

Finally, we see that $ \rho_i $ is one to one since $ D^\prime_i \subseteq \langle C \cap A_i \rangle $ and $ D^\prime_i \cap A_j = \varnothing $ for $ j > i $, and we are done.

\[Proof of Theorem \[theorem main stronger security\]\] First observe that $ \pi_i(V) \subseteq \mathbb{F}_{q^m}^{n_i} $ is again Galois closed, for $ i = 1,2, \ldots, l $. By definition of GRWs, if $ \dim(\pi_i(V)) < d_{R,r_i}(C_i) $, then $ \dim(C_i \cap \pi_i(V)) < r_i $, for $ i $ such that $ r_i > 0 $. On the other hand, if $ \dim(\pi_i(V)) \leq d_{R,r_i}(C_i) $ and $ r_i < k_i $, then by monotonicity of GRWs [@rgrw Lemma 4], it holds that $ \dim(\pi_i(V)) < d_{R,r_i+1}(C_i) $, which implies that $ \dim(C_i \cap \pi_i(V)) < r_i+1 $, that is, $ \dim(C_i \cap \pi_i(V)) \leq r_i $. Finally, if $ \dim(\pi_i(V)) \leq d_{R,k_i}(C_i) $, then it is trivial that $ \dim(C_i \cap \pi_i(V)) \leq \dim(C_i) = k_i $.

The result follows then from the previous lemma.

In the situation of Corollary \[corollary stronger security 2\], if $ \dim(\pi_i(V)) \leq d_{R,r_i}(C_i) $, for $ i = 1,2, \ldots, l $ and with strict inequality for some $ j $, then an eavesdropper that obtains $ \mathbf{c} B^T $, where $ B $ generates $ V $, gains less than $ r $ packets of information about the original packets by Equation (\[leaked info\]).

Observe that the previous condition implies that $ \dim(V) < \sum_{i=1}^l d_{R,r_i}(C_i) $. We know from the bound (\[lower bound\]) that if $ \dim(V) < \sum_{i=1}^l d_{R,s_i}(C_i) $ for all possible decompositions $ r= \sum_{i=1}^l s_i $, then $ \dim(C \cap V ) < r $.

However, many $ \mathbb{F}_{q^m} $-linear Galois closed spaces may satisfy $ \dim(\pi_i(V)) < d_{R,r_i}(C_i) $, for $ i = 1,2, \ldots, l $, and a given decomposition $ r = \sum_{i=1}^l r_i $, but may also satisfy $ \dim(V) \geq \sum_{i=1}^l d_{R,s_i}(C_i) $ for some other decomposition $ r = \sum_{i=1}^l s_i $.

Take for instance $ V = V_1 \times V_2 \times \cdots \times V_l $, where $ V_i \subseteq \mathbb{F}_{q^m}^{n_i} $ are $ \mathbb{F}_{q^m} $-linear Galois closed spaces satisfying $ \dim(V_i) \leq d_{R,r_i}(C_i) $, for $ i = 1,2, \ldots, l $ and with strict inequality for some $ j $, but $ \dim(V) = \sum_{i=1}^l \dim(V_i) \geq d_{R,r}(C) $.

In the particular case of Corollary \[corollary stronger security 1\], to obtain at least $ r $ packets of information, it must hold that $ \pi_i(V) $ is the whole space $ \mathbb{F}_{q^m}^m $ for at least $ r $ indices $ i $. Take for instance $ V= V_1 \times V_2 \times \cdots \times V_k $, where $ V_i \subsetneq \mathbb{F}_{q^m}^n $ satisfies $ \dim(V_i) = m-1 $, for $ i = 1,2, \ldots, k $. In that case, $ \dim(V) = k(m-1) $, which is usually much bigger than $ d_{R,1}(C) = m $. However, the adversary still obtains no information about the original packets.

Related properties of reducible codes
=====================================

In this section, we study some secondary properties of reducible codes that are related to their GRWs.

Cartesian product conditions
----------------------------

In this subsection, we gather sufficient and necessary conditions for reducible codes to be rank equivalent to cartesian products (see Section \[sec all optimal\] for the definition of rank equivalence).

We start by using Galois closures and generalized rank weights to see whether an $ \mathbb{F}_{q^m} $-linear code that can be decomposed as a direct sum of smaller codes is rank equivalent to the cartesian product of these codes. It can be seen as a converse statement to Corollary \[exact grw product\].

\[char product\] Given an $ \mathbb{F}_{q^m} $-linear code $ C = C_1^\prime \oplus C_2^\prime \oplus \cdots \oplus C_l^\prime \subseteq \mathbb{F}_{q^m}^n $, with $ k_i = \dim(C_i^\prime) $, for $ i = 1,2, \ldots, l $, and $ k = \dim(C) $, we have that $ C^* = C_1^{\prime *} + C_2^{\prime *} + \cdots + C_l^{\prime *} $ and the following conditions are equivalent:

1.  $ C $ is rank equivalent to a cartesian product $ C_1 \times C_2 \times \cdots \times C_l \subseteq \mathbb{F}_{q^m}^n $, where $ C_i \subseteq \mathbb{F}_{q^m}^{n_i} $ is rank equivalent to $ C_i^\prime $, and the equivalence map from $ C $ to the product is the product of the equivalence maps from $ C_i^\prime $ to $ C_i $.

2.  $ C^* = C_1^{\prime *} \oplus C_2^{\prime *} \oplus \cdots \oplus C_l^{\prime *} $.

3.  $ d_{R,k}(C) = d_{R,k_1}(C_1^\prime) + d_{R,k_2}(C_2^\prime) + \cdots + d_{R,k_l}(C_l^\prime) $.

4.  For all $ r = 1,2, \ldots, k $, it holds that $$\begin{split}
    d_{R,r}(C) = \min \{ & d_{R,r_1}(C_1^\prime) + d_{R,r_2}(C_2^\prime) + \cdots + d_{R,r_l}(C_l^\prime) \\
     & \mid r = r_1 + r_2 + \cdots + r_l, 0 \leq r_i \leq k_i \}. \\
    \end{split}$$

It is trivial that item 1 implies item 4 by Corollary \[exact grw product\]. It is also trivial that item 4 implies item 3, and items 2 and 3 are equivalent since $ d_{R,k}(C) = \dim(C^*) $ and $ d_{R,k_i}(C_i^\prime) = \dim(C_i^{\prime *}) $, for $ i = 1,2, \ldots, l $, by Lemma \[equivalent definition slides\].

Now we prove that item 2 implies item 1. Define $ V_i = C_i^{\prime *} $, for $ i =1,2, \ldots, l $, and $ V = C^* $. We may assume that $ C $ is not rank degenerate, that is, $ V = \mathbb{F}_{q^m}^n $. Therefore, $ n = \dim(V) $, $ n_i = \dim(V_i) $, for $ i = 1,2, \ldots, l $, and $ n = n_1 + n_2 + \cdots + n_l $.

On the other hand, define a vector space isomorphisms $ \psi_i : V_i \longrightarrow \mathbb{F}_{q^m}^{n_i} $, for $ i = 1,2, \ldots, l $, by sending a basis of $ V_i $ of vectors in $ \mathbb{F}_q^n $ to the canonical basis of $ \mathbb{F}_{q^m}^{n_i} $. It is a rank equivalence by Lemma \[rank equivalences\]. Define $ C_i = \psi_i(C_i^\prime) $. Therefore, $ C_i $ and $ C_i^\prime $ are rank equivalent by definition.

Finally, define $ \psi : V = V_1 \oplus V_2 \oplus \cdots \oplus V_l \longrightarrow \mathbb{F}_{q^m}^n $ by $$\psi (\mathbf{c}_1 + \mathbf{c}_2 + \cdots + \mathbf{c}_l) = (\psi_1(\mathbf{c}_1), \psi_2(\mathbf{c}_2), \ldots, \psi_l(\mathbf{c}_l)),$$ where $ \mathbf{c}_i \in V_i $, for all $ i = 1,2, \ldots, l $. It holds that $ \psi $ maps vectors in $ \mathbb{F}_q^n $ to vectors in $ \mathbb{F}_q^n $ and is a vector space isomorphism. Hence, it is a rank equivalence by Lemma \[rank equivalences\] and verifies the required conditions.

With notation as in Subsection \[subsec reducible\], if $ C_i $ is rank equivalent to $ C_i^\prime $, for all $ i = 1,2, \ldots, l $, then $ C $ is rank equivalent to $ C_1 \times C_2 \times \cdots \times C_l $.

Observe that the previous corollary states that Remark \[remark exact grw product\] is actually implied by Corollary \[exact grw product\].

On the other hand, we may use the column components to see wether $ C = C_1 \times C_2 \times \cdots \times C_l $ exactly. The proof is straightforward:

With notation as in Subsection \[subsec reducible\], the following conditions are equivalent:

1.  $ C = C_1 \times C_2 \times \cdots \times C_l $.

2.  $ C = \widehat{C} $.

3.  $ k_i = \widehat{k}_i $, for all $ i = 1,2, \ldots, l $.

4.  For each $ j = 2,3, \ldots, l $, the rows in $ G_{i,j} $, $ 1 \leq i \leq j-1 $, are contained in the main component $ C_j $.

Rank degenerate conditions
--------------------------

Recall the definition of rank degenerate codes from [@similarities Def. 9]:

\[**[@similarities]**\] \[definition degenerate\] An $ \mathbb{F}_{q^m} $-linear code $ C \subseteq \mathbb{F}_{q^m}^n $ of dimension $ k $ is rank degenerate if $ d_{R,k}(C) < n $.

In network coding, a code is rank degenerate if it can be applied to a network with strictly less outgoing links from the source node (see [@slides; @similarities] for more details).

In this subsection, we study sufficient and necessary conditions for reducible codes to be rank degenerate.

With notation as in Subsection \[subsec reducible\], it holds that:

1.  If $ C $ is rank degenerate, then there exists an $ 1 \leq i \leq l $ such that $ C_i $ is rank degenerate.

2.  If there exists an $ 1 \leq j \leq l $ such that $ \widehat{C}_j $ is rank degenerate, then $ C $ is rank degenerate.

We prove each item separately:

1.  It follows from $$d_{R,k}(C) \geq d_{R,k_1}(C_1) + d_{R,k_2}(C_2) + \cdots + d_{R,k_l}(C_l),$$ which follows from Theorem \[grw bounds\], and the fact that $ C $ has length $ n $ and $ C_i $ has length $ n_i $, for $ i = 1,2, \ldots, l $.

2.  We have that $ C \subseteq \widehat{C} $. Hence $ C^* \subseteq \widehat{C}^* $ and $$d_{R,k}(C) = \dim(C^*) \leq \dim(\widehat{C}^*) = d_{R,\widehat{k}}(\widehat{C}),$$ by Lemma \[equivalent definition slides\], and $$d_{R,\widehat{k}}(\widehat{C}) = d_{R,\widehat{k}_1}(\widehat{C}_1) + d_{R,\widehat{k}_2}(\widehat{C}_2) + \cdots + d_{R,\widehat{k}_l}(\widehat{C}_l),$$ by Corollary \[exact grw product\], hence the item follows, using now that $ \widehat{C}_j $ has length $ n_j $, for $ j = 1,2, \ldots, l $.

If $ C = C_1 \times C_2 \times \cdots \times C_l $, then $ C $ is rank degenerate if and only if there exists an $ 1 \leq i \leq l $ such that $ C_i $ is rank degenerate.

Duality and bounds on GRWs
--------------------------

With notation as in Subsection \[subsec reducible\], it is shown in [@reducible] that the dual of the reducible code $ C $ has a generator matrix of the form $$H = \left(
\begin{array}{cccccc}
H_{1,1} & 0 & 0 & \ldots & 0 & 0 \\
H_{2,1} & H_{2,2} & 0 & \ldots & 0 & 0 \\
H_{3,1} & H_{3,2} & H_{3,3} & \ldots & 0 & 0 \\
\vdots & \vdots & \vdots & \ddots & \vdots & \vdots \\
H_{l-1,1} & H_{l-1,2} & H_{l-1,3} & \ldots & H_{l-1,l-1} & 0 \\
H_{l,1} & H_{l,2} & H_{l,3} & \ldots & H_{l,l-1} & H_{l,l} \\
\end{array} \right),$$ where $ H_{i,i} $ is a generator matrix of $ C_i^\perp $, for $ i = 1,2, \ldots, l $.

We see that reversing the order of the row blocks does not change the code, and reversing the order of the column blocks gives a rank equivalent code. Hence, denoting by $ (C^\perp)_i^\prime $ the subcode of $ C^\perp $ generated by the matrix $$H_i^\prime = (H_{i,1}, \ldots, H_{i,i-1}, H_{i,i}, 0, \ldots, 0),$$ for $ i = 1,2, \ldots, l $, we may obtain analogous bounds on the generalized rank weights of $ C^\perp $ to those in Theorem \[grw bounds\]. We leave the details to the reader.

An upper bound on the GRW of $ C^\perp $ using column components of $ C $ that follows from Corollary \[exact grw product\] is the following:

With notation as in Subsection \[subsec reducible\], it holds that $$\label{lower bound duals}
\begin{split}
d_{R,r}(C^\perp) \leq \min \{ & d_{R,\widehat{r}_1}(\widehat{C}^\perp_1) + d_{R,\widehat{r}_2}(\widehat{C}^\perp_2) + \cdots + d_{R,\widehat{r}_l}(\widehat{C}^\perp_l) \\
 & \mid r = \widehat{r}_1 + \widehat{r}_2 + \cdots + \widehat{r}_l, 0 \leq \widehat{r}_i \leq \widehat{k}_i \},
\end{split}$$ for $ r = 1,2, \ldots, n- \widehat{k} $ (observe that $ n- \widehat{k} \leq n-k $).

It holds that $ C \subseteq \widehat{C} $, hence $ \widehat{C}^\perp \subseteq C^\perp $, and the result follows then from Corollary \[exact grw product\] and the fact that $ \widehat{C}^\perp = \widehat{C}_1^\perp \times \widehat{C}_2^\perp \times \cdots \times \widehat{C}_l^\perp $.

In particular, if $ \widehat{k} < n $, it holds that $$\label{lower bound duals min}
d_{R,1}(C^\perp) \leq \min \{ d_{R,1}(\widehat{C}^\perp_1), d_{R,1}(\widehat{C}^\perp_2), \ldots, d_{R,1}(\widehat{C}^\perp_l) \}.$$

MRD rank
--------

Recall from [@rgrw Prop. 1] the (classical) Singleton bound on GRWs: $$\label{singleton}
d_{R,r}(C) \leq n - k + r,$$ for any $ \mathbb{F}_{q^m} $-linear code $ C \subseteq \mathbb{F}_{q^m}^n $, where $ k = \dim(C) $ and $ 1 \leq r \leq k $. By monotonicity of GRWs [@rgrw Lemma 4], if the $ r $-th weight of $ C $ attains the Singleton bound, then the $ s $-th weight of $ C $ also attains it, for all $ s \geq r $. The minimum of such $ r $ is called the MRD rank of the code [@jerome Def. 1]:

For an $ \mathbb{F}_{q^m} $-linear code $ C \subseteq \mathbb{F}_{q^m}^n $ of dimension $ k $, we define its MRD rank as the minimum positive integer $ r $ such that $ d_{R,r}(C) = n - k + r $, and denote it by $ r(C) $.

If $ d_{R,k}(C) < n $, then we define $ r(C) = k + 1 $.

Observe that the last part of the previous definition is a redefinition of rank degenerate codes. We have the next characterization of $ r(C) $ given in [@jerome Cor. III.3]:

For an $ \mathbb{F}_{q^m} $-linear code $ C \subseteq \mathbb{F}_{q^m}^n $ of dimension $ k $, it holds that $$r(C) = k - d_{R,1}(C^\perp) + 2,$$ defining $ d_{R,1}(\{ \mathbf{0} \}) = n+1 $ for the case $ C = \mathbb{F}_{q^m}^n $.

In particular, from the bounds obtained so far, we derive the following result on the MRD rank of a reducible code:

Let the notation be as in Subsection \[subsec reducible\]. It holds that $$\label{lower bound MRD}
k - r(C) \geq \min \{ k_1 - r(C_1), k_2 - r(C_2), \ldots, k_l - r(C_l) \}$$ and $$\label{upper bound MRD 1}
k - r(C) \leq \min \{ \widehat{k}_1 - r(\widehat{C}_1), \widehat{k}_2 - r(\widehat{C}_2), \ldots, \widehat{k}_l - r(\widehat{C}_l) \}.$$ Moreover, denote by $ k_{i,j} $ and $ r_{i,j} $ the dimension and MRD rank of the $ \mathbb{F}_{q^m} $-linear code with parity check matrix $ H_{i,j} $, respectively, with notation as in the previous subsection, for $ i = 2,3, \ldots, l $ and $ j = 1,2, \ldots, i-1 $. Then $$\label{upper bound MRD 2}
\begin{split}
k - r(C) \leq \min \{ & k_i - r(C_i) + \sum_{H_{i,j} \neq 0} (k_{i,j} - r_{i,j} +2) \\ 
 & \mid i = 1,2, \ldots, l \}.
\end{split}$$

The bound (\[lower bound MRD\]) follows from the previous lemma and the bound (\[bound min distance\]). The bound (\[upper bound MRD 1\]) follows from the previous lemma and the bound (\[lower bound duals min\]).

Now we prove the bound (\[upper bound MRD 2\]). From the previous lemma and the bound (\[upper bound min distance\]), we obtain that $$k - r(C) \leq \min \{ d_{R,1}((C^\perp)^\prime_1, (C^\perp)^\prime_2, \ldots, (C^\perp)^\prime_l) \},$$ with notation as in the previous subsection. Now, if $ d_{i,j} $ denotes the minimum rank distance of the $ \mathbb{F}_{q^m} $-linear code with parity check matrix $ H_{i,j} $, it follows that $$d_{R,1}((C^\perp)_i^\prime) \leq d_{R,1}(C_i^\perp) + \sum_{H_{i,j} \neq 0} d_{i,j},$$ and the result follows again from the previous lemma.

The MRD rank of the code $ C $ in Example \[example computation\] was obtained directly using Theorem \[grw bounds\]. However, it could be directly obtained using the previous proposition.

We conclude with the cartesian product case:

With notation as in the previous proposition, if $ C = C_1 \times C_2 \times \cdots \times C_l $, it holds that $$k - r(C) = \min \{ k_1 - r(C_1), k_2 - r(C_2), \ldots, k_l - r(C_l) \},$$ and all the bounds in the previous proposition are equalities.

Particular constructions
------------------------

To conclude, in this subsection we briefly recall some constructions of reducible codes in the literature introduced to improve the minimum Hamming distance of cartesian products of codes, and see when they may give improvements for the rank distance.

Recall the well-known $ (\mathbf{u}, \mathbf{u} + \mathbf{v}) $-construction by Plotkin [@plotkin]. Take $ \mathbb{F}_{q^m} $-linear codes $ C_1, C_2 \subseteq \mathbb{F}_{q^m}^n $, and define the $ \mathbb{F}_{q^m} $-linear code $ C \subseteq \mathbb{F}_{q^m}^{2n} $ by $$C = \{ (\mathbf{u}, \mathbf{u} + \mathbf{v}) \mid \mathbf{u} \in C_1, \mathbf{v} \in C_2 \}.$$ Denoting by $ d_H(D) $ the minimum Hamming distance of a code $ D $, it holds that $ d_H(C_1 \times C_2) = \min \{ d_H(C_1), d_H(C_2) \} $, whereas $ d_H(C) = \min \{ 2 d_H(C_1), d_H(C_2) \} $, hence improving the minimum Hamming distance of the cartesian product if $ d_H(C_1) < d_H(C_2) $.

Observe that $ C $ is reducible. However, its first row component is obviously rank equivalent to its first main component. By Proposition \[char product\], $ C $ and $ C_1 \times C_2 $ are rank equivalent. Hence the $ (\mathbf{u}, \mathbf{u} + \mathbf{v}) $-construction gives nothing but cartesian products for the rank metric.

We may apply the same argument for the so-called matrix-product codes [@blackmore], which are a generalization of the previous construction. Let the notation be as in Subsection \[subsec reducible\], fix a non-singular matrix $ A \in \mathbb{F}_{q^m}^{l \times l} $ and assume that $ N = n_1 = n_2 = \ldots = n_l $. Define the $ \mathbb{F}_{q^m} $-linear code $ C = (C_1, C_2, \ldots, C_l) A \subseteq \mathbb{F}_{q^m}^{n} $ with generator matrix $$G = \left(
\begin{array}{cccc}
a_{1,1} G_1 & a_{1,2} G_1 & \ldots & a_{1,l} G_1 \\
a_{2,1} G_2 & a_{2,2} G_2 & \ldots & a_{2,l} G_2 \\
\vdots & \vdots & \ddots & \vdots \\
a_{l,1} G_l & a_{l,2} G_l & \ldots & a_{l,l} G_l \\
\end{array} \right).$$ If $ A $ is upper triangular, we see that $ C $ is a reducible code. Just as before, if $ A \in \mathbb{F}_q^{l \times l} $, then $ C $ is rank equivalent to $ C_1 \times C_2 \times \cdots \times C_l $, and thus this construction gives nothing but cartesian products.

In the following examples we see that, as an alternative, the $ (\mathbf{u}, \alpha \mathbf{u} + \mathbf{v}) $-construction, for $ \alpha \in \mathbb{F}_{q^m} \setminus \mathbb{F}_q $, and $ (\mathbf{u}, \mathbf{u}^{[i]} + \mathbf{v}) $-construction, for $ 0 < i < m $, may improve the minimum rank distance of the cartesian product.

Consider $ \alpha \in \mathbb{F}_{q^m} \setminus \mathbb{F}_q $, $ n = 3 $, $ C_1 \subseteq \mathbb{F}_{q^m}^3 $ generated by $ (1,0,0) $ and $ C_2 \subseteq \mathbb{F}_{q^m}^3 $ generated by $ (0,\alpha, \alpha^{[1]}) $ and $ (0,\alpha^{[1]}, \alpha^{[2]}) $. Let $ C $ be the $ (\mathbf{u}, \alpha \mathbf{u} + \mathbf{v}) $-construction of the codes $ C_1 $ and $ C_2 $.

It holds that $ d_{R,1}(C_1 \times C_2) = 1 $, whereas $ d_{R,1}(C) = 2 $.

Consider $ \alpha \in \mathbb{F}_{q^m} \setminus \mathbb{F}_q $, $ n = 3 $, $ C_1 \subseteq \mathbb{F}_{q^m}^3 $ generated by $ (\alpha,0,0) $ and $ C_2 \subseteq \mathbb{F}_{q^m}^3 $ generated by $ (0,\alpha, \alpha^{[1]}) $ and $ (0,\alpha^{[1]}, \alpha^{[2]}) $. Let $ C $ be the $ (\mathbf{u}, \mathbf{u}^{[1]} + \mathbf{v}) $-construction of the codes $ C_1 $ and $ C_2 $.

Again, it holds that $ d_{R,1}(C_1 \times C_2) = 1 $, whereas $ d_{R,1}(C) = 2 $.

Conclusion and open problems
============================

In this paper, we have studied the security performance of reducible codes in network coding when used in the form of coset coding schemes. We have obtained lower bounds on their generalized rank weights (GRWs) that extend the known lower bound on their minimum rank distance [@reducible] and which give exact values for cartesian products, and we have obtained upper bounds that are always reached for the minimum rank distance and some reduction. We have obtained maximum rank distance (MRD) reducible codes with MRD main components for new parameters, extending the families of MRD codes for $ n > m $ considered in [@reducible] and [@silva-universal].

We have obtained all $ \mathbb{F}_{q^m} $-linear codes whose GRWs are all optimal, for all fixed packet and code sizes up to rank equivalence. The given code construction is a cartesian product of full-length one-dimensional Gabidulin codes and has the minimum possible length required by the optimality of their GRWs. As we have shown, these codes do not only have optimal GRWs, but the difference between every two consecutive GRWs is the packet lenght, which is optimal, in constrast with Gabidulin codes, for which this difference is the minimum possible. Thus if the length of the code is big enough or not restricted, then the given construction behaves much better than Gabidulin codes in secure network coding.

Afterwards we have shown that, when using reducible codes, a wire-tapping adversary obtains in many cases less information than that described by their GRWs. In particular, when using MRD reducible codes or those with optimal GRWs for fixed packet and code sizes, the eavesdropper obtains no information about the sent packets even when wire-tapping more links than those allowed by other MRD codes.

Finally, we have studied some secondary related properties of reducible codes: Characterizations to be rank equivalent to cartesian products of codes, characterizations to be rank degenerate, bounds on their dual codes, MRD ranks, and alternative constructions to the well-known $ (\mathbf{u}, \mathbf{u} + \mathbf{v}) $-construction.

To conclude, we list a few open problems of interest regarding the security behaviour of reducible codes:

1.  Find other cases when the bounds in Theorem \[grw bounds\] are equalities, apart from the cases covered in Corollary \[grw product\] and Proposition \[proposition exact for one red\].

2.  Find new parameters for which reducible codes are MRD, or prove the impossibility that a reducible code is MRD for certain parameters.

3.  Prove or disprove the optimality of the codes in Section \[sec all optimal\] among $ \mathbb{F}_q $-linear codes. We remark here that no sharp bounds such as those in Lemma \[mono\] are known for general $ \mathbb{F}_q $-linear codes, to the best of our knowledge.

Uniqueness of reductions {#app 1}
========================

In this appendix, we discuss the uniqueness of the main components, row components and column components of a reducible code (see Subsection \[subsec reducible\]). We will show that the main components remain unchanged by changing the reduction or by rank equivalence, hence the bound (\[lower bound\]) remains unchanged. However, the row components may change by changing the reduction, and the column components may change by a rank equivalence. Hence the bounds (\[upper bound\]) and (\[lower bound duals\]) may change in those cases. See Proposition \[proposition exact for one red\], for instance.

Fix a reducible code $ C \subseteq \mathbb{F}_{q^m}^n $, with notation as in Subsection \[subsec reducible\].

\[uniqueness conditions 1\] Given another reduction $ \widehat{\mathcal{R}} $ of $ C $ with the same row and column block sizes as $ \mathcal{R} $, it holds that the main components and column components of $ \widehat{\mathcal{R}} $ and $ \mathcal{R} $ are the same, respectively.

Let $ \widehat{\mathcal{R}} = (\widehat{G}_{i,j})_{1 \leq i \leq l}^{i \leq j \leq l} $ and let $ \widehat{G} $ be the generator matrix of $ C $ given by this reduction. Since the matrices $ G_{i,i} $ have full rank, there exist matrices $ A_{i,j} \in \mathbb{F}_{q^m}^{k_i \times k_j} $, for $ i = 1,2, \ldots, l $ and $ j = i, i+1, \ldots, l $, such that the $ k \times k $ matrix $$A = \left(
\begin{array}{cccccc}
A_{1,1} & A_{1,2} & A_{1,3} & \ldots & A_{1, l-1} & A_{1,l} \\
0 & A_{2,2} & A_{2,3} & \ldots & A_{2, l-1} & A_{2,l} \\
0 & 0 & A_{3,3} & \ldots & A_{3, l-1} & A_{3,l} \\
\vdots & \vdots & \vdots & \ddots & \vdots & \vdots \\
0 & 0 & 0 & \ldots & A_{l-1,l-1} & A_{l-1,l} \\
0 & 0 & 0 & \ldots & 0 & A_{l,l} \\
\end{array} \right)$$ satisfies that $ \widehat{G} = A G $. Then it holds that $ \widehat{G}_{i,i} = A_{i,i} G_{i,i} $, for $ i = 1,2, \ldots, l $, and the main components of both reductions coincide. In addition, it holds that $$\left(
\begin{array}{c}
 \widehat{G}_{1,j} \\
 \widehat{G}_{2,j} \\
 \vdots \\
 \widehat{G}_{j,j} \\
\end{array} \right) = \left(
\begin{array}{cccc}
A_{1,1} & A_{1,2} & \ldots & A_{1,j} \\
0 & A_{2,2} & \ldots & A_{2,j} \\
\vdots & \vdots & \ddots & \vdots \\
0 & 0 & \ldots & A_{j,j} \\
\end{array} \right)  \left(
\begin{array}{c}
 G_{1,j} \\
 G_{2,j} \\
 \vdots \\
 G_{j,j} \\
\end{array} \right),$$ and the column components of both reductions also coincide.

\[uniqueness conditions 2\] Assume that the main components of the reduction $ \mathcal{R} $ of $ C $ are not rank degenerate. Let $ \mathcal{R}^\prime $ be a reduction of an $ \mathbb{F}_{q^m} $-linear code $ C^\prime $ that is rank equivalent to $ C $, with the same row and column block sizes as $ \mathcal{R} $, and such that the rank equivalence maps the rows of the generator matrix corresponding to $ \mathcal{R} $ to the rows of the generator matrix corresponding to $ \mathcal{R}^\prime $. Then the main components and row components of $ \mathcal{R}^\prime $ and $ \mathcal{R} $ are rank equivalent, respectively.

Let $ \mathcal{R}^\prime = (G^\prime_{i,j})_{1 \leq i \leq l}^{i \leq j \leq l} $ and let $ G^\prime $ be the generator matrix of $ C^\prime $ given by this reduction. By hypothesis and by Lemma \[rank equivalences\], we may assume that the rank equivalence is given by $ \phi(\mathbf{c}) = \mathbf{c} A $, for $ \mathbf{c} \in \mathbb{F}_{q^m}^n $, for some $ n \times n $ matrix $$A = \left(
\begin{array}{cccccc}
A_{1,1} & A_{1,2} & A_{1,3} & \ldots & A_{1, l-1} & A_{1,l} \\
A_{2,1} & A_{2,2} & A_{2,3} & \ldots & A_{2, l-1} & A_{2,l} \\
A_{3,1} & A_{3,2} & A_{3,3} & \ldots & A_{3, l-1} & A_{3,l} \\
\vdots & \vdots & \vdots & \ddots & \vdots & \vdots \\
A_{l-1,1} & A_{l-1,2} & A_{l-1,3} & \ldots & A_{l-1,l-1} & A_{l-1,l} \\
A_{l,1} & A_{l,2} & A_{l,3} & \ldots & A_{l,l-1} & A_{l,l} \\
\end{array} \right),$$ with coefficients in $ \mathbb{F}_q $, and such that $ G^\prime = G A $. Looking at the generator matrices of the last row components of $ \mathcal{R} $ and $ \mathcal{R}^\prime $, we see that $$(0, \ldots, 0, G_{l,l}^\prime) = (G_{l,l} A_{l,1}, G_{l,l} A_{l,2}, \ldots, G_{l,l} A_{l,l}),$$ which implies that $ G_{l,l} A_{l,j} = 0 $, for $ j = 1,2, \ldots, l-1 $. This means that the columns of $ A_{l,j} $ are in $ C_l^\perp $. However, since their coefficients lie in $ \mathbb{F}_q $, these columns have rank weight equal to $ 1 $.

On the other hand, we are assuming that the main components of $ \mathcal{R} $ are not rank degenerate, which in particular means that $ d_R(C_l^\perp) > 1 $ (see [@slides Def. 26 and Cor. 28]). Therefore, all the columns in $ A_{l,j} $ are the zero vector, that is, $ A_{l,j} = 0 $, for $ j = 1,2, \ldots, l-1 $.

If we now look at the generator matrices of the $ (l-1) $-th row components of $ \mathcal{R} $ and $ \mathcal{R}^\prime $, we see that $$(0, \ldots, 0, G_{l-1,l-1}^\prime, G_{l-1,l}^\prime) = (G_{l-1,l-1} A_{l-1,1}, \ldots$$ $$G_{l-1,l-1} A_{l-1,l-1}, G_{l-1,l-1} A_{l-1,l} + G_{l-1,l}A_{l,l}),$$ which implies that $ G_{l-1,l-1} A_{l-1,j} = 0 $, for $ j = 1,2, \ldots, l-2 $. In the same way as before, we see that this implies that $ A_{l-1,j} = 0 $, for $ j = 1,2, \ldots, l-2 $.

Continuing iteratively in this way, we see that $ A_{i,j} = 0 $, for $ i > j $. In other words, we have that $ A $ is again of the form $$A = \left(
\begin{array}{cccccc}
A_{1,1} & A_{1,2} & A_{1,3} & \ldots & A_{1, l-1} & A_{1,l} \\
0 & A_{2,2} & A_{2,3} & \ldots & A_{2, l-1} & A_{2,l} \\
0 & 0 & A_{3,3} & \ldots & A_{3, l-1} & A_{3,l} \\
\vdots & \vdots & \vdots & \ddots & \vdots & \vdots \\
0 & 0 & 0 & \ldots & A_{l-1,l-1} & A_{l-1,l} \\
0 & 0 & 0 & \ldots & 0 & A_{l,l} \\
\end{array} \right).$$ As in the proof of Proposition \[uniqueness conditions 1\], this implies that the main components and row components of $ \mathcal{R} $ and $ \mathcal{R}^\prime $ are rank equivalent, respectively.

Acknowledgement {#acknowledgement .unnumbered}
===============

The author wishes to thank Olav Geil and Diego Ruano for fruitful discussions and comments. He also wishes to thank the editor and anonymous reviewers for their very helpful comments.

[10]{} \[1\][\#1]{} url@samestyle \[2\][\#2]{} \[2\][[l@\#1=l@\#1\#2]{}]{}

R. Ahlswede, N. Cai, S.-Y. R. Li, and R. W. Yeung, “Network information flow,” *IEEE Trans. Inform. Theory*, vol. 46, no. 4, pp. 1204–1216, Jul 2000.

T. D. Blackmore and G. H. Norton, “Matrix-product codes over $ \mathbb{F}_q
  $,” *Applicable Algebra in Engineering, Communications and Computing*, vol. 12, no. 6, pp. 477–500, 2001.

N. Cai and R. W. Yeung, “Network coding and error correction,” in *Proc. 2002 IEEE Information Theory Workshop*, 2002, pp. 119–122.

——, “Secure network coding,” in *Proc. 2002 IEEE International Symposium on Information Theory*, 2002, p. 323.

P. Delsarte, “Bilinear forms over a finite field, with applications to coding theory,” *Journal of Combinatorial Theory, Series A*, vol. 25, no. 3, pp. 226–241, 1978.

J. Ducoat, “Generalized rank weights: A duality statement,” in *Topics in Finite Fields*, ser. Comtemporary Mathematics, G. L. M. G. Kyureghyan and A. Pott, Eds.1em plus 0.5em minus 0.4emAmerican Mathematical Society, 2015, vol. 632, pp. 114–123.

J. Ducoat and F. E. Oggier, “Rank weight hierarchy of some classes of cyclic codes,” in *IEEE Information Theory Workshop (ITW), 2014*, 2014, pp. 142–146.

E. M. Gabidulin, “Theory of codes with maximum rank distance,” *Problems Inform. Transmission*, vol. 21, no. 1, pp. 1–12, 1985.

E. M. Gabidulin, A. V. Ourivski, B. Honary, and B. Ammar, “Reducible rank codes and their applications to cryptography,” *IEEE Trans. Inform. Theory*, vol. 49, no. 12, pp. 3289–3293, 2003.

E. M. Gabidulin, A. V. Paramonov, and O. V. Tretjakov, “Ideals over a non-commutative ring and their application in cryptology,” in *Advances in Cryptology — EUROCRYPT ’91*, ser. Lecture Notes in Computer Science, D. W. Davies, Ed.1em plus 0.5em minus 0.4emSpringer Berlin Heidelberg, 1991, vol. 547, pp. 482–489.

R. Jurrius and R. Pellikaan, “On defining generalized rank weights,” *Adv. Math. Comm.*, vol. 11, no. 1, pp. 225–235, Feb 2017.

R. K[ö]{}tter and M. Medard, “An algebraic approach to network coding,” *IEEE/ACM Trans. Networking*, vol. 11, no. 5, pp. 782–795, Oct 2003.

J. Kurihara, R. Matsumoto, and T. Uyematsu, “Relative generalized rank weight of linear codes and its applications to network coding,” *IEEE Trans. Inform. Theory*, vol. 61, no. 7, pp. 3912–3936, 2015.

S.-Y. Li, R. Yeung, and N. Cai, “Linear network coding,” *IEEE Trans. Inform. Theory*, vol. 49, no. 2, pp. 371–381, Feb 2003.

U. Mart[í]{}nez-Pe[ñ]{}as, “Generalized rank weights of reducible codes, optimal cases and related properties,” in *2016 IEEE International Symposium on Information Theory (ISIT)*, Jul 2016, pp. 1959–1963.

——, “On the similarities between generalized rank and [H]{}amming weights and their applications to network coding,” *IEEE Trans. Inform. Theory*, vol. 62, no. 7, pp. 4081–4095, Jul 2016.

U. Mart[í]{}nez-Pe[ñ]{}as and R. Matsumoto, “Unifying notions of generalized weights for universal security on wire-tap networks,” in *Proceedings of the 54th Annual Allerton Conference on Communication, Control, and Computing*, Sep 2016, pp. 800–807.

F. E. Oggier and A. Sboui, “On the existence of generalized rank weights,” in *Proceedings of the International Symposium on Information Theory and its Applications, [ISITA]{} 2012, Honolulu, HI, USA, October 28-31, 2012*, 2012, pp. 406–410.

L. H. Ozarow and A. D. Wyner, “Wire-tap channel [II]{},” in *Advances in Cryptology: EUROCRYPT 84*, ser. Lecture Notes in Comput. Sci.1em plus 0.5em minus 0.4emSpringer Berlin Heidelberg, 1985, vol. 209, pp. 33–50.

M. Plotkin, “Binary codes with specified minimum distance,” *IRE Trans. Inform. Theory*, vol. 6, no. 4, pp. 445–450, Sep 1960.

A. Ravagnani, “Generalized weights: An anticode approach,” *Journal of Pure and Applied Algebra*, vol. 220, no. 5, pp. 1946–1962, 2016.

D. Silva and F. R. Kschischang, “On metrics for error correction in network coding,” *IEEE Trans. Inform. Theory*, vol. 55, no. 12, pp. 5479–5490, 2009.

——, “Universal secure network coding via rank-metric codes,” *IEEE Trans. Inform. Theory*, vol. 57, no. 2, pp. 1124–1135, Feb. 2011.

H. Stichtenoth, “On the dimension of subfield subcodes,” *IEEE Trans. Inform. Theory*, vol. 36, no. 1, pp. 90–93, 1990.

A. D. Wyner, “The wire-tap channel,” *The Bell System Technical Journal*, vol. 54, no. 8, pp. 1355–1387, Oct. 1975.

R. Zamir, S. Shamai, and U. Erez, “Nested linear/lattice codes for structured multiterminal binning,” *IEEE Trans. Inform. Theory*, vol. 48, no. 6, pp. 1250–1276, Jun 2002.

[^1]: This work was supported by The Danish Council for Independent Research under Grant No. DFF-4002-00367 and Grant No. DFF-5137-00076B (EliteForsk-Rejsestipendium).

    Parts of this paper were presented at the IEEE International Symposium on Information Theory, Barcelona, Spain, Jul 2016. [@grwreducible]

    U. Mart[í]{}nez-Peñas is with the Department of Mathematical Sciences, Aalborg University, Aalborg 9220, Denmark (e-mail: umberto@math.aau.dk).
