
theorem lemmaA:
for F being ordered Field,
    P being Ordering of F
for E being FieldExtension of F,
    a being non zero Element of E
holds a in QS(E,P)
iff ex f being P-quadratic non empty FinSequence of E
    st Sum f = a &
       for i being Element of NAT st i in dom f holds f.i <> 0.E
proof
let F be ordered Field, P be Ordering of F;
let E be FieldExtension of F, a be non zero Element of E;
now assume A: a in QS(E,P);
consider g being P-quadratic FinSequence of E such that
B: Sum g = a by A;
Z: g is non empty by B;
defpred P[Nat] means
    for g being P-quadratic non empty FinSequence of E
    st len g = $1 & Sum g <> 0.E
    ex f being P-quadratic non empty FinSequence of E
    st Sum f = Sum g &
       for i being Element of NAT st i in dom f holds f.i <> 0.E;
IA: P[1]
      proof
      now let g be P-quadratic non empty FinSequence of E;
        assume A1: len g = 1 & Sum g <> 0.E;
        set y = g.1;
        A2: g = <*y*> by A1,FINSEQ_1:40;
        rng<*y*> = {y} by FINSEQ_1:39; then
        y in rng<*y*> by TARSKI:def 1; then
        consider u being object such that
        A6: u in dom g & g.u = y by A2,FUNCT_1:def 3;
        reconsider u as Element of NAT by A6;
        g.u in rng g & rng g c= the carrier of E by A6,FUNCT_1:3; then
        reconsider y as Element of the carrier of E by A6;
        now let i be Element of NAT;
          assume H: i in dom g;
          dom g = Seg 1 by A2,FINSEQ_1:38;
          then i = 1 by H,FINSEQ_1:2,TARSKI:def 1;
          hence g.i <> 0.E by A1,A2,RLVECT_1:44;
          end;
        hence ex f being P-quadratic non empty FinSequence of E
          st Sum f = Sum g &
          for i being Element of NAT st i in dom f holds f.i <> 0.E;
        end;
      hence P[1];
      end;
IS: now let k be Nat;
      assume A: k >= 1;
      assume IV: P[k];
      now let f be P-quadratic non empty FinSequence of E;
      assume A1: len f = k + 1 & Sum f <> 0.E;
      consider G being FinSequence, y being object such that
      A3: f = G^<*y*> by FINSEQ_1:46;
      A4: len f = len G + len<*y*> by A3,FINSEQ_1:22
               .= len G + 1 by FINSEQ_1:39;
      rng G c= rng f by A3,FINSEQ_1:29; then
      reconsider G as non empty FinSequence of E
                         by A,A1,A4,XBOOLE_1:1,FINSEQ_1:def 4;
      rng<*y*> = {y} by FINSEQ_1:39; then
      A6: y in rng<*y*> by TARSKI:def 1;
      rng<*y*> c= rng f by A3,FINSEQ_1:30; then
      consider u being object such that
      A7: u in dom f & f.u = y by A6,FUNCT_1:def 3;
      reconsider u as Element of NAT by A7;
      f.u in rng f & rng f c= the carrier of E by A7,FUNCT_1:3; then
      reconsider y as Element of the carrier of E by A7;
      reconsider g1 = <*y*> as FinSequence of E;
      f = G ^ g1 by A3; then
      reconsider G,g1 as P-quadratic non empty FinSequence of E by XYZbS3a;
      per cases;
      suppose Sum G = 0.E; then
        I: 0.E + Sum g1 = Sum f by A3,RLVECT_1:41;
        now let i be Element of NAT;
          assume H: i in dom g1;
          dom g1 = Seg 1 by FINSEQ_1:38;
          then J: i = 1 by H,FINSEQ_1:2,TARSKI:def 1;
          thus g1.i <> 0.E by J,I,A1,RLVECT_1:44;
          end;
        hence ex g being P-quadratic non empty FinSequence of E
        st Sum f = Sum g &
           for i being Element of NAT st i in dom g holds g.i <> 0.E by I;
        end;
      suppose Sum G <> 0.E; then
      consider G1 being P-quadratic non empty FinSequence of E such that
      B: Sum G1 = Sum G &
         for i being Element of NAT st i in dom G1 holds G1.i<>0.E by A1,A4,IV;
      C: Sum f = Sum G + Sum <*y*> by A3,RLVECT_1:41
              .= Sum G + y by RLVECT_1:44;
      per cases;
      suppose y = 0.E;
        hence ex g being P-quadratic non empty FinSequence of E
        st Sum f = Sum g &
           for i being Element of NAT st i in dom g holds g.i <> 0.E by B,C;
        end;
      suppose D1: y <> 0.E;
        set g = G1 ^ g1;
        D2: Sum g = Sum G1 + Sum <*y*> by RLVECT_1:41
                 .= Sum f by B,C,RLVECT_1:44;
        now let i be Element of NAT;
          assume D3: i in dom g;
          D4: dom g = Seg(len g) by FINSEQ_1:def 3;
          len g = len G1 + len g1 by FINSEQ_1:22
               .= len G1 + 1 by FINSEQ_1:39; then
          D6: 1 <= i & i <= len G1 + 1 by D3,D4,FINSEQ_1:1;
          per cases;
          suppose D6: i in dom G1; then
            g.i = G1.i by FINSEQ_1:def 7;
            hence g.i <> 0.E by B,D6;
            end;
          suppose D7: not i in dom G1;
            D8: now assume i <> len G1 + 1;
                then i < len G1 + 1 by D6,XXREAL_0:1;
                then i + 1 - 1 <= len G1 + 1 - 1 by INT_1:7; then
                i in Seg(len G1) by D6,FINSEQ_1:1;
                hence contradiction by D7,FINSEQ_1:def 3;
                end;
            dom g1 = Seg 1 by FINSEQ_1:38; then
            1 in dom g1 by FINSEQ_1:3; then
            g.i = g1.1 by D8,FINSEQ_1:def 7 .= y;
            hence g.i <> 0.E by D1;
            end;
          end;
        hence ex g being P-quadratic non empty FinSequence of E
        st Sum f = Sum g &
           for i being Element of NAT st i in dom g holds g.i <> 0.E by D2;
        end;
      end;
      end;
      hence P[k+1];
      end;
I: for k being Nat st k >= 1 holds P[k] from NAT_1:sch 8(IA,IS);
  consider n being Nat such that H: len g = n;
  n >= 0 + 1 by Z,H,INT_1:7;
  hence ex f being P-quadratic non empty FinSequence of E
    st Sum f = a &
    for i being Element of NAT st i in dom f holds f.i <> 0.E by Z,H,I,B;
  end;
hence thesis;
end;
