Consistent Flag Codes

In this paper we study flag codes on Fqn, being Fq the finite field with q elements. Special attention is given to the connection between the parameters and properties of a flag code and the ones of a family of constant dimension codes naturally associated to it (the projected codes). More precisely, we focus on consistent flag codes, that is, flag codes whose distance and size are completely determined by their projected codes. We explore some aspects of this family of codes and present examples of them by generalizing the concepts of equidistant and sunflower subspace code to the flag codes setting. Finally, we present a decoding algorithm for consistent flag codes that fully exploits the consistency condition.


Introduction
The concept of network coding was introduced in [1] as a method to increase the information flow within a network modelled as an acyclic directed graph with possibly more than one source and receiver. This network operates with vectors of a given vector space F n q over the finite field of q elements F q , being q a prime power. The intermediate nodes transmit random F q -linear combinations of these vectors, instead of simply routing them. In [2], Koetter and Kschischang presented an algebraic approach to network coding. Since vector spaces are invariant by linear combinations, the authors suggested using vector subspaces, in lieu of vectors, as codewords. In the same paper, the authors explained how to use the channel in order to send a vector space of F n q . The sender injects the set of vectors of any basis of the given vector space into the network and every intermediate node sends random F q -linear combinations of the available vectors. In the end, the receiver collects the incoming vectors and forms the F q -vector subspace spanned by them. In this context, a subspace code of length n is just a nonempty collection of subspaces of F n q . In case we restrict ourselves to subspaces with the same dimension, we speak about constant dimension codes. The study of constant dimension codes has led to many papers in recent years. We refer the reader to [3] and references therein for the basics on these codes.
Subspace codes require a single use of the channel described above to send a codeword, i.e., a subspace. These codes were generalized in [4] as the so-called multishot subspace codes. More precisely, in an r-shot code, codewords are sequences of r 2 vector subspaces of F n q . In this case, sending a codeword needs r uses (shots) of the channel. As it was shown in that paper, fixed the values n and q, multishot codes could achieve better cardinality and distance than one-shot codes just by introducing a new parameter: the number of the channel uses.
In this paper we focus on flag codes, a specific family of multishot codes whose codewords are given by sequences of nested subspaces (flags) with prescribed dimensions. In the network coding framework, flag codes were introduced in [5]. In that work, the authors studied flag codes as orbits of subgroups of the general linear group and provided some constructions of them as well as a new channel model for flags.
The goal of the present work is the study of the connection between the parameters and properties of a flag code and the ones of its projected codes, that is, the constant dimension codes used at each shot when sending flags of a flag code. In this direction, we introduce the concept of consistent flag codes, a family of flag codes whose cardinality and distance are perfectly described in terms of its projected codes. This notion of consistency (cardinality-consistency together with distance-consistency) will allow us to easily translate distance and cardinality properties of a flag code to the subspace code level and vice versa. Moreover, in a consistent flag code, some structural properties satisfied at flag codes level are transferred as the equivalent properties at the subspace codes level, that is, they are properly inherited by the projected codes (and conversely). We will exhibit this fact providing two specific families of consistent flag codes coming from the natural generalization of equidistant and sunflower constant dimension codes (see [6,7]). The consistency condition will be exploited to give a decoding algorithm, which translates the problem of decoding a flag code to the one of decoding a constant dimension code.
The paper is is organized as follows. In Section 2, we provide the basic background on subspace codes, focusing on two well-known families of constant dimension codes: equidistant and sunflower codes. Besides, some definitions and known facts about flag codes are presented, together with the channel model to be used later on. Section 3 is devoted to properly define the concept of consistency of a flag code with respect to its projected codes and to discuss some aspects related to this class of flag codes. In Section 4, we present families of consistent flag codes by generalizing the concepts of equidistant and sunflower code to the flag codes scenario. Furthermore, we will see that the only consistent equidistant (resp. sunflower) flag codes are the ones that have equidistant (resp. sunflower) projected codes. Finally, in Section 5 we study the problem of decoding consistent flag codes on the erasure channel by exhibiting a suitable decoding algorithm.

Preliminaries
This section is devoted to recall some background needed along this paper. The first part concerns subspace codes, focusing on two important families of constant dimension codes. In the second part we remind some known facts and definitions related to flag codes.

