
theorem lembasx2:
for F being Field,
    E being FieldExtension of F
for a being Element of E
for n being Element of NAT
for l being Linear_Combination of VecSp(E,F)
ex p being Polynomial of F
st deg p <= n &
   for i being Element of NAT st i <= n holds p.i = l.(a|^i)
proof
let F be Field, E be FieldExtension of F; let a be Element of E;
let n be Element of NAT; let l be Linear_Combination of VecSp(E,F);
set V = VecSp(E,F);
defpred P[object,object] means
    (ex i being Nat st i <= n & $1 = i & $2 = l.(a|^i)) or
    (ex i being Nat st i > n & $1 = i & $2 = 0.F);
A: for x being Element of NAT
   ex y being Element of the carrier of F st P[x,y]
   proof
   let x be Element of NAT;
   reconsider v = a|^x as Element of V by FIELD_4:def 6;
   per cases;
   suppose A1: ex i being Nat st i <= n & x = i;
     reconsider y = l.v as Element of F;
     take y;
     thus thesis by A1;
     end;
   suppose A1: ex i being Nat st i > n & x = i;
     take 0.F;
     thus thesis by A1;
     end;
   end;
consider p being Function of NAT,the carrier of F such that
B: for x being Element of NAT holds P[x,p.x] from FUNCT_2:sch 3(A);
C1: for i being Nat holds i <= n implies p.i = l.(a|^i)
    proof
    let i be Nat;
    assume C3: i <= n;
    i is Element of NAT by ORDINAL1:def 12; then
    P[i,p.i] by B;
    hence l.(a|^i) = p.i by C3;
    end;
C2: for i being Nat holds i >= n + 1 implies p.i = 0.F
    proof
    let i be Nat;
    assume C3: i >= n + 1;
    i is Element of NAT by ORDINAL1:def 12; then
    P[i,p.i] by B;
    hence 0.F = p.i by C3,NAT_1:13;
    end; then
reconsider p as Polynomial of F by ALGSEQ_1:def 1;
take p;
n + 1 is_at_least_length_of p by C2,ALGSEQ_1:def 2; then
len p <= n + 1 by ALGSEQ_1:def 3; then
len p - 1 <=  n + 1 - 1 by XREAL_1:9;
hence deg p <= n by HURWITZ:def 2;
thus thesis by C1;
end;
