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 Th11:
  x in Lin{w1,w2} iff ex a,b st x = a * w1 + b * w2
proof
  thus x in Lin{w1,w2} implies ex a,b st x = a * w1 + b * w2
  proof
    assume
A1: x in Lin{w1,w2};
    now
      per cases;
      suppose
        w1 = w2;
        then {w1,w2} = {w1} by ENUMSET1:29;
        then consider a such that
A2:     x = a * w1 by A1,Th8;
        x = a * w1 + 0.V by A2,RLVECT_1:4
          .= a * w1 + 0 * w2 by RLVECT_1:10;
        hence thesis;
      end;
      suppose
A3:     w1 <> w2;
        consider l being Linear_Combination of {w1,w2} such that
A4:     x = Sum(l) by A1,RLVECT_3:14;
        x = l.w1 * w1 + l.w2 * w2 by A3,A4,RLVECT_2:33;
        hence thesis;
      end;
    end;
    hence thesis;
  end;
  given a,b such that
A5: x = a * w1 + b * w2;
  now
    per cases;
    suppose
A6:   w1 = w2;
      then x = (a + b) * w1 by A5,RLVECT_1:def 6;
      then x in Lin{w1} by Th8;
      hence thesis by A6,ENUMSET1:29;
    end;
    suppose
A7:   w1 <> w2;
      deffunc F(VECTOR of V)=zz;
      reconsider aa=a, bb=b as Element of REAL by XREAL_0:def 1;
      consider f being Function of the carrier of V, REAL such that
A8:   f.w1 = aa & f.w2 = bb and
A9:   for u st u <> w1 & u <> w2 holds f.u = F(u) from FUNCT_2:sch 7(
      A7);
      reconsider f as Element of Funcs(the carrier of V,REAL) by FUNCT_2:8;
      now
        let u;
        assume not u in {w1,w2};
        then u <> w1 & u <> w2 by TARSKI:def 2;
        hence f.u = 0 by A9;
      end;
      then reconsider f as Linear_Combination of V by RLVECT_2:def 3;
      Carrier f c= {w1,w2}
      proof
        let x be object;
        assume that
A10:    x in Carrier f and
A11:    not x in {w1,w2};
        x <> w1 & x <> w2 by A11,TARSKI:def 2;
        then f.x = 0 by A9,A10;
        hence contradiction by A10,RLVECT_2:19;
      end;
      then reconsider f as Linear_Combination of {w1,w2} by RLVECT_2:def 6;
      x = Sum(f) by A5,A7,A8,RLVECT_2:33;
      hence thesis by RLVECT_3:14;
    end;
  end;
  hence thesis;
end;