Subspace Codes
Let q be a prime power and F q the finite field of q elements. For every n 1, we denote by P q (n) the projective geometry of the vector space F n q , which consists of the set of all the F q -vector subspaces of F n q . This set can be endowed with a metric, the subspace distance, given by The Grassmannian G q (k, n) (or Grassmann variety) of dimension k n of F n q is just the set of k-dimensional subspaces in P q (n). The subspace distance induces in turn a metric in G q (k, n) and, in this case, its expression becomes A subspace code of F n q is a nonempty subset C of P q (n). If every subspace in C has the same dimension, say k, then it is said to be a constant dimension code in the Grassmannian G q (k, n). The (minimum) distance of a subspace code C is For codes consisting of just one element, we put d S (C) = 0. In any other case, the minimum distance of a subspace code is a positive integer. For a constant dimension code C in the Grassmannian G q (k, n), the minimum distance d S (C) is an even integer with For the basic background on constant dimension codes we refer the reader to [2], the seminal paper in this subject, and to [3].
A constant dimension code C ⊆ G q (k, n) is said to be equidistant if its distance is attained by every pair of different subspaces in C. In this situation, there exists an integer c such that max{0, 2k − n} c k and d S (C) = 2(k − c). This value c represents the dimension of the intersection between every pair of different subspaces in C. Due to this reason, these codes are also known as equidistant c-intersecting constant dimension codes. Trivial codes consisting just of one element are trivially equidistant of distance zero. Equidistant subspace codes have been widely studied in [6,7]. In Section 3 we will generalize this concept to the flag codes setting.
Observe that constant dimension codes in the Grassmannian G q (k, n) attaining the maximum distance are, in particular, equidistant c-intersecting constant dimension codes with c = max{0, 2k − n}. For dimensions up to n 2 , they are better known as partial spread codes. For further information on this family of codes, consult [8].
Regarding the intersections between couples of codewords, there is another interesting class of equidistant constant dimension codes to take into account. A constant dimension code C ⊆ G q (k, n) is said to be a sunflower if there exists a subspace C such that, for every pair of different subspaces U , V ∈ C, it holds U ∩ V = C. In this case, the subspace C is called the center of the sunflower. Observe that a sunflower is an equidistant c-intersecting code with c = dim(C). These codes have been also studied and constructed in [6,7]. Observe that every subspace code with just one codeword C = {U } can be seen as a trivial sunflower of center U .
Concerning the way we use the channel to transmit some information encoded in a subspace code, recall that, to send a codeword (a subspace) we just need to use the channel once, that is, we perform one shot (see [2]). Under this viewpoint, subspace codes can be called one-shot codes. In contrast, when the number of required uses of the channel is bigger, say r, we speak about multishot codes of length r or, simply, r-shot codes. More precisely, r-shot codes are nonempty subsets of P q (n) r , i.e., their codewords are sequences of length r of subspaces of F n q . The subspace distance defined in (1) can be naturally generalized to this setting. Given two sequences of subspaces U = (U 1 , . . . , U r ) and V = (V 1 , . . . , V r ), their extended subspace distance is given by For further information on multishot codes, see [4].

Flag Codes
Flag codes are a special family of multishot subspace codes, in which codewords are sequences of nested subspaces of a vector space over a finite field. In the network coding setting, they were first introduced in [5]. Given integers 1 t 1 < t 2 < · · · < t r < n, a flag of type (t 1 , . . . , t r ) on F n q is a sequence of nested vector subspaces F = (F 1 , . . . , F r ) ∈ G q (t 1 , n) × · · · × G q (t r , n) such that The t i -dimensional subspace F i is called the i-th subspace of the flag F . When we consider flags of full type vector, that is, (1, . . . , n − 1), we speak about full flags.
The flag variety of type (t 1 , . . . , t r ) on F n q is denoted by F q ((t 1 , . . . , t r ), n) and it is the set of flags of the corresponding type. As a subset of P q (n) r , the flag variety can be seen as a metric space, equipped with the extended subspace distance given in (3). We call it the flag distance and denote it by d f in this setting. More precisely, if F = (F 1 , . . . , F r ) and F = (F 1 , . . . , F r ) are flags of type (t 1 , . . . , t r ) on F n q , the flag distance between them is given by A flag code of type (t 1 , . . . , t r ) on F n q is a nonempty subset C of the flag variety F q ((t 1 , . . . , t r ), n) and its (minimum) distance is given by Observe that, if C contains at least two flags, its distance is a positive even integer. On the other hand, if |C| = 1, we put d f (C) = 0. The bounds for the distance between t i -dimensional subspaces given in (2) yield to the following upper bound for the flag distance: Flag codes attaining this bound are called optimum distance flag codes (see [9,10]).
To finish this section, we present a channel for flags following the general idea of the channel model introduced in [5]. If we see flag codes as a particular case of multishot codes, sending a flag of type (t 1 , . . . , t r ) on F n q (as a codeword of a flag code) requires using the subspace channel r times to send r nested subspaces of F n q . The nested structure allows us to reduce the amount of sent information in every shot. Let us make this precise.
The network can be modelled as a finite directed acyclic multigraph with a single source and several receivers. Assume that we want to send a flag F = (F 1 , . . . , F r ). By virtue of the nested structure of flags, one can find vectors v 1 , . . . , v t r ∈ F n q such that for every 1 i r, the subspace F i is spanned by the set of vectors {v 1 , . . . , v t i }.
In order to send the flag F , we proceed as follows. We fix t 0 = 0 and for every value of 1 i r, at the i-th shot:

•
The source injects the set of vectors {v t i−1 +1 , . . . , v t i }. One of each through a different outgoing edge. • Then, intermediate nodes construct random F q -linear combinations of the received vectors up to this moment (included the ones received in previous shots) and send each of them through an outgoing edge.

•
The receivers get random linear combinations of the vectors {v 1 , . . . , v t i } and put them as the rows of a matrix Z i to construct the subspace that is, the vector space spanned by the rows of Z 1 , . . . , Z r .
After r shots, every receiver is able to form a stuttering flag X = (X 1 , . . . , X r ), i.e., a sequence of nested subspaces where equalities are allowed. Note that, in absence of errors, this sequence coincides with the sent flag F . Nevertheless, erasures and insertions can occur at every shot. Let us explain in more detail these two concepts.
and it represents the number of dimension losses from F i in X i . The number of insertions at the i-th shot is dim(E i ) and it measures the dimension of the vector space generated by the set of vectors in X i but not in F i . Hence, the number of errors at the i-th shot is given by e i = d S (F i , X i ) and it counts both the number of erasures and insertions occurred in this single shot. Finally, the total number of errors of the communication is denoted by e and it is computed as In a general channel, this number e tells us how many erasures and insertions have occurred in the transmission of the flag F . Through this paper, we will focus on a more particular channel, the erasure channel for flags, in which insertions are not allowed. Hence, only erasures can occur and it holds X i ⊆ F i for every 1 i r. In this context, the value e is called total number of erasures and e i is called the number of erasures at the i-th shot.

Consistent Flag Codes
Following the ideas in [9], given a flag code C, we can naturally associate to it a set of constant dimension codes that we obtain when we gather the subspaces of the same dimension used at a fixed shot in the process of sending flags. Let us explain more precisely the definition of these codes. Definition 1. Let C be a flag code of type (t 1 , . . . , t r ) on F n q . For every 1 i r, we call the i-projected code of C to the constant dimension code C i ⊆ G q (t i , n) given by the set of i-th subspaces of flags in C. More precisely, Due to the close relationship between a flag code C and its projected codes, it is a natural question to explore how far properties and structure of these codes determine the structure of C and conversely. In this direction, this section is devoted to the study of flag codes that are consistent with respect to their projected codes or just consistent flag codes. This is a family of flag codes in which the cardinality and distance are completely determined by the ones of their projected codes. We will show how, in some specific cases, this property of consistency goes beyond size and distance and gives rise to a stronger structural consistency. Furthermore, as we will see in Section 5, the property of being consistent makes it possible to give a decoding algorithm in the erasure channel for flags.
Let us first point out the connection between the cardinality of a flag code C of type (t 1 , . . . , t r ) and the ones of its projected codes. It is clear that the size of any projected code is upper-bounded by the cardinality of C, that is, |C i | |C|, i = 1, . . . , r.
The first condition of consistency we will impose to our family of flags is the property of disjointness.

