
theorem Th11:
  for V being RealUnitarySpace, A being Subset of V st A is
  linearly-independent holds ex B being Subset of V st A c= B & B is
  linearly-independent & Lin(B) = the UNITSTR of V
proof
  let V be RealUnitarySpace;
  let A be Subset of V;
  defpred P[set] means (ex B being Subset of V st B = $1 & A c= B & B is
  linearly-independent);
  consider Q being set such that
A1: for Z being set holds Z in Q iff Z in bool(the carrier of V) & P[Z]
  from XFAMILY:sch 1;
A2: now
    let Z be set;
    assume that
A3: Z <> {} and
A4: Z c= Q and
A5: Z is c=-linear;
    set x = the Element of Z;
    x in Q by A3,A4;
    then
A6: ex B being Subset of V st B = x & A c= B & B is linearly-independent by A1;
    set W = union Z;
    W c= the carrier of V
    proof
      let x be object;
      assume x in W;
      then consider X being set such that
A7:   x in X and
A8:   X in Z by TARSKI:def 4;
      X in bool(the carrier of V) by A1,A4,A8;
      hence thesis by A7;
    end;
    then reconsider W as Subset of V;
A9: W is linearly-independent
    proof
      deffunc F(object) = {C where C is Subset of V: $1 in C & C in Z};
      let l be Linear_Combination of W;
      assume that
A10:  Sum(l) = 0.V and
A11:  Carrier(l) <> {};
      consider f being Function such that
A12:  dom f = Carrier(l) and
A13:  for x being object st x in Carrier(l) holds f.x = F(x) from
      FUNCT_1:sch 3;
      reconsider M = rng f as non empty set by A11,A12,RELAT_1:42;
      set F = the Choice_Function of M;
      set S = rng F;
A14:  now
        assume {} in M;
        then consider x being object such that
A15:    x in dom f and
A16:    f.x = {} by FUNCT_1:def 3;
        Carrier(l) c= W by RLVECT_2:def 6;
        then consider X being set such that
A17:    x in X and
A18:    X in Z by A12,A15,TARSKI:def 4;
        reconsider X as Subset of V by A1,A4,A18;
        X in {C where C is Subset of V: x in C & C in Z} by A17,A18;
        hence contradiction by A12,A13,A15,A16;
      end;
      then
A19:  dom F = M by RLVECT_3:28;
      then dom F is finite by A12,FINSET_1:8;
      then
A20:  S is finite by FINSET_1:8;
A21:  now
        let X be set;
        assume X in S;
        then consider x being object such that
A22:    x in dom F and
A23:    F.x = X by FUNCT_1:def 3;
        consider y being object such that
A24:    y in dom f & f.y = x by A19,A22,FUNCT_1:def 3;
A25:    x = {C where C is Subset of V: y in C & C in Z} by A12,A13,A24;
        reconsider x as set by TARSKI:1;
        X in x by A14,A19,A22,A23,ORDERS_1:89;
        then ex C being Subset of V st C = X & y in C & C in Z by A25;
        hence X in Z;
      end;
A26:  now
        let X,Y be set;
        assume X in S & Y in S;
        then X in Z & Y in Z by A21;
        then X,Y are_c=-comparable by A5,ORDINAL1:def 8;
        hence X c= Y or Y c= X;
      end;
      S <> {} by A19,RELAT_1:42;
      then union S in S by A26,A20,CARD_2:62;
      then union S in Z by A21;
      then consider B being Subset of V such that
A27:  B = union S and
      A c= B and
A28:  B is linearly-independent by A1,A4;
      Carrier(l) c= union S
      proof
        let x be object;
        set X = f.x;
        assume
A29:    x in Carrier(l);
        then
A30:    f.x = {C where C is Subset of V: x in C & C in Z} by A13;
A31:    f.x in M by A12,A29,FUNCT_1:def 3;
        then F.X in X by A14,ORDERS_1:89;
        then
A32:    ex C being Subset of V st F.X = C & x in C & C in Z by A30;
        F.X in S by A19,A31,FUNCT_1:def 3;
        hence thesis by A32,TARSKI:def 4;
      end;
      then l is Linear_Combination of B by A27,RLVECT_2:def 6;
      hence thesis by A10,A11,A28;
    end;
    x c= W by A3,ZFMISC_1:74;
    then A c= W by A6;
    hence union Z in Q by A1,A9;
  end;
A33: (Omega).V = the UNITSTR of V by RUSUB_1:def 3;
  assume A is linearly-independent;
  then Q <> {} by A1;
  then consider X being set such that
A34: X in Q and
A35: for Z being set st Z in Q & Z <> X holds not X c= Z by A2,ORDERS_1:67;
  consider B being Subset of V such that
A36: B = X and
A37: A c= B and
A38: B is linearly-independent by A1,A34;
  take B;
  thus A c= B & B is linearly-independent by A37,A38;
  assume Lin(B) <> the UNITSTR of V;
  then consider v being VECTOR of V such that
