reserve p,q,r for FinSequence,
  x,y,y1,y2 for set,
  i,k for Element of NAT,
  GF for add-associative right_zeroed right_complementable Abelian associative
  well-unital distributive non empty doubleLoopStr,
  V for Abelian
  add-associative right_zeroed right_complementable vector-distributive
  scalar-distributive scalar-associative scalar-unital
   non empty ModuleStr over GF,
  u,v,v1,v2,v3,w for Element of V,
  a,b for Element of GF,
  F,G ,H for FinSequence of V,
  A,B for Subset of V,
  f for Function of V, GF;
reserve L,L1,L2,L3 for Linear_Combination of V;
reserve l for Linear_Combination of A;

theorem
  0.GF <> 1.GF implies (A <> {} & A is linearly-closed iff for l holds
  Sum(l) in A)
proof
  assume
A1: 0.GF <> 1.GF;
  thus A <> {} & A is linearly-closed implies for l holds Sum(l) in A
  proof
    defpred P[Nat] means
    for l st card(Carrier(l)) = $1 holds Sum(l) in A;
    assume that
A2: A <> {} and
A3: A is linearly-closed;
A4: P[0]
    proof
      let l;
      assume card(Carrier(l)) = 0;
      then Carrier(l) = {};
      then l = ZeroLC(V) by Def3;
      then Sum(l) = 0.V by Lm1;
      hence thesis by A2,A3,VECTSP_4:1;
    end;
A5: for k being Nat st P[k] holds P[k+1]
    proof let k be Nat;
      assume
A6:   P[k];
      let l;
      deffunc F(Element of V) = l.$1;
      consider F such that
A7:   F is one-to-one and
A8:   rng F = Carrier(l) and
A9:   Sum(l) = Sum(l (#) F) by Def6;
      reconsider G = F | Seg k as FinSequence of the carrier of V by
FINSEQ_1:18;
      assume
A10:  card(Carrier(l)) = k + 1;
      then
A11:  len F = k + 1 by A7,A8,FINSEQ_4:62;
      then
A12:  len(l (#) F) = k + 1 by Def5;
A13:  k + 1 in Seg(k + 1) by FINSEQ_1:4;
      then
A14:  k + 1 in dom F by A11,FINSEQ_1:def 3;
      k + 1 in dom F by A11,A13,FINSEQ_1:def 3;
      then reconsider v = F.(k + 1) as Element of V by FINSEQ_2:11;
      consider f being Function of the carrier of V, the carrier of GF such
      that
A15:  f.v = 0.GF and
A16:  for u being Element 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, the carrier of GF) by
FUNCT_2:8;
A17:  v in Carrier(l) by A8,A14,FUNCT_1:def 3;
      now
        let u;
        assume
A18:    not u in Carrier(l);
        hence f.u = l.u by A17,A16
          .= 0.GF by A18;
      end;
      then reconsider f as Linear_Combination of V by Def1;
A19:  A \ {v} c= A by XBOOLE_1:36;
A20:  Carrier(l) c= A by Def4;
      then
A21:  l.v * v in A by A3,A17;
A22:  Carrier(f) = Carrier(l) \ {v}
      proof
        thus Carrier(f) c= Carrier(l) \ {v}
        proof
          let x be object;
          assume x in Carrier(f);
          then consider u such that
A23:      u = x and
A24:      f.u <> 0.GF;
          f.u = l.u by A15,A16,A24;
          then
A25:      x in Carrier(l) by A23,A24;
          not x in {v} by A15,A23,A24,TARSKI:def 1;
          hence thesis by A25,XBOOLE_0:def 5;
        end;
        let x be object;
        assume
A26:    x in Carrier(l) \ {v};
        then x in Carrier(l) by XBOOLE_0:def 5;
        then consider u such that
A27:    x = u and
A28:    l.u <> 0.GF;
        not x in {v} by A26,XBOOLE_0:def 5;
        then x <> v by TARSKI:def 1;
        then l.u = f.u by A16,A27;
        hence thesis by A27,A28;
      end;
      then Carrier(f) c= A \ {v} by A20,XBOOLE_1:33;
      then Carrier(f) c= A by A19;
      then reconsider f as Linear_Combination of A by Def4;
A29:  len G = k by A11,FINSEQ_3:53;
      then
A30:  len (f (#) G) = k by Def5;
A31:  rng G = Carrier(f)
      proof
        thus rng G c= Carrier(f)
        proof
          let x be object;
          assume x in rng G;
          then consider y being object such that
A32:      y in dom G and
A33:      G.y = x by FUNCT_1:def 3;
          reconsider y as Element of NAT by A32,FINSEQ_3:23;
A34:      dom G c= dom F & G.y = F.y by A32,FUNCT_1:47,RELAT_1:60;
          now
            assume x = v;
            then
A35:        k + 1 = y by A7,A14,A32,A33,A34;
A36:          k in NAT by ORDINAL1:def 12;
            y <= k by A29,A32,FINSEQ_3:25;
            hence contradiction by A35,XREAL_1:29,A36;
          end;
          then
A37:      not x in {v} by TARSKI:def 1;
          x in rng F by A32,A33,A34,FUNCT_1:def 3;
          hence thesis by A8,A22,A37,XBOOLE_0:def 5;
        end;
        let x be object;
        assume
A38:    x in Carrier(f);
        then x in rng F by A8,A22,XBOOLE_0:def 5;
        then consider y being object such that
A39:    y in dom F and
A40:    F.y = x by FUNCT_1:def 3;
        reconsider y as Element of NAT by A39,FINSEQ_3:23;
        now
          assume not y in Seg k;
          then y in dom F \ Seg k by A39,XBOOLE_0:def 5;
          then y in Seg(k + 1) \ Seg k by A11,FINSEQ_1:def 3;
          then y in {k + 1} by FINSEQ_3:15;
          then y = k + 1 by TARSKI:def 1;
          then not v in {v} by A22,A38,A40,XBOOLE_0:def 5;
          hence contradiction by TARSKI:def 1;
        end;
        then y in dom F /\ Seg k by A39,XBOOLE_0:def 4;
        then
A41:    y in dom G by RELAT_1:61;
        then G.y = F.y by FUNCT_1:47;
        hence thesis by A40,A41,FUNCT_1:def 3;
      end;
      Seg(k + 1) /\ Seg k = Seg k by FINSEQ_1:7,NAT_1:12
        .= dom(f (#) G) by A30,FINSEQ_1:def 3;
      then
A42:  dom(f (#) G) = dom(l (#) F) /\ Seg k by A12,FINSEQ_1:def 3;
      now
        let x be object;
A43:    rng F c= the carrier of V by FINSEQ_1:def 4;
        assume
A44:    x in dom(f (#) G);
        then reconsider n = x as Element of NAT by FINSEQ_3:23;
        n in dom(l (#) F) by A42,A44,XBOOLE_0:def 4;
        then
A45:    n in dom F by A11,A12,FINSEQ_3:29;
        then F.n in rng F by FUNCT_1:def 3;
        then reconsider w = F.n as Element of V by A43;
A46:    n in dom G by A29,A30,A44,FINSEQ_3:29;
        then
A47:    G.n in rng G by FUNCT_1:def 3;
        rng G c= the carrier of V by FINSEQ_1:def 4;
        then reconsider u = G.n as Element of V by A47;
        not u in {v} by A22,A31,A47,XBOOLE_0:def 5;
        then
A48:    u <> v by TARSKI:def 1;
A49:    (f (#) G).n = f.u * u by A46,Th8
          .= l.u * u by A16,A48;
        w = u by A46,FUNCT_1:47;
        hence (f (#) G).x = (l (#) F).x by A49,A45,Th8;
      end;
      then f (#) G = (l (#) F) | Seg k by A42,FUNCT_1:46;
      then
A50:  f (#) G = (l (#) F) | dom (f (#) G) by A30,FINSEQ_1:def 3;
      v in rng F by A14,FUNCT_1:def 3;
      then {v} c= Carrier(l) by A8,ZFMISC_1:31;
      then card(Carrier(f)) = k + 1 - card{v} by A10,A22,CARD_2:44
        .= k + 1 - 1 by CARD_1:30
        .= k by XCMPLX_1:26;
      then
A51:  Sum(f) in A by A6;
      G is one-to-one by A7,FUNCT_1:52;
      then
A52:  Sum(f (#) G) = Sum(f) by A31,Def6;
      (l (#) F).(len F) = l.v * v by A11,A14,Th8;
      then Sum(l (#) F) = Sum (f (#) G) + l.v * v by A11,A12,A30,A50,
RLVECT_1:38;
      hence thesis by A3,A9,A21,A52,A51;
    end;
    let l;
A53: card(Carrier(l)) = card(Carrier(l));
    for k being Nat holds P[k] from NAT_1:sch 2(A4,A5);
    hence thesis by A53;
  end;
  assume
A54: for l holds Sum(l) in A;
  hence A <> {};
  ZeroLC(V) is Linear_Combination of A & Sum(ZeroLC(V)) = 0.V by Lm1,Th5;
  then
A55: 0.V in A by A54;
A56: for a,v st v in A holds a * v in A
  proof
    let a,v;
    assume
A57: v in A;
    now
      per cases;
      suppose
        a = 0.GF;
        hence thesis by A55,VECTSP_1:14;
      end;
      suppose
A58:    a <> 0.GF;
        deffunc F(set) = 0.GF;
        consider f such that
A59:    f.v = a and
A60:    for u being Element 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, the carrier of GF)
        by FUNCT_2:8;
        now
          let u;
          assume not u in {v};
          then u <> v by TARSKI:def 1;
          hence f.u = 0.GF by A60;
        end;
        then reconsider f as Linear_Combination of V by Def1;
A61:    Carrier(f) = {v}
        proof
          thus Carrier(f) c= {v}
          proof
            let x be object;
            assume x in Carrier(f);
            then consider u such that
A62:        x = u and
A63:        f.u <> 0.GF;
            u = v by A60,A63;
            hence thesis by A62,TARSKI:def 1;
          end;
          let x be object;
          assume x in {v};
          then x = v by TARSKI:def 1;
          hence thesis by A58,A59;
        end;
        {v} c= A by A57,ZFMISC_1:31;
        then reconsider f as Linear_Combination of A by A61,Def4;
        consider F such that
A64:    F is one-to-one & rng F = Carrier(f) and
A65:    Sum(f (#) F) = Sum(f) by Def6;
        F = <* v *> by A61,A64,FINSEQ_3:97;
        then f (#) F = <* f.v * v *> by Th10;
        then Sum(f) = a * v by A59,A65,RLVECT_1:44;
        hence thesis by A54;
      end;
    end;
    hence thesis;
  end;
  thus for v,u st v in A & u in A holds v + u in A
  proof
    let v,u;
    assume that
A66: v in A and
A67: u in A;
    now
      per cases;
      suppose
        u = v;
        then v + u = 1.GF * v + v
          .= 1.GF * v + 1.GF * v
          .= (1.GF + 1.GF) * v by VECTSP_1:def 15;
        hence thesis by A56,A66;
      end;
      suppose
A68:    v <> u;
        deffunc F(set) = 0.GF;
        consider f such that
A69:    f.v = 1.GF & f.u = 1.GF and
A70:    for w being Element of V st w <> v & w <> u holds f.w = F(w)
        from FUNCT_2:sch 7(A68);
        reconsider f as Element of Funcs(the carrier of V, the carrier of GF)
        by FUNCT_2:8;
        now
          let w;
          assume not w in {v,u};
          then w <> v & w <> u by TARSKI:def 2;
          hence f.w = 0.GF by A70;
        end;
        then reconsider f as Linear_Combination of V by Def1;
A71:    Carrier(f) = {v,u}
        proof
          thus Carrier(f) c= {v,u}
          proof
            let x be object;
            assume x in Carrier(f);
            then ex w st x = w & f.w <> 0.GF;
            then x = v or x = u by A70;
            hence thesis by TARSKI:def 2;
          end;
          let x be object;
          assume x in {v,u};
          then x = v or x = u by TARSKI:def 2;
          hence thesis by A1,A69;
        end;
        then
A72:    Carrier(f) c= A by A66,A67,ZFMISC_1:32;
        reconsider f as Linear_Combination of A by A72,Def4;
        consider F such that
A74:    F is one-to-one & rng F = Carrier(f) and
A75:    Sum(f (#) F) = Sum(f) by Def6;
        F = <* v,u *> or F = <* u,v *> by A68,A71,A74,FINSEQ_3:99;
        then f (#) F = <* 1.GF * v, 1.GF * u *> or f (#) F = <* 1.GF * u, 1.
        GF * v *> by A69,Th11;
        then Sum(f) = v + u by A75,RLVECT_1:45;
        hence thesis by A54;
      end;
    end;
    hence thesis;
  end;
  thus thesis by A56;
end;
