reserve x,y for object,X,Y for set,
  D for non empty set,
  i,j,k,l,m,n,m9,n9 for Nat,
  i0,j0,n0,m0 for non zero Nat,
  K for Field,
  a,b for Element of K,
  p for FinSequence of K,
  M for Matrix of n,K;
reserve A for (Matrix of D),
  A9 for Matrix of n9,m9,D,
  M9 for Matrix of n9, m9,K,
  nt,nt1,nt2 for Element of n-tuples_on NAT,
  mt,mt1 for Element of m -tuples_on NAT,
  M for Matrix of K;
reserve P,P1,P2,Q,Q1,Q2 for without_zero finite Subset of NAT;
reserve v,v1,v2,u,w for Vector of n-VectSp_over K,
  t,t1,t2 for Element of n -tuples_on the carrier of K,

  L for Linear_Combination of n-VectSp_over K,
  M,M1 for Matrix of m,n,K;

theorem Th115:
  for V be VectSp of K for U be finite Subset of V st U is
linearly-independent for u, v be Vector of V st u in U & v in U & u <> v holds
  U\{u} \/ {u+a*v} is linearly-independent
proof
  let V be VectSp of K;
  let U be finite Subset of V such that
A1: U is linearly-independent;
  let u, v be Vector of V such that
A2: u in U and
A3: v in U and
A4: u<>v;
  set ua=u+a*v;
  set Uu=U\{u};
  set Uua=Uu\/{ua};
  per cases;
  suppose
    u=ua;
    hence thesis by A1,A2,ZFMISC_1:116;
  end;
  suppose
A5: u<>ua;
    now
      let L be Linear_Combination of Uua such that
A6:   Sum(L)=0.V;
      per cases;
      suppose
A7:     L.ua=0.K;
        Carrier L c= Uu
        proof
          let x be object;
          assume
A8:       x in Carrier L;
          then consider v be Vector of V such that
A9:       x = v and
A10:      L.v <> 0.K by VECTSP_6:1;
          Carrier L c= Uua by VECTSP_6:def 4;
          then v in Uu or v in {ua} & not v in {ua} by A7,A8,A9,A10,
TARSKI:def 1,XBOOLE_0:def 3;
          hence thesis by A9;
        end;
        then reconsider L9=L as Linear_Combination of Uu by VECTSP_6:def 4;
A11:    Sum L9=0.V by A6;
        Uu is linearly-independent by A1,VECTSP_7:1,XBOOLE_1:36;
        hence Carrier L={} by A11;
      end;
      suppose
A12:    L.ua<>0.K;
A13:    Carrier L c= Uua by VECTSP_6:def 4;
        Uu c= U by XBOOLE_1:36;
        then Uua c=U\/{ua} by XBOOLE_1:13;
        then
A14:    Carrier L c= U\/{ua} by A13;
        ua in {ua} by TARSKI:def 1;
        then ua in Lin{ua} by VECTSP_7:8;
        then consider Lua be Linear_Combination of {ua} such that
A15:    ua=Sum Lua by VECTSP_7:7;
        reconsider LLua=L.ua * Lua as Linear_Combination of {ua} by VECTSP_6:31
;
A16:    Carrier LLua c= {ua} by VECTSP_6:def 4;
        then not u in Carrier LLua by A5,TARSKI:def 1;
        then
A17:    LLua.u=0.K by VECTSP_6:2;
        v in {v} by TARSKI:def 1;
        then v in Lin{v} by VECTSP_7:8;
        then consider Lv be Linear_Combination of {v} such that
A18:    v=Sum Lv by VECTSP_7:7;
        reconsider LLv=(L.ua*a) * Lv as Linear_Combination of {v} by
VECTSP_6:31;
A19:    Carrier LLv c= {v} by VECTSP_6:def 4;
        then not u in Carrier LLv by A4,TARSKI:def 1;
        then
A20:    LLv.u=0.K by VECTSP_6:2;
        v <> ua
        proof
          assume v=u+a*v;
          then v-a*v = u+(a*v-a*v) by RLVECT_1:def 3
            .= u+0.V by VECTSP_1:16
            .= u by RLVECT_1:def 4;
          then u = 1_K*v+-a*v
            .= 1_K*v+(-a)*v by VECTSP_1:21
            .= (1_K-a)*v by VECTSP_1:def 15;
          then
A21:      {v,u} is linearly-dependent by A4,VECTSP_7:5;
          {v,u} c= U by A2,A3,ZFMISC_1:32;
          hence thesis by A1,A21,VECTSP_7:1;
        end;
        then not ua in Carrier LLv by A19,TARSKI:def 1;
        then
A22:    LLv.ua=0.K by VECTSP_6:2;
A23:    u + a * v <> 0.V
        proof
          {v,u} c= U by A2,A3,ZFMISC_1:32;
          then
A24:      {v,u} is linearly-independent by A1,VECTSP_7:1;
A25:      1_K*u = u;
          assume 0.V=u + a * v;
          then 1_K=0.K by A4,A24,A25,VECTSP_7:6;
          hence thesis;
        end;
A26:    u<>0.V by A1,A2,VECTSP_7:2;
        Lua.ua * ua = ua by A15,VECTSP_6:17
          .= 1_K*ua;
        then
A27:    Lua.ua=1_K by A23,VECTSP10:4;
        u in {u} by TARSKI:def 1;
        then u in Lin{u} by VECTSP_7:8;
        then consider Lu be Linear_Combination of {u} such that
A28:    u=Sum Lu by VECTSP_7:7;
        reconsider LLu=L.ua * Lu as Linear_Combination of {u} by VECTSP_6:31;
A29:    Carrier LLu c= {u} by VECTSP_6:def 4;
        then not ua in Carrier LLu by A5,TARSKI:def 1;
        then
A30:    LLu.ua=0.K by VECTSP_6:2;
        {u} c= U by A2,ZFMISC_1:31;
        then
A31:    Carrier LLu c= U by A29;
        L+ LLv+LLu-LLua = L+(LLv+LLu)-LLua by VECTSP_6:26
          .= L+(LLv+LLu)+(-LLua) by VECTSP_6:def 11
          .= L+(LLv+LLu+(-LLua)) by VECTSP_6:26
          .= L+ (LLv+LLu-LLua) by VECTSP_6:def 11;
        then
A32:    Carrier (L+ LLv+LLu-LLua)c=Carrier L\/Carrier (LLv+LLu-LLua) by
VECTSP_6:23;
A33:    Carrier (LLv+LLu-LLua) c= Carrier (LLv+LLu) \/Carrier LLua by
VECTSP_6:41;
A34:    Carrier (LLv+ LLu) c= Carrier LLv \/ Carrier LLu by VECTSP_6:23;
        {v} c= U by A3,ZFMISC_1:31;
        then Carrier LLv c= U by A19;
        then Carrier LLv \/ Carrier LLu c= U by A31,XBOOLE_1:8;
        then Carrier (LLv+ LLu) c= U by A34;
        then Carrier(LLv+LLu)\/Carrier LLua c= U\/{ua} by A16,XBOOLE_1:13;
        then Carrier (LLv+LLu-LLua) c= U\/{ua} by A33;
        then Carrier L\/Carrier (LLv+LLu-LLua)c=U\/{ua} by A14,XBOOLE_1:8;
        then
A35:    Carrier (L+ LLv+LLu-LLua) c= U\/{ua} by A32;
A36:    (L+ LLv+LLu-LLua).ua=(L+ LLv+LLu+(-LLua)).ua by VECTSP_6:def 11
          .= (L+ LLv+LLu).ua + (-LLua).ua by VECTSP_6:22
          .= (L+ LLv).ua+ LLu.ua + (-LLua).ua by VECTSP_6:22
          .= L.ua+ 0.K+ 0.K + (-LLua).ua by A22,A30,VECTSP_6:22
          .= L.ua+ 0.K + (-LLua).ua by RLVECT_1:def 4
          .= L.ua+(-LLua).ua by RLVECT_1:def 4
          .= L.ua-LLua.ua by VECTSP_6:36
          .= L.ua - L.ua*1_K by A27,VECTSP_6:def 9
          .= L.ua - L.ua
          .= 0.K by VECTSP_1:19;
        Carrier (L+ LLv+LLu-LLua) c= U
        proof
          let x be object;
          assume
A37:      x in Carrier (L+ LLv+LLu-LLua);
          assume not x in U;
          then
A38:      x in {ua} by A35,A37,XBOOLE_0:def 3;
          ex v be Element of V st x=v & (L+ LLv+LLu-LLua).v<>0.K by A37,
VECTSP_6:1;
          hence contradiction by A36,A38,TARSKI:def 1;
        end;
        then reconsider LLL=L+LLv+LLu-LLua as Linear_Combination of U by
VECTSP_6:def 4;
A39:    not u in Uu by ZFMISC_1:56;
        not u in {ua} by A5,TARSKI:def 1;
        then not u in Carrier L by A13,A39,XBOOLE_0:def 3;
        then
A40:    L.u=0.K by VECTSP_6:2;
        Lu.u * u = u by A28,VECTSP_6:17
          .= 1_K*u;
        then
A41:    Lu.u=1_K by A26,VECTSP10:4;
        LLL.u = (L+ LLv+LLu+(-LLua)).u by VECTSP_6:def 11
          .= (L+ LLv+LLu).u + (-LLua).u by VECTSP_6:22
          .= (L+ LLv).u+ LLu.u + (-LLua).u by VECTSP_6:22
          .= L.u+ LLv.u+ LLu.u + (-LLua).u by VECTSP_6:22
          .= 0.K+ 0.K + LLu.u -0.K by A20,A17,A40,VECTSP_6:36
          .= 0.K+LLu.u -0.K by RLVECT_1:def 4
          .= LLu.u-0.K by RLVECT_1:def 4
          .= LLu.u by VECTSP_1:18
          .= L.ua*1_K by A41,VECTSP_6:def 9
          .= L.ua;
        then
A42:    u in Carrier LLL by A12,VECTSP_6:1;
        Sum (L+ LLv+LLu-LLua)=Sum (L+LLv+LLu) - Sum LLua by VECTSP_6:47
          .= Sum (L+LLv)+ Sum LLu - Sum LLua by VECTSP_6:44
          .= Sum L+ Sum LLv+ Sum LLu - Sum LLua by VECTSP_6:44
          .= Sum L+ Sum LLv+ Sum LLu - L.ua * ua by A15,VECTSP_6:45
          .= Sum L+ Sum LLv+ (L.ua)*u - L.ua * ua by A28,VECTSP_6:45
          .= Sum L+ (a*L.ua)*v+ (L.ua)*u-L.ua*ua by A18,VECTSP_6:45
          .= Sum L+L.ua*(a*v)+L.ua*u-L.ua*ua by VECTSP_1:def 16
          .= Sum L+(L.ua*(a*v) + L.ua*u)-L.ua*ua by RLVECT_1:def 3
          .= Sum L+ L.ua*(a*v+ u)- L.ua*ua by VECTSP_1:def 14
          .= Sum L+ (L.ua*ua- L.ua*ua) by RLVECT_1:def 3
          .= 0.V+ 0.V by A6,VECTSP_1:16
          .= 0.V by RLVECT_1:def 4;
        hence Carrier L={} by A1,A42;
      end;
    end;
    hence thesis;
  end;
end;