A39: not(v in Lin(B) iff v in the UNITSTR of V) by A33,RUSUB_1:25;
A40: B \/ {v} is linearly-independent
  proof
    let l be Linear_Combination of B \/ {v};
    assume
A41: Sum(l) = 0.V;
    now
      per cases;
      suppose
        v in Carrier(l);
        then
A42:    - l.v <> 0 by RLVECT_2:19;
        deffunc G(set) = zz;
        deffunc F(VECTOR of V) = l.$1;
        consider f being Function of the carrier of V, REAL such that
A43:    f.v = In(0,REAL) and
A44:    for u being VECTOR of V st u <> v holds f.u = F(u) from
        FUNCT_2:sch 6;
        reconsider f as Element of Funcs(the carrier of V, REAL) by FUNCT_2:8;
        now
          let u be VECTOR of V;
          assume not u in Carrier(l) \ {v};
          then not u in Carrier(l) or u in {v} by XBOOLE_0:def 5;
          then l.u = 0 & u <> v or u = v by TARSKI:def 1;
          hence f.u = 0 by A43,A44;
        end;
        then reconsider f as Linear_Combination of V by RLVECT_2:def 3;
        Carrier(f) c= B
        proof
          let x be object;
A45:      Carrier(l) c= B \/ {v} by RLVECT_2:def 6;
          assume x in Carrier(f);
          then consider u being VECTOR of V such that
A46:      u = x and
A47:      f.u <> 0;
          f.u = l.u by A43,A44,A47;
          then u in Carrier(l) by A47;
          then u in B or u in {v} by A45,XBOOLE_0:def 3;
          hence thesis by A43,A46,A47,TARSKI:def 1;
        end;
        then reconsider f as Linear_Combination of B by RLVECT_2:def 6;
        consider g being Function of the carrier of V, REAL such that
A48:    g.v = - l.v and
A49:    for u being VECTOR of V st u <> v holds g.u = G(u) from
        FUNCT_2:sch 6;
        reconsider g as Element of Funcs(the carrier of V, REAL) by FUNCT_2:8;
        now
          let u be VECTOR of V;
          assume not u in {v};
          then u <> v by TARSKI:def 1;
          hence g.u = 0 by A49;
        end;
        then reconsider g as Linear_Combination of V by RLVECT_2:def 3;
        Carrier(g) c= {v}
        proof
          let x be object;
          assume x in Carrier(g);
          then ex u being VECTOR of V st x = u & g.u <> 0;
          then x = v by A49;
          hence thesis by TARSKI:def 1;
        end;
        then reconsider g as Linear_Combination of {v} by RLVECT_2:def 6;
A50:    Sum(g) = (- l.v) * v by A48,RLVECT_2:32;
        f - g = l
        proof
          let u be VECTOR of V;
          now
            per cases;
            suppose
A51:          v = u;
              thus (f - g).u = f.u - g.u by RLVECT_2:54
                .= l.u by A43,A48,A51;
            end;
            suppose
A52:          v <> u;
              thus (f - g).u = f.u - g.u by RLVECT_2:54
                .= l.u - g.u by A44,A52
                .= l.u - 0 by A49,A52
                .= l.u;
            end;
          end;
          hence thesis;
        end;
        then 0.V = Sum(f) - Sum(g) by A41,RLVECT_3:4;
        then Sum(f) = 0.V + Sum(g) by RLSUB_2:61
          .= (- l.v) * v by A50,RLVECT_1:4;
        then
A53:    (- l.v) * v in Lin(B) by Th1;
        (- l.v)" * ((- l.v) * v) = (- l.v)" * (- l.v) * v by RLVECT_1:def 7
          .= 1 * v by A42,XCMPLX_0:def 7
          .= v by RLVECT_1:def 8;
        hence thesis by A39,A53,RLVECT_1:1,RUSUB_1:15;
      end;
      suppose
A54:    not v in Carrier(l);
        Carrier(l) c= B
        proof
          let x be object;
          assume
A55:      x in Carrier(l);
          Carrier(l) c= B \/ {v} by RLVECT_2:def 6;
          then x in B or x in {v} by A55,XBOOLE_0:def 3;
          hence thesis by A54,A55,TARSKI:def 1;
        end;
        then l is Linear_Combination of B by RLVECT_2:def 6;
        hence thesis by A38,A41;
      end;
    end;
    hence thesis;
  end;
  v in {v} by TARSKI:def 1;
  then
A56: v in B \/ {v} by XBOOLE_0:def 3;
A57: not v in B by A39,Th2,RLVECT_1:1;
  B c= B \/ {v} by XBOOLE_1:7;
  then A c= B \/ {v} by A37;
  then B \/ {v} in Q by A1,A40;
  hence contradiction by A35,A36,A56,A57,XBOOLE_1:7;
end;
