intros.
assert (is_lin_comb x T).
red in |- *; red in H1.
inversion_clear H1.
exists x0.
inversion_clear H2.
exists x1.
inversion_clear H1.
exists (Map_to_equal_subsets H x2).
apply Trans with (sum (mult_by_scalars x1 (Map_embed x2))); auto with algebra.
red in |- *.
red in H2.
inversion H2.
inversion H3.
inversion H4.
exists x0.
exists x1.
exists x2.
apply Trans with x; auto with algebra.
Qed.
Hint Resolve is_lin_comb_comp: algebra.
(** - Being a linear combination is in fact a setoid-Predicate. *)
Definition is_lin_comb_pred :
forall (F : field) (V : vectorspace F), part_set V -> Predicate V.
intros.
apply (Build_Predicate (Pred_fun:=fun x : V => is_lin_comb x X)).
red in |- *.
intros.
apply is_lin_comb_comp with x X; auto with algebra.
Defined.
End lin_dep_def.
Section condensing.
(** - Easy to see but not easy to prove: if $x=\sum_{i=1}^n a_ib_i$ then in fact $x=\sum_{i=1}^{n'} a_ib'_i$ where all $b'_i$ are distinct vectors.*)

Lemma lin_comb_with_distinct_vectors :
forall (F : field) (V : vectorspace F) (x : V) (B : part_set V),
is_lin_comb x B ->
exists n : Nat,
(exists a : seq n F,
(exists v : seq n B,
x =' sum (mult_by_scalars a (Map_embed v)) in _ /\ distinct v)).