(* This program is free software; you can redistribute it and/or      *)
(* modify it under the terms of the GNU Lesser General Public License *)
(* as published by the Free Software Foundation; either version 2.1   *)
(* of the License, or (at your option) any later version.             *)
(*                                                                    *)
(* This program is distributed in the hope that it will be useful,    *)
(* but WITHOUT ANY WARRANTY; without even the implied warranty of     *)
(* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the      *)
(* GNU General Public License for more details.                       *)
(*                                                                    *)
(* You should have received a copy of the GNU Lesser General Public   *)
(* License along with this program; if not, write to the Free         *)
(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *)
(* 02110-1301 USA                                                     *)
(** * lin_dep_facts.v *)
Set Implicit Arguments.
Unset Strict Implicit.
Require Export lin_dependence.
Require Export lin_comb_facts.
Require Export subseqs.
Require Export seq_set_facts.
Require Export distinct_facts.
(** - If $a_i\neq0$ and $\sum_ka_kv_k=0$, then $v_i=-a_i^{-1}\sum_{k\neq i}a_kv_k$ *)
intros.
assert
(a i mX v i ='
a i mX field_inverse (a i) mX (min sum (omit (mult_by_scalars a v) i)) in _).
apply Trans with (mult_by_scalars a v i); auto with algebra.
apply
Trans
with
((a i rX field_inverse (a i)) mX (min sum (omit (mult_by_scalars a v) i)));
auto with algebra.
apply Trans with (one mX (min sum (omit (mult_by_scalars a v) i)));
auto with algebra.
apply Trans with (min sum (omit (mult_by_scalars a v) i)); auto with algebra.
assert
(mult_by_scalars a v i +' sum (omit (mult_by_scalars a v) i) ='
(zero V) in _).
apply Trans with (sum (mult_by_scalars a v)); auto with algebra.
apply Sym.
apply
(seqsum_is_elt_plus_omitseq (M:=V:abelian_monoid) (mult_by_scalars a v)).
2: apply MODULE_comp; auto with algebra.
2: apply Sym.
2: apply FIELD_inverse_r; auto with algebra.
apply Sym.
apply GROUP_law_inverse.
apply Trans with (sum (mult_by_scalars a v)); auto with algebra.
apply
Trans with (mult_by_scalars a v i +' sum (omit (mult_by_scalars a v) i));
auto with algebra.
apply Sym.
apply
(seqsum_is_elt_plus_omitseq (M:=V:abelian_monoid) (mult_by_scalars a v));
auto with algebra.
set (expr := field_inverse (a i) mX (min sum (omit (mult_by_scalars a v) i)))
in *.
cut (one mX v i =' one mX expr in _).
intro.
apply Trans with (one mX expr); auto with algebra.
apply Trans with (one mX v i); auto with algebra.
apply Trans with ((field_inverse (a i) rX a i) mX v i).
apply MODULE_comp; auto with algebra.
apply Sym.
auto with algebra.
apply Trans with ((field_inverse (a i) rX a i) mX expr); auto with algebra.
apply Trans with (field_inverse (a i) mX a i mX expr); auto with algebra.
apply Trans with (field_inverse (a i) mX a i mX v i); auto with algebra.
Qed.
simpl in |- *.
intros.
generalize H; elim y.
intros yv yp Hy.
simpl in yp.
simpl in Hy.
simpl in |- *.
unfold not in Hy.
case yp; auto.
tauto.
Qed.

(** - %\intoc{\bf Theorem 1.8}%: If $S\subset V$ is linearly independent and $x\not\in S$ then $S\cup\{x\}$ is linearly dependent iff $x\in span(S)$  (By the by - this innocent-looking lemma was extremely hard to prove) *)
Lemma lin_dep_vs_span_lemma :
forall (F : field) (V : vectorspace F) (s : part_set V),
lin_indep s ->
forall x : V,
~ in_part x s -> (lin_dep (union s (single x)) <-> in_part x (span s)).