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 $ 