Definition 2.
A flag code C of type (t 1 , . . . , t r ) on F n q is said to be disjoint if its cardinality coincides with the ones of its projected codes, that is, if |C| = |C 1 | = · · · = |C r |.
The notion of disjoint flag codes was introduced in [9] in order to characterize optimum distance flag codes in terms of their projected codes. Observe that the cardinality of a disjoint flag code is determined by the one of any of its projected codes. In this sense, we can say that disjoint flag codes are consistent with respect to the cardinality of their projected codes, or just cardinality-consistent, for short.
Just as the cardinality of a disjoint flag code is determined by the ones of its projected codes, we introduce the concept of consistency of flag codes with respect to the distance of their projected codes taking into account the pairs of flags attaining the minimum distance of the flag code.
Definition 3. Let C be a flag code of type (t 1 , . . . , t r ) on F n q . We say that C is distance-consistent if for every pair of different flags F , F in C, the following statements are equivalent: Notice that, in a distance-consistent flag code, a pair of flags provides the minimum distance if, and only if, the (subspace) distance between their subspaces is the minimum (subspace) distance of the corresponding projected code. Hence, closest flags in a distance-consistent flag code are given by nested sequences of the closest subspaces in the projected codes. That does not occur in a general flag code, as we can see in the following example: Example 1. Let C be the flag code of type (1, 2, 3) on F 5 q given by the set of flags denotes the standard basis of F 5 q over F q . In this case, we have d f (C) = d f (F 1 , F 2 ) = 6. However, the flag code C is not distance-consistent since the distance of every projected code is d S ( Under the distance-consistency condition, there is a coherent link between what is close both at flag level and at subspace level. Moreover, it follows a clear connection between the distance of a flag code and the ones of its projected codes. Proposition 1. The distance of a distance-consistent flag code coincides with the sum of the ones of its projected codes. The previous example shows that the converse of this result is not true in general. Just observe that the distance of C is 6, which is the sum of the distances of its projected codes, whereas C is not distance-consistent. However, we can notice that, in this example, the minimum distance is attained by two different flags F 1 , F 2 ∈ C with a common subspace. If we exclude this situation and focus on flag codes where different flags have all their subspaces different, i.e., disjoint flag codes, we have the following characterization. Proposition 2. Let C be a disjoint flag code of type (t 1 , . . . , t r ) on F n q . The following statements are equivalent: Proof. By means of Proposition 1, we just need to prove that a disjoint flag code C with distance To do so, consider a pair of different flags F , F in C giving the distance of the code. Since C is disjoint, we know that F i = F i for every 1 i r. As a result, for every value of i, the distance d S (F i , F i ) cannot be zero and hence must be, at least, d S (C i ). On the other hand, we have that These two concepts of consistency, with respect either to the cardinality or to the distance, give rise to a more general idea of consistency which gathers both of them.

Definition 4.
A flag code is said to be consistent (w.r.t. its projected codes), if it is both cardinality-consistent (disjoint) and distance-consistent.
This definition along with Proposition 2 provides the following characterization of consistent flag codes.
The following statements are equivalent: Observe that, by means of this result, in order to determine if a flag code is consistent, we just need to compute the distance and cardinality of the given flag code as well as the ones of its projected codes. This is notably easier than checking the distance-consistency condition, i.e., that every pair of flags in the code gives the minimum distance if, and only if, the distance between their subspaces coincides with the minimum distance of every projected code. In particular, every flag code consisting of a single flag is automatically consistent with d f (C) = 0.
To finish this section, we deepen the structure of consistent flag codes in order to give some crucial definitions and properties for the design of the decoding process (Algorithm 1) described in Section 5. Let us fix C a consistent flag code of type (t 1 , . . . , t r ) on F n q . Observe that, if F , F ∈ C attain the minimum distance of C, by virtue of the distance-consistency property, it holds for every 1 i r. Equivalently, the distance of C is attained by a pair of flags F , F ∈ C if, and only if, for every 1 i r.
Recall also that, as the code C is consistent, in particular, it is disjoint. Hence, if |C| 2, every projected code contains at least two different subspaces and its distance is a positive even integer. As a result, for every value 1 i r, we have that m i < t i . Moreover, since subspaces in a flag are nested, associated to C we obtain a non-decreasing sequence of integers 0 m 1 · · · m r < t r such that, for each pair F , F with d f (F , F ) = d f (C), we can construct a (stuttering) flag of type (m 1 , . . . , m r ). With this notation, we give the following definition.
Definition 5. Let C be a consistent flag code of type (t 1 , . . . , t r ) on F n q . We define the minimum distance intersection code of C as the stuttering flag code of type (m 1 , . . . , m r ) given by the family Notice that, for not consistent flag codes, the set given in (6) has not necessarily a fixed type. For instance, if we consider the code C in the Example 1, the set contains stuttering flags of types (1, 1, 1) and (0, 1, 2).
The sequence of numbers (m 1 , . . . , m r ) defined as in (5) provides upper bounds for the dimension of the intersection of subspaces in every projected code of a consistent flag code. Proposition 3. Let C be a consistent flag code C of type (t 1 , . . . , t r ) and consider a pair of different flags F , F ∈ C. Then dim(F i ∩ F i ) m i , for every 1 i r.
Proof. Let F and F be a pair of flags in a consistent flag code C. Since this code is disjoint, from the condition F = F , we obtain that F i = F i for every value of 1 i r. Hence, it holds Notice that, in the previous result, the condition of consistency cannot be relaxed in none of its two sides. On the one hand, being distance-consistent is necessary to properly define the numbers m 1 , . . . , m r . On the other hand, the next example shows that the condition of cardinality-consistency can neither be removed.
where {u 1 , . . . , u 6 } is the standard basis of F 6 q over F q . Observe that C is not disjoint since C 1 contains only two subspaces. The distance of every projected code is 2 and the distance of the flag code is d f (C) = 8. This distance is only attained by the pair of flags F 1 and F 2 and, for this couple of flags, it holds d S (F 1 i , F 2 i ) = 2 = d S (C i ) for every i = 1, 2, 3, 4. Hence, C is a distance-consistent flag code and it makes sense to consider the values defined as in (5). However, notice that dim(F 1 1 ∩ F 3 1 ) = 1 > 0 = m 1 , in contrast to what happens in the context of Proposition 3, where the extra condition of cardinality-consistency (disjointness) is required.
Recall that every flag code with just one element is consistent with distance equal to zero. Apart from this case, we have the following result concerning the possible values for the distance of consistent flag codes. Proposition 4. Let C be a consistent flag code of type (t 1 , . . . , t r ) on F n q with |C| 2. Then its distance satisfies Moreover, the equality for the lower bound holds if, and only if, d S (C i ) = 2 for every 1 i r.
Proof. The upper bound holds, since it is the general upper bound given in (4) for the distance of any flag code of type (t 1 , . . . , t r ) on F n q . On the other hand, by the cardinality-consistency property, we have that |C i | = |C| 2. Hence, the distance of every projected code must be a positive even integer. Moreover, by means of Theorem 1, the distance of the consistent flag code C satisfies and the equality holds only if, for every 1 i r, the i-projected code has distance d S (C i ) = 2.
The maximum cardinality of a constant dimension code in the Grassmannian G q (k, n) and distance d is denoted by A q (n, d, k). The next result provides an upper bound for the cardinality of a consistent flag code C ⊆ F q ((t 1 , . . . , t r ), n) in terms of the values A q (n, d S (C i ), t i ), for 1 i r.
Proposition 5. Let C ⊆ F q ((t 1 , . . . , t r ), n) be a consistent flag code. Then its cardinality satisfies Proof. It follows from the fact that the cardinality of every consistent flag code C coincides with the ones of its projected codes. Hence, for every 1 i r, it holds Given that flag codes are not consistent in general, it is a natural question to wonder how much cardinality we lose when imposing the consistency condition. Up to now, the maximum possible cardinality of flag codes has only been studied in [11], where the author develops a tool to upper bound the cardinality of full flag codes with a prescribed distance (see Theorem 4.2) and deduces bounds for certain specific values of the parameters. Following this idea, let us study the largest cardinality of consistent flag codes for two concrete values of the distance: either the maximum or the minimum possible ones.
In [9] it was shown that flag codes of any type vector attaining the maximum distance have to be cardinality-consistent and all their projected codes must be constant dimension codes with the maximum distance. In particular, observe that the distance of every optimum distance flag code coincides with the sum of the ones of its projected codes. Hence, by means of Theorem 1, optimum distance flag codes are consistent. As a consequence, for the maximum possible distance there is no loss of cardinality when working under the consistency condition with respect to general flag codes.
On the other hand, in light of Proposition 5, we can derive an upper bound for the cardinality of consistent flag codes attaining the minimum possible distance provided in Proposition 4. Corollary 1. The cardinality of a consistent flag code C ⊆ F q ((t 1 , . . . , t r ), n) with distance 2r is upper bounded by |C| min |G q (t i , n)| | 1 i r .
In particular, the cardinality of a consistent full flag code on F n q and distance 2(n − 1) is, at most, q n −1 q−1 .
Proof. By means of Proposition 4, it follows that every projected code C i of C has distance d S (C i ) = 2. Now, by application of Proposition 5 and having into account that A q (n, 2, t i ) = |G q (t i , n)|, the result holds. Specifically, if we take the full type vector, the minimum of the values {|G q (i, n)| | 1 i n − 1} is precisely the number of lines (or hyperplanes) of F n q , which is Observe that, in case of considering consistent flag codes with distance 2r, we can give a bound for the cardinality not depending on the projected codes, since all of them have subspace distance equal to 2.
Let us see three particular examples in this context of full flags, considering both the bounds given in [11] and the ones in the previous corollary. Example 3. According to [11] (Proposition 2.6), the maximum possible cardinality of a full flag code on F 4 q and distance 6 is exactly In the proof of this result, the author shows that this bound is attained by disjoint full flag codes having projected codes of distances d S (C i ) = 2, for i = 1, 2, 3. Observe that such codes are consistent by Theorem 1. Moreover, the previous value coincides with the bound given in Corollary 1 for n = 4 and full type vector.
On the other hand, for higher values of n, the fact of having the minimum distance for consistent full flag codes, that is, 2(n − 1), does not imply that the code is consistent. In this case, the minimum distance can be attained with different combinations for the distances of the projected codes if we allow the existence of different flags sharing common subspaces (that is, if we do not require the cardinality-consistency condition). The next example reflects this situation. Example 4. For n = 5, one possibility to attain the distance 2(n − 1) = 8 is the following. Given a hyperplane H of F 5 q , consider an optimum distance full flag code C on H and form a full flag code In this case, the distance between every pair of different flags in C is 8. The maximum cardinality of a code constructed in this way is precisely the maximum possible size for optimum distance full flag codes on F 4 q , which is q 2 + 1, as proved in [9,11].
Observe that the distances of the projected codes C 2 and C 4 in the previous example are different from 2, in contrast to what happens when considering consistent full flag codes on F 5 q with distance 8. The possibility of obtaining the same flag distance as the sum of different combinations of subspace distances allows (general) flag codes to attain better cardinalities than the attained by the consistent ones, as we can see in the next example.
Example 5. As stated in [11] (Proposition 6.3), the maximum possible size of a full flag code on F 5 q and distance equal to 8 is upper bounded by Observe that this value is exactly the product of the maximum cardinality of an optimum distance full flag code on a hyperplane of F 5 q (see Example 4) by the number of hyperplanes in the Grassmannian G q (4,5). In contrast, the maximum cardinality of a consistent full flag code with the same parameters cannot be greater than q 5 −1 q−1 , by means of Corollary 1.
The previous examples suggest that the problem of comparing the maximum possible size of both (general) full flag codes and consistent full flag codes with a prescribed distance is by no means trivial and it requires a profound examination that takes into account, on the one hand, how the distance of a flag code can be distributed among its projected codes and, on the other hand, the number of common subspaces shared by different flags in a code. Furthermore, out of the full type case, this comparative becomes much more complicated since the study of bounds for the cardinality of flag codes of a general type vector has not yet been undertaken and, as pointed out in [11], it is even a wider open problem than the analogous for the full type vector.
Despite the expected loss of cardinality for some values of the distance when imposing the consistency condition (with respect to flag codes in general), in the following section we present several families of consistent flag codes coming from the natural generalization of some known families of subspace codes to the flag codes framework.

Some Families of Consistent Flag Codes
Given that a flag code C of type (t 1 , . . . , t r ) can be seen as a subset of the product of the Grassmannians G q (t 1 , n) × · · · × G q (t r , n), it seems quite natural, beyond cardinality and distance questions, to study the relationship between flag codes satisfying certain property and flag codes with projected codes fulfilling the equivalent property at the subspace codes level.
With this objective in mind, in this section we introduce two couples of special families of flag codes. We start studying and comparing equidistant flag codes and flag codes with equidistant projected codes. We show that, in general, these concepts are not equivalent whereas under the assumption of being consistent they coincide. Next, we focus on the study of sunflower flag codes and flag codes with sunflower (subspace) codes as their projected codes. Again, we see that, in general, these two families do not coincide but they turn to be the same when we impose the consistency condition. This study allows us to conclude that the consistency condition defined in Section 3 leads as well to a structural consistency that strongly relates the nature of a flag code with the ones of its projected codes. Let us make these ideas precise.

Consistent Equidistant Flag Codes
Recall from Section 2 that a subspace code C in G q (k, n) is called equidistant if for each pair of codewords U , V in C, we have that d S (U , V ) = d S (C). Let us generalize this concept to the flag codes scenario in two different ways.

Definition 6.
A flag code C ⊆ F q ((t 1 , . . . , t r ), n) is said to be equidistant if, for every pair of different flags F , F ∈ C, it holds d f (C) = d f (F , F ).

Definition 7.
A flag code C is said to be projected-equidistant if all its projected codes C i are equidistant constant dimension codes.
These two concepts do not represent the same notion in the general framework of flag codes as the reader can realize from the following two examples. First, we see that equidistant flag codes do not need to be projected-equidistant. Example 6. Let {u 1 , , . . . , u 5 } denote the standard basis of F 5 q over F q and consider the flag code C of type (2, 3) on F 5 q , consisting of the set of flags F 1 = ( u 1 , u 2 , u 1 , u 2 , u 3 ), F 2 = ( u 1 , u 4 , u 1 , u 4 , u 5 ), This code is equidistant with d f (C) = 6 but none of its projected code is equidistant. For instance, d S (F 1 1 , The other way round, being projected-equidistant does not imply equidistance.
Example 7. Let C be a full flag code on F 3 q given by the set of flags where {u 1 , u 2 , u 3 } is the standard basis of F 3 q over the field F q . Observe that C 1 is and C 2 are equidistant constant dimension codes. In other words, the flag code C is projected-equidistant. Nevertheless, it is clear that C is not equidistant since In light of Example 7, we can see that projected-equidistant flag codes are not in general consistent since they might not even be cardinality-consistent (disjoint). When we require them to satisfy this extra condition, we obtain the following results. Proposition 6. Let C ⊆ F q ((t 1 , . . . , t r ), n) be a projected-equidistant flag code. If C is cardinality-consistent, then it is equidistant with distance d f (C) = ∑ r i=1 d S (C i ).
Proof. Assume that C is a cardinality-consistent projected-equidistant flag code, i.e., a disjoint flag code with equidistant projected codes. We distinguish two cases: Hence, d f (C) = d S (C i ) = 0 and the result trivially holds.
• If |C| 2, consider an arbitrary pair of different flags F , F ∈ C. The cardinality-consistency condition implies that F i = F i for every 1 i r. Now, given that every projected code C i is equidistant, As a consequence, and by means of Theorem 1, we obtain the next corollary.

Remark 1.
Observe that if C ⊆ F q ((t 1 , . . . , t r ), n) is a projected-equidistant flag code, then there exist integers c 1 , . . . , c r such that every projected code C i is an equidistant c i -intersecting constant dimension code in G q (t i , n). Moreover, if C is disjoint, by means of the previous corollary, it is consistent. In this case, the sequence (c 1 , . . . , c r ) is precisely the type vector of the minimum distance intersection code defined as in (6) associated to the consistent flag code C.
According to these two results, it is clear that disjoint projected-equidistant flag codes are equidistant and consistent. In the next result, we prove that they are exactly the only codes that can be equidistant and consistent simultaneously.

Theorem 2. A consistent flag code is equidistant if, and only if, it is projected-equidistant.
Proof. The "if" part is consequence of Proposition 6. For the "only if" part, assume that C is a consistent and equidistant flag code. Let us see that, under these two conditions, every projected code is equidistant. In case C contains a single flag, it is clear that every projected code is equidistant (with distance equal to zero).
Let us study the case |C| 2. Observe that, since C is consistent, in particular the cardinality of every projected code coincides with the one of C and, given an index 1 i r, we can always find two different subspaces U , V ∈ C i . By the definition of projected code, there must exist different flags F , F ∈ C such that F i = U and F i = V. Since C is equidistant, it holds d f (C) = d f (F , F ). This fact together with the distance-consistency property implies that d S (F j , F j ) = d S (C j ) for every 1 j r. In particular, we conclude that d S (C i ) = d S (F i , F i ) = d S (U , V ), which proves that the projected code C i is equidistant.
Observe that consistency completely translates the property of being equidistant from a flag code to its projected codes and vice versa. As a particular case of equidistant flag codes, we mention the family of optimum distance flag codes, which were introduced in [9] as a generalization of constant dimension codes attaining the maximum distance. These codes were characterized in the same paper as disjoint flag codes with projected codes attaining the maximum possible distances for the corresponding dimensions. Hence, not only are they an example of equidistant flag codes but also of projected-equidistant flag codes. Consequently, by means of Corollary 2, we obtain the next result. This result can be independently proved by using Theorem 1, as mentioned in Section 3. Once again, consistency allows to perfectly translate the property of attaining maximum distance at the subspace codes level to flag codes and conversely.

Consistent Sunflower Flag Codes
Following the ideas in [7], here below we introduce the concept of sunflower flag code.
In this case, the stuttering flag C is called the center of the sunflower flag code C.
By analogy with the concept of projected-equidistant flag code, we define now the family of flag codes having sunflowers as projected codes.

Definition 9.
A flag code C ⊆ F q ((t 1 , . . . , t r ), n) is said to be projected-sunflower if all its projected codes are sunflowers. In this situation, there exist subspaces C 1 , . . . , C r such that every i-projected code C i of C is a sunflower of center C i . We say that C 1 , . . . , C r are the centers of the projected-sunflower flag code C.
One has the following relationship between these two concepts. Proposition 7. Let C ⊆ F q ((t 1 , . . . , t r ), n) be a sunflower flag code of center C = (C 1 , . . . , C r ). Then the code C is a projected-sunflower flag code of centers C 1 , . . . , C r .

Proof.
Assume that C is a sunflower flag code of type (t 1 , . . . , t r ). If |C| = 1, the result trivially holds. Suppose now that |C| 2. For every index 1 i r, we must prove that the projected code C i is a sunflower of center C i . We distinguish to possibilities.

•
If |C i | = |C| 2, we can find two different subspaces U , V ∈ C i . Hence, there exist flags F , F ∈ C such that F i = U and F i = V. Since C is a sunflower of center C, we have which proves that C i is a sunflower of center C i .

•
In case of |C i | < |C|, there must exist two different flags F , F in C such that F i = F i . Since C is a sunflower of center C, we have that On the other hand, notice that every subspace in the projected code C i contains the subspace C i . Using that dim(C i ) = t i , we conclude that C i = {C i }, which is the trivial sunflower of center C i .
The converse of Proposition 7 is not true in general. The next example shows that projected-sunflower flag codes are not necessarily sunflowers.
where {u 1 , u 2 , u 3 , u 4 } denotes the standard basis of F 4 q over F q . Observe that the projected codes are sunflowers of center C 1 = u 1 and C 2 = u 1 , u 2 . However, the code C is not a projected sunflower of center (C 1 , Notice that the code in the previous example is not disjoint (cardinality-consistent) since F 1 and F 2 have the same second subspace. If we require the cardinality-consistency condition, we have the following characterization. Theorem 3. Let C ⊆ F q ((t 1 , . . . , t r ), n) be a cardinality-consistent flag code. The following statements are equivalent: 1. C is a sunflower of center (C 1 , . . . , C r ); 2. C is a projected-sunflower of centers C 1 , . . . , C r .
Proof. By means of Proposition 7, it suffices to see that (2) implies (1). Assume that C is a projected-sunflower and, for every 1 i r, denote by C i the center of C i . Consider two different flags F , F ∈ C. Since C is disjoint, we get that F i = F i for every 1 i r. Hence, we have F i ∩ F i = C i for every choice of i and we conclude that C is a sunflower flag code of center (C 1 , . . . , C r ).
Observe that projected-sunflower flag codes are, in particular, projected-equidistant. Hence, by the previous theorem together with Corollary 2, the next result holds straightforwardly.

Corollary 4.
Assume that C is a cardinality-consistent sunflower flag code of center C = (C 1 , . . . , C r ). Then it is consistent and its minimum distance intersection code is given by its center {C}.

Remark 2.
Notice that Theorem 2 still holds true if we replace "equidistant" by "sunflower". However, in the latter case, the condition of being consistent can be relaxed to just the one of cardinality-consistency, as shown in Theorem 3. This is due to the fact that distance-consistency is an inherent property of sunflower flag codes. More precisely, if C ⊆ F q ((t 1 , . . . , t r ), n) is a sunflower of center (C 1 , . . . , C r ), then this center not only determines the distance of the flag code C given by but also the one of every projected code C i , which is d S (C i ) = 2(t i − dim(C i )).
Once again we see that, under the consistency condition, one can naturally translate properties between the flag codes and the subspace codes frameworks. In this case, we can identify the flag codes property of being a sunflower with the one of having sunflowers as projected codes.

A decoding Algorithm for Consistent Flag Codes
In this section we provide a decoding algorithm on the erasure channel for consistent flag codes. In particular, it can be applied to the families mentioned in the previous section. This algorithm generalizes the ideas given in [9], where a decoding process for optimum distance flag codes was given. As we will see through this section, both distance-consistency and cardinality-consistency play a key role in this procedure and allow us to reduce the problem of decoding a flag code to the one of just decoding one of its projected codes.
Let C be a flag code of type (t 1 , . . . , t r ) on F n q . Assume we have sent a flag F = (F 1 , . . . , F r ) ∈ C through the erasure channel for flags defined in Section 2.2 (see [5]) and, after r shots, a receiver gets a stuttering flag X = (X 1 , . . . , X r ).
As we are using an erasure channel, only erasures (no insertions) can occur. Hence, every subspace X i is contained in the subspace F i sent at the corresponding shot. Recall from Section 2.2 that, at every shot, some information can be lost. This amount of information is called number of erasures at the i-th shot and computed as The total number of erasures of the communication is given by and it is said to be correctable by the flag code C if In this case, the received sequence X can be decoded into F by minimum distance in C. This means that F is the closest flag in C to the received stuttering flag X . Analogously, for every 1 i r, the number of erasures at the i-th shot e i is said to be correctable by the projected code C i of C if The next proposition relates the correctability of the total number of erasures by a flag code C and with the number of erasures occurred at each shot, under certain conditions on the distance of the code. Proposition 8. Let C be a flag code of type (t 1 , . . . , t r ) on F n q and suppose that d f (C) ∑ r i=1 d S (C i ). If the total number of erasures e is correctable by C, then there is some e i that is correctable by the corresponding C i .

Proof.
Assume that e d f (C)− 1 2 but no e i is correctable, that is, e i > d S (C i ) which is a contradiction, since e is correctable.
The next result provides a characterization of a correctable number of erasures at some shot in terms of the dimension of the received subspace. The proof follows straightforwardly from the definition of the number of erasures at some shot, together with the condition of correctability. Proposition 9. The number of erasures at the i-th shot e i is correctable if, and only if, the dimension of the subspace X i is greater than t i − d S (C i ) 2 .
reduce the problem of decoding X into F to the one of decoding some X i into the corresponding sent subspace F i . After that, the cardinality-consistency condition allows us to come back to the flags setting and recover F from any of its subspaces. Again, the use of the consistency property in flag codes transfers a problem at the flag codes level-the one of decoding on the erasure channel-to the equivalent problem in the subspace codes scenario.

Conclusions and Future Work
In this paper we have introduced the concept of consistency for flag codes. This new notion allows us to measure in some way how far the parameters and properties of a flag code are determined by the ones of its projected codes. Moreover, we have determined the possible values for the distance of consistent flag codes and obtained bounds for their maximum possible size of in terms of the distances of their projected codes. In our search for families of consistent flag codes, we have generalized the concepts of equidistant and sunflower code to the flag codes framework in several ways and proved that, under the assumption of consistency, they coincide. In this way, consistency plays an important role in the study of properties of flag codes that can be induced by their projected codes and vice versa. A decoding algorithm for consistent flag codes in the erasure channel has been provided.
In future works, we would like to generalize the decoding algorithm presented in this paper in two possible ways. On the one hand, exploring how to decode consistent flag codes in a general channel where insertions were allowed. On the other hand, we want to study the decoding process for more general families of flag codes on the erasure channel, by relaxing the property of consistency in one of its two sides: either the distance-consistency or the cardinality-consistency. Furthermore, it would be very interesting to investigate the question of finding bounds for the maximum possible cardinality of flag codes with a prescribed distance for a general type vector as well as to measure the cardinality loss derived from the use of consistent flag codes.

Conflicts of Interest:
The authors declare no conflict of interest.