reserve x for set;
reserve a,b,c,d,e,r1,r2,r3,r4,r5,r6 for Real;
reserve V for RealLinearSpace;
reserve u,v,v1,v2,v3,w,w1,w2,w3 for VECTOR of V;
reserve W,W1,W2 for Subspace of V;

theorem Th6:
  for l being Linear_Combination of {u,v,w} st u <> v & u <> w & v
  <> w holds Sum(l) = l.u * u + l.v * v + l.w * w
proof
  let f be Linear_Combination of {u,v,w};
  assume that
A1: u <> v and
A2: u <> w and
A3: v <> w;
  set c = f.w;
  set b = f.v;
  set a = f.u;
A4: Carrier f c= {u,v,w} by RLVECT_2:def 6;
A5: now
    let x be VECTOR of V;
    assume x <> v & x <> u & x <> w;
    then not x in Carrier f by A4,ENUMSET1:def 1;
    hence f.x = 0 by RLVECT_2:19;
  end;
  now
    per cases;
    suppose
A6:   a = 0;
      now
        per cases;
        suppose
A7:       b = 0;
          now
            per cases;
            suppose
A8:           c = 0;
              now
                set x = the Element of Carrier f;
                assume
A9:             Carrier f <> {};
                then
A10:            x is VECTOR of V by TARSKI:def 3;
                then f.x <> 0 by A9,RLVECT_2:19;
                hence contradiction by A5,A6,A7,A8,A10;
              end;
              then f = ZeroLC(V) by RLVECT_2:def 5;
              hence Sum(f) = 0.V by RLVECT_2:30
                .= f.u * u by A6,RLVECT_1:10
                .= f.u * u + 0.V by RLVECT_1:4
                .= f.u * u + f.v * v by A7,RLVECT_1:10
                .= f.u * u + f.v * v + 0.V by RLVECT_1:4
                .= f.u * u + f.v * v + f.w * w by A8,RLVECT_1:10;
            end;
            suppose
A11:          c <> 0;
A12:          Carrier f c= {w}
              proof
                let x be object;
                assume that
A13:            x in Carrier f and
A14:            not x in {w};
                f.x <> 0 & x <> w by A13,A14,RLVECT_2:19,TARSKI:def 1;
                hence contradiction by A5,A6,A7,A13;
              end;
              w in Carrier f by A11,RLVECT_2:19;
              then
A15:          Carrier f = {w} by A12,ZFMISC_1:33;
              set F = <* w *>;
