End NaryDirect.

(* Specifications: *)
(* Linear span generated by a list of vectors *)
Lemma memv_span X v : v \in X -> v \in <<X>>%VS.
Lemma memv_span1 v : v \in <<[:: v]>>%VS.
Lemma sub_span X Y : {subset X <= Y} -> (<<X>> <= <<Y>>)%VS.
Lemma span_def X : span X = (\sum_(u <- X) <[u]>)%VS.
Lemma span_nil : (<<Nil vT>> = 0)%VS.
Lemma coord0 i v : coord [tuple 0] i v = 0.
(* Free generator sequences. *)
Lemma nil_free : free (Nil vT).
Lemma free_directv X : free X = (0 \notin X) && directv (\sum_(v <- X) <[v]>).
Lemma free_not0 v X : free X -> v \in X -> v != 0.
Lemma coord_free n (X : n.-tuple vT) (i j : 'I_n) :
free X -> coord X j (X`_i) = (i == j)%:R.
Lemma coord_sum_free n (X : n.-tuple vT) k j :
free X -> coord X j (\sum_(i < n) k i *: X`_i) = k j.
Lemma cat_free X Y :
free (X ++ Y) = [&& free X, free Y & directv (<<X>> + <<Y>>)].
Lemma catl_free Y X : free (X ++ Y) -> free X.
Lemma free_cons v X : free (v :: X) = (v \notin <<X>>)%VS && free X.
Lemma freeE n (X : n.-tuple vT) :
free X = [forall i : 'I_n, X`_i \notin <<drop i.+1 X>>%VS].
Lemma freeNE n (X : n.-tuple vT) :
~~ free X = [exists i : 'I_n, X`_i \in <<drop i.+1 X>>%VS].
Lemma free_span X v (sumX := fun k => \sum_(x <- X) k x *: x) :
free X -> v \in <<X>>%VS ->
{k | v = sumX k & forall k1, v = sumX k1 -> {in X, k1 =1 k}}.
Lemma linear_of_free (rT : lmodType K) X (fX : seq rT) :
{f : {linear vT -> rT} | free X -> size fX = size X -> map f X = fX}.