A16:          f (#) F = <* c * w *> by RLVECT_2:26;
              rng F = {w} & F is one-to-one by FINSEQ_1:39,FINSEQ_3:93;
              then Sum(f) = Sum<* c * w *> by A15,A16,RLVECT_2:def 8
                .= c * w by RLVECT_1:44
                .= 0.V + c * w by RLVECT_1:4
                .= 0.V + 0.V + c * w by RLVECT_1:4
                .= a * u + 0.V + c * w by A6,RLVECT_1:10;
              hence thesis by A7,RLVECT_1:10;
            end;
          end;
          hence thesis;
        end;
        suppose
A17:      b <> 0;
          now
            per cases;
            suppose
A18:          c = 0;
A19:          Carrier f c= {v}
              proof
                let x be object;
                assume that
A20:            x in Carrier f and
A21:            not x in {v};
                f.x <> 0 & x <> v by A20,A21,RLVECT_2:19,TARSKI:def 1;
                hence contradiction by A5,A6,A18,A20;
              end;
              v in Carrier f by A17,RLVECT_2:19;
              then
A22:          Carrier f = {v} by A19,ZFMISC_1:33;
              set F = <* v *>;
A23:          f (#) F = <* b * v *> by RLVECT_2:26;
              rng F = {v} & F is one-to-one by FINSEQ_1:39,FINSEQ_3:93;
              then Sum(f) = Sum<* b * v *> by A22,A23,RLVECT_2:def 8
                .= b * v by RLVECT_1:44
                .= 0.V + b * v by RLVECT_1:4
                .= 0.V + b * v + 0.V by RLVECT_1:4
                .= a * u + b * v + 0.V by A6,RLVECT_1:10;
              hence thesis by A18,RLVECT_1:10;
            end;
            suppose
              c <> 0;
              then
A24:          w in Carrier f by RLVECT_2:19;
A25:          Carrier f c= {v,w}
              proof
                let x be object;
                assume that
A26:            x in Carrier f and
A27:            not x in {v,w};
A28:            x <> w by A27,TARSKI:def 2;
                f.x <> 0 & x <> v by A26,A27,RLVECT_2:19,TARSKI:def 2;
                hence contradiction by A5,A6,A26,A28;
              end;
              v in Carrier f by A17,RLVECT_2:19;
              then {v,w } c= Carrier f by A24,ZFMISC_1:32;
              then
A29:          Carrier f = {v,w} by A25;
              set F = <* v,w *>;
A30:          f (#) F = <* b * v,c * w *> by RLVECT_2:27;
              rng F = {v,w} & F is one-to-one by A3,FINSEQ_2:127,FINSEQ_3:94;
              then Sum(f) = Sum<* b * v,c * w *> by A29,A30,RLVECT_2:def 8
                .= b * v + c * w by RLVECT_1:45
                .= 0.V + b * v + c * w by RLVECT_1:4;
              hence thesis by A6,RLVECT_1:10;
            end;
          end;
          hence thesis;
        end;
      end;
      hence thesis;
    end;
    suppose
A31:  a <> 0;
      now
        per cases;
        suppose
A32:      b = 0;
          now
            per cases;
            suppose
A33:          c = 0;
A34:          Carrier f c= {u}
              proof
                let x be object;
                assume that
A35:            x in Carrier f and
A36:            not x in {u};
                f.x <> 0 & x <> u by A35,A36,RLVECT_2:19,TARSKI:def 1;
                hence contradiction by A5,A32,A33,A35;
              end;
              u in Carrier f by A31,RLVECT_2:19;
              then
A37:          Carrier f = {u} by A34,ZFMISC_1:33;
              set F = <* u *>;
A38:          f (#) F = <* a * u *> by RLVECT_2:26;
              rng F = {u} & F is one-to-one by FINSEQ_1:39,FINSEQ_3:93;
              then Sum(f) = Sum<* a * u *> by A37,A38,RLVECT_2:def 8
                .= a * u by RLVECT_1:44
                .= a * u + 0.V by RLVECT_1:4
                .= a * u + 0.V + 0.V by RLVECT_1:4
                .= a * u + b * v + 0.V by A32,RLVECT_1:10;
              hence thesis by A33,RLVECT_1:10;
            end;
            suppose
              c <> 0;
              then
A39:          w in Carrier f by RLVECT_2:19;
A40:          Carrier f c= {u,w}
              proof
                let x be object;
                assume that
A41:            x in Carrier f and
A42:            not x in {u,w};
A43:            x <> u by A42,TARSKI:def 2;
                f.x <> 0 & x <> w by A41,A42,RLVECT_2:19,TARSKI:def 2;
                hence contradiction by A5,A32,A41,A43;
              end;
              u in Carrier f by A31,RLVECT_2:19;
              then {u,w} c= Carrier f by A39,ZFMISC_1:32;
              then
A44:          Carrier f = {u,w} by A40;
              set F = <* u,w *>;
A45:          f (#) F = <* a * u,c * w *> by RLVECT_2:27;
              rng F = {u,w} & F is one-to-one by A2,FINSEQ_2:127,FINSEQ_3:94;
              then Sum(f) = Sum<* a * u,c * w *> by A44,A45,RLVECT_2:def 8
                .= a * u + c * w by RLVECT_1:45
                .= a * u + 0.V + c * w by RLVECT_1:4;
              hence thesis by A32,RLVECT_1:10;
            end;
          end;
          hence thesis;
        end;
        suppose
A46:      b <> 0;
          now
            per cases;
            suppose
A47:          c = 0;
A48:          Carrier f c= {u,v}
              proof
                let x be object;
                assume that
A49:            x in Carrier f and
A50:            not x in {u,v};
A51:            x <> u by A50,TARSKI:def 2;
                f.x <> 0 & x <> v by A49,A50,RLVECT_2:19,TARSKI:def 2;
                hence contradiction by A5,A47,A49,A51;
              end;
              v in Carrier f & u in Carrier f by A31,A46,RLVECT_2:19;
              then {u,v} c= Carrier f by ZFMISC_1:32;
              then
A52:          Carrier f = {u,v} by A48;
              set F = <* u,v *>;
A53:          f (#) F = <* a * u,b * v *> by RLVECT_2:27;
              rng F = {u,v} & F is one-to-one by A1,FINSEQ_2:127,FINSEQ_3:94;
              then Sum(f) = Sum<* a * u,b * v *> by A52,A53,RLVECT_2:def 8
                .= a * u + b * v by RLVECT_1:45
                .= a * u + b * v + 0.V by RLVECT_1:4;
              hence thesis by A47,RLVECT_1:10;
            end;
            suppose
A54:          c <> 0;
              {u,v,w} c= Carrier f
              proof
                let x be object;
                assume x in {u,v,w};
                then x = u or x = v or x = w by ENUMSET1:def 1;
                hence thesis by A31,A46,A54,RLVECT_2:19;
              end;
              then
A55:          Carrier f = {u,v,w} by A4;
              set F = <* u,v,w *>;
A56:          f (#) F = <* a * u,b * v,c * w *> by RLVECT_2:28;
              rng F = {u,v,w} & F is one-to-one by A1,A2,A3,FINSEQ_2:128
,FINSEQ_3:95;
              then Sum(f) = Sum <* a * u,b * v,c * w *> by A55,A56,
RLVECT_2:def 8
                .= a * u + b * v + c * w by RLVECT_1:46;
              hence thesis;
            end;
          end;
          hence thesis;
        end;
      end;
      hence thesis;
    end;
  end;
  hence thesis;
end;
