Eine aufbereitete Darstellung der Quelle

 
     
 
 
 
Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung


Quelle  polynom9.miz   Sprache: Mizar

 

:: Prime Representing Polynomial with 10 Unknowns
::  by Karol P\kak
::
:: Received December 27, 2022
:: Copyright (c) 2022-2026 Association of Mizar Users
::           (Stowarzyszenie Uzytkownikow Mizara, Bialystok, Poland).
:: This code can be distributed under the GNU General Public Licence
:: version 3.0 or later, or the Creative Commons Attribution-ShareAlike
:: License version 3.0 or later, subject to the binding interpretation
:: detailed in file COPYING.interpretation.
:: See COPYING.GPL and COPYING.CC-BY-SA for the full text of these
:: licenses, or see http://www.gnu.org/licenses/gpl.html and
:: http://creativecommons.org/licenses/by-sa/3.0/.

environ

 vocabularies NUMBERS, XBOOLE_0, SUBSET_1, FINSEQ_1, RELAT_1, PARTFUN1, CARD_1,
      FUNCT_1, TARSKI, XXREAL_0, ARYTM_1, ARYTM_3, NAT_1, ORDERS_1, GROUP_1,
      BINOP_1, ALGSTR_0, RLVECT_1, VECTSP_1, LATTICES, ZFMISC_1, FINSET_1,
      STRUCT_0, SUPINF_2, CARD_3, FINSOP_1, ORDINAL4, PRE_POLY, FUNCT_4,
      FUNCOP_1, ORDINAL1, WELLORD2, MESFUNC1, POLYNOM1, ALGSEQ_1, POLYNOM2,
      HILBASIS, GRAPH_2, AFINSQ_1, HILB10_2, CQC_LANG, SQUARE_1, VALUED_1,
      REAL_1, UPROOTS, POLYNOM7, CAT_3, COMPLFLD, COMPLEX1, POLYNOM5, FUNCT_3,
      FINSUB_1, PBOOLE, FINSEQ_2, VALUED_0, BINOP_2, XCMPLX_0, HILB10_7,
      SETWISEO, FUNCT_6, WAYBEL_4, ABIAN, AOFA_I00, FINSEQOP, PRGCOR_2,
      SGRAPH1, NEWTON, INT_1, INT_2, RING_3, QC_LANG1, PYTHTRIP, ABCMIZ_1,
      POLYNOM9, FUNCT_2;
 notations TARSKI, XBOOLE_0, SUBSET_1, CARD_1, ORDINAL1, NUMBERS, RELAT_1,
      FINSOP_1, RELSET_1, FUNCT_1, FINSET_1, XCMPLX_0, PARTFUN1, FUNCT_2,
      RVSUM_1, BINOP_1, BINOP_2, FUNCT_4, FUNCT_7, NAT_1, NEWTON, ORDERS_1,
      FINSEQ_1, FINSEQ_2, STRUCT_0, ALGSTR_0, RLVECT_1, FUNCOP_1, VFUNCT_1,
      VECTSP_1, GROUP_1, XXREAL_0, PBOOLE, DOMAIN_1, VALUED_0, COMPLFLD,
      FUNCT_3, INT_1, VALUED_1, FINSEQOP, COMPLEX1, SQUARE_1, XREAL_0, ABIAN,
      FINSUB_1, SETWISEO, SETFAM_1, RLAFFIN3, HILB10_7, AFINSQ_1, NAT_D,
      RING_3, GROUP_4, PRE_POLY, POLYNOM1, POLYNOM2, UPROOTS, POLYNOM7,
      HILB10_2, FINSEQ_4, BAGORDER, POLYRED, INT_2, PYTHTRIP, HILBASIS;
 constructors REAL_1, FINSOP_1, GROUP_4, RECDEF_1, VFUNCT_1, POLYNOM2,
      SETWISEO, FINSEQOP, BINOP_2, BAGORDER, UPROOTS, POLYNOM7, HILB10_7,
      ABIAN, RLAFFIN3, RING_3, HILB10_2, WSIERP_1, HILBASIS, PYTHTRIP,
      FINSEQ_4, PEPIN, RVSUM_4, POLYRED;
 registrations XBOOLE_0, ORDINAL1, RELSET_1, FUNCOP_1, FINSET_1, XREAL_0,
      NAT_1, INT_1, FINSEQ_1, FINSEQ_2, NEWTON, STRUCT_0, VECTSP_1, POLYNOM1,
      VALUED_0, CARD_1, SUBSET_1, PRE_POLY, RELAT_1, VFUNCT_1, FUNCT_2,
      FUNCT_1, PBOOLE, POLYNOM2, MEMBERED, GROUP_1, FVSUM_1, AFINSQ_1,
      VALUED_1, XCMPLX_0, POLYNOM7, COMPLFLD, SQUARE_1, RLVECT_1, HILB10_7,
      NEWTON04, FOMODEL0, ABIAN, NEWTON03, GR_CY_1, BAGORDER, NUMBERS,
      HILB10_2, PEPIN, XXREAL_0, OSALG_1, WSIERP_1, HILB10_3, FINSEQ_4, NIVEN,
      AOFA_A01, RVSUM_4;
 requirements NUMERALS, BOOLE, SUBSET, REAL, ARITHM;
 definitions TARSKI, XBOOLE_0, FUNCT_1, GROUP_1;
 equalities ORDINAL1, FINSEQ_1, POLYNOM7, XCMPLX_0, STRUCT_0, ALGSTR_0,
      VECTSP_1, HILB10_2, FINSEQ_2;
 expansions TARSKI, FUNCT_2, FUNCT_1, PYTHTRIP;
 theorems TARSKI, ZFMISC_1, RLVECT_1, FUNCT_1, FUNCT_2, POLYNOM1, NAT_1,
      FINSEQ_1, FINSEQ_3, FUNCOP_1, RELAT_1, CARD_1, ORDINAL1, POLYNOM2,
      FINSEQ_5, GROUP_1, XBOOLE_0, XBOOLE_1, XREAL_1, XXREAL_0, PARTFUN1,
      NAT_D, PRE_POLY, AFINSQ_1, FINSEQ_4, FINSOP_1, VALUED_0, XCMPLX_1,
      VALUED_1, FUNCT_7, HILB10_2, RFUNCT_1, TOPREALC, UPROOTS, VECTSP_1,
      POLYNOM7, POLYRED, SETWISEO, STRUCT_0, CARD_2, FUNCT_3, SQUARE_1,
      COMPLEX1, COMPLFLD, XCMPLX_0, HILB10_7, RING_3, SETWOP_2, FINSEQOP,
      RLAFFIN3, FVSUM_1, PRVECT_1, NEWTON03, FINSUB_1, NEWTON, HILB10_5,
      FINSEQ_2, ABIAN, BINOP_2, HURWITZ, GROUP_4, NIVEN, UNIROOTS, INT_1,
      NUMBERS, XREAL_0, PYTHTRIP, INT_2, RVSUM_4, MATRPROB, FINSET_1, MATRLIN,
      FUNCT_4, PREPOWER, BAGORDER, HILBASIS, HILB10_8, BOOLMARK;
 schemes NAT_1, FUNCT_2, FINSEQ_1, FUNCT_1, SETWISEO, FRAENKEL;

begin :: Preliminaries

reserve i,j,k,n,m for Nat,
        X for set,
        b,s for bag of X,
        x for object;

theorem Th1:
  for i be Integer holds i '*' 1_ F_Complex = i
proof
A1: 0.F_Complex = 0 by COMPLFLD:def 1;
  defpred P[Nat] means $1 '*' 1_ F_Complex = $1;
A2:P[0] by A1,RING_3:59;
A3:P[n] implies P[n+1]
  proof
    assume
A4:P[n];
    thus (n+1) '*' 1_ F_Complex = (n '*' 1_ F_Complex) + (1 '*' 1_ F_Complex)
    by RING_3:62
    .= n+1 by A4,COMPLEX1:def 4,COMPLFLD:8,RING_3:60;
  end;
A5:P[n] from NAT_1:sch 2(A2,A3);
  let i be Integer;
  consider k be Nat such that
A6:i= k or i = - k by INT_1:2;
  per cases by A6;
  suppose i=k;
    hence thesis by A5;
  end;
  suppose
A7: i = -k;
    hence i '*' 1_ F_Complex = - (k '*' 1_ F_Complex) by RING_3:63
    .= i by A7,A5;
  end;
end;

theorem Th2:
  for z1,z2 be Complex st Re z1 >=0 & Re z2>=0 & Im z1 >=0 & Im z2>=0 &
    z1^2=z2^2 & z1^2 is Real holds z1=z2
proof
  let z1,z2 be Complex such that
A1:Re z1 >=0 & Re z2>=0 & Im z1 >=0 & Im z2>=0
    &z1^2=z2^2 & z1^2 is Real & z1<>z2;
A2:z1^2 = z1*z1 & z2^2=z2*z2 by SQUARE_1:def 1;
A3:Re(z1 * z1) = Re z1 * Re z1 - Im z1 * Im z1 by COMPLEX1:9;
A4:Re(z2 * z2) = Re z2 * Re z2 - Im z2 * Im z2 by COMPLEX1:9;
A5:Re(z1 * z1) = Re(z2 * z2) by A2,A1;
A6: 0 = Im (z2^2) by A1,COMPLEX1:def 2
  .=Im (z2*z2) by SQUARE_1:def 1
  .= (Im z2)* (Re z2) + (Im z2)* (Re z2) by COMPLEX1:9;
  0 = Im (z1^2) by A1,COMPLEX1:def 2
  .= (Im z1)* (Re z1) + (Im z1)* (Re z1) by A2,COMPLEX1:9;
  then per cases by A6;
  suppose
A7: Im z1=0 & Im z2 = 0;
    then (Re z1)^2 = Re z1 * Re z1 = Re z2 * Re z2 = (Re z2)^2
      by A1,A3,A4,A2,SQUARE_1:def 1;
    then
A8: Re z1 = Re z2 or Re z1 = - Re z2 by SQUARE_1:40;
    then Re z1=0 by A1,A7,COMPLEX1:def 3;
    hence thesis by A7,A1,A8,COMPLEX1:def 3;
  end;
  suppose
A9: Im z1=0 & Re z2 = 0;
    then
A10:Im z2 =0 by A2,A1,A3,A4;
    Re z1 = 0 by A2,A9,A1,A3,A4;
    hence thesis by A10,A9,COMPLEX1:def 3,A1;
  end;
  suppose
A11: Im z2=0 & Re z1 = 0;
    then
A12: Im z1 =0 by A2,A1,A3,A4;
    Re z2 = 0 by A2,A11,A1,A3,A4;
    hence thesis by A12,A11,COMPLEX1:def 3,A1;
  end;
  suppose A13: Re z1=0 & Re z2 = 0;
    then (Im z1)^2 = Im z1 * Im z1 = Im z2 * Im z2 = (Im z2)^2
      by A3,A4,A5,SQUARE_1:def 1;
    then A14: Im z1 = Im z2 or Im z1 = - Im z2 by SQUARE_1:40;
    then Im z1=0 by A1,A13,COMPLEX1:def 3;
    hence thesis by A13,A1,A14,COMPLEX1:def 3;
  end;
end;

theorem Th3:
  for a,b be Integer st a^2 divides b^2 holds
    a divides b
proof
  let a,b be Integer such that
A1:a^2 divides b^2;
A2: |.a.| = a or |.a.| = -a by COMPLEX1:71;
A3: |.b.| = b or |.b.| = -b by COMPLEX1:71;
  a^2 = |.a.|^2 & b^2 = |.b.|^2 by COMPLEX1:75;
  then |.a.| divides |.b.| by A1,PYTHTRIP:6;
  hence thesis by A2,A3,INT_2:10;
end;

theorem Th4:
  for m be positive Nat holds card bool (Seg m\{1}) = 2|^(m-'1)
proof
  let m be positive Nat;
  defpred P[Nat] means card bool (Seg (1+$1)\{1}) = 2|^$1;
  Seg (1+0)\{1} = {} by FINSEQ_1:2;
  then card bool (Seg (1+0)\{1}) = 1 by ZFMISC_1:1,CARD_1:30;
  then A1: P[0] by NEWTON:4;
  A2:P[n] implies P[n+1]
  proof
    assume P[n];
    then card bool (Seg (1+(n+1))\{1}) = 2 * (2|^n) by HILB10_7:9
    .= 2|^(n+1) by NEWTON:6;
    hence thesis;
  end;
  A3:P[n] from NAT_1:sch 2(A1,A2);
  reconsider m1 = m-1 as Nat;
  card bool (Seg (1+m1)\{1}) = 2|^(m1) by A3;
  hence thesis;
end;

theorem Th5:
  for n be Ordinal, A be finite Subset of n holds
    RelIncl n linearly_orders A
proof
   let X be Ordinal, A be finite Subset of X;
   set b=chi(A,X);
A1: support b c= A
   proof
     let y be object such that
A2:  y in support b;
A3:  b.y <>0 by A2,PRE_POLY:def 7;
     then y in dom b by FUNCT_1:def 2;
     hence thesis by A3,FUNCT_3:def 3;
   end;
A4: A c= support b
   proof
     let y be object such that
A5:  y in A;
     b.y = 1 by FUNCT_3:def 3,A5;
     hence thesis by PRE_POLY:def 7;
   end;
   reconsider b as bag of X by PRE_POLY:def 8,A1;
   RelIncl X linearly_orders support b by PRE_POLY:82;
   hence thesis by A4,A1,XBOOLE_0:def 10;
end;

theorem Th6:
  for x be Element of F_Real st x<>0.F_Real holds
     (power F_Real).(x,n) <> 0.F_Real
proof
  let x be Element of F_Real such that
A1: x<>0.F_Real;
  defpred P[Nat] means (power F_Real).(x,$1) <>0.F_Real;
  (power F_Real).(x,0) = 1_F_Real by GROUP_1:def 7;
  then
A2:P[0];
A3:P[i] implies P[i+1]
  proof
    assume
A4: P[i];
    set i1=i+1;
    (power F_Real).(x,i1) = (power F_Real).(x,i) * x by GROUP_1:def 7;
    hence thesis by A1,A4;
  end;
  P[i] from NAT_1:sch 2(A2,A3);
  hence thesis;
end;

begin :: More on Bags

theorem Th7:
  for b be bag of X holds
    support (n(#)b) c= support b
proof
  let b be bag of X;
  let x be object such that
A1: x in  support (n(#)b);
  (n(#)b).x <> 0 by A1,PRE_POLY:def 7;
  then x in dom (n(#)b) by FUNCT_1:def 2;
  then (n(#)b).x = n * b.x by VALUED_1:def 5;
  then b.x <>0 by A1,PRE_POLY:def 7;
  hence thesis by PRE_POLY:def 7;
end;

theorem
  for b be bag of X st n <> 0 holds support (n(#)b) = support b
proof
  let b be bag of X such that
A1: n<>0;
  thus support (n(#)b) c= support b by Th7;
  let x be object;
  assume x in  support b;
  then
A2: b.x<>0 by PRE_POLY:def 7;
  (n(#)b).x = n * (b.x) by VALUED_1:6;
  hence thesis by A1,A2,PRE_POLY:def 7;
end;

theorem
  for b be bag of X holds
    support (b +*(x,n)) c= {x} \/ support b
proof
  let b be bag of X;
  let y be object;
  assume y in support (b +*(x,n));
  then
A1: (b +*(x,n)).y <>0 by PRE_POLY:def 7;
  per cases;
  suppose y=x;
    then y in {x} by TARSKI:def 1;
    hence thesis by XBOOLE_0:def 3;
  end;
  suppose y<>x;
    then b.y<>0 by A1,FUNCT_7:32;
    then y in support b by PRE_POLY:def 7;
    hence thesis by XBOOLE_0:def 3;
  end;
end;

registration
  let X be set;
  let b be bag of X;
  let n be natural number;
  cluster n(#)b -> finite-support;
  coherence
  proof
    support (n(#)b) c= support b by Th7;
    hence thesis by PRE_POLY:def 8;
  end;
  let x be object;
  cluster b+*(x,n) -> finite-support;
  coherence
  proof
    x is set by TARSKI:1;
    hence thesis;
  end;
end;

theorem
   for b be bag of X holds 0 (#) b = EmptyBag X
proof
  let b be bag of X;set E=EmptyBag X;
  A1:dom (0 (#) b) = X = dom E & X=dom b by PARTFUN1:def 2;
  for x st x in dom E holds E.x=(0 (#) b).x
  proof
    let x;
    (0 (#)b).x = 0* b.x by VALUED_1:6;
    hence thesis;
  end;
  hence thesis by A1;
end;

theorem
  for n be Ordinal,
      L be right_zeroed add-associative right_complementable
              well-unital distributive Abelian non trivial commutative
              associative non empty doubleLoopStr
   for x being Function of n, L
     for b be bag of n, i be Nat st i<>0
holds
   eval(i (#) b,x) = (power L) . (eval(b,x) , i)
proof
  let n be Ordinal,
      L be right_zeroed add-associative right_complementable
              well-unital distributive Abelian non trivial commutative
              associative non empty doubleLoopStr;
  let x be Function of n, L;
  let b be bag of n;
    defpred P[Nat] means
    $1 <> 0 implies eval($1 (#) b,x) = (power L) . (eval(b,x) , $1);
A1: P[0];
A2: P[j] implies P[j+1]
  proof
    assume
A3: P[j];
    assume j+1<>0;
    per cases;
    suppose
A4:   j=0;
      hence eval((j+1) (#) b,x) = eval(b,x) by RFUNCT_1:21
      .= (power L) . (eval(b,x), j+1) by A4,GROUP_1:50;
    end;
    suppose
A5:   j<>0;
      thus eval((j+1) (#) b,x) = eval( (j (#) b)+(1(#)b),x) by TOPREALC:2
      .= eval(j (#) b,x) * eval(1(#)b,x) by POLYNOM2:16
      .= (power L) . (eval(b,x), j) * eval(b,x) by A5,A3,RFUNCT_1:21
      .= (power L) . (eval(b,x), j+1) by GROUP_1:def 7;
    end;
  end;
  P[j] from NAT_1:sch 2(A1,A2);
  hence thesis;
end;

theorem Th12:
  for X be non empty set,x be Element of X, i be Element of NAT holds
   (EmptyBag X) +*(x,i) = ({x},i)-bag
proof
  let X be non empty set,x be Element of X, i be Element of NAT;
  dom (EmptyBag X) = X by PARTFUN1:def 2;
  hence (EmptyBag X) +*(x,i) = (EmptyBag X)+* (x.-->i) by FUNCT_7:def 3
  .= (EmptyBag X)+* ({x} -->i) by FUNCOP_1:def 9
  .= ({x},i)-bag by UPROOTS:def 2;
end;

theorem Th13:
  for X be set,x,i st x in X & i <>0 holds
    support((EmptyBag X) +*(x,i))={x}
proof
  let X be set,x,i  such that
A1: x in X & i <> 0;
  reconsider i as Element of NAT by ORDINAL1:def 12;
  reconsider D=X as non empty set by A1;
  reconsider d=x as Element of D by A1;
  (EmptyBag X) +*(x,i) = ({d},i)-bag by Th12;
  hence thesis by A1,UPROOTS:8;
end;

theorem Th14:
  for n be Ordinal,
      L be well-unital non trivial doubleLoopStr,
      y be Function of n, L st x in n holds
  eval((EmptyBag n) +*(x,i),y) = power(L).(y.x,i)
proof
  let n be Ordinal, L be well-unital non trivial doubleLoopStr,
  y be Function of n, L such that
A1: x in n;
A2: n=dom y by PARTFUN1:def 2;
  reconsider x as set by TARSKI:1;
  set E = EmptyBag n,Ex = E+*(x,i);
  per cases;
  suppose A3:i<>0;
A4: dom E = n by PARTFUN1:def 2;
   support(Ex)={x} by Th13,A1,A3;
   then eval(Ex,y) = power(L).(y.x,Ex.x) by POLYNOM2:15;
    hence thesis by A4,A1,FUNCT_7:31;
  end;
  suppose
A5: i=0;
    then E = E +*(x,E.x) & E.x = i by FUNCT_7:35;
    then eval(E +*(x,i),y) = 1_L by POLYNOM2:14
    .= (power L).(y/.x, i) by A5,GROUP_1:def 7;
    hence thesis by A2,A1,PARTFUN1:def 6;
  end;
end;

theorem Th15:
  for b be bag of X holds
    b = b +*(x,0) + (EmptyBag X) +* (x,b.x)
proof
  let b be bag of X;
  set E=EmptyBag X, bx = b +*(x,0), Ex = E +* (x,b.x);
A1:dom ( bx + Ex ) = X = dom b & X = dom E by PARTFUN1:def 2;
  for y be object st y in dom b holds b.y = ( bx + Ex ).y
  proof
    let y be object such that
A2: y in dom b;
A3: ( bx + Ex ).y = (bx.y) + (Ex.y) by A2,A1,VALUED_1:def 1;
    per cases;
    suppose x in X & x = y;
      then bx.y = 0 & Ex.y = b.y by A1,FUNCT_7:31;
      hence thesis by A3;
    end;
    suppose x in X & x <> y;
      then bx.y = b.y & Ex.y = E.y =0 by FUNCT_7:32;
      hence thesis by A3;
    end;
    suppose not x in X;
      then bx = b & Ex = E by A1,FUNCT_7:def 3;
      hence thesis by PRE_POLY:53;
    end;
  end;
  hence thesis by A1;
end;

theorem Th16:
  for b be bag of X holds
    support (b +*(x,0)) = support b\{x}
proof
  let b be bag of X;
A1:dom (b +*(x,0)) = X = dom b by PARTFUN1:def 2;
  thus support (b +*(x,0)) c= support b\{x}
  proof
    let y be object;
    assume
A2: y in support (b +*(x,0)); then
A3:(b +*(x,0)).y<>0 by PRE_POLY:def 7;
A4: y<>x by A2,A3,A1,FUNCT_7:31;
    then 0 <> b.y by A3,FUNCT_7:32;
    then y in support b by PRE_POLY:def 7;
    hence thesis by A4,ZFMISC_1:56;
  end;
  let y be object;
  assume y in support b\{x};
  then
A5: y in support b c= dom b & x <>y by ZFMISC_1:56,PRE_POLY:37;
  then 0 <> b.y & y in dom b by PRE_POLY:def 7;
  then (b +*(x,0)).y<>0 by A5,FUNCT_7:32;
  hence thesis by PRE_POLY:def 7;
end;

theorem Th17:
  for n be Ordinal,
      L be right_zeroed add-associative right_complementable
              well-unital distributive Abelian non trivial commutative
              associative non empty doubleLoopStr
  for x being Function of n, L
    for b be bag of n, i be object,j be Nat st i in n holds
  eval (b+*(i,j),x) * (power L).(x/.i, b.i) = eval (b,x) * (power L).(x/.i, j)
  proof
    let n be Ordinal,
      L be right_zeroed add-associative right_complementable
              well-unital distributive Abelian non trivial commutative
              associative non empty doubleLoopStr;
    let x be Function of n, L;
    set E=EmptyBag n;
    let b be bag of n,i be object ,j be Nat such that
A1: i in n;
A2: i is set by TARSKI:1;
    set d = b+*(i,j);
    d = d +*(i,0) + E+*(i,d.i) by Th15;
    then d = b +*(i,0) + E+*(i,d.i) by A2,FUNCT_7:34;
    then
A3: eval (b+*(i,j),x) * (power L).(x/.i, b.i) =
    eval(b +*(i,0),x) * eval(E+*(i,d.i),x) * (power L).(x/.i, b.i)
    by POLYNOM2:16;
    dom b = n =dom x by PARTFUN1:def 2;
    then
A5: d.i = j & x/.i = x.i by A1,FUNCT_7:31,PARTFUN1:def 6;
A10: b = (b +*(i,0)) + E+*(i,b.i) by Th15;
     (power L).(x/.i, b.i) = eval(E +* (i,b.i),x) by A5,Th14,A1;
     then
A14: eval(b +*(i,0),x) * (power L).(x/.i, b.i) =
     eval(b,x) by POLYNOM2:16,A10;
     thus eval (b+*(i,j),x) * (power L).(x/.i, b.i) =
     eval(b +*(i,0),x) * (power L).(x/.i, b.i) * eval(E+*(i,j),x)
     by A5,A3,GROUP_1:def 3
     .= eval(b,x) * (power L).(x/.i, j) by A14,A5,A1,Th14;
   end;

definition
  let A,B be set;
  let f be Function of A,B;
  let x be object, b be Element of B;
  redefine func f +*(x,b) -> Function of A,B;
  coherence
  proof
    per cases;
    suppose not x in dom f;
      hence thesis by FUNCT_7:def 3;
    end;
    suppose x in dom f;
      then
A1:   B<>{};
      then dom f = A by FUNCT_2:def 1;
      then
A2:   dom (f +*(x,b))=A by FUNCT_7:30;
A3:   rng f c= B by RELAT_1:def 19;
      {b}  c= B by A1,ZFMISC_1:31;
      then A4: rng f \/ {b} c= B by A3,XBOOLE_1:8;
      rng (f +*(x,b)) c= rng f \/ {b} by FUNCT_7:100;
      then rng (f +*(x,b)) c= B by A4;
      hence thesis by A2,FUNCT_2:2;
    end;
  end;
end;

theorem Th18:
  for n be Ordinal,
      L be well-unital non trivial doubleLoopStr,
      b be bag of n,
      f be Function of n, L,
       u be Element of L st b.x = 0 holds
    eval(b,f +*(x,u)) = eval(b,f)
proof
  let n be Ordinal,
       L be well-unital non trivial doubleLoopStr,
      b be bag of n,f be Function of n, L,
       u be Element of L such that
A1: b.x = 0;
  set S=SgmX(RelIncl n, support b);
  set fxu = f +*(x,u);
  consider y be FinSequence of L such that
A2: len y = len S & eval(b,fxu) = Product y and
A3: for i be Element of NAT st 1 <= i & i <= len y holds
      y/.i = power(L).((fxu * S)/.i,(b * S)/.i) by POLYNOM2:def 2;
  RelIncl n linearly_orders support b by PRE_POLY:82;
  then
A4: rng S = support b by PRE_POLY:def 2;
  for i be Element of NAT st 1 <= i & i <= len y holds
  y/.i = power(L).((f*S)/.i,(b*S)/.i)
  proof
    let i be Element of NAT such that
A5: 1 <= i & i <= len y;
    dom f = n = dom fxu by FUNCT_2:def 1;
    then
A6: dom (f * S) = dom S = dom (fxu *S) by A4,RELAT_1:27;
    then
A7:(f * S)/.i = (f * S).i = f.(S.i) & i in dom S
    by A5,FINSEQ_3:25,A2,PARTFUN1:def 6,FUNCT_1:12;
    then S.i in rng S by FUNCT_1:def 3;
    then
A8: S.i <> x by A1,A4,PRE_POLY:def 7;
    (fxu * S)/.i = (fxu * S).i = fxu.(S.i)
    by A6,A5,FINSEQ_3:25,A2,PARTFUN1:def 6,FUNCT_1:12;
    then (f * S)/.i = (fxu * S)/.i by A7,A8,FUNCT_7:32;
    hence thesis by A5,A3;
  end;
  hence thesis by A2,POLYNOM2:def 2;
end;

theorem Th19:
  for n be Nat, b be bag of n, i st b.i = degree b holds
    b = (EmptyBag n) +* (i,b.i)
proof
  let n be Nat, b be bag of n, i such that
A1: b.i = degree b;
  per cases;
  suppose degree b=0;
    then
A2: b = EmptyBag n by UPROOTS:12;
A3: dom ((EmptyBag n) +* (i,b.i)) = n =dom b by PARTFUN1:def 2;
    x in dom b implies b.x = ((EmptyBag n) +* (i,b.i)).x
    proof
      assume A4:x in dom b;
      per cases;
      suppose x=i;
        hence thesis by A4,A2,FUNCT_7:31;
      end;
      suppose x<>i;
        hence thesis by A2,FUNCT_7:32;
      end;
    end;
    hence thesis by A3;
  end;
  suppose
A5: degree b > 0;
    then
A6: i in dom b =n by A1,FUNCT_1:def 2,PARTFUN1:def 2;
    set E = (EmptyBag n) +* (i,b.i);
A7: dom EmptyBag n = n by PARTFUN1:def 2;
A8: b = b +*(i,0) + (EmptyBag n) +* (i,b.i) by Th15;
    then
A9: Sum b = Sum (b +*(i,0)) + Sum (E) by UPROOTS:15;
A10: support E = {i} by A5,A1,A6,Th13;
A11: RelIncl n  linearly_orders support E by PRE_POLY:82;
    set S=SgmX(RelIncl n, support E);
A12: rng S = {i} & len S = card {i}=1
    by A10,A11,PRE_POLY:def 2,PRE_POLY:11,CARD_1:30;
    {i} c= dom E by A10,PRE_POLY:37;
    then
A13: dom (E*S) = dom S by A12,RELAT_1:27;
    then
A14: len (E*S) = 1 by A12,FINSEQ_3:29;
    1 in dom (E*S) by A13,FINSEQ_3:25,A12;
    then (E*S).1 = E.(S.1) & S.1 in rng S by A13,FUNCT_1:12,def 3;
    then (E*S).1 = E.i by A12,TARSKI:def 1;
    then E*S = <*E.i*> by A14,FINSEQ_1:40;
    then Sum (E*S) = b.i by A7,A6,FUNCT_7:31;
    then b.i = Sum (b +*(i,0)) + b.i by A9,A1,HILB10_5:5;
    then b +*(i,0) = EmptyBag n by UPROOTS:12;
    hence thesis by PRE_POLY:53,A8;
  end;
end;

theorem Th20:
  for X be set
    for b1,b2 be bag of X st 2(#)b1 +* (0,b1.0) = 2(#)b2 +* (0,b2.0)
  holds b1 = b2
proof
  let X be set;
  let b1,b2 be bag of X such that
A1: 2(#)b1 +* (0,b1.0) = 2(#)b2 +* (0,b2.0);
A2:dom b1 = X = dom b2 & dom (2(#)b1) = X =dom (2(#)b2) by PARTFUN1:def 2;
  for x st x in X holds b1.x = b2.x
  proof
    let x such that
A3: x in X;
    per cases;
    suppose
A4:   x=0;
      hence b1.x = (2(#)b1 +* (0,b1.0)).x by A3,A2,FUNCT_7:31
      .= b2.x by A4,A3,A2,A1,FUNCT_7:31;
    end;
    suppose
A5:   x<>0;
      2*(b1.x) = (2(#)b1).x by A2,A3,VALUED_1:def 5
      .= (2(#)b1 +* (0,b1.0)).x by A5,FUNCT_7:32
      .= (2(#)b2).x by A5,A1,FUNCT_7:32
      .= 2*(b2.x) by A3,A2,VALUED_1:def 5;
      hence b1.x = b2.x;
    end;
  end;
  hence thesis by A2;
end;

theorem Th21:
  for X be set
    for b be bag of X holds support(2(#)b +* (0,b.0)) = support b
proof
  let X be set;
  let b be bag of X;
A1:dom b = X = dom (2(#)b) & X = dom (2(#)b +* (0,b.0)) by PARTFUN1:def 2;
A2:support(2(#)b +* (0,b.0)) c= support b
  proof
    let x be object;
    assume
A3: x in support(2(#)b +* (0,b.0));
    then
A4: (2(#)b +* (0,b.0)).x <>0 by PRE_POLY:def 7;
    per cases;
    suppose x =0;
      then (2(#)b +* (0,b.0)).x = b.x by A3,A1,FUNCT_7:31;
      hence thesis by A4,PRE_POLY:def 7;
    end;
    suppose x <>0;
      then (2(#)b +* (0,b.0)).x = (2(#)b).x by FUNCT_7:32
      .= 2*(b.x) by VALUED_1:6;
      then b.x<>0 by A3,PRE_POLY:def 7;
      hence thesis by PRE_POLY:def 7;
    end;
  end;
  support b c= support(2(#)b +* (0,b.0))
  proof
    let x be object;
    assume
A5: x in support b;
    then
A6: b.x <>0 by PRE_POLY:def 7;
    per cases;
    suppose x =0;
      then (2(#)b +* (0,b.0)).x = b.x by A5,A1,FUNCT_7:31;
      hence thesis by A6,PRE_POLY:def 7;
    end;
    suppose x <>0;
      then (2(#)b +* (0,b.0)).x = (2(#)b).x by FUNCT_7:32
      .= 2*(b.x) by VALUED_1:6;
      then (2(#)b +* (0,b.0)).x<>0 by A5,PRE_POLY:def 7;
      hence thesis by PRE_POLY:def 7;
    end;
  end;
  hence thesis by A2,XBOOLE_0:def 10;
end;

theorem Th22:
  for b be bag of X holds
    b +*(x,i+k) = b +*(x,i) + (EmptyBag X) +* (x,k)
proof
  let b be bag of X;
  set EX= EmptyBag X;
A1: dom (b +*(x,i+k)) = X = dom b by PARTFUN1:def 2;
A2: dom (b +*(x,i) + EX +* (x,k)) =X =dom EX by PARTFUN1:def 2;
  for y be object st y in X holds (b +*(x,i+k)).y =(b +*(x,i) + EX +* (x,k)).y
  proof
    let y be object such that
A3: y in X;
    per cases;
    suppose
A4:   x=y;
      (b +*(x,i) + EX +* (x,k)).y = (b +*(x,i)).y + (EX +* (x,k)).y
      by PRE_POLY:def 5
      .= i + (EX +* (x,k)).y by A4,A1,A3,FUNCT_7:31
      .= i + k by A4,A2,A3,FUNCT_7:31;
      hence thesis by A4,A1,A3,FUNCT_7:31;
    end;
    suppose
A5:   x<>y;
A6:   (EX +* (x,k)).y = EX.y by A5,FUNCT_7:32
      .= 0;
A7:   (b +*(x,i)).y = b.y by A5,FUNCT_7:32;
      (b +*(x,i) + EX +* (x,k)).y = (b +*(x,i)).y + (EX +* (x,k)).y
      by PRE_POLY:def 5;
      hence thesis by A5,FUNCT_7:32,A7,A6;
    end;
  end;
  hence thesis by A1,PARTFUN1:def 2;
end;

theorem
  for L be add-associative right_zeroed right_complementable
           non empty doubleLoopStr
    for a be Element of L, b be bag of X holds
      Monom(-a,b) = -Monom(a,b)
proof
  let L be add-associative right_zeroed right_complementable non
    empty doubleLoopStr;
  let a be Element of L, b be bag of X;
A1: dom 0_(X,L) = Bags X by FUNCT_2:def 1;
  x in Bags X implies Monom(-a,b).x = (-Monom(a,b)).x
  proof
    assume
A2: x in Bags X;
    then reconsider s=x as bag of X;
    per cases;
    suppose
A3:   x=b;
      hence Monom(-a,b).x = -a by A1,A2,FUNCT_7:31
      .= -(Monom(a,b).s) by A3,A1,A2,FUNCT_7:31
      .= (-Monom(a,b)).x by POLYNOM1:17;
    end;
    suppose
A4:   x<>b;
      hence Monom(-a,b).x = 0_(X,L).x by FUNCT_7:32
      .= -(0.L) by A2,POLYNOM1:22
      .= -(0_(X,L).s) by POLYNOM1:22
      .= -(Monom(a,b).s) by A4,FUNCT_7:32
      .= (-Monom(a,b)).x by POLYNOM1:17;
    end;
  end;
  hence thesis;
end;

theorem
  for L be add-associative right_zeroed right_complementable non
     empty doubleLoopStr
    for a1,a2 be Element of L, b be bag of X holds
      Monom(a1,b) + Monom(a2,b) = Monom(a1+a2,b)
proof
  let L be add-associative right_zeroed right_complementable non
    empty doubleLoopStr;
  let a1,a2 be Element of L, b be bag of X;
A1: dom 0_(X,L) = Bags X by FUNCT_2:def 1;
  x in Bags X implies (Monom(a1,b) + Monom(a2,b)).x = Monom(a1+a2,b).x
  proof
    assume
A2: x in Bags X;
    then reconsider s=x as bag of X;
    per cases;
    suppose
A3:   x=b;
      thus (Monom(a1,b) + Monom(a2,b)).x =
      (Monom(a1,b).s) + (Monom(a2,b).s) by POLYNOM1:15
      .=(Monom(a1,b).s) + (a2) by A1,A2,A3,FUNCT_7:31
      .= a1 + a2 by A1,A2,A3,FUNCT_7:31
      .= Monom(a1+a2,b).x by A1,A2,A3,FUNCT_7:31;
    end;
    suppose
A4:   x<>b;
      thus ( Monom(a1,b) + Monom(a2,b)).x =
      (Monom(a1,b).s) + (Monom(a2,b).s) by POLYNOM1:15
      .=(Monom(a1,b).s) + (0_(X,L).s) by A4,FUNCT_7:32
      .=(0_(X,L).s) + (0_(X,L).s) by A4,FUNCT_7:32
      .=(0_(X,L).s) + (0.L) by POLYNOM1:22
      .=(Monom(a1+a2,b).x) by A4,FUNCT_7:32;
    end;
  end;
  hence thesis;
end;

theorem Th25:
  for L be non empty ZeroStr
    for b be bag of X holds Monom(0.L,b) = 0_(X,L)
proof
  let L be non empty ZeroStr,b be bag of X;
A1: dom 0_(X,L) = Bags X by FUNCT_2:def 1;
  x in Bags X implies Monom(0.L,b).x = 0_(X,L).x
  proof
    assume
A2:  x in Bags X;
    per cases;
    suppose x=b;
      hence Monom(0.L,b).x = 0.L by A1,A2,FUNCT_7:31
      .= 0_(X,L).x by A2,POLYNOM1:22;
    end;
    suppose x<>b;
      hence Monom(0.L,b).x = 0_(X,L).x by FUNCT_7:32;
    end;
  end;
  hence thesis;
end;

theorem
  for O be Ordinal, R be right_zeroed add-associative right_complementable
      right_unital distributive non trivial doubleLoopStr
    for p be Polynomial of O,R, b be bag of O
  holds Support(p - Monom(p.b,b)) = Support(p)\{b}
proof
  let O be Ordinal, R be right_zeroed add-associative right_complementable
  right_unital distributive non trivial doubleLoopStr;
  let p be Polynomial of O,R, b be bag of O;
  set M=Monom(p.b,b);
  per cases;
  suppose
A1: p.b =0.R;
    then M = 0_(O,R) by Th25;
    then
A2: p - M = p by POLYRED:4;
    not b in Support(p) by A1,POLYNOM1:def 3;
    hence thesis by A2,ZFMISC_1:57;
   end;
   suppose p.b<>0.R;
A3:  dom 0_(O,R) = Bags O by FUNCT_2:def 1;
A4:  dom p = Bags O =dom (p - M) by FUNCT_2:def 1;
     thus Support(p - M) c= Support(p)\{b}
     proof
       let x;
       assume
A5:    x in Support(p-M);
       then reconsider x as bag of O;
A6:    (p - M).x = (p+ (-M)).x by POLYNOM1:def 7
       .= (p.x) +((-M).x) by POLYNOM1:15
       .= (p.x) +(-(M.x)) by POLYNOM1:17;
A7:    x<>b
       proof
         assume x= b;
         then M.x = p.x by A5,A3,FUNCT_7:31;
         then (p.x) -(M.x) = 0.R by RLVECT_1:15;
         hence thesis by A6,A5,POLYNOM1:def 3;
       end;
       M.x = 0_(O,R).x by A7,FUNCT_7:32;
       then M.x = 0.R by POLYNOM1:22;
       then p.x <>0.R by A6,A5,POLYNOM1:def 3;
       then x in Support(p) by A4,A5,POLYNOM1:def 3;
       hence thesis by A7,ZFMISC_1:56;
     end;
     let x;
     assume
A8:  x in Support(p)\{b};
     then reconsider x as bag of O;
A9:  x in Support(p) & x<>b by A8,ZFMISC_1:56;
     M.x = 0_(O,R).x by A9,FUNCT_7:32;
     then
A10: M.x = 0.R by POLYNOM1:22;
     (p - M).x = (p+ (-M)).x by POLYNOM1:def 7
     .= (p.x) +((-M).x) by POLYNOM1:15
     .= (p.x) +(-(M.x)) by POLYNOM1:17
     .= p.x by A10;
     then (p - M).x <>0.R by A9,POLYNOM1:def 3;
     hence thesis by A8,A4,POLYNOM1:def 3;
   end;
end;

theorem Th27:
  for n be Nat, p be object st p in n
  for i be integer Element of F_Real
   for x be Function of n,F_Real holds
     eval( Monom(i,(EmptyBag n) +*(p,1)),x) = i*(x/.p)
proof
  let n be Nat, p be object such that
A1: p in n;
  let i be integer Element of F_Real;
  let x be Function of n,F_Real;
  set Ep=(EmptyBag n) +*(p,1);
  n =dom x by PARTFUN1:def 2;
  then
A2: x.p = x/.p by A1,PARTFUN1:def 6;
  eval(Ep,x) = power(F_Real).(x.p,1) by A1,Th14
  .= x/.p by A2,GROUP_1:50;
  hence thesis by POLYNOM7:13;
end;

registration
  let X be set;
  let b be bag of X;
  let i be integer Element of F_Real;
  cluster Monom(i,b) -> INT -valued;
  coherence
  proof
    set M=Monom(i,b);
    b in Bags X = dom 0_(X,F_Real) by PARTFUN1:def 2,PRE_POLY:def 12;
    then Monom(i,b) = 0_(X,F_Real) +* (b.-->i) by FUNCT_7:def 3;
    then rng Monom(i,b) c= rng 0_(X,F_Real) \/ rng (b.-->i) by FUNCT_4:17;
    then rng Monom(i,b) c= INT by INT_1:def 2;
    hence thesis by RELAT_1:def 19;
  end;
end;

begin :: Power of Multivariate Polynomial

reserve O for Ordinal,
        R for right_zeroed add-associative right_complementable
          right_unital distributive non trivial doubleLoopStr,
        p for Polynomial of O, R;

definition
  let n be Ordinal, R be right_zeroed add-associative right_complementable
      right_unital distributive non trivial doubleLoopStr;
  let p be Polynomial of n, R;
  let k be Nat;
  func p `^ k -> Polynomial of n,R equals
    (power Polynom-Ring (n, R)) . (p,k);
  coherence
  proof
    set PR=Polynom-Ring (n, R);
    reconsider P=p as Element of PR by POLYNOM1:def 11;
    (power PR) . (P,k) in the carrier of PR;
    hence thesis by POLYNOM1:def 11;
  end;
end;

theorem Th28:
  R is well-unital implies p `^ 0 = 1_(O,R) & p `^ 1 = p
proof
  set PR=Polynom-Ring (O, R);
  reconsider P=p as Element of PR by POLYNOM1:def 11;
  reconsider E=1_(O,R) as Element of PR by POLYNOM1:def 11;
  assume
A1: R is well-unital;
A2: for H being Element of PR holds H * E = H & E * H = H
  proof
    let H be Element of PR;
    reconsider h=H as Polynomial of O, R by POLYNOM1:def 11;
    h *' 1_(O,R) = h = 1_(O,R) *' h by A1,POLYNOM1:29,30;
    hence thesis by POLYNOM1:def 11;
  end;
A3: PR is unital
  proof
    take E;
    thus thesis by A2;
  end;
  then 1_PR = E by A2,GROUP_1:def 4;
  then (power PR).(P,0) = E by GROUP_1:def 7;
  hence thesis by A3,GROUP_1:50;
end;

theorem Th29:
  p `^ (n+1) = (p `^ n) *' p
proof
  set PR=Polynom-Ring (O, R);
  reconsider P=p as Element of PR by POLYNOM1:def 11;
  thus p `^ (n+1) = (power PR) . (P,n) * P by GROUP_1:def 7
  .= (p `^ n) *' p by POLYNOM1:def 11;
end;

theorem Th30:
  for R be Abelian well-unital commutative
      associative right_zeroed add-associative right_complementable
      right_unital distributive non trivial doubleLoopStr
  for p be Polynomial of O, R, f be Function of O, R holds
     eval(p`^k,f) = (power R).( eval(p,f), k)
proof
  let R be Abelian well-unital commutative
      associative right_zeroed add-associative right_complementable
      right_unital distributive non trivial doubleLoopStr;
  let p be Polynomial of O, R, f be Function of O, R;
  defpred P[Nat] means  eval(p`^$1,f) = (power R).( eval(p,f), $1);
   eval(p`^0,f) = eval(1_(O,R),f) by Th28
   .= 1_R by POLYNOM2:21
   .= (power R).( eval(p,f), 0) by GROUP_1:def 7;
   then
A1: P[0];
A2: P[n] implies P[n+1]
   proof
     assume
A3:  P[n];
     thus eval(p`^(n+1),f) = eval((p`^n) *' p ,f) by Th29
     .= (power R).( eval(p,f), n) *eval(p,f) by A3,POLYNOM2:25
     .= (power R).( eval(p,f), n+1) by GROUP_1:def 7;
   end;
   P[n] from NAT_1:sch 2(A1,A2);
   hence thesis;
end;

registration
  let O be Ordinal;
  let p be INT -valued Polynomial of O, F_Real;
  let n be Nat;
  cluster p `^ n -> INT -valued;
  coherence
  proof
    defpred P[Nat] means p `^ $1 is INT -valued;
    1_(O,F_Real) is INT -valued;
    then
A1: P[0] by Th28;
A2: P[i] implies P[i+1]
    proof
      assume
A3:   P[i];
      p `^ (i+1) = (p `^ i) *' p by Th29;
      hence thesis by A3;
    end;
    P[i] from NAT_1:sch 2(A1,A2);
    hence thesis;
  end;
end;

begin :: Substitution in Multivariate Polynomials

definition
  let X be set;
  let b,s be bag of X;
  let x be object;
  func Subst(b,x,s) -> bag of X equals
    b+*(x,0) + s;
  coherence;
end;

theorem
  support Subst(b,x,s) = support b\{x} \/ support s
proof
  support Subst(b,x,s) = support (b+*(x,0)) \/ support s by PRE_POLY:38;
  hence thesis by Th16;
end;

theorem Th32:
  for s1,s2,b be bag of X st
    Subst(b,x,s1) = Subst(b,x,s2) holds s1 = s2
proof
  let s1,s2,b be bag of X such that
A1: Subst(b,x,s1) = Subst(b,x,s2);
A2:dom s1 = X = dom s2 by PARTFUN1:def 2;
  for y be object st y in dom s1 holds s1.y = s2.y
  proof
    let y be object such that
A3: y in dom s1;
A4: dom Subst(b,x,s1) = X = dom Subst(b,x,s2) by PARTFUN1:def 2;
    (b+*(x,0)).y + s2.y = Subst(b,x,s2).y by A3,A4,VALUED_1:def 1
    .= (b+*(x,0)).y + s1.y by A1,A3,A4,VALUED_1:def 1;
    hence thesis;
  end;
  hence thesis by A2;
end;

definition
  let X be Ordinal, L be right_zeroed add-associative right_complementable
      right_unital distributive non trivial doubleLoopStr;
  let t be bag of X;
  let p be Polynomial of X, L;
  let x be object;
  func Subst(t,x,p) -> Series of X, L means :Def3:
     for b be bag of X holds
       ((ex s be bag of X st b = Subst(t,x,s)) implies
          for s be bag of X st b = Subst(t,x,s) holds
         it.b = (p `^ (t.x) ).s) &
       ((for s be bag of X holds b <> Subst(t,x,s)) implies it.b = 0.L);
  existence
  proof
    set P=p `^ (t.x);
    defpred P[Element of Bags X, Element of L] means
    ((ex s be bag of X st $1 = Subst(t,x,s)) implies
    (for s be bag of X st $1 = Subst(t,x,s) holds $2 = P.s)) &
    ((for s be bag of X holds $1 <>Subst(t,x,s)) implies $2 = 0.L);
A1: for x being Element of Bags X ex y being Element of L st P[x,y]
    proof
      let b be Element of Bags X;
      per cases;
      suppose ex s be bag of X st b = Subst(t,x,s);
        then consider s be bag of X such that
A2:     b = Subst(t,x,s);
        take M= P.s;
        thus thesis by A2,Th32;
      end;
      suppose
A3:     for s be bag of X holds b <>Subst(t,x,s);
        take 0.L;
        thus thesis by A3;
      end;
    end;
    consider S being Function of Bags X,L such that
A4:  for x being Element of Bags X holds P[x,S.x] from FUNCT_2:sch 3(A1);
    take S;
    let b be bag of X;
    reconsider bb=b as Element of Bags X by PRE_POLY:def 12;
    thus (ex s be bag of X st b = Subst(t,x,s)) implies
    for s be bag of X st b = Subst(t,x,s) holds S.b = P.s
    proof
      assume ex s be bag of X st b = Subst(t,x,s);
      let s be bag of X;assume b = Subst(t,x,s);
      then S.bb = P.s by A4;
      hence thesis;
    end;
    P[bb,S.bb] by A4;
    hence (for s be bag of X holds b <>Subst(t,x,s)) implies S.b = 0.L;
  end;
  uniqueness
  proof
    let S1,S2 be Series of X, L;
    set P=p `^ (t.x);
    assume that
A5: for b be bag of X holds
    ((ex s be bag of X st b = Subst(t,x,s)) implies
    for s be bag of X st b = Subst(t,x,s) holds S1.b = P.s) &
    ((for s be bag of X holds b <>Subst(t,x,s)) implies S1.b = 0.L) and
A6: for b be bag of X holds
    ((ex s be bag of X st b = Subst(t,x,s)) implies
    for s be bag of X st b = Subst(t,x,s) holds S2.b = P.s) &
    ((for s be bag of X holds b <>Subst(t,x,s)) implies S2.b = 0.L);
    for x st x in Bags X holds S1.x = S2.x
    proof
      let b be object such that
A7:   b in Bags X;
      reconsider b as Element of Bags X by A7;
      per cases;
      suppose ex s be bag of X st b = Subst(t,x,s);
        then consider s be bag of X such that A8: b = Subst(t,x,s);
        S1.b = P.s = S2.b by A8,A5,A6;
        hence thesis;
      end;
      suppose  for s be bag of X holds b <>Subst(t,x,s);
        then S1.b = 0.L = S2.b by A5,A6;
        hence thesis;
       end;
     end;
     hence thesis;
   end;
end;

reserve O for Ordinal,
        R for right_zeroed add-associative right_complementable
             right_unital distributive non trivial doubleLoopStr,
        p for Polynomial of O, R;

theorem Th33:
  for t,s be bag of O holds
    Subst(t,x,p).Subst(t,x,s) = (p `^ (t.x) ).s by Def3;

theorem Th34:
  for t be bag of O
    for ordP be one-to-one FinSequence of Bags O st
      rng ordP = Support (p `^ (t.x))
      ex ordS be one-to-one FinSequence of Bags O st
        rng ordS = Support Subst(t,x,p) &
        len ordS = len ordP  &
        for j st 1 <= j <= len ordS holds ordS.j = Subst(t,x,ordP/.j)
proof
  let t be bag of O; set S = Subst(t,x,p), P=p `^ (t.x);
  let ordP be one-to-one FinSequence of Bags O such that
A1: rng ordP = Support P;
  deffunc O(object) = Subst(t,x,ordP/.$1);
  consider ordS be FinSequence such that
A2: len ordS = len ordP and
A3: for k st k in dom ordS holds ordS.k=O(k) from FINSEQ_1:sch 2;
A4: dom ordS = dom ordP by A2,FINSEQ_3:29;
A5: dom S = Bags O =dom P by FUNCT_2:def 1;
A6: rng ordS c= Support S
  proof
    let y be object;
    assume y in rng ordS;
    then consider z be object such that
A7: z in dom ordS & ordS.z = y by FUNCT_1:def 3;
    reconsider z as Nat by A7;
A8: ordS.z=O(z) by A7,A3;
    ordP/.z = ordP.z in rng ordP by A7,A4,FUNCT_1:def 3,PARTFUN1:def 6;
    then
A9:  P. (ordP/.z)<>0.R by POLYNOM1:def 3,A1;
A10: O(z) in Bags O by PRE_POLY:def 12;
    S. O(z) = P. (ordP/.z) by Th33;
    hence thesis by A8,A7,A9,A5,A10,POLYNOM1:def 3;
  end;
  then reconsider ordS as FinSequence of Bags O by FINSEQ_1:def 4,XBOOLE_1:1;
A11: Support S c= rng ordS
  proof
    let y be object such that
A12:y in Support S;
    reconsider y as bag of O by A12;
A13: S.y <>0.R by A12,POLYNOM1:def 3;
    then consider s be bag of O such that
A14: y = Subst(t,x,s) by Def3;
A15: s in dom P by A5,PRE_POLY:def 12;
    S.y = P.s by A14,Th33;
    then s in Support P by A13,A15,POLYNOM1:def 3;
    then consider i be object such that
A16:  i in dom ordP & ordP.i = s by A1,FUNCT_1:def 3;
    reconsider i as Nat by A16;
    ordP/.i= s by A16,PARTFUN1:def 6;
    then ordS.i = y by A14,A3,A16,A4;
    hence thesis by A16,A4,FUNCT_1:def 3;
  end;
  ordS is one-to-one
  proof
    let x1,x2 be object such that
A17:x1 in dom ordS & x2 in dom ordS & ordS.x1 = ordS.x2;
    ordS.x1 = O(x1) & ordS.x2 = O(x2) by A3,A17;
    then ordP.x1=ordP/.x1 = ordP/.x2 =ordP.x2 by A4,PARTFUN1:def 6, Th32,A17;
    hence thesis by A17,A4,FUNCT_1:def 4;
  end;
  then reconsider ordS as one-to-one FinSequence of Bags O;
  take ordS;
  thus rng ordS = Support Subst(t,x,p) & len ordS = len ordP
    by A2,A6,A11,XBOOLE_0:def 10;
  thus thesis by A3,FINSEQ_3:25;
end;

registration
  let O be Ordinal, R be right_zeroed add-associative right_complementable
      right_unital distributive non trivial doubleLoopStr;
  let t be bag of O;
  let p be Polynomial of O, R;
  let x be object;
  cluster Subst(t,x,p) -> finite-Support;
  coherence
  proof
    set S = Subst(t,x,p),P=p `^ (t.x);
    reconsider SP=Support P as finite  set by POLYNOM1:def 5;
    set ordP = canFS SP;
A1: rng ordP = Support P by FUNCT_2:def 3;
    then reconsider ordP as FinSequence of Bags O by FINSEQ_1:def 4;
    deffunc O(object) = Subst(t,x,ordP/.$1);
    consider ordS be FinSequence such that
A2: len ordS = len ordP and
A3: for k st k in dom ordS holds ordS.k=O(k) from FINSEQ_1:sch 2;
A4: dom ordS = dom ordP by A2,FINSEQ_3:29;
A5: dom S = Bags O =dom P by FUNCT_2:def 1;
    Support S c= rng ordS
    proof
      let y be object such that
A6:   y in Support S;
      reconsider y as bag of O by A6;
A7:   S.y <>0.R by A6,POLYNOM1:def 3;
      then consider s be bag of O such that
A8:    y = Subst(t,x,s) by Def3;
A9:   s in dom P by A5,PRE_POLY:def 12;
      P.s<>0.R by A7,A8,Th33;
      then s in Support P by A9,POLYNOM1:def 3;
      then consider i be object such that
A10:  i in dom ordP & ordP.i = s by A1,FUNCT_1:def 3;
      reconsider i as Nat by A10;
      ordP/.i= s by A10,PARTFUN1:def 6;
      then
      ordS.i = Subst(t,x,s) by A3,A10,A4;
      hence thesis by A8,A10,A4,FUNCT_1:def 3;
    end;
    hence thesis by POLYNOM1:def 5;
  end;
end;

theorem Th35:
  for R be commutative associative
           Abelian right_zeroed add-associative right_complementable
           well-unital distributive non trivial doubleLoopStr
    for t be bag of O, p be Polynomial of O, R, i be object
      for x being Function of O, R st i in O holds
    eval(Subst(t,i,p),x) = eval(t, x+*(i,eval(p,x)))
proof
  let R be commutative associative
        Abelian right_zeroed add-associative right_complementable
        well-unital distributive non trivial doubleLoopStr;
  let t be bag of O, p be Polynomial of O, R, i be object;
  let x be Function of O, R such that
A1:i in O;
  set xE = x+*(i,eval(p,x));
  set P = p `^ (t.i), t0= t+*(i,0);
  set SS=SgmX(BagOrder O, Support P);
  set Smp = Subst(t,i,p);
  consider y be FinSequence of R such that
A2:  len y = len SS & eval(P,x) = Sum y and
A3:  for i be Element of NAT st 1 <= i & i <= len y holds
  y/.i = (P * SS)/.i * eval(SS/.i,x) by POLYNOM2:def 4;
  BagOrder O linearly_orders  Support P by POLYNOM2:18;
  then
A4: rng SS = Support P by PRE_POLY:def 2;
A5: SS is one-to-one by POLYNOM2:18,PRE_POLY:10;
  consider tran be one-to-one FinSequence of Bags O such that
A6:  rng tran = Support Smp and
A7:  len tran = len SS and
A8:  for j st 1 <= j <= len tran holds tran.j = Subst(t,i,SS/.j) by A4,A5,Th34;
A9: len tran = card Support Smp by A6,FINSEQ_4:62;
A10:card Support Smp = len SS by A6,FINSEQ_4:62,A7;
  consider Y be FinSequence of R such that
A11:len Y = card Support Smp & eval(Smp,x) = Sum Y and
A12:  for i being Nat st 1 <= i & i <= len Y holds
  Y/.i = (Smp * tran)/.i * eval(tran/.i,x) by A6,HILB10_2:24;
A13:dom (y * (eval(t0,x) )) = dom y by POLYNOM1:def 2;
  then
A14: len (y * (eval(t0,x))) = len y by FINSEQ_3:29;
A15: eval(P ,x) = (power R).( eval(p,x), (t.i)) by Th30;
  for j st 1 <= j & j <= len Y holds Y. j = (y * (eval(t0,x) )).j
  proof
    let j such that
A16:1 <= j & j <= len Y;
A17: j in NAT by ORDINAL1:def 12;
A18: len Y = len tran = len SS =len y by A2,A11,A6,FINSEQ_4:62,A7;
A19: rng tran c= Bags O by RELAT_1:def 19;
    dom P = Bags O =dom Smp by FUNCT_2:def 1;
    then
A20: dom (P * SS) = dom SS & dom (Smp * tran)= dom tran
      by A19,A4,RELAT_1:27;
A21: j in dom tran & j in dom SS & j in dom y & j in dom Y
      by A16,A2,A11,A7,A9,FINSEQ_3:25;
    then
A22:  tran/.j = tran.j = Subst(t,i,SS/.j) by A16,A8,A11,A9,PARTFUN1:def 6;
A23: (P * SS)/.j = (P * SS).j by A20,A16,A11,A10,FINSEQ_3:25,PARTFUN1:def 6
    .= P.(SS.j) by A20,A16,A11,A10,FINSEQ_3:25,FUNCT_1:12
    .= P.(SS/.j) by A21,PARTFUN1:def 6;
A24: (Smp * tran)/.j = (Smp * tran).j
    by A16,A11,A9,FINSEQ_3:25,A20,PARTFUN1:def 6
    .= Smp.(tran.j) by A16,A11,A9,FINSEQ_3:25,A20,FUNCT_1:12
    .= (P * SS)/.j by A23,Th33,A22;
    Y.j = Y/.j = (Smp * tran)/.j * eval(tran/.j,x)
      by A16,A12,A21,PARTFUN1:def 6;
    hence Y.j = ((P * SS)/.j * (eval(t0,x) * eval(SS/.j,x)))
      by A22,A24,POLYNOM2:16
    .= (((P * SS)/.j * eval(SS/.j,x)) *eval(t0,x)) by GROUP_1:def 3
    .= ((y/.j) *eval(t0,x)) by A17,A3,A18,A16
    .= (y * (eval(t0,x)))/.j by A21,POLYNOM1:def 2
    .= (y * (eval(t0,x))).j by A13,A16,A2,A11,A7,A9
    ,FINSEQ_3:25,PARTFUN1:def 6;
  end;
  then
A25: Y = (y * (eval(t0,x))) by A14,A2,A11,A6,FINSEQ_4:62,A7,FINSEQ_1:14;
  dom t= O by PARTFUN1:def 2;
  then
A26: t0.i = 0 by A1,FUNCT_7:31;
  dom x = O = dom xE by PARTFUN1:def 2;
  then
A27: xE/.i= xE.i = eval(p,x) by A1,FUNCT_7:31,PARTFUN1:def 6;
  (power R).(xE/.i, 0) = 1_R = 1.R by GROUP_1:def 7;
  then eval (t0,xE) * (power R).(xE/.i, t.i) = eval (t,xE)* 1.R by A1,Th17;
  hence eval (t,xE)=(power R).(eval(p,x), t.i) * eval(t0,x) by A26,Th18,A27
  .= eval(Smp,x) by A25,A15,A2,A11,POLYNOM1:13;
end;

registration
  let X be set, L be add-associative right_zeroed right_complementable
    right-distributive non empty doubleLoopStr,
    p be finite-Support Series of X,L, a be Element of L;
  cluster a * p -> finite-Support;
  coherence
  proof
    set ap = a * p;
A1: Support p is finite by POLYNOM1:def 5;
    Support ap c= Support p
    proof
      let u be object;
      assume that
A2:   u in Support ap  & not u in Support p;
A3:   dom ap = Bags X =dom p by FUNCT_2:def 1;
      reconsider u as bag of X by A2;
A4:   a*(p.u) = ap.u <> 0.L & u in dom p
      by A3,A2,POLYNOM1:def 3,POLYNOM7:def 9;
      p.u=0.L by A2,POLYNOM1:def 3,A3;
      hence thesis by A4;
    end;
    hence thesis by A1,POLYNOM1:def 5;
  end;
end;

definition
  let X be Ordinal, L be right_zeroed add-associative right_complementable
      right_unital well-unital distributive non trivial doubleLoopStr;
  let p,s be Polynomial of X, L;
  let x be object;
  func Subst(p,x,s) -> Polynomial  of X, L means :Def4:
   ex S be FinSequence of Polynom-Ring (X, L) st
     it = Sum S & len SgmX(BagOrder X, Support p) = len S &
   for i st i in dom S holds
     S.i = p.(SgmX(BagOrder X, Support p)/.i) *
                Subst(SgmX(BagOrder X, Support p)/.i,x, s);
  existence
  proof
    set B = SgmX(BagOrder X, Support p);
    deffunc S(object) = p.(B/.$1) * Subst(B/.$1,x, s);
    consider S be FinSequence such that
A1: len S = len B & for k st k in dom S holds S.k=S(k) from FINSEQ_1:sch 2;
    rng S c= the carrier of Polynom-Ring (X, L)
    proof
      let x;
      assume x in rng S;
      then consider k be object such that
A2:     k in dom S & S.k= x by FUNCT_1:def 3;
      x = S(k) by A2,A1;
      hence thesis by POLYNOM1:def 11;
    end;
    then reconsider S as FinSequence of Polynom-Ring (X, L) by FINSEQ_1:def 4;
    reconsider H=Sum S as Polynomial  of X, L by POLYNOM1:def 11;
    take H,S;
    thus thesis by A1;
  end;
  uniqueness
  proof
    set B= SgmX(BagOrder X, Support p);
    let P1,P2 be Polynomial  of X, L;
    given S1 be FinSequence of Polynom-Ring (X, L) such that
A3:   P1 = Sum S1 & len B = len S1 &
    for i st i in dom S1 holds S1.i = p.(B/.i) * Subst(B/.i,x, s);
    given S2 be FinSequence of Polynom-Ring (X, L) such that
A4:   P2 = Sum S2 & len B = len S2 &
    for i st i in dom S2 holds S2.i = p.(B/.i) * Subst(B/.i,x, s);
A5: dom S1= dom S2 by A3,A4,FINSEQ_3:29;
    for i st i in dom S1 holds S1.i = S2.i
    proof
      let i such that
A6:   i in dom S1;
      S1.i = p.(B/.i) * Subst(B/.i,x, s) = S2.i by A6,A3,A4,A5;
      hence thesis;
    end;
    hence thesis by A3,A4,FINSEQ_3:29,FINSEQ_1:13;
  end;
end;

registration
  let O be Ordinal;
  let t be bag of O;
  let p be INT -valued Polynomial of O, F_Real;
  let x be object;
  cluster Subst(t,x,p) -> INT -valued;
  coherence
  proof
    rng Subst(t,x,p) c= INT
    proof
      let y be object such that
A1:   y in rng Subst(t,x,p);
      consider b be object such that
A2:   b in dom Subst(t,x,p) & Subst(t,x,p).b = y by A1,FUNCT_1:def 3;
      reconsider b as bag of O by A2;
      per cases;
      suppose y = 0.F_Real;
        hence thesis by INT_1:def 2;
      end;
      suppose y <> 0.F_Real;
        then consider s be bag of O such that
A3:     b = Subst(t,x,s) by A2,Def3;
        y = (p `^ (t.x) ).s by Def3,A2,A3;
        hence thesis by INT_1:def 2;
      end;
    end;
    hence thesis by RELAT_1:def 19;
  end;
end;

registration
  let O be Ordinal;
  let p,s be INT -valued Polynomial of O, F_Real;
  let x be object;
  cluster Subst(p,x,s) -> INT -valued;
  coherence
  proof
    set SGM=SgmX(BagOrder O, Support p), PR=Polynom-Ring (O, F_Real);
    consider S be FinSequence of PR such that
A1: Subst(p,x,s) = Sum S & len SGM = len S and
A2: for i st i in dom S holds
    S.i = p.(SGM/.i) * Subst(SGM/.i,x, s) by Def4;
    defpred P[Nat] means for w be Polynomial of O, F_Real st
    $1 <= len S &w = Sum(S|$1) holds w is INT -valued;
A3: P[0]
    proof
      reconsider Z=0 as Nat;
      let w be Polynomial of O, F_Real;
      S|Z = <*>(the carrier of PR);
      then Sum(S|Z) = 0.PR by RLVECT_1:43
      .= 0_(O,F_Real) by POLYNOM1:def 11;
      hence thesis;
    end;
A4: P[i] implies P[i+1]
    proof
      assume
A5:   P[i];
      set i1=i+1;
      let w be Polynomial of O, F_Real such that
A6:   i1 <= len S & w = Sum(S|i1);
A7:   i < len S by A6,NAT_1:13;
A8:   i1 in dom S by A6,FINSEQ_3:25,NAT_1:11;
      S.i1 = p.(SGM/.i1) * Subst(SGM/.i1,x, s) by A8,A2;
      then reconsider Si1 = S/.i1 as INT -valued Polynomial of O, F_Real
      by A8,PARTFUN1:def 6;
      reconsider SU=Sum (S|i) as Polynomial of O, F_Real by POLYNOM1:def 11;
A9:   SU is INT -valued by A5,A7;
      S|i1 = S|i^<*S/.i1*> by A6,FINSEQ_5:82;
      then w = Sum (S|i) + Sum <*S/.i1*> by A6,RLVECT_1:41
      .= Sum (S|i) + S/.i1 by RLVECT_1:44
      .= SU + Si1 by POLYNOM1:def 11;
      hence thesis by A9;
    end;
    P[i] from NAT_1:sch 2(A3,A4);
    then P[len S];
    hence thesis by A1;
  end;
end;

theorem Th36:
  for O be Ordinal, L be right_zeroed add-associative
    right_complementable Abelian well-unital distributive non trivial
    doubleLoopStr,
    p be Polynomial of O,L,
    x be Function of  O,L
  for P be FinSequence of Polynom-Ring (O, L) st p = Sum P
    for E be FinSequence of L st len E = len P &
      for s be Polynomial of O,L,i st i in dom E & s = P.i holds E.i=eval(s,x)
    holds eval(p,x) = Sum E
proof
  let O be Ordinal, L be right_zeroed add-associative
  right_complementable Abelian well-unital distributive non trivial
  doubleLoopStr, p be Polynomial of O,L, x be Function of  O,L;
  set PR=Polynom-Ring (O, L);
  let P be FinSequence of PR such that
A1: p = Sum P;
  let E be FinSequence of the carrier of L such that
A2:len E = len P &
  for s be Polynomial of O,L,i st i in dom E & s = P.i
  holds E.i=eval(s,x);
  defpred P[Nat] means for i be Nat st $1=i & i <= len P holds
  for q be Polynomial of O,L st q = Sum (P|i) holds Sum (E|i) = eval(q,x);
A3: P[0]
  proof
    let i be Nat;
    assume
A4: 0=i & i<=len P;
    let q be Polynomial of O,L such that
A5: q = Sum (P | i);
    P | i = <*>(the carrier of PR) by A4;
    then q = 0.PR by A5,RLVECT_1:43
    .= 0_(O,L) by POLYNOM1:def 11;
    then
A6: eval(q,x) = 0.L by POLYNOM2:20;
    E|0 =<*>(the carrier of L);
    hence thesis by A4,A6,RLVECT_1:43;
  end;
  A7: P[n] implies P[n+1]
  proof
    assume
A8: P[n];
    let n1 be Nat such that
A9: n1=n+1 & n1 <= len P;
    let q be Polynomial of O,L such that
A10:q = Sum (P | n1);
    reconsider q1 = Sum(P|n), Pn1 = P/.n1 as Polynomial of O,L
    by POLYNOM1:def 11;
A11:n1 in dom P & n1 in dom E by A2,A9,FINSEQ_3:25,NAT_1:11;
    then
A12: P|n1 = (P|n)^<*P.n1*> & P.n1 =P/.n1 & E|n1 = (E|n)^<*E.n1*>
    by A9,FINSEQ_5:10,PARTFUN1:def 6;
    then
A13: q = Sum(P|n) + Sum(<*P/.n1*>) by A10,RLVECT_1:41
    .= Sum(P|n) + P/.n1 by RLVECT_1:44
    .= q1+ Pn1 by POLYNOM1:def 11;
A14: n < len P by NAT_1:13,A9;
    E.n1 = eval(Pn1,x) by A11,A12,A2;
    hence Sum (E|n1) = Sum(E|n) +Sum <*eval(Pn1,x)*> by A12,RLVECT_1:41
    .= Sum(E|n) + eval(Pn1,x) by RLVECT_1:44
    .= eval(q1,x) + eval(Pn1,x) by A14,A8
    .= eval(q,x) by A13,POLYNOM2:23;
  end;
A15: P | len P = P;
  P[n] from NAT_1:sch 2(A3,A7);
  then Sum (E|len E) = eval(p,x) by A1,A2,A15;
  hence thesis;
end;

theorem Th37:
  for R be commutative associative
           Abelian right_zeroed add-associative right_complementable
           well-unital distributive non trivial doubleLoopStr
    for p, s be Polynomial of O, R, i be object
      for x be Function of O, R st i in O holds
    eval(Subst(p,i,s),x) = eval(p, x+*(i,eval(s,x)))
proof
  let R be commutative associative
           Abelian right_zeroed add-associative right_complementable
           well-unital distributive non trivial doubleLoopStr;
  let p,s be Polynomial of O, R, i be object;
  let  x be Function of O, R such that
A1: i in O;
  set Sub = Subst(p,i,s), xE=x +* (i,eval(s,x)), B=SgmX(BagOrder O, Support p);
  consider f be FinSequence of R such that
A2: len f = len B & eval(p,xE) = Sum f and
A3:  for j be Element of NAT st 1 <= j & j <= len f holds
  f/.j = (p * B)/.j * eval(B/.j,xE) by POLYNOM2:def 4;
  consider S be FinSequence of Polynom-Ring (O, R) such that
A4:Subst(p,i,s) = Sum S & len B = len S and
A5: for j st j in dom S holds S.j = p.(B/.j) * Subst(B/.j,i, s) by Def4;
  for q be Polynomial of O,R,j st j in dom f & q = S.j holds f.j=eval(q,x)
  proof
    let q be Polynomial of O,R,j such that
A6: j in dom f & q = S.j;
A7: dom f = dom S =dom B by A2,A4,FINSEQ_3:29;
    then S.j = p.(B/.j) * Subst(B/.j,i, s) by A6,A5;
    then
A8: eval (q,x) = p.(B/.j) * eval (Subst(B/.j,i, s),x) by A6,POLYNOM7:29
    .= p.(B/.j) * eval (B/.j,xE) by Th35,A1;
    BagOrder O linearly_orders Support p by POLYNOM2:18;
    then
A9: rng B = Support p by PRE_POLY:def 2;
    dom p = Bags O by FUNCT_2:def 1;
    then dom (p * B) = dom B by A9,RELAT_1:27;
    then
A10:(p * B)/.j =(p * B).j = p.(B.j) & B/.j = B.j
    by A6,A7,PARTFUN1:def 6,FUNCT_1:13;
    1<=j & j <= len f & j in NAT by A6,FINSEQ_3:25;
    then f.j = f/.j = (p * B)/.j * eval(B/.j,xE) by A3,A6,PARTFUN1:def 6;
    hence thesis by A8,A10;
  end;
  hence thesis by A4,Th36,A2;
end;

begin :: Set of Variables Used in Multivariate Polynomial

definition
  let X be set, S be ZeroStr;
  let p be Series of X,S;
  func vars p -> Subset of X means :Def5:
    for x be object holds
      x in it iff ex b be bag of X st b in Support p & b.x <> 0;
  existence
  proof
    set V = {x where x is Element of X:
    ex b be bag of X st b in Support p & b.x <> 0};
    V c= X
    proof
      let y be object;
      assume y in V;
      then consider x be Element of X such that
A1:   x=y & ex b be bag of X st b in Support p & b.x <> 0;
      consider b be bag of X such that
A2:   b in Support p & b.x <> 0 by A1;
      x in dom b = X by A2,FUNCT_1:def 2,PARTFUN1:def 2;
      hence thesis by A1;
    end;
    then reconsider V as Subset of X;
    take V;
    let y be object;
    thus y in V implies ex b be bag of X st b in Support p & b.y <> 0
    proof
      assume y in V;
      then ex x be Element of X st
      y=x & ex b be bag of X st b in Support p & b.x <> 0;
      hence thesis;
    end;
    given b be bag of X such that
A3: b in Support p & b.y <> 0;
    y in dom b = X by A3,FUNCT_1:def 2,PARTFUN1:def 2;
    hence thesis by A3;
  end;
  uniqueness
  proof
    let V1,V2 be Subset of X such that
A4: for x be object holds
      x in V1 iff ex b be bag of X st b in Support p & b.x <> 0 and
A5: for x be object holds
      x in V2 iff ex b be bag of X st b in Support p & b.x <> 0;
    now let y be object;
      y in V1 iff ex b be bag of X st b in Support p & b.y <> 0 by A4;
      hence y in V1 iff y in V2 by A5;
    end;
    hence thesis by TARSKI:2;
  end;
end;

theorem Th38:
  for X be Ordinal, S be non empty ZeroStr
    for p be Series of X,S holds
      vars p = {} iff p is Constant
proof
  let X be Ordinal, S be non empty ZeroStr;
  let p be Series of X,S;
  thus  vars p = {} implies p is Constant
  proof
    assume
A1: vars p = {};
    assume not p is Constant;
    then consider b be bag of X such that
A2: b <> EmptyBag X & p.b <> 0.S by POLYNOM7:def 7;
    b in Bags X = dom p by PARTFUN1:def 2,PRE_POLY:def 12;
    then
A3: b in Support p by A2, POLYNOM1:def 4;
    dom b = X = dom (EmptyBag X) by PARTFUN1:def 2;
    then ex x st
    x in X & (EmptyBag X).x<>b.x by A2;
    hence thesis by A1,A3,Def5;
  end;
  assume
A4:p is Constant;
  assume vars p <> {};
  then consider x such that
A5: x in vars p by XBOOLE_0:def 1;
  consider b be bag of X such that
A6: b in Support p & b.x <> 0 by A5,Def5;
  p.b <> 0.S & b <> EmptyBag X by A6,POLYNOM1:def 4;
  hence thesis by A4,POLYNOM7:def 7;
end;

theorem Th39:
  for X be set, S be ZeroStr
    for p be Series of X,S holds
        vars p = union{ support b where b is Element of Bags X:b in Support p}
proof
  let X be set, S be ZeroStr;
  let p be Series of X,S;
  set F={ support b where b is Element of Bags X:b in Support p};
  thus vars p c= union F
  proof
    let x;
    assume x in vars p;
    then consider b be bag of X such that
A1: b in Support p & b.x <> 0 by Def5;
    b in Bags X by PRE_POLY:def 12;
    then x in support b & support b in F by A1,PRE_POLY:def 7;
    hence thesis by TARSKI:def 4;
  end;
  let x;
  assume x in union F;
  then consider B be set such that
A2: x in B & B in F by TARSKI:def 4;
  consider b be  Element of Bags X such that
A3: B= support b & b in Support p by A2;
  b.x<>0 by A2,A3,PRE_POLY:def 7;
  hence thesis by A3,Def5;
end;

theorem Th40:
  for X be set, S be ZeroStr
    for p be Series of X,S, b be bag of X st b in Support p holds
       support b c= vars p
proof
  let X be set,S be ZeroStr;
  let p be Series of X,S, b be bag of X such that A1: b in Support p;
  set SS={support b where b is Element of Bags X:b in Support p};
  b in Bags X by PRE_POLY:def 12;
  then support b in SS by A1;
  then support b c= union SS by ZFMISC_1:74;
  hence thesis by Th39;
end;

registration
  let X be Ordinal, S be non empty ZeroStr;
  let p be Polynomial of X, S;
  cluster vars p -> finite;
  coherence
  proof
    deffunc P(Element of Bags X) = support $1;
A1: Support p is finite by POLYNOM1:def 5;
    set Y={ P(b) where b is Element of Bags X:b in Support p};
A2: Y is finite from FRAENKEL:sch 21(A1);
    for A be set st A in Y holds A is finite
    proof
      let A be set;
      assume A in Y;
      then ex b be Element of Bags X st A=P(b) & b in Support p;
      hence thesis;
    end;
    then union Y is finite by A2,FINSET_1:7;
    hence thesis by Th39;
  end;
end;

theorem Th41:
  for X be set, S be right_zeroed non empty addLoopStr
  for p,q be Series of X, S holds
    vars (p+q) c= vars p \/ vars q
proof
  let X be set, S be right_zeroed non empty addLoopStr;
  let p,q be Series of X, S;
  let x;
  assume x in vars (p+q);
  then consider b be bag of X such that
A1: b in Support (p+q) & b.x <> 0 by Def5;
  Support (p+q) c= (Support p) \/(Support q) by POLYNOM1:20;
  then b in (Support p) or b in (Support q) by A1,XBOOLE_0:def 3;
  then x in vars p or x in vars q by A1,Def5;
  hence thesis by XBOOLE_0:def 3;
end;

theorem Th42:
  for X be set, S be add-associative right_zeroed right_complementable
     non empty addLoopStr
  for p be Series of X, S holds
    vars p = vars -p
proof
  let X be set, S be add-associative right_zeroed right_complementable
    non empty addLoopStr;
  let p be Series of X, S;
  thus vars p c= vars -p
  proof
    let x;
    assume x in vars p;
    then consider b be bag of X such that
A1: b in Support p & b.x <> 0 by Def5;
    reconsider b as Element of Bags X by PRE_POLY:def 12;
    -(p.b) <> - 0.S = 0.S by A1,POLYNOM1:def 4;
    then (-p).b <>0.S by POLYNOM1:17;
    then b in Support (-p) by POLYNOM1:def 4;
    hence thesis by A1,Def5;
  end;
  let x;
  assume x in vars (-p);
  then consider b be bag of X such that
A2: b in Support (-p) & b.x <> 0 by Def5;
  reconsider b as Element of Bags X by PRE_POLY:def 12;
  -((-p).b) <> - 0.S = 0.S by A2,POLYNOM1:def 4;
  then (- - p).b <>0.S by POLYNOM1:17;
  then b in Support (- -p) by POLYNOM1:def 4;
  then b in Support (p) by POLYNOM1:19;
  hence thesis by A2,Def5;
end;

theorem Th43:
  for X be Ordinal, S be add-associative right_complementable right_zeroed
    right_unital distributive non empty doubleLoopStr
  for p,q be Polynomial of X, S holds
    vars (p*'q) c= vars p \/  vars q
proof
  let X be Ordinal, S be add-associative right_complementable right_zeroed
    right_unital distributive non empty doubleLoopStr;
  let p,q be Polynomial of X, S;
  let x;
  assume x in vars (p*'q);
  then consider b be bag of X such that
A1: b in Support (p*'q) & b.x <> 0 by Def5;
  reconsider b as Element of Bags X by PRE_POLY:def 12;
  consider s be FinSequence of the carrier of S such that
A2:(p*'q).b = Sum s and
A3:len s = len decomp b and
A4:for k be Element of NAT st k in dom s ex b1, b2 be bag of
  X st (decomp b)/.k = <*b1, b2*> & s/.k = (p.b1) * (q.b2)
  by POLYNOM1:def 10;
  (p*'q).b <> 0.S by A1,POLYNOM1:def 4;
  then consider k be Nat such that
A5:k in dom s and
A6:s/.k <> 0.S by A2,MATRLIN:11;
  consider b1, b2 be bag of X such that
A7:(decomp b)/.k = <*b1, b2*> and
A8:s/.k = p.b1*q.b2 by A4,A5;
A9:b1 in Bags X by PRE_POLY:def 12;
A10:b2 in Bags X by PRE_POLY:def 12;
  q.b2 <> 0.S by A6,A8;
  then
A11:b2 in Support q by A10,POLYNOM1:def 4;
  p.b1 <> 0.S by A6,A8;
  then
A12:b1 in Support p by A9,POLYNOM1:def 4;
  k in dom decomp b by A3,A5,FINSEQ_3:29;
  then consider b19, b29 be bag of X such that
A13:(decomp b)/.k = <*b19, b29*> and
A14:b = b19+b29 by PRE_POLY:68;
  b19 = b1 & b29 = b2 by A7,A13,FINSEQ_1:77;
  then b.x = b1.x+b2.x by A14,PRE_POLY:def 5;
  then b1.x <>0 or b2.x <>0 by A1;
  then x in vars p or x in vars q by A11,A12,Def5;
  hence thesis by XBOOLE_0:def 3;
end;

theorem Th44:
  for X be set, S be add-associative right_zeroed right_complementable
    right-distributive non empty doubleLoopStr
  for p be Series of X,S, a be Element of S
    holds vars (a * p) c= vars p
proof
  let X be set, S be add-associative right_zeroed right_complementable
  right-distributive non empty doubleLoopStr;
  let p be Series of X,S, a be Element of S;
  let x;
  assume x in vars (a*p);
  then consider b be bag of X such that
A1: b in Support (a*p) & b.x <> 0 by Def5;
  a * (p.b) = (a*p).b <>0.S by A1,POLYNOM1:def 3,POLYNOM7:def 9;
  then p.b <>0.S & b in Bags X = dom p
  by PRE_POLY:def 12,PARTFUN1:def 2;
  then b in Support p by POLYNOM1:def 3;
  hence thesis by A1,Def5;
end;

theorem Th45:
  for X be Ordinal, S be right_zeroed add-associative right_complementable
      right_unital distributive well-unital non trivial doubleLoopStr
  for p be Polynomial of X, S, k be Nat holds
     vars (p `^ k) c= vars p
proof
  let X be Ordinal, S be right_zeroed add-associative right_complementable
  right_unital distributive  well-unital non trivial doubleLoopStr;
  let p be Polynomial of X, S;
  defpred P[Nat] means vars (p `^ $1) c= vars p;
  p `^ 0 = 1_(X,S) by Th28;
  then vars (p `^ 0) = {} by Th38;
  then
A1: P[0] by XBOOLE_1:2;
A2:P[k] implies P[k+1]
  proof
    assume P[k];
    then
A3: vars (p `^ k) \/ vars p c= vars p \/ vars p by XBOOLE_1:9;
    p `^ (k+1) = (p `^ k) *' p by Th29;
    then vars (p `^ (k+1)) c= vars (p `^ k) \/ vars p by Th43;
    hence thesis by A3,XBOOLE_1:1;
  end;
  P[k] from NAT_1:sch 2(A1,A2);
  hence thesis;
end;

theorem Th46:
  for X be Ordinal, S be right_zeroed add-associative right_complementable
    right_unital distributive well-unital non trivial doubleLoopStr
  for p be Polynomial of X, S, t be bag of X holds
    vars Subst(t,x,p) c= (support t)\{x} \/ vars p
proof
  let X be Ordinal, S be right_zeroed add-associative right_complementable
      right_unital distributive well-unital non trivial doubleLoopStr;
  let p be Polynomial of X, S, t be bag of X;
  let y be object;
  assume y in vars Subst(t,x,p);
  then consider b be bag of X such that
A1: b in Support Subst(t,x,p) & b.y <> 0 by Def5;
A2: Subst(t,x,p).b <>0.S by A1,POLYNOM1:def 3;
  then consider s be bag of X such that
A3: b = Subst(t,x,s) by Def3;
A4: y in dom b & dom b = X =dom t by A1,FUNCT_1:def 2,PARTFUN1:def 2;
A5: s in Bags X = dom (p `^ (t.x) ) by PRE_POLY:def 12,PARTFUN1:def 2;
  b.y = (t+*(x,0)).y + s.y by A3,PRE_POLY:def 5;
  then per cases by A1;
  suppose
A6: (t+*(x,0)).y<>0;
    then
A7: y<>x by A4,FUNCT_7:31;
    then (t+*(x,0)).y = t.y by FUNCT_7:32;
    then y in support t by A6,PRE_POLY:def 7;
    then y in (support t)\{x} by A7,ZFMISC_1:56;
    hence thesis by XBOOLE_0:def 3;
  end;
  suppose
A8: s.y<>0;
    (p `^ (t.x) ).s <> 0.S by A2,A3,Def3;
    then s in Support (p `^ (t.x) ) by A5,POLYNOM1:def 4;
    then y in vars (p `^ (t.x) ) c= vars p by A8,Def5,Th45;
    hence thesis by XBOOLE_0:def 3;
  end;
end;

theorem Th47:
  for X be Ordinal, S be right_zeroed add-associative right_complementable
      right_unital distributive well-unital non trivial doubleLoopStr
  for p,s be Polynomial of X, S holds
    vars Subst(p,x,s) c= (vars p)\{x} \/ vars s
proof
  let X be Ordinal, S be right_zeroed add-associative right_complementable
      right_unital distributive well-unital non trivial doubleLoopStr;
  let p,s be Polynomial of X, S;
  set PR=Polynom-Ring (X, S);
  set SX = SgmX(BagOrder X, Support p);
  consider F be FinSequence of PR such that
A1:  Subst(p,x,s) = Sum F & len SX = len F and
A2: for i st i in dom F holds
  F.i = p.(SX/.i) * Subst(SX/.i,x, s) by Def4;
  defpred P[Nat] means for i be Nat st i=$1 & i <= len F
  for q be Polynomial of X,S st q = Sum (F|i) holds
  vars q c= (vars p)\{x} \/ vars s;
A3: P[0]
  proof
    let i be Nat such that
A4: i=0 & i <= len F;
    let q be Polynomial of X,S such that A5: q = Sum (F|i);
    F | i = <*>(the carrier of PR) by A4;
    then q = 0.PR by A5,RLVECT_1:43
    .= 0_(X,S) by POLYNOM1:def 11;
    hence thesis by Th38;
  end;
A6: P[n] implies P[n+1]
  proof
    assume
A7: P[n];
    let n1 be Nat such that
A8: n1=n+1 & n1 <= len F;
    let q be Polynomial of X,S such that
A9: q = Sum (F | n1);
    reconsider q1 = Sum(F|n), Fn1 = F/.n1 as Polynomial of X,S
    by POLYNOM1:def 11;
A10:n1 in dom F & n1 in dom SX by A1,A8,FINSEQ_3:25,NAT_1:11;
    then
A11:F|n1 = (F|n)^<*F.n1*> & F.n1 =F/.n1 & SX.n1 =SX/.n1
    by A8,FINSEQ_5:10,PARTFUN1:def 6;
    then q = Sum(F|n) + Sum(<*F/.n1*>) by A9,RLVECT_1:41
    .= Sum(F|n) + F/.n1 by RLVECT_1:44
    .= q1+ Fn1 by POLYNOM1:def 11;
    then
A12: vars q c= vars q1 \/ vars Fn1 by Th41;
    n < len F by NAT_1:13,A8;
    then
A13: vars q1 c= (vars p)\{x} \/ vars s by A7;
    Fn1 = p.(SgmX(BagOrder X, Support p)/.n1) *
    Subst(SgmX(BagOrder X, Support p)/.n1,x, s) by A11,A2,A10;
    then
A14: vars Fn1 c= vars Subst(SX/.n1,x, s) by Th44;
A15: vars Subst(SX/.n1,x, s) c=
    (support SX/.n1)\{x} \/ vars s by Th46;
    BagOrder X linearly_orders  Support p by POLYNOM2:18;
    then SX/.n1 in rng SX = Support p by A10,A11,PRE_POLY:def 2,FUNCT_1:def 3;
    then (support SX/.n1)\{x} c= vars p\{x} by Th40,XBOOLE_1:33;
    then (support SX/.n1)\{x} \/ vars s c= (vars p)\{x} \/ vars s
    by XBOOLE_1:9;
    then vars Fn1 c= (vars p)\{x} \/ vars s by A14,A15;
    then vars q1 \/ vars Fn1 c= (vars p)\{x} \/ vars s by A13,XBOOLE_1:8;
    hence thesis by A12;
  end;
A16: P[n] from NAT_1:sch 2(A3,A6);
  F|len F=F;
  hence thesis by A1,A16;
end;

theorem Th48:
  for X be set, S be non empty ZeroStr
    for s be Element of S holds vars Monom(s,(EmptyBag X) +*(x,n)) c= {x}
proof
  let X be set, S be non empty ZeroStr;
  let s be Element of S;
  set EX=(EmptyBag X) +*(x,n);
  let y be object;
  assume y in vars Monom(s,EX);
  then consider b be bag of X such that
A1: b in Support Monom(s,EX) & b.y <> 0 by Def5;
  assume not y in {x};
  then
A2: y <>x by TARSKI:def 1;
  Support Monom(s,EX) = {term(Monom(s,EX))} by A1,POLYNOM7:7;
  then
A3: b = term(Monom(s,EX)) by TARSKI:def 1,A1;
  coefficient Monom(s,EX)<>0.S by A1,POLYNOM7:def 5;
  then s<>0.S by POLYNOM7:8;
  then s is non zero & S is non trivial ZeroStr by STRUCT_0:def 12,def 18;
  then b=EX by A3,POLYNOM7:10;
  then b.y = (EmptyBag X).y by A2,FUNCT_7:32;
  hence thesis by A1;
end;

begin :: Polynomial Without the Last Variable

definition
  let n be Nat;
  let L be non empty ZeroStr;
  let p be Series of n+1,L;
  func p removed_last -> Series of n,L means :Def6:
    for b be bag of n holds it.b = p.(b bag_extend 0);
  existence
  proof
    defpred P[Element of Bags n, Element of L] means
    $2=p.($1 bag_extend 0);
A1: for x being Element of Bags n ex y being Element of L st P[x,y];
    consider f be Function of Bags n,L such that
A2: for x be Element of Bags n holds P[x,f.x] from FUNCT_2:sch 3(A1);
    take f;
    let b be bag of n;
    b is Element of Bags n by PRE_POLY:def 12;
    hence thesis by A2;
  end;
  uniqueness
  proof
    let r1,r2 be Series of n,L such that
A3: for b being bag of n holds r1.b = p.(b bag_extend 0)and
A4: for b being bag of n holds r2.b = p.(b bag_extend 0);
    now let b be Element of Bags(n);
      r1.b = p.(b bag_extend 0) by A3;
      hence r1.b=r2.b by A4;
    end;
    hence thesis;
  end;
end;

registration
  let n be Nat;
  let L be non empty ZeroStr;
  let p be Polynomial of n+1,L;
  cluster p removed_last -> finite-Support;
  coherence
  proof
    deffunc F(bag of n+1)= $1|n;
A1: (Support p) is finite by POLYNOM1:def 5;
    set FS={F(w) where w is Element of Bags(n+1):w in Support p};
A2: FS is finite from FRAENKEL:sch 21(A1);
    set R=p removed_last;
    Support R c= FS
    proof
      let x be object;
      assume
A3:   x in Support R;
      then reconsider b=x as bag of n;
A4:   b bag_extend 0 in Bags (n+1) = dom p by PARTFUN1:def 2;
      R.b <>0.L by A3,POLYNOM1:def 3;
      then p.(b bag_extend 0)<>0.L by Def6;
      then
A5:   b bag_extend 0 in Support p by A4,POLYNOM1:def 3;
      (0,n)-cut (b bag_extend 0) = b by HILB10_2:5;
      then F(b bag_extend 0) = b by NAT_1:11,HILB10_2:3;
      hence thesis by A5;
    end;
    hence thesis by A2,POLYNOM1:def 5;
  end;
end;

theorem
  for n be Nat for L be non empty ZeroStr
  for p be Series of n,L
    holds (p extended_by_0) removed_last = p
proof
  let n be Nat;
  let L be non empty ZeroStr;
  let p be Series of n,L;
  set e0 =p extended_by_0;
  for a being Element of Bags n holds p.a = (e0 removed_last).a
  proof
    let b be Element of Bags n;
    thus (e0 removed_last).b = e0. (b bag_extend 0) by Def6
    .= p.b by HILB10_2:6;
  end;
  hence thesis;
end;

theorem Th50:
  for n be Nat
    for L be non empty ZeroStr
      for p be Series of n+1,L st not n in vars p
  holds (p removed_last) extended_by_0 = p
proof
  let n be Nat;
  let L be non empty ZeroStr;
  let p be Series of n+1,L such that
A1: not n in vars p;
  set r=p removed_last;
  for a being Element of Bags (n+1) holds p.a = (r extended_by_0).a
  proof
    let b be Element of Bags (n+1);
    per cases;
    suppose
A2:   b.n<>0;
      then
A3:   (r extended_by_0).b = 0.L by HILB10_2:def 3;
A4:   Bags(n+1)=dom p by PARTFUN1:def 2;
      not b in Support p by A1,A2,Def5;
      hence thesis by A3,A4,POLYNOM1:def 3;
    end;
    suppose
A5:   b.n=0;
      then
A6:   (r extended_by_0).b = r.(0,n)-cut b by HILB10_2:def 3;
      set c = (0,n)-cut b;
      n-'0 = n-0;
      then r.c = p. ( c bag_extend 0) by Def6;
      hence thesis by A6,A5,HILB10_2:4;
    end;
  end;
  hence thesis;
end;

theorem Th51:
  for n be Nat
  for L be right_zeroed add-associative right_complementable
      well-unital distributive non trivial doubleLoopStr
  for p be Polynomial of n+1,L,
    x be Function of n, L,
    y be Function of (n+1), L st not n in vars p & y|n=x
  holds
    eval(p removed_last,x) = eval(p,y)
proof
  let n be Nat;
  let L be right_zeroed add-associative right_complementable
      well-unital distributive non trivial doubleLoopStr;
  let p be Polynomial of n+1,L,
  x be Function of n, L,y be Function of (n+1), L such that
A1: not n in vars p & y|n=x;
  thus eval(p removed_last,x) = eval((p removed_last) extended_by_0,y)
    by A1,HILB10_2:18
  .= eval(p,y) by A1,Th50;
end;

theorem Th52:
  for n be Nat
  for L be non empty ZeroStr
  for p be Series of n+1,L holds vars(p removed_last) c= vars p\{n}
proof
  let n be Nat;
  let L be non empty ZeroStr;
  let p be Series of n+1,L;
  set r=p removed_last;
  let y be object;
  assume y in vars(p removed_last);
  then consider b be bag of n such that
A1:b in Support r & b.y <> 0 by Def5;
  set bn=b bag_extend 0;
  A2: Bags(n+1)=dom p by PARTFUN1:def 2;
  0.L<> r.b = p.bn & bn in Bags(n+1) by A1,Def6,POLYNOM1:def 4;
  then
A3: bn in Support p by POLYNOM1:def 3,A2;
A4: y in dom b =n by A1,FUNCT_1:def 2,PARTFUN1:def 2;
  then (bn|n).y = bn.y by FUNCT_1:49;
  then b.y = bn.y by HILBASIS:def 1;
  then
A5:y in vars p by A3,A1,Def5;
  not n in n;
  hence thesis by A4,A5,ZFMISC_1:56;
end;

theorem Th53:
  for X be Ordinal
  for S be right_zeroed add-associative right_complementable
    well-unital distributive non trivial doubleLoopStr
  for p be Polynomial of X, S, i be object
  for x be Function of X, S st i in X\vars p
  for s be Element of S holds
    eval(p,x) = eval(p, x+*(i,s))
proof
  let X be Ordinal;
  let S be right_zeroed add-associative right_complementable
    well-unital distributive non trivial doubleLoopStr;
  let p be Polynomial of X, S, o be object;
  let x be Function of X, S such that
A1: o in X\vars p;
  let s be Element of S;
  set xo=x+*(o,s);set SB=SgmX(BagOrder X,Support p);
  consider y be FinSequence of the carrier of S such that
A2: len y = len SB & eval(p,x) = Sum y and
A3: for i be Element of NAT st 1 <= i & i <= len y holds
  y/.i = (p * SB)/.i * eval(SB/.i,x) by POLYNOM2:def 4;
  consider yo be FinSequence of the carrier of S such that
A4: len yo = len SB & eval(p,xo) = Sum yo and
A5: for i be Element of NAT st 1 <= i & i <= len yo holds
  yo/.i = (p * SB)/.i * eval(SB/.i,xo) by POLYNOM2:def 4;
  for i be Nat st 1<=i <= len SB holds y.i = yo.i
  proof
    let i be Nat such that
A6: 1<=i <= len SB;
    reconsider i as Element of NAT by ORDINAL1:def 12;
A7: i in dom SB & i in dom y & i in dom yo by A6,A2,A4,FINSEQ_3:25;
    then
A8:  SB/.i = SB.i in rng SB by PARTFUN1:def 6,FUNCT_1:def 3;
    BagOrder X linearly_orders Support p by POLYNOM2:18;
    then
A9: SB/.i in Support p by A8,PRE_POLY:def 2;
    not o in vars p by A1,XBOOLE_0:def 5;
    then (SB/.i).o = 0 by A9,Def5;
    then eval(SB/.i,x) = eval(SB/.i,xo) by Th18;
    then yo/.i = (p * SB)/.i * eval(SB/.i,x) by A4,A5,A6;
    then yo/.i = y/.i =y.i by A2,A3,A6,A7,PARTFUN1:def 6;
    hence thesis by A7,PARTFUN1:def 6;
  end;
  hence thesis by A4,A2,FINSEQ_1:14;
end;

begin :: Square Root Function -- Some Generalization

definition
  let n be Ordinal;
  let x be object, A be finite Subset of n;
  let f be real-valued Function;
  func _sqrtSegm(f,x,A) -> FinSequence of F_Complex means
    len it = 1+card A &
    it.1 = f.x &
    for i be Nat st i in dom SgmX(RelIncl n, A) holds
      (it.(i+1))^2 = f.(SgmX(RelIncl n, A).i) &
      Re (it.(i+1)) >=0 & Im (it.(i+1)) >=0;
  existence
  proof
    set S=SgmX(RelIncl n, A);
    defpred P[object,object] means $2 is Complex & for z be Complex st z = $2
      holds z^2 = f.(S.$1) & Re (z) >=0 & Im (z) >=0;
A1: for i be Nat st i in Seg len S ex y be object st P[i,y]
    proof
      let i be Nat such that i in Seg len S;
      set fS = f.(S.i);
      per cases;
      suppose
A2:     fS >=0;
        take z1 = sqrt fS;
        thus z1 is Complex;
        let z be Complex; assume z = z1;
        hence thesis by SQUARE_1:def 2,A2,COMPLEX1:def 2;
      end;
      suppose
A3:     fS < 0;
        take z1 = (sqrt (-fS))*<i>;
        thus z1 is Complex;
        let z be Complex such that
A4:     z = z1;
A5:     sqrt (-fS) >=0 & (sqrt (-fS))*(sqrt (-fS))= (sqrt (-fS))^2 = -fS
        by SQUARE_1:def 1,def 2,A3;
        Re(z1 * z1) = Re z1 * Re z1 - Im z1 * Im z1 &
        Im(z1 * z1) = Re z1 * Im z1 + Re z1 * Im z1 by COMPLEX1:9;
        hence thesis by A4,A5,SQUARE_1:def 1;
      end;
    end;
    consider p be FinSequence such that
A7:  dom p = Seg len S & for k be Nat st k in Seg len S holds P[k,p.k]
    from FINSEQ_1:sch 1(A1);
    f.x in COMPLEX by XCMPLX_0:def 2;
    then reconsider f1=f.x as Element of F_Complex by COMPLFLD:def 1;
    rng p c= the carrier of F_Complex
    proof
      let y be object such that
A8:   y in rng p;
      consider x be object such that
A9:   x in dom p & p.x = y by A8,FUNCT_1:def 3;
      P[x,p.x] by A9,A7;
      then p.x in COMPLEX by XCMPLX_0:def 2;
      hence thesis by A9,COMPLFLD:def 1;
    end;
    then reconsider p as FinSequence of F_Complex by FINSEQ_1:def 4;
    take C = <*f1*>^p;
A10:len <*f1*> = 1 by FINSEQ_1:39;
    len p = len S = card A by A7,FINSEQ_1:def 3,Th5,PRE_POLY:11;
    hence len C = 1 + card A & C.1 = f.x by A10,FINSEQ_1:22;
    let i be Nat such that
A11: i in dom S;
A12: dom S = dom p by A7,FINSEQ_1:def 3;
    then C.(i+1) = p.i by A11,A10,FINSEQ_1:def 7;
    hence thesis by A7,A11,A12;
  end;
  uniqueness
  proof
    set S=SgmX(RelIncl n, A);
    let C1,C2 be FinSequence of F_Complex such that
A13:    len C1 = 1+card A & C1.1 = f.x and
A14:    for i be Nat st i in dom S holds
    (C1.(i+1))^2 = f.(S.i) & Re (C1.(i+1)) >=0 & Im (C1.(i+1)) >=0 and
A15:    len C2 = 1+card A & C2.1 = f.x and
A16:    for i be Nat st i in dom S holds (C2.(i+1))^2 = f.(S.i) &
      Re (C2.(i+1)) >=0 & Im (C2.(i+1)) >=0;
    for i be Nat st 1<= i <= len C1  holds C1.i=C2.i
    proof
      let i be Nat such that
A17:  1<= i <= len C1;
A18:  len S = card A by Th5,PRE_POLY:11;
      per cases by A17,XXREAL_0:1;
      suppose i=1;
        hence thesis by A13,A15;
      end;
      suppose
A19:    i >1;
        then reconsider i1= i-1 as Nat;
        0<> i1 <= len C1-1 by A17,A19,XREAL_1:9;
        then 1<= i1 <= card A by A13,NAT_1:14;
        then i1 in dom S by A18,FINSEQ_3:25;
        then (C1.(i1+1))^2 = f.(S.i1) = (C2.(i1+1))^2 & Re (C2.(i1+1)) >=0 &
        Im (C2.(i1+1))>=0 &
        Re (C1.(i1+1)) >=0 & Im (C1.(i1+1))>=0 by A14,A16;
        hence thesis by Th2;
      end;
    end;
    hence thesis by A13,A15,FINSEQ_1:14;
  end;
end;

definition
  let n be Nat;
  let f be finite Function;
  func count_reps(f,n) -> bag of n means :Def8:
    for i be Nat st i in n holds it.i = card (f"{i+1});
  existence
proof
  defpred P[object,object] means for i be Nat st i=$1 holds
    $2 = card (f"{i+1});
A1: for x be object st x in n ex y be object st y in NAT & P[x,y]
   proof
     let x be object such that
A2:  x in n;
     x in Segm n by A2;
     then
     reconsider x as Nat;
     take c = card (f"{x+1});
     thus thesis;
   end;
   consider c be Function such that
A3: dom c = n & rng c c= NAT
     & for x being object st x in n holds P[x,c.x] from FUNCT_1:sch 6(A1);
   reconsider c as ManySortedSet of n by A3,PARTFUN1:def 2,RELAT_1:def 18;
   reconsider c as bag of n by A3,VALUED_0:def 6;
   take c;
   let i be Nat;assume i in n;
   hence c.i = card (f"{i+1}) by A3;
 end;
 uniqueness
 proof
   let b1,b2 be bag of n such that
A4: for i be Nat st i in n holds b1.i = card (f"{i+1})and
A5: for i be Nat st i in n holds b2.i = card (f"{i+1});
A6: dom b1= n = dom b2 by PARTFUN1:def 2;
   for x be object st x in dom b1 holds b1.x=b2.x
   proof
     let x be object such that
A7:  x in dom b1;
     x in Segm n by A7;
     then reconsider i=x as Nat;
     thus b1.x = card (f"{i+1}) by A7,A4
     .= b2.x by A5,A7;
   end;
   hence thesis by A6;
 end;
end;

theorem Th54:
   count_reps({},n) = EmptyBag n
proof
  set s = count_reps({},n), E= EmptyBag n;
A1: dom s = n = dom E by PARTFUN1:def 2;
  for x be object st x in dom s holds s.x=E.x
  proof
    let x be object such that
A2: x in dom s;
    x in Segm n by A2;
    then reconsider i=x as Nat;
    thus s.x = card ({}"{i+1}) by Def8,A2
    .= E.x;
  end;
  hence thesis by A1;
end;

theorem Th55:
  for f be FinSequence holds
    count_reps(f^<*i+1*>,n) = count_reps(f,n) + (EmptyBag n) +*(i,1)
proof
  let f be FinSequence;
  set s1=count_reps(f^<*i+1*>,n), s = count_reps(f,n), E = EmptyBag n;
A1:dom s1 = n = dom (s+E+*(i,1)) & n = dom E by PARTFUN1:def 2;
  for x be object st x in dom s1 holds s1.x=(s+E+*(i,1)).x
  proof
    let x be object such that
A2: x in dom s1;
    x in Segm n by A2;
    then reconsider a=x as Nat;
A3: card ((f^<*i+1*>)"{a+1}) = card (f"{a+1}) + card (<*i+1*>"{a+1})
    by FINSEQ_3:57;
A4: rng <*i+1*> = {i+1} by FINSEQ_1:38;
    per cases;
    suppose
A5:   a<>i;
      then a+1 <>i+1;
      then
A6:   <*i+1*>"{a+1} = {} by A4,RELAT_1:138,ZFMISC_1:11;
A7:   (E+*(i,1)).a = E.a = 0 by A5,FUNCT_7:32;
      thus s1.x = card (f"{a+1}) +0 by A6,A2,Def8,A3
      .= s.a +0 by A2,Def8
      .= (s+E+*(i,1)).x by A7,A2,A1,VALUED_1:def 1;
    end;
    suppose
A8:   a=i;
      then
A9:   <*i+1*>"{a+1} = dom <*i+1*> = Seg 1 ={1}
      by A4,RELAT_1:134,FINSEQ_1:38,2;
A10: (E+*(i,1)).a = 1 by A8,A1,A2,FUNCT_7:31;
      thus s1.x = card (f"{a+1}) +1 by A9,A2,Def8,A3
      .= s.a +1 by A2,Def8
      .= (s+E+*(i,1)).x by A10,A2,A1,VALUED_1:def 1;
    end;
  end;
  hence thesis by A1;
end;

definition
  let f be finite Function;
  let L be doubleLoopStr;
  let E be Function;
  func SgnMembershipNumber(f,L,E) -> Element of L  means :Def9:
    for c be Nat st c = card {x where x is Element of dom f:
        x in dom f & f.x in E.x}
    holds
      (c is even implies it = 1.L) &
      (c is odd implies  it = -1.L);
  existence
  proof
    set X={x where x is Element of dom f:x in dom f & f.x in E.x};
    X c= dom f
    proof
      let x be object;assume x in X;
      then ex y be Element of dom f st x=y & y in dom f & f.y in E.y;
      hence thesis;
    end;
    then reconsider X as finite set;
    per cases;
    suppose
A1:   card X is even;
      take 1.L;
      thus thesis by A1;
    end;
    suppose
A2:   card X is odd;
      take - 1.L;
      thus thesis by A2;
    end;
  end;
  uniqueness
  proof
    let u1,u2 be Element of L such that
A3: for c be Nat st c = card {x where x is Element of dom f:
    x in dom f & f.x in E.x}
    holds
    (c is even implies u1 = 1.L) &
    (c is odd implies u1 = - 1.L) and
A4: for c be Nat st c = card {x where x is Element of dom f:
    x in dom f & f.x in E.x}
    holds
    (c is even implies u2 = 1.L) &
    (c is odd implies u2 = - 1.L);
    set X={x where x is Element of dom f:x in dom f & f.x in E.x};
    X c= dom f
    proof
      let x be object;assume x in X;
      then ex y be Element of dom f st x=y & y in dom f & f.y in E.y;
      hence thesis;
    end;
    then reconsider X as finite set;
    per cases;
    suppose
A5:   card X is even;
      hence u1 = 1.L by A3 .= u2 by A5,A4;
    end;
    suppose
A6:   card X is odd;
      hence u1 = - 1.L by A3 .= u2 by A6,A4;
    end;
  end;
end;

theorem Th56:
  for L be doubleLoopStr, E be Function holds
    SgnMembershipNumber({},L,E) = 1.L
proof
  let L be doubleLoopStr, E be Function;
  reconsider f={} as finite Function;
  set X = {x where x is Element of dom f: x in dom f & f.x in E.x};
A1: X={}
  proof
    assume X<>{};
    then consider y be object such that
A2: y in X by XBOOLE_0:def 1;
    ex x be Element of dom f st y =x & x in dom f & f.x in E.x by A2;
    hence thesis;
  end;
  then reconsider X as finite set;
  card X is even by A1;
  hence thesis by Def9;
end;

theorem Th57:
  for L be doubleLoopStr
    for f,e be FinSequence, x be object,E be set st
    len f = len e & not x in E holds
      SgnMembershipNumber(f^<*x*>,L,e^<*E*>) = SgnMembershipNumber(f,L,e)
proof
  let L be doubleLoopStr;
  let f,e be FinSequence, x be object,E be set such that
  A1:len e = len f and A2:not x in E;
  set fx= f^<*x*>, eX=e^<*E*>;
  set X1 = {x where x is Element of dom fx: x in dom fx & fx.x in eX.x};
  set X = {x where x is Element of dom f: x in dom f & f.x in e.x};
A3: dom f = dom e by A1,FINSEQ_3:29;
  X c= dom f
  proof
    let a be object;assume a in X;
    then ex x be Element of dom f st x=a & x in dom f & f.x in e.x;
    hence thesis;
  end;
  then reconsider X as finite set;
A4: X=X1
  proof
    thus X c= X1
    proof
      let a be object;
      assume a in X;
      then consider x be Element of dom f such that
A5:   x=a & x in dom f & f.x in e.x;
      reconsider x as Nat;
A6:   dom f c= dom fx by FINSEQ_1:26;
      eX.x = e.x & fx.x = f.x by A5,A3,FINSEQ_1:def 7;
      hence thesis by A6,A5;
    end;
    let a be object;
    assume a in X1;
    then consider y be Element of dom fx such that
A7: y=a & y in dom fx & fx.y in eX.y;
    reconsider y as Nat;
    len <*x*> =1 by FINSEQ_1:39;
    then
A8: len fx = len f+1 by FINSEQ_1:22;
    per cases;
    suppose y = len f+1;
      hence thesis by A7,A2,A1;
    end;
    suppose
A9:   y <> len f+1;
      y <= len f+1 by A8,FINSEQ_3:25;
      then y < len f+1 by A9,XXREAL_0:1;
      then 1<= y <= len f by NAT_1:13,FINSEQ_3:25;
      then
A10:y in dom f by FINSEQ_3:25;
      then fx.y = f.y & eX.y = e.y by A3,FINSEQ_1:def 7;
      hence thesis by A7,A10;
    end;
  end;
  then reconsider X1 as finite set;
  per cases;
  suppose card X is even;
    then SgnMembershipNumber(f,L,e) = 1.L
      = SgnMembershipNumber(fx,L,eX) by Def9,A4;
    hence thesis;
  end;
  suppose card X is odd;
    then SgnMembershipNumber(f,L,e) = - 1.L
      = SgnMembershipNumber(fx,L,eX) by Def9,A4;
    hence thesis;
  end;
end;

theorem Th58:
  for L be add-associative right_zeroed right_complementable non
     empty doubleLoopStr
    for f,e be FinSequence, x be object,E be set st len f = len e & x in E
  holds
     SgnMembershipNumber(f^<*x*>,L,e^<*E*>) = - SgnMembershipNumber(f,L,e)
proof
  let L be add-associative right_zeroed right_complementable non
  empty doubleLoopStr;
  let f,e be FinSequence, x be object,E be set such that
A1:len e = len f and
A2:x in E;
  set fx= f^<*x*>, eX=e^<*E*>;
  set X1 = {x where x is Element of dom fx: x in dom fx & fx.x in eX.x};
  set X = {x where x is Element of dom f: x in dom f & f.x in e.x};
A3: dom f = dom e by A1,FINSEQ_3:29;
A4: X c= X1
  proof
    let a be object;
    assume a in X;
    then consider x be Element of dom f such that
A5: x=a & x in dom f & f.x in e.x;
    reconsider x as Nat;
A6: dom f c= dom fx by FINSEQ_1:26;
    eX.x = e.x & fx.x = f.x by A5,A3,FINSEQ_1:def 7;
    hence thesis by A6,A5;
  end;
  X1 c= dom fx
  proof
    let a be object;
    assume a in X1;
    then ex x be Element of dom fx st x=a & x in dom fx & fx.x in eX.x;
    hence thesis;
  end;
  then reconsider X1,X as finite set by A4;
  len <*x*> =1 by FINSEQ_1:39;
  then
A7:  len fx = len f+1 by FINSEQ_1:22;
A8: not len f+1 in X
  proof
    assume len f+1 in X;
    then consider x be Element of dom f such that
A9: x=len f+1 & x in dom f & f.x in e.x;
    len f+1 <= len f by A9,FINSEQ_3:25;
    hence thesis by NAT_1:13;
  end;
  1<= len f+1 by NAT_1:11;
  then fx.(len f+1) = x & eX.(len f+1) = E & len f+1 in dom fx
    by A1,A7,FINSEQ_3:25;
  then len f+1 in X1 by A2;
  then {len f+1} c= X1 by ZFMISC_1:31;
  then
A10: X\/{len f+1} c= X1 by A4,XBOOLE_1:8;
  X1 c= X\/{len f+1}
  proof
    let a be object;
    assume a in X1;
    then consider y be Element of dom fx such that
A11:y=a & y in dom fx & fx.y in eX.y;
    reconsider y as Nat;
    per cases;
    suppose y = len f+1;
      hence thesis by A11,ZFMISC_1:136;
    end;
    suppose
A12:y <> len f+1;
      y <= len f+1 by A7,FINSEQ_3:25;
      then y < len f+1 by A12,XXREAL_0:1;
      then 1<= y <= len f by NAT_1:13,FINSEQ_3:25;
      then
A13:y in dom f by FINSEQ_3:25;
      then fx.y = f.y & eX.y = e.y by A3,FINSEQ_1:def 7;
      then y in X by A11,A13;
      hence thesis by A11,ZFMISC_1:136;
    end;
  end;
  then X1 = X\/{len f+1} by A10,XBOOLE_0:def 10;
  then
A14: card X1 = card X+1 by A8,CARD_2:41;
  per cases;
  suppose
A15: card X is even;
    then SgnMembershipNumber(fx,L,eX) =-1.L by Def9,A14;
    hence thesis by A15,Def9;
  end;
  suppose
A16: card X is odd;
    SgnMembershipNumber(f,L,e) = - 1.L by A16,Def9;
    hence thesis by A16,Def9,A14;
  end;
end;

theorem Th59:
   for L be add-associative right_zeroed right_complementable
            well-unital distributive associative Abelian commutative
            non empty non trivial doubleLoopStr
   for n be Nat
     for f be FinSequence of L
       for xf be Function of n,L st xf = FS2XFS f
         for F be finite set
           for E be Enumeration of F
   for d be FinSequence st d in doms (SignGenOp(f,the addF of L,F) * E)
     holds
  (the multF of L) "**" ((App (SignGenOp(f,the addF of L,F) * E)).d) =
    eval(Monom(SgnMembershipNumber(d,L,E),count_reps(d,n)),xf)
proof
  let L be add-associative right_zeroed right_complementable
  well-unital distributive associative Abelian  commutative
  non empty non trivial doubleLoopStr;
  let n be Nat;
  let f be FinSequence of L;
  let xf be Function of n,L such that
A1:xf = FS2XFS f;
  set M=the multF of L, A=the addF of L;
  defpred P[Nat] means for F be finite set st card F=$1
  for E be Enumeration of F
  for d be FinSequence st d in doms (SignGenOp(f,A,F) * E) holds
  M "**" ((App (SignGenOp(f,A,F) * E)).d) =
  eval(Monom(SgnMembershipNumber(d,L,E),count_reps(d,n)),xf);
A2: P[0]
  proof
    let F be finite set such that
A3: card F=0;
    let E be Enumeration of F;
    let d be FinSequence such that
A4: d in doms (SignGenOp(f,the addF of L,F) * E);
    len d = len (SignGenOp(f,A,F) * E) =len E = card F
    by A4,HILB10_7:47,CARD_1:def 7;
    then
A5:d = {} & SignGenOp(f,A,F) * E={} by A3;
    then
A6: M "**" ((App (SignGenOp(f,A,F) * E)).d)
    = the_unity_wrt the multF of L by FINSOP_1:def 1,HILB10_7:59
    .= 1_L by GROUP_1:22;
A7:SgnMembershipNumber(d,L,E) = 1.L by A5,Th56;
    count_reps(d,n) = EmptyBag n by A5,Th54;
    then eval(count_reps(d,n),xf) = 1.L by POLYNOM2:14;
    then eval(Monom(SgnMembershipNumber(d,L,E),count_reps(d,n)),xf)= 1.L * 1.L
    by A7,POLYNOM7:13
    .= 1.L;
    hence thesis by A6;
  end;
A8:P[i] implies P[i+1]
  proof
    assume
A9: P[i];
    let F be finite set such that
A10:  card F=i+1;
    let E be Enumeration of F;
    let d be FinSequence such that
A11:d in doms (SignGenOp(f,the addF of L,F) * E);
A12:len d = len (SignGenOp(f,A,F) * E) =len E = card F
    by A11,HILB10_7:47,CARD_1:def 7;
    set EE={E.len E}, Fi=F\EE;
    reconsider Ei = E|i as Enumeration of Fi by A12,A10,HILB10_7:96;
    reconsider Ee = <*E.len E*> as Enumeration of EE by A12,A10,HILB10_7:96;
    set di= d|i, D=<*d.(i+1)*>;
A13:len di = i & len Ei=i by A12,A10,NAT_1:11,FINSEQ_1:59;
A14: d = di ^ D by A10,A12,FINSEQ_3:55;
A15: len (SignGenOp(f,A,Fi) * Ei) = len Ei by CARD_1:def 7;
A16: F = Fi \/ EE by A12,A10,HILB10_7:96;
A17: E= Ei ^ Ee by A10,A12,FINSEQ_3:55;
    then
A18: SignGenOp(f,the addF of L,F) * E =
    (SignGenOp(f,A,Fi) * Ei)^(SignGenOp(f,A,EE) * Ee) by A16,HILB10_7:81;
    then
A19: di in doms (SignGenOp(f,A,Fi) * Ei) &
    D in doms (SignGenOp(f,A,EE) * Ee) by A11,A15,A13,A14,HILB10_7:50;
    then (App (SignGenOp(f,A,F) * E)).d =
    ((App (SignGenOp(f,A,Fi) * Ei)).di)^((App (SignGenOp(f,A,EE) * Ee)).D)
    by HILB10_7:61,A14,A18;
    then
A20: M "**" ((App (SignGenOp(f,A,F) * E)).d) =
    M.(M"**"((App (SignGenOp(f,A,Fi)*Ei)).di),
    M"**"((App (SignGenOp(f,A,EE)*Ee)).D)) by FINSOP_1:5;
A21: SignGenOp(f,A,EE) * Ee = <* SignGen(f,A,E.len E) *> by HILB10_7:78;
    then
A22: D.1 in dom SignGen(f,A,E.len E) by A19,HILB10_7:51;
    then
A23: SignGen(f,A,E.len E).(d.(i+1)) in rng SignGen(f,A,E.len E)
    by FUNCT_1:def 3;
A24: rng SignGen(f,A,E.len E) c= the carrier of L by FINSEQ_1:def 4;
    (App (SignGenOp(f,A,EE) * Ee)).D = <* SignGen(f,A,E.len E) . (d.(i+1))*>
    by A21,A22,HILB10_7:60;
    then
A25: M"**"((App (SignGenOp(f,A,EE) * Ee)).D)
    = SignGen(f,A,E.len E) . (d.(i+1)) by A24,A23,FINSOP_1:11;
A26: card Fi = i by A13,CARD_1:def 7;
    1<=1+i by NAT_1:11;
    then
A27: i+1 in dom d & i+1 in dom E by A10,A12,FINSEQ_3:25;
    then
A28: d.(i+1) in dom ((SignGenOp(f,A,F) * E).(i+1)) by HILB10_7:47,A11;
    then d.(i+1) in dom SignGen(f,A,E.(i+1)) by HILB10_7:80,A27;
    then
A29: d.(i+1) in dom f by HILB10_7:def 11;
    reconsider dd=d.(i+1) as Nat by A11;
    1<=dd by A28,FINSEQ_3:25;
    then reconsider dd1=dd-1 as Nat;
    len (FS2XFS f) = n by A1,FUNCT_2:def 1;
    then
A30: n = len f by AFINSQ_1:def 8;
    then
A31: dd1+1 <= n by A29,FINSEQ_3:25;
    then dd1 <n by NAT_1:13;
    then
A32: dd1 in Segm n by NAT_1:44;
A33: f.dd in rng f c= the carrier of L by FINSEQ_1:def 4,A29,FUNCT_1:def 3;
    then reconsider fdd=f.dd as Element of L;
A34: f.(dd1+1) = xf.dd1 by A1,A31,NAT_1:13,A30,AFINSQ_1:def 8;
A35: dd1+1 = dd;
A36: count_reps(d,n) = count_reps(di,n) + (EmptyBag n)+*(dd1,1)
    by A14,A35,Th55;
A37: eval((EmptyBag n)+*(dd1,1),xf) = power(L).(xf.dd1,1) by A32,Th14
    .= xf.dd1 by A33,A34,GROUP_1:50;
A38:  M "**" ((App (SignGenOp(f,A,F) * E)).d)
    = M.(eval(Monom(SgnMembershipNumber(di,L,Ei),count_reps(di,n)),xf),
    SignGen(f,A,E.len E) . dd) by A26,A25,A20,A9,A19
    .= M.(SgnMembershipNumber(di,L,Ei) *
    eval(count_reps(di,n),xf),SignGen(f,A,E.len E) . dd) by POLYNOM7:13;
    per cases;
    suppose
A39:  dd in E.len E;
      dd in dom SignGen(f,A,E.len E) by A29,HILB10_7:def 11;
      then SignGen(f,A,E.len E) . dd = (the_inverseOp_wrt A).fdd
      by A39,HILB10_7:def 11
      .= (comp L) .fdd by FVSUM_1:15
      .= -fdd by VECTSP_1:def 13;
      hence M "**" ((App (SignGenOp(f,A,F) * E)).d)
      = SgnMembershipNumber(di,L,Ei) * eval(count_reps(di,n),xf) *(-fdd)
      by A38
      .= SgnMembershipNumber(di,L,Ei) * (eval(count_reps(di,n),xf) * (-fdd))
      by GROUP_1:def 3
      .= SgnMembershipNumber(di,L,Ei) * (-(eval(count_reps(di,n),xf) * fdd))
      by VECTSP_1:8
      .= SgnMembershipNumber(di,L,Ei) * (-eval(count_reps(d,n),xf))
      by A36,POLYNOM2:16,A37,A34
      .= -(SgnMembershipNumber(di,L,Ei) * eval(count_reps(d,n),xf))
      by VECTSP_1:8
      .= (-SgnMembershipNumber(di,L,Ei)) * eval(count_reps(d,n),xf)
      by VECTSP_1:8
      .= SgnMembershipNumber(d,L,E) * eval(count_reps(d,n),xf)
      by A13,A39,Th58,A14,A17
      .= eval(Monom(SgnMembershipNumber(d,L,E),count_reps(d,n)),xf)
      by POLYNOM7:13;
    end;
    suppose
A40:  not dd in E.len E;
      dd in dom SignGen(f,A,E.len E) by A29,HILB10_7:def 11;
      hence M "**" ((App (SignGenOp(f,A,F) * E)).d) =
      SgnMembershipNumber(di,L,Ei) * eval(count_reps(di,n),xf) *fdd
      by A38,A40,HILB10_7:def 11
      .= SgnMembershipNumber(di,L,Ei) * (eval(count_reps(di,n),xf) * fdd)
      by GROUP_1:def 3
      .= SgnMembershipNumber(di,L,Ei) * eval(count_reps(d,n),xf)
      by A36,POLYNOM2:16,A37,A34
      .= SgnMembershipNumber(d,L,E) * eval(count_reps(d,n),xf)
      by A13,A40,Th57,A14,A17
      .= eval(Monom(SgnMembershipNumber(d,L,E),count_reps(d,n)),xf)
      by POLYNOM7:13;
    end;
  end;
  P[i] from NAT_1:sch 2(A2,A8);
  hence thesis;
end;

theorem Th60:
  for f be finite Function st f is with_evenly_repeated_values
    holds count_reps(f,n).x is even
proof
  let f be finite Function such that
A1:f is with_evenly_repeated_values;
A2: dom count_reps(f,n) = n by PARTFUN1:def 2;
  per cases;
  suppose
A3: x in n;
    then x in Segm n;
    then reconsider i=x as Nat;
    count_reps(f,n).i = card (f"{i+1}) by Def8,A3;
    hence thesis by A1,HILB10_7:def 6;
  end;
  suppose not x in n;
    hence thesis by A2,FUNCT_1:def 2;
  end;
end;

theorem Th61:
  for f be FinSequence of Seg n
    holds degree count_reps(f,n) = len f
proof
  defpred P[Nat] means for f be FinSequence of Seg n st len f= $1
    holds degree count_reps(f,n) = len f;
A1: P[0]
  proof
    let f be  FinSequence of Seg n such that
A2: len f= 0;
    f={} by A2;
    then count_reps(f,n) = EmptyBag n by Th54;
    hence thesis by UPROOTS:11,A2;
  end;
A3:P[i] implies P[i+1]
  proof
    assume
A4: P[i];
    let f be FinSequence of Seg n such that
A5: len f= i+1;
    1<= i+1 by NAT_1:11;
    then i+1 in dom f by A5,FINSEQ_3:25;
    then
A6: f.(i+1) in rng f c= Seg n
    by FUNCT_1:def 3,FINSEQ_1:def 4;
    then f.(i+1)>=1 by FINSEQ_1:1;
    then reconsider fi1 = f.(i+1)-1 as Nat;
    set fi=f|i,F = <*fi1+1*>;
A7: len fi = i by NAT_1:11,A5,FINSEQ_1:59;
    then
A8: degree count_reps(fi,n) = len fi by A4;
    fi1+1 <= n by A6,FINSEQ_1:1;
    then fi1 <n by NAT_1:13;
    then
A9: fi1 in Segm n by NAT_1:44;
    reconsider N=n as non empty set by A5;
    reconsider a=fi1 as Element of N by A9;
    reconsider A={fi1} as Subset of N by A9,ZFMISC_1:31;
    (EmptyBag n) +*(fi1,1) = ({a},1)-bag by Th12;
    then
A10: degree ((EmptyBag n) +*(fi1,1)) = card {a} =1
    by UPROOTS:13,CARD_1:30;
    f = fi^F by FINSEQ_3:55,A5;
    then count_reps(f,n) = count_reps(fi,n) + (EmptyBag n) +*(fi1,1) by Th55;
    hence thesis by A10,A8,A7,A5,UPROOTS:15;
  end;
  P[i] from NAT_1:sch 2(A1,A3);
  hence thesis;
end;

theorem Th62:
  for L be doubleLoopStr
    for f be finite Function, E be Function holds
      SgnMembershipNumber(f,L,E) = 1.L or
      SgnMembershipNumber(f,L,E) = -1.L
proof
  let L be doubleLoopStr;
  let f be finite Function, E be Function;
  set X={x where x is Element of dom f: x in dom f & f.x in E.x};
  X c= dom f
  proof
    let y be object;
    assume y in X;
    then ex x be Element of dom f st x=y & x in dom f & f.x in E.x;
    hence thesis;
  end;
  then reconsider X as finite set;
  card X is even or card X is odd;
  hence thesis by Def9;
end;

theorem Th63:
  for f be FinSequence of Seg n,i st
    i in n & count_reps(f,n) = (EmptyBag n) +* (i,len f)
  holds f = len f |-> (i+1)
proof
  set E=EmptyBag n;
  let f be FinSequence of Seg n,i such that
A1: i in n & count_reps(f,n) = E +* (i,len f);
  dom E = n by PARTFUN1:def 2;
  then count_reps(f,n).i = len f by A1,FUNCT_7:31;
  then
A2: len f = card (f"{i+1}) by Def8,A1;
A3: dom f =Seg len f by FINSEQ_1:def 3;
  then card dom f = len f;
  then
A4: dom f = f"{i+1} by A2,RELAT_1:132,CARD_2:102;
  for x st x in dom f holds f.x = i+1
  proof
    let x;
    assume x in dom f;
    then f.x in {i+1} by A4,FUNCT_1:def 7;
    hence thesis by TARSKI:def 1;
  end;
  hence thesis by A3,FUNCOP_1:11;
end;

theorem Th64:
  i in n implies count_reps(m |-> (i+1),n) = (EmptyBag n) +* (i,m)
proof
  set E=EmptyBag n, s = count_reps(m |-> (i+1),n);
  assume i in n;
A1: dom s = n = dom (E+* (i,m)) & n = dom E by PARTFUN1:def 2;
  for x st x in n holds s.x = (E+* (i,m)).x
  proof
    let x;
    assume
A2: x in n;
    then x in Segm n;
    then reconsider a=x as Nat;
A3: s.a = card ((m |-> (i+1))"{a+1}) by A2,Def8;
    per cases;
    suppose
A4:   a=i;
      (Seg m --> (i+1))"{a+1}=Seg m by A4,FUNCOP_1:15;
      hence thesis by A3,A4,A1,A2,FUNCT_7:31;
    end;
    suppose
A5:   a<>i;
      then
A6:   (E+* (i,m)).x = E.x by FUNCT_7:32;
      a+1 <>i+1 by A5;
      then not i+1 in {a+1} by TARSKI:def 1;
      then (Seg m --> (i+1))"{a+1}={} by FUNCOP_1:16;
      hence thesis by A6,A3;
    end;
  end;
  hence thesis by A1;
end;

begin :: Jpolynom

definition
  let L be Abelian commutative add-associative right_zeroed
           right_complementable associative well-unital distributive
           non empty non trivial doubleLoopStr;
  let m be Nat such that
A1: m > 1;
  mode Jpolynom of m,L -> Polynomial of m,L means :Def10:
      it.((EmptyBag m) +* (0,2 |^ (m-'1))) = 1.L &
      (for b be bag of m st b in Support it holds
        degree b = 2 |^ (m-'1) &
        (ex i be Integer st  it.b = i '*' 1_L) &
        (  2 |^ (m-'1) in rng b  implies ( it.b = 1.L or it.b = -1.L)) &
         for n holds b.n is even) &
     for f be FinSequence of L
        for xf be Function of m,L st xf = FS2XFS f holds
          eval(it,xf) = SignGenOp(f,the multF of L,the addF of L,Seg m\{1});
  existence
  proof
    reconsider mm=m as non trivial Nat by A1,NEWTON03:def 1;
    set A= the addF of L, M =the multF of L;
A2: A is having_a_unity by FVSUM_1:8;
A3: comp L is_an_inverseOp_wrt the addF of L by PRVECT_1:2;
A4: M is_distributive_wrt A by FVSUM_1:10;
A5: the_unity_wrt A = 0.L by FVSUM_1:7;
A6: for d be Element of L holds M.(the_unity_wrt A,d) =the_unity_wrt A
    proof
      let d be Element of L;
      thus  M.(the_unity_wrt A,d) = 0.L*d by FVSUM_1:7
      .= the_unity_wrt A by FVSUM_1:7;
    end;
    set F = bool(Seg mm\{1}), D = doms(mm,card F);
    consider E be Enumeration of F,S be Subset of D such that
A7: S is with_evenly_repeated_values-member and
A8: card F |-> 1 in S and
A9: for CE be non-empty non empty FinSequence of (the carrier of L)*,
      f be FinSequence of the carrier of L st
      CE = SignGenOp(f,A,F) * E & len f = m
    for Sce be Element of Fin dom App CE st Sce=S holds
      SignGenOp(f,M,A,Seg m\{1}) = A $$ (Sce,M "**" App CE)
    by A2,FINSEQOP:def 2,A3,A4,A1,A6,HILB10_7:143;
    defpred P[set] means
    $1 c= S implies ex P be Polynomial of m,L st
     ( card F |-> 1 in $1 implies
            P.((EmptyBag m) +* (0,2 |^ (m-'1))) = 1.L) &
     (for b be bag of m st b in Support P holds
          degree b = 2 |^ (m-'1) &
          (ex i be Integer st  P.b = i '*' 1_L) &
          (   for n be Nat st b.n = 2 |^ (m-'1) holds
                     (P.b = 1.L or P.b = -1.L) &
                              (2 |^ (m-'1)) |-> (n+1) in $1)
          &for n holds b.n is even) &
     for f be FinSequence of L
        for xf be Function of m,L st xf = FS2XFS f
      for CE be non-empty non empty FinSequence of (the carrier of L)* st
        CE = SignGenOp(f,A,F) * E
        for Sce be Element of Fin dom App CE st Sce=$1 holds
        eval(P,xf) = A $$ (Sce,M "**" App CE);
A10:P[{}.D]
    proof
      assume {}.D c= S;
      take P = 0_(m, L);
      thus card F |-> 1 in {}.D implies
        P.((EmptyBag m) +* (0,2 |^ (m-'1))) = 1.L;
      Support P ={}
      proof
        assume Support P<>{};
        then consider b be object such that
A11:    b in Support P by XBOOLE_0:def 1;
        b in dom P & P.b <>0.L by A11,POLYNOM1:def 3;
        hence thesis by POLYNOM1:22;
      end;
      hence for b be bag of m st b in Support P holds
      degree b = 2 |^ (m-'1) &
      (ex i be Integer st  P.b = i '*' 1_L) &
      (for n be Nat st b.n = 2 |^ (m-'1) holds
      (P.b = 1.L or P.b = -1.L) & (2 |^ (m-'1)) |-> (n+1) in {}.D)&
      for n holds b.n is even;
      let f be FinSequence of L;
      let xf be Function of m,L such that xf = FS2XFS f;
      let CE be non-empty non empty FinSequence of (the carrier of L)*
      such that CE = SignGenOp(f,A,F) * E;
      let Sce be Element of Fin dom App CE such that
A12:  Sce={}.D;
      thus eval(P,xf) = 0.L by POLYNOM2:20
      .= A $$ ({}.dom App CE,M "**" App CE)
      by A5,SETWISEO:31,FVSUM_1:8
      .= A $$ (Sce,M "**" App CE) by A12;
    end;
A13: for B9 being (Element of Fin D), b being Element of D
    holds P[B9] & not b in B9
    implies P[B9 \/ {b}]
    proof
      let X be Element of Fin D, d be Element of D such that
A14:  P[X] & not d in X & X\/{d} c= S;
      X c= X\/{d} by XBOOLE_1:7;
      then X c= S by A14;
      then consider P be Polynomial of m,L such that
A15:  card F |-> 1 in X implies
      P.((EmptyBag m) +* (0,2 |^ (m-'1))) = 1.L and
A16:  for b be bag of m st b in Support P holds
          degree b = 2 |^ (m-'1) &
          (ex i be Integer st  P.b = i '*' 1_L) &
          (for n be Nat st b.n = 2 |^ (m-'1) holds
          (P.b = 1.L or P.b = -1.L) &
          (2 |^ (m-'1)) |-> (n+1) in X) &
          for n holds b.n is even and
A17:  for f be FinSequence of L
        for xf be Function of m,L st xf = FS2XFS f
        for CE be non-empty non empty FinSequence of (the carrier of L)* st
        CE = SignGenOp(f,A,F) * E
        for Sce be Element of Fin dom App CE st Sce=X holds
        eval(P,xf) = A $$ (Sce,M "**" App CE) by A14;
        set s=count_reps(d,m), Q = Monom(SgnMembershipNumber(d,L,E),s);
A18:  d in X\/{d} by ZFMISC_1:136;
A19:  d is Element of (card F)-tuples_on Seg m by HILB10_7:def 14;
A20:  len d = card F by CARD_1:def 7;
      then
A21:  len d = 2|^(m-'1) by Th4;
      take PQ = P+Q;
      thus card F |-> 1 in X\/{d} implies
      PQ.((EmptyBag m) +* (0,2 |^ (m-'1))) = 1.L
      proof
        set Em=EmptyBag m, EM = Em +* (0,2 |^ (m-'1));
        0<mm;
        then
A22:    0 in Segm m by NAT_1:44;
        assume card F |-> 1 in X\/{d};
        then per cases by ZFMISC_1:136;
        suppose
A23:      card F |-> 1 in X;
A24:      EM<>s
          proof
            assume EM=s;
            then d = len d |-> (0+1) by A21,A22,A19,Th63;
            hence thesis by A14,A23,CARD_1:def 7;
          end;
          Q .EM = 0_(m,L).EM by A24,FUNCT_7:32
          .= 0.L by POLYNOM1:22;
          then PQ.EM = (P.EM) + 0.L by POLYNOM1:15
          .= P.EM;
          hence thesis by A23,A15;
        end;
        suppose
A25:      card F |-> 1 = d;
          then len d |-> (1+0) = d;
          then count_reps(d,m) = Em +* (0,len d) by A22,Th64;
          then
A26:      s = Em +* (0,2 |^ (m-'1)) by A20,Th4;
A27:      dom PQ = Bags m = dom P & EM in Bags m
            by FUNCT_2:def 1,PRE_POLY:def 12;
A28:      not EM in Support P
          proof
            dom Em = m by PARTFUN1:def 2;
            then
A29:        EM.0 = 2 |^ (m-'1) by A22,FUNCT_7:31;
            assume EM in Support P;
            then (2 |^ (m-'1)) |-> (0+1) in X by A29,A16;
            hence thesis by A25,A14,Th4;
          end;
          dom 0_(m,L) = Bags m by FUNCT_2:def 1;
          then
A30:      s in dom 0_(m,L) by PRE_POLY:def 12;
A31:      Q .s = SgnMembershipNumber(d,L,E) by A30,FUNCT_7:31;
A32:      PQ.EM = (P.EM) + (Q .EM) by POLYNOM1:15
          .= (0.L) + (Q .EM) by A28,A27, POLYNOM1:def 4
          .= (Q .EM);
          set X = {x where x is Element of dom d:
          x in dom d & d.x in E.x};
          X={}
          proof
            assume X<>{};
            then consider a be object such that
A33:        a in X by XBOOLE_0:def 1;
            consider x be Element of dom d such that
A34:        a=x & x in dom d & d.x in E.x by A33;
            reconsider x as Nat;
            len E = card F by CARD_1:def 7;
            then dom E = dom d by A20,FINSEQ_3:29;
            then E.x in rng E =F by FUNCT_1:def 3,RLAFFIN3:def 1;
            hence thesis by ZFMISC_1:56,A34,A25;
          end;
          then card X = 0 & 0 is even;
          hence thesis by A31,A26,A32,Def9;
        end;
      end;
      thus for b be bag of m st b in Support PQ holds
      degree b = 2 |^ (m-'1) & (ex i be Integer st  PQ.b = i '*' 1_L) &
      (for n be Nat st b.n = 2 |^ (m-'1) holds
      (PQ.b = 1.L or PQ.b = -1.L) & (2 |^ (m-'1)) |-> (n+1) in X\/{d})&
      for n holds b.n is even
      proof
        let b be bag of m such that
A35:    b in Support PQ;
        dom P = Bags m by FUNCT_2:def 1;
        then
A36:    b in dom P by PRE_POLY:def 12;
        per cases;
        suppose
A37:      b in Support P;
          hence degree b = 2 |^ (m-'1) by A16;
          consider i be Integer such that
A38:      P.b = i '*' 1_L by A37,A16;
          thus ex i be Integer st  PQ.b = i '*' 1_L
          proof
            per cases;
            suppose
A39:          b<>s;
              Q .b = 0_(m,L).b by A39,FUNCT_7:32
              .= 0.L by POLYNOM1:22;
              then PQ.b = (P.b) + 0.L by POLYNOM1:15
              .= P.b;
              hence thesis by A38;
            end;
            suppose
A40:          b=s;
              dom 0_(m,L) = Bags m by FUNCT_2:def 1;
              then
A41:          b in dom 0_(m,L) by PRE_POLY:def 12;
A42:          Q .b = SgnMembershipNumber(d,L,E) by A41,A40,FUNCT_7:31;
              SgnMembershipNumber(d,L,E) = 1.L or
                SgnMembershipNumber(d,L,E) = -1.L by Th62;
              then SgnMembershipNumber(d,L,E) = 1'*'1.L or
              SgnMembershipNumber(d,L,E) = (-1)'*'1.L by RING_3:60,61;
              then PQ .b = (i '*' 1_L) + (1'*'1.L) or
                   PQ .b = (i '*' 1_L) + ((-1)'*'1.L) by A38,A42,POLYNOM1:15;
              then PQ .b = (i+1) '*' 1_L or PQ .b = (i +(-1))'*' 1_L
                by RING_3:62;
              hence thesis;
            end;
          end;
          thus for n be Nat st b.n = 2 |^ (m-'1) holds
          (PQ.b = 1.L or PQ.b = -1.L) & (2 |^ (m-'1)) |-> (n+1) in X\/{d}
          proof
            let n be Nat such that
A43:        b.n = 2 |^ (m-'1);
A44:        n in dom b =m by A43,FUNCT_1:def 2,PARTFUN1:def 2;
A45:        (2 |^ (m-'1)) |-> (n+1) in X by A16,A37,A43;
            b<>s
            proof
              assume
A46:          b=s;
              b.n = degree b by A37,A16,A43;
              then s = (EmptyBag m) +* (n,len d) by A21,A43,A46,Th19;
              hence thesis by A21,A14,A45,A19,A44,Th63;
            end;
            then Q . b = 0_(m,L).b by FUNCT_7:32
            .= 0.L by POLYNOM1:22;
            then PQ.b = (P.b) + 0.L by POLYNOM1:15
            .= P.b;
            hence thesis by A45,ZFMISC_1:136,A16,A37,A43;
          end;
          thus thesis by A37,A16;
        end;
        suppose
A47:      not b in Support P;
A48:      Support PQ c= Support P \/ Support Q by POLYNOM1:20;
A49:      b in Support Q by A35,A47,A48,XBOOLE_0:def 3;
          then
A50:      Support(Q) = {term(Q)} by POLYNOM7:7;
A51:      coefficient(Q)<>0.L by A49,POLYNOM7:def 5;
          then SgnMembershipNumber(d,L,E)<>0.L by POLYNOM7:9;
          then SgnMembershipNumber(d,L,E) is non zero by STRUCT_0:def 12;
          then
A52:      term(Q) = s by POLYNOM7:10;
          then
A53:      b=s by A49,A50,TARSKI:def 1;
          hence
A54:      degree b = 2 |^ (m-'1) by Th61,A19,A21;
A55:      PQ.b = (P.b)+(Q . b) by POLYNOM1:15
          .= 0.L + Q . b by POLYNOM1:def 3,A47,A36
          .= Q . b;
A56:      Q . b = SgnMembershipNumber(d,L,E) by A53,A52,A51,POLYNOM7:9;
          then Q .b = 1.L or Q .b = -1.L by Th62;
          then Q .b = 1'*'1.L or Q .b = (-1)'*'1.L by RING_3:60,61;
          hence ex i be Integer st  PQ.b = i '*' 1_L by A55;
          thus for n be Nat st b.n = 2 |^ (m-'1) holds
          (PQ.b = 1.L or PQ.b = -1.L) & (2 |^ (m-'1)) |-> (n+1) in X\/{d}
          proof
            let n be Nat such that
A57:        b.n = 2 |^ (m-'1);
A58:        n in dom b =m by A57,FUNCT_1:def 2,PARTFUN1:def 2;
            s = (EmptyBag m) +* (n,len d) by A57,A54,A21,A53,Th19;
            then d = len d |-> (n+1) by A19,A58,Th63;
            hence thesis by A21,A55,A56,Th62,ZFMISC_1:136;
          end;
          thus for n holds b.n is even by A18,A14,A7,Th60,A53;
        end;
      end;
      let f be FinSequence of L;
      let xf be Function of m,L such that
A59: xf = FS2XFS f;
      let CE be non-empty non empty FinSequence of (the carrier of L)*
      such that
A60:  CE = SignGenOp(f,A,F) * E;
      let Sce be Element of Fin dom App CE such that A61: Sce=X\/{d};
      dom xf = m by FUNCT_2:def 1;
      then
A62:  len f = m by A59,AFINSQ_1:def 8;
A63:  doms CE = D by HILB10_7:106,A60,A62;
      then d in doms CE;
      then
A64:  d in dom (App CE) by HILB10_7:def 9;
A65:  eval(Q,xf) = M "**" ((App CE).d) by A63,A60,A59,Th59
      .= (M "**" App CE).d by HILB10_7:def 10,A64;
      reconsider X1 = X as Element of Fin dom App CE
      by A63,HILB10_7:def 9;
      reconsider dd=d as Element of dom App CE by A63,HILB10_7:def 9;
      thus A $$ (Sce,M "**" App CE)
      = A. ( A $$ (X1,M "**" App CE),(M "**" App CE).dd)
      by SETWOP_2:2,FVSUM_1:8,A14,A61
      .= eval(P,xf)+eval(Q,xf) by A65,A17,A59,A60
      .= eval(PQ,xf) by POLYNOM2:23;
    end;
A66: for B being Element of Fin D holds P[B] from SETWISEO:sch 2(A10,A13);
    S is Element of Fin D by FINSUB_1:def 5;
    then consider P be Polynomial of m,L such that
A67:  card F |-> 1 in S implies
    P.((EmptyBag m) +* (0,2 |^ (m-'1))) = 1.L and
A68: (for b be bag of m st b in Support P holds
    degree b = 2 |^ (m-'1) & (ex i be Integer st  P.b = i '*' 1_L) &
    (for n be Nat st b.n = 2 |^ (m-'1) holds
    (P.b = 1.L or P.b = -1.L) & (2 |^ (m-'1)) |-> (n+1) in S) &
    for n holds b.n is even) and
A69: for f be FinSequence of L
    for xf be Function of m,L st xf = FS2XFS f
    for CE be non-empty non empty FinSequence of (the carrier of L)* st
    CE = SignGenOp(f,A,F) * E
    for Sce be Element of Fin dom App CE st Sce=S holds
    eval(P,xf) = A $$ (Sce,M "**" App CE) by A66;
    take P;
    thus P.((EmptyBag m) +* (0,2 |^ (m-'1))) = 1.L by A8,A67;
    thus for b be bag of m st b in Support P holds
    degree b = 2 |^ (m-'1) & (ex i be Integer st  P.b = i '*' 1_L) &
    (2 |^ (m-'1) in rng b implies P.b = 1.L or P.b = -1.L)&
    for n holds b.n is even
    proof
      let b be bag of m such that
A70: b in Support P;
      2 |^ (m-'1) in rng b implies P.b = 1.L or P.b = -1.L
      proof
        assume 2 |^ (m-'1) in rng b;
        then consider n be object such that
A71:    n in dom b & b.n = 2 |^ (m-'1) by FUNCT_1:def 3;
        dom b = Segm m by PARTFUN1:def 2;
        hence thesis by A70,A68,A71;
      end;
      hence thesis by A70,A68;
    end;
    let f be FinSequence of L;
    let xf be Function of m,L such that
A72: xf = FS2XFS f;
    set CE = SignGenOp(f,A,F) * E;
    len (FS2XFS f) = m by A72,FUNCT_2:def 1;
    then
A73: len f = m by AFINSQ_1:def 8;
A74: for x st x in dom CE holds CE.x is non empty
    proof
      let x;
      assume x in dom CE;
      then CE.x = SignGen(f,A,E.x) by HILB10_7:80;::HILB10_7:40;
      hence thesis by A73;
    end;
    reconsider CE as non-empty non empty FinSequence of
    (the carrier of L)* by A74,FUNCT_1:def 9;
    doms CE = D by A73,HILB10_7:106;
    then S c= doms CE;
    then S c= dom App CE by HILB10_7:def 9;
    then reconsider Sce = S as Element of Fin dom App CE by FINSUB_1:def 5;
    SignGenOp(f,M,A,Seg m\{1}) = A $$ (Sce,M "**" App CE) by A9,A73;
    hence thesis by A72,A69;
  end;
end;

definition
  let f be real-valued FinSequence;
  func _sqrt(f) -> FinSequence of F_Complex means :Def11:
    len it = len f &
    it.1 = f.1 &
    for i be Nat st i in dom f & i <> 1 holds
      (it.i)^2 = f.i &
      Re (it.i) >=0 & Im (it.i) >=0;
  existence
  proof
    defpred P[object,object] means $2 is Complex & ($1 = 1 implies $2=f.1) &
      ($1 <>1 implies
      for z be Complex st z = $2
       holds z^2 = f.$1 & Re (z) >=0 & Im (z) >=0);
A1: for i be Nat st i in Seg len f ex y be object st P[i,y]
      proof
        let i be Nat such that i in Seg len f;
        per cases;
        suppose
A2:       i=1;
          take F=f.1;
          thus thesis by A2;
        end;
        suppose
A3:       i<>1;
          per cases;
          suppose
A4:         f.i >=0;
            take z1 = sqrt (f.i);
            thus z1 is Complex & (i = 1 implies z1=f.1) by A3;
            assume i<>1;
            let z be Complex;
            thus thesis by SQUARE_1:def 2,A4,COMPLEX1:def 2;
          end;
          suppose
A5:         f.i < 0;
            take z1 = (sqrt (-f.i))*<i>;
            thus z1 is Complex & (i = 1 implies z1=f.1) by A3;
            assume i<>1;
            let z be Complex such that
A6:         z = z1;
A7:         sqrt (-f.i) >=0 & (sqrt (-f.i))*(sqrt (-f.i))= (sqrt (-f.i))^2
            = -f.i by SQUARE_1:def 1,def 2,A5;
            Re(z1 * z1) = Re z1 * Re z1 - Im z1 * Im z1 &
            Im(z1 * z1) = Re z1 * Im z1 + Re z1 * Im z1 by COMPLEX1:9;
            hence thesis by A6,A7,SQUARE_1:def 1;
          end;
        end;
      end;
    consider p be FinSequence such that
A9:  dom p = Seg len f & for k be Nat st k in Seg len f holds P[k,p.k]
    from FINSEQ_1:sch 1(A1);
    rng p c= the carrier of F_Complex
    proof
      let y be object such that
A10:  y in rng p;
      consider x be object such that
A11:  x in dom p & p.x = y by A10,FUNCT_1:def 3;
      P[x,p.x] by A11,A9;
      then p.x in COMPLEX by XCMPLX_0:def 2;
      hence thesis by A11,COMPLFLD:def 1;
    end;
    then reconsider p as FinSequence of F_Complex by FINSEQ_1:def 4;
    take p;
    thus  len p = len f by A9,FINSEQ_1:def 3;
A12: dom p = dom f by A9,FINSEQ_1:def 3;
    thus p.1 = f.1
    proof
      per cases;
      suppose 1 in dom p;
        hence thesis by A9;
      end;
      suppose
A13:    not 1 in dom p;
        hence  p.1 =0 by FUNCT_1:def 2
        .= f.1 by A13,A12,FUNCT_1:def 2;
      end;
    end;
    let i be Nat;
    thus thesis by A12,A9;
  end;
  uniqueness
  proof
    let C1,C2 be FinSequence of F_Complex such that
A14:  len C1 = len f & C1.1 = f.1 and
A15:  for i be Nat st i in dom f & i <> 1 holds
       (C1.i)^2 = f.i & Re (C1.i) >=0 & Im (C1.i) >=0 and
A16:   len C2 = len f & C2.1 = f.1 and
A17:    for i be Nat st i in dom f & i <> 1 holds
    (C2.i)^2 = f.i & Re (C2.i) >=0 & Im (C2.i) >=0;
    for i be Nat st 1<= i <= len C1  holds C1.i=C2.i
    proof
      let i be Nat such that
A18:  1<= i <= len C1;
      per cases by A18,XXREAL_0:1;
      suppose i=1;
        hence thesis by A14,A16;
      end;
      suppose
A19:    i >1;
        i in dom f by A18,A14,FINSEQ_3:25;
        then (C1.i)^2 = f.i & Re (C1.i) >=0 & Im (C1.i) >=0 &
        (C2.i)^2 = f.i & Re (C2.i) >=0 & Im (C2.i) >=0 by A19,A17,A15;
        hence thesis by Th2;
      end;
    end;
    hence thesis by A14,A16,FINSEQ_1:14;
  end;
end;

definition
  let L be non empty 1-sorted;
  let m be set;
  let P be Series of m,L;
  func JsqrtSeries P -> Series of m,L means :Def12:
     for b be bag of m holds
       it.b = P.( 2(#)b +* (0,b.0));
  existence
  proof
    defpred P[bag of m,object] means $2 = P.( 2(#)$1 +* (0,$1.0));
A1: for x being Element of Bags m ex y being Element of L st P[x,y];
    consider P be Function of (Bags m), the carrier of L such that
A2: for b being Element of Bags m holds P[b, P.b] from FUNCT_2:sch 3(A1);
    take P;
    let b be bag of m;
    b in Bags m by PRE_POLY:def 12;
    hence thesis by A2;
  end;
  uniqueness
  proof
    let S1,S2 be Series of m,L such that
A3:   for b be bag of m holds S1.b = P.( 2(#)b +* (0,b.0)) and
A4:   for b be bag of m holds S2.b = P.( 2(#)b +* (0,b.0));
    for x st x in Bags m holds S1.x = S2.x
    proof
      let b be object such that
A5:   b in Bags m;
      reconsider b as Element of Bags m by A5;
      S1.b = P.( 2(#)b +* (0,b.0)) by A3
      .= S2.b by A4;
      hence thesis;
    end;
    hence thesis;
  end;
end;

registration
  let L be non empty ZeroStr;
  let m be Ordinal;
  let P be Polynomial of m,L;
  cluster JsqrtSeries P -> finite-Support;
  coherence
  proof
    set C=JsqrtSeries P;
    deffunc F(bag of m) = 2(#)$1 +* (0,$1.0);
    defpred P[bag of m,bag of m] means $1 = F($2);
    set S = { x where x is Element of Bags m:
      ex w being Element of Bags m st P[w,x] & w in Support P };
A1: Support P is finite by POLYNOM1:def 5;
A2: for w being Element of Bags m, x,y being Element of Bags m st
         P[w,x] & P[w,y] holds x = y by Th20;
A3: S is finite from FRAENKEL:sch 28(A1,A2);
A4: dom C = Bags m = dom P by FUNCT_2:def 1;
    Support C c= S
    proof
      let x be object;
      assume
A5:   x in Support C;
      then
A6:   x in dom C & C.x <> 0.L by POLYNOM1:def 3;
      reconsider x as bag of m by A5;
A7:   F(x) in Bags m by PRE_POLY:def 12;
      C.x = P.F(x) by Def12;
      then F(x) in Support P by A7,A6,A4,POLYNOM1:def 3;
      hence thesis by A5;
    end;
    hence thesis by A3,POLYNOM1:def 5;
  end;
end;

theorem Th65:
  for L be non empty ZeroStr
  for m be Nat
  for p be Polynomial of m,L st
    for b be bag of m,n st b in Support p holds b.n is even
  for CS be one-to-one FinSequence of Bags m st
    rng CS = Support JsqrtSeries p
  ex S be one-to-one FinSequence of Bags m st
    len S = len CS & rng S = Support p &
    for i st i in dom S holds S.i = 2(#)(CS/.i) +* (0,(CS/.i.0))
proof
  let L be non empty ZeroStr;
  let m be Nat;
  let p be Polynomial of m,L such that
A1: for b be bag of m,n st b in Support p holds b.n is even;
  let CS be one-to-one FinSequence of Bags m such that
A2:rng CS = Support JsqrtSeries p;
  deffunc B(bag of m) = 2(#)$1 +* (0,$1.0);
  deffunc F(object) = B(CS/.$1);
  consider S be FinSequence such that
A3:len S = len CS & for k st k in dom S holds S.k=F(k) from FINSEQ_1:sch 2;
A4:dom S = dom CS by A3,FINSEQ_3:29;
A5:rng S c= Support p
  proof
    let y be object such that
A6: y in rng S;
    consider x such that
A7: x in dom S & S.x = y by A6,FUNCT_1:def 3;
    reconsider x as Nat by A7;
A8: (JsqrtSeries p).(CS/.x) = p.B(CS/.x) by Def12;
A9: B(CS/.x) in Bags m by PRE_POLY:def 12;
    CS.x = CS/.x & CS.x in rng CS by A7,A4,FUNCT_1:def 3,PARTFUN1:def 6;
    then (JsqrtSeries p).(CS/.x) <> 0.L by A2,POLYNOM1:def 4;
    then B(CS/.x) in Support p by A8,A9,POLYNOM1:def 4;
    hence thesis by A7,A3;
  end;
A10:Support p c= rng S
  proof
    let b be object such that
A11:b in Support p;
A12:b in dom p & p.b <>0.L by A11,POLYNOM1:def 3;
    reconsider b as bag of m by A11;
    defpred P[object,object] means
    ( $1 = 0 implies $2=b.0) &
    ( $1 <> 0 implies $2 = (1/2)*b.$1);
A13:  for x be object st x in m ex y being object st y in NAT & P[x,y]
    proof
      let x such that
A14:  x in m;
      x in Segm m by A14;
      then reconsider x as Nat;
      b.x is even by A11,A1;
      then consider i be Nat such that
A15:  b.x = 2*i by ABIAN:def 2;
      per cases;
      suppose
A16:    x=0;
        take b.x;
        thus thesis by A16,ORDINAL1:def 12;
      end;
      suppose
A17:    x<>0;
        take i;
        thus thesis by A17,A15,ORDINAL1:def 12;
      end;
    end;
    consider f be Function such that
A18:  dom f = m & rng f c= NAT
    & for x being object st x in m holds P[x,f.x] from FUNCT_1:sch 6(A13);
    reconsider f as ManySortedSet of m
    by A18,RELAT_1:def 18,PARTFUN1:def 2;
    reconsider f as bag of m by A18, VALUED_0:def 6;
A19:f in Bags m by PRE_POLY:def 12;
A20: dom b = m = dom (2(#)f) &
    m = dom (2(#)f +* (0,f.0)) by PARTFUN1:def 2;
    for x st x in m holds b.x = (2(#)f +* (0,f.0)).x
    proof
      let x such that
A21:  x in m;
      per cases;
      suppose
A22:    x=0;
        hence (2(#)f +* (0,f.0)).x = f.0 by A21,A20,FUNCT_7:31
        .= b.x by A22,A18,A21;
      end;
      suppose
A23:    x<>0;
        hence (2(#)f +* (0,f.0)).x = (2(#)f).x by FUNCT_7:32
        .= 2*(f.x) by VALUED_1:6
        .= 2*((1/2)*b.x) by A23,A18,A21
        .= b.x;
      end;
    end;
    then
A24: b = 2(#)f +* (0,f.0) by A20;
    then (JsqrtSeries p).f = p.b by Def12;
    then f in Support (JsqrtSeries p) by A12,A19,POLYNOM1:def 4;
    then consider x such that
A25: x in dom CS & CS.x = f by A2,FUNCT_1:def 3;
    reconsider x as Nat by A25;
A26: f = CS/.x by A25,PARTFUN1:def 6;
    S.x = b by A24,A26,A25,A4,A3;
    hence thesis by A25,A4,FUNCT_1:def 3;
  end;
  then
A27: Support p = rng S by A5,XBOOLE_0:def 10;
  S is one-to-one
  proof
    let x1,x2 be object such that
A28: x1 in dom S & x2 in dom S & S.x1=S.x2;
    reconsider x1,x2 as Nat by A28;
    B(CS/.x1)=S.x1 = B(CS/.x2) by A3,A28;
    then CS.x1 = CS/.x1 = CS/.x2 = CS.x2 by Th20,A4,A28,PARTFUN1:def 6;
    hence thesis by A4,A28,FUNCT_1:def 4;
  end;
  then reconsider S as one-to-one FinSequence of Bags m by A27,FINSEQ_1:def 4;
  take S;
  thus thesis by A10,A3,A5,XBOOLE_0:def 10;
end;

theorem Th66:
  for m be non trivial Nat
    for p be Jpolynom of m,F_Complex
      for f be FinSequence of REAL
        for xf,cxf be Function of m,F_Complex st
      xf = FS2XFS f & cxf = FS2XFS _sqrt(f) holds
  eval(p,cxf) = eval(JsqrtSeries p,xf)
proof
  let m be non trivial Nat;
  let p be Jpolynom of m,F_Complex;
  reconsider L=F_Complex as Field;
  let f be FinSequence of REAL;
  let xf,cxf be Function of m,F_Complex such that
A1:  xf = FS2XFS f &cxf = FS2XFS _sqrt(f);
  reconsider xfL=xf,cxfL=cxf  as Function of m,L;
  m>1 by NEWTON03:def 1;
  then
A2:for b be bag of m,n st b in Support p holds b.n is even by Def10;
  set c = JsqrtSeries p;
  reconsider P=p,C=c as Polynomial of m,L;
  set CS = SgmX(BagOrder m, Support C);
  consider Cy be FinSequence of L such that
A3: len Cy = len CS & eval(C,xfL) = Sum Cy and
A4: for i be Element of NAT st 1 <= i & i <= len Cy holds
  Cy/.i = (C * CS)/.i * eval((CS/.i),xfL) by POLYNOM2:def 4;
  BagOrder m linearly_orders  Support C by POLYNOM2:18;
  then
A5: rng CS = Support C & CS is one-to-one by PRE_POLY:def 2,10;
  then consider S be one-to-one FinSequence of Bags m such that
A6:len S = len CS & rng S = Support p and
A7:for i st i in dom S holds S.i = 2(#)(CS/.i) +* (0,(CS/.i.0)) by A2,Th65;
  consider y being FinSequence of L such that
A8: len y = card Support p & eval(P,cxfL) = Sum y and
A9: for i being Nat st 1 <= i & i <= len y holds
      y/.i = (P * S)/.i * eval(S/.i,cxfL) by A6,HILB10_2:24;
A10: card Support p = len S by A6,FINSEQ_4:62;
  for i st 1 <= i & i <= len y holds y.i = Cy.i
  proof
    let i such that
A11:1 <= i & i <= len y;
A12:i in NAT by ORDINAL1:def 12;
    rng CS c= Bags m = dom C by A5,FUNCT_2:def 1;
    then
A13: dom (C*CS) = dom CS by RELAT_1:27;
    rng S c= Bags m = dom P by A6,FUNCT_2:def 1;
    then
A14: dom (P*S) = dom S by RELAT_1:27;
A15: i in dom CS & i in dom S & i in dom y & i in dom Cy
    by A11,A10,A3,A6,A8,FINSEQ_3:25;
A16: (P * S)/.i = (P*S).i = P.(S.i) & S.i = S/.i
    by A14,A11,A10,A8,FINSEQ_3:25,PARTFUN1:def 6,FUNCT_1:12;
A17: (C * CS)/.i = (C*CS).i = C.(CS.i) & CS.i = CS/.i
    by A13,A11,A10,A6,A8,FINSEQ_3:25,PARTFUN1:def 6,FUNCT_1:12;
A18: S.i = 2(#)(CS/.i) +* (0,(CS/.i.0))
    by A11,A10,A8,FINSEQ_3:25,A7;
    then
A19:(C * CS)/.i = (P * S)/.i by A16,A17,Def12;
A20:Cy/.i = (C * CS)/.i * eval((CS/.i),xfL) by A12,A4,A11,A10,A3,A6,A8;
A21: y/.i = (P * S)/.i * eval(S/.i,cxfL) by A9,A11;
    set Si =SgmX(RelIncl m, support (S/.i));
    consider a be FinSequence of the carrier of L such that
A22: len a = len Si & eval(S/.i,cxfL) = Product a and
A23: for j being Element of NAT st 1 <= j & j <= len a holds
    a/.j = power(L).((cxfL * Si)/.j,
    ((S/.i) * Si)/.j) by POLYNOM2:def 2;
    support (S/.i) = support (CS/.i) by A16,A18,Th21;
    then consider Ca be FinSequence of the carrier of L such that
A24: len Ca = len Si & eval(CS/.i,xfL) = Product Ca and
A25: for j being Element of NAT st 1 <= j & j <= len Ca holds
    Ca/.j = power(L).((xfL * Si)/.j,
    ((CS/.i) * Si)/.j) by POLYNOM2:def 2;
    RelIncl m linearly_orders support (S/.i) by PRE_POLY:82;
    then
A26: rng Si = support (S/.i) by PRE_POLY:def 2;
    rng Si c= m = dom (S/.i) & m = dom (CS/.i) by A26,PARTFUN1:def 2;
    then
A27: dom ((CS/.i) * Si) = dom Si = dom ((S/.i) * Si) by RELAT_1:27;
    dom xfL = m = dom cxfL by FUNCT_2:def 1;
    then
A28: dom (xfL * Si) = dom Si = dom (cxfL * Si) by A26,RELAT_1:27;
    for j st 1<=j<= len a holds a.j = Ca.j
    proof
      let j such that
A29:  1<=j<= len a;
A30:  j in NAT by ORDINAL1:def 12;
A31:  j in dom Si & j in dom a & j in dom Ca by A29,A22,A24,FINSEQ_3:25;
      then
A32:  a.j = a/.j & Ca.j = Ca/.j by PARTFUN1:def 6;
A33: (cxfL * Si)/.j =(cxfL * Si).j = cxfL .(Si.j) & Si.j=Si/.j
      by A29,A22,FINSEQ_3:25,A28,PARTFUN1:def 6,FUNCT_1:12;
A34: ((S/.i) * Si)/.j = ((S/.i) * Si).j = (S/.i).( Si.j)
      by A27,A29,A22,FINSEQ_3:25,PARTFUN1:def 6,FUNCT_1:12;
A35:  (xfL * Si)/.j =(xfL * Si).j = xfL .(Si.j)
      by A28,A29,A22,FINSEQ_3:25,PARTFUN1:def 6,FUNCT_1:12;
A36:  ((CS/.i) * Si)/.j = ((CS/.i) * Si).j = (CS/.i).( Si.j)
      by A27,A29,A22,FINSEQ_3:25,PARTFUN1:def 6,FUNCT_1:12;
A37:  Si.j in rng Si by A31,FUNCT_1:def 3;
      then
A38:  Si.j in m=Segm m by A26;
      then reconsider Sij=Si.j as Nat;
A39:  Sij < m by A38,NAT_1:44;
A40:  len f = len (FS2XFS f) = m = len (FS2XFS (_sqrt f)) = len _sqrt(f)
      by A1,AFINSQ_1:def 8,FUNCT_2:def 1;
A41:  xfL .Sij = f.(Sij+1) by A1,A40,A38,NAT_1:44,AFINSQ_1:def 8;
A42:  cxfL .Sij = (_sqrt f).(Sij+1) by A1,A40,A38,NAT_1:44,AFINSQ_1:def 8;
A43:  Ca/.j = power(L).((xfL * Si)/.j,
      ((CS/.i) * Si)/.j) by A30,A22,A24,A25,A29;
A44:  dom (2(#)(CS/.i))=m by PARTFUN1:def 2;
      1<= Sij+1 <= m by A39,NAT_1:11,13;
      then
A45:  Sij+1 in dom f by A40,FINSEQ_3:25;
      per cases;
      suppose
A46:    Sij =0;
        then
A47:    (cxfL * Si)/.j = (xfL * Si)/.j by A41,A42,A33,A35,Def11;
        ((S/.i) * Si)/.j=
        (2(#)(CS/.i) +* (0,(CS/.i.0))).Sij
        by A14,A11,A10,A8,FINSEQ_3:25,PARTFUN1:def 6,A18,A34
        .= ((CS/.i) * Si)/.j by A36,A46,A37,A26,A44,FUNCT_7:31;
        hence thesis by A47,A32,A30,A23,A29,A43;
      end;
      suppose
A48:    Sij<>0;
        then Sij+1<>1;
        then ((_sqrt f).(Sij+1))*((_sqrt f).(Sij+1))=
           ((_sqrt f).(Sij+1))^2 = f.(Sij+1) by A45,Def11,SQUARE_1:def 1;
        then
A49:    multcomplex.(((_sqrt f).(Sij+1)),
        ((_sqrt f).(Sij+1))) = f.(Sij+1) by BINOP_2:def 5;
        ((S/.i) * Si)/.j= (2(#)(CS/.i) +* (0,(CS/.i.0))).Sij
        by A14,A11,A10,A8,FINSEQ_3:25,PARTFUN1:def 6,A18,A34
        .= (2(#)(CS/.i)).Sij by A48,FUNCT_7:32
        .= 2*((CS/.i) * Si)/.j by A36,VALUED_1:6;
        hence a.j = power(L).((cxfL * Si)/.j,
        ((CS/.i) * Si)/.j+((CS/.i) * Si)/.j) by A32,A30,A23,A29
        .= power(L).((cxfL * Si)/.j,((CS/.i) * Si)/.j)
        * power(L).((cxfL * Si)/.j,((CS/.i) * Si)/.j) by HURWITZ:3
        .= power(L).((cxfL * Si)/.j * (cxfL * Si)/.j,((CS/.i) * Si)/.j)
        by GROUP_1:52
        .= power(L).((xfL * Si)/.j,((CS/.i) * Si)/.j)
        by A49,A41,A42,A33,A35,COMPLFLD:def 1
        .= Ca.j by A32,A30,A22,A24,A25,A29;
      end;
    end;
    then Cy/.i = y/.i=y.i by A19,A20,A21,A15,PARTFUN1:def 6,
    A22,A24,FINSEQ_1:14;
    hence thesis by A15,PARTFUN1:def 6;
  end;
  hence thesis by A8,A3,A6,FINSEQ_4:62,FINSEQ_1:14;
end;

theorem Th67:
  for fc be FinSequence of F_Complex, fr be FinSequence of F_Real st fc = fr
    holds Product fc = Product fr
proof
  reconsider FC = F_Complex,FR = F_Real as Field;
  defpred P[Nat]means
  for fc be FinSequence of FC,
  fr be FinSequence of FR st fc=fr & len fc =$1 holds
  Product fc = Product fr;
A1:P[0]
  proof
    let fc be FinSequence of FC,
    fr be FinSequence of FR such that
A2: fc = fr & len fc =0;
A3: fc = <*>the carrier of FC & fr = fc = <*>the carrier of FR by A2;
    hence
    Product fc = 1_FR by COMPLEX1:def 4,COMPLFLD:8,GROUP_4:8
    .= Product fr by A3,GROUP_4:8;
  end;
A4: P[n] implies P[n+1]
  proof
    assume
A5: P[n];
    set n1=n+1;
    let fc be FinSequence of FC,
    fr be FinSequence of FR such that
A6: fc = fr & len fc =n1;
    reconsider x=Product (fr|n),y=fr/.n1 as Real;
    n < n1 by NAT_1:13;
    then
A7: len (fc|n) = n =len (fr|n) by A6,FINSEQ_1:59;
    1<= n1 by NAT_1:11;
    then
A8: fc/.n1 = fc.n1 = fr/.n1 by A6,PARTFUN1:def 6,FINSEQ_3:25;
A9: fr = (fr|n)^<*fr/.n1*> &
    fc = (fc|n)^<*fc/.n1*> by A6,FINSEQ_5:21;
    hence Product fc = Product (fc|n) * fc/.n1 by GROUP_4:6
    .= multcomplex.(Product (fc|n),fc/.n1) by COMPLFLD:def 1
    .= multcomplex.(x,y) by A5,A6,A7,A8
    .= x*y by BINOP_2:def 5
    .= Product (fr|n) * fr/.n1 by BINOP_2:def 11
    .= Product fr by A9,GROUP_4:6;
  end;
  let fc be FinSequence of F_Complex,fr be FinSequence of F_Real such that
A10: fc = fr;
  P[n] from NAT_1:sch 2(A1,A4);
  then P[len fc];
  hence thesis by A10;
end;

theorem Th68:
  for m be Ordinal for b be bag of m
    for xc be Function of m,F_Complex,xr be Function of m,F_Real st
      xc = xr
  holds eval(b,xc) = eval(b,xr)
proof
  let m be Ordinal;
  let b be bag of m;
  let xc be Function of m,F_Complex, xr be Function of m,F_Real such that
A1:xc = xr;
  reconsider FC = F_Complex,FR = F_Real as Field;
  reconsider xc as Function of m,FC;
  reconsider xr as Function of m,FR;
  set S=SgmX(RelIncl m, support b);
  consider yC being FinSequence of FC such that
A2: len yC = len S & eval(b,xc) = Product yC and
A3: for i being Element of NAT st 1 <= i & i <= len yC holds
  yC/.i = power(FC).((xc * S)/.i,(b * S)/.i) by POLYNOM2:def 2;
  consider yR being FinSequence of FR such that
A4: len yR = len S & eval(b,xr) = Product yR and
A5: for i being Element of NAT st 1 <= i & i <= len yR holds
  yR/.i = power(FR).((xr * S)/.i,(b * S)/.i) by POLYNOM2:def 2;
  RelIncl m linearly_orders  support b by PRE_POLY:82;
  then
A6: rng  S = support b by PRE_POLY:def 2;
A7: dom xc = m = dom xr & m = dom b by PARTFUN1:def 2;
A8: dom (xc*S) = dom S & dom (xr*S) = dom S &
  dom (xr*S) = dom S by A6,A7,RELAT_1:27;
  for i st 1<=i <= len S holds yC.i = yR.i
  proof
    let i such that
A9:1<=i<=len S;
A10:i in NAT & (b * S)/.i in NAT by ORDINAL1:def 12;
    reconsider r=(xr * S)/.i as Real;
A11: i in dom S & i in dom yR & i in dom yC by A9,FINSEQ_3:25,A2,A4;
A12: (xc * S)/.i = (xc * S).i = xc.(S.i) &
    (xr * S)/.i = (xr * S).i = xr.(S.i)
    by PARTFUN1:def 6,A9,FINSEQ_3:25,A8,FUNCT_1:12;
    then
A13: ex x being Real st x = (xc * S)/.i &
    (power F_Complex).((xc * S)/.i,(b * S)/.i) =
    x |^ (b * S)/.i by A1,UNIROOTS:43;
    thus yR.i = yR/.i by A11,PARTFUN1:def 6
    .=power(FR).((xr * S)/.i,(b * S)/.i) by A10,A9,A4,A5
    .=(power FC).((xc * S)/.i,(b * S)/.i) by NIVEN:7,A13,A12,A1
    .= yC/.i by A10,A9,A2,A3
    .=yC.i by A11,PARTFUN1:def 6;
  end;
  hence thesis by Th67,A4,A2,FINSEQ_1:14;
end;

theorem Th69:
  for m be Ordinal
     for Pc be Polynomial of m,F_Complex,
         Pr be Polynomial of m,F_Real st Pc = Pr
      for xc be Function of m,F_Complex,
          xr be  Function of m,F_Real st xc = xr
  holds eval(Pc,xc) = eval(Pr,xr)
proof
  let m be Ordinal;
  let Pc be Polynomial of m,F_Complex,Pr be Polynomial of m,F_Real such that
A1: Pc = Pr;
  let xc be Function of m,F_Complex,
  xr be  Function of m,F_Real such that
A2:xc = xr;
  reconsider FC = F_Complex,FR = F_Real as Field;
  reconsider Pc as Polynomial of m,FC;
  reconsider Pr as Polynomial of m,FR;
  reconsider xc as Function of m,FC;
  reconsider xr as Function of m,FR;
  set S=SgmX(BagOrder m, Support Pc);
  consider Cy be FinSequence of the carrier of FC such that
A3:len Cy = len S & eval(Pc,xc) = Sum Cy and
A4: for i be Element of NAT st 1 <= i & i <= len Cy holds
  Cy/.i = (Pc * S)/.i * eval((S/.i),xc) by POLYNOM2:def 4;
A5: 0.FC = 0.FR by COMPLFLD:def 1;
A6: Support Pc c= Support Pr
  proof
    let x be object;
    assume x in Support Pc;
    then x in dom Pc & Pc.x <> 0.FC by POLYNOM1:def 3;
    hence thesis by A5,A1,POLYNOM1:def 3;
  end;
  Support Pr c= Support Pc
  proof
    let x be object;
    assume x in Support Pr;
    then x in dom Pr & Pr.x <> 0.FR by POLYNOM1:def 3;
    hence thesis by A5,A1,POLYNOM1:def 3;
  end;
  then
A7:Support Pr = Support Pc by A6,XBOOLE_0:def 10;
  then consider Ry be FinSequence of the carrier of FR such that
A8:len Ry = len S & eval(Pr,xr) = Sum Ry and
A9: for i be Element of NAT st 1 <= i & i <= len Ry holds
    Ry/.i = (Pr * S)/.i * eval((S/.i),xr) by POLYNOM2:def 4;
  defpred P[Nat] means for i be Nat st i=$1 <= len S holds
  Sum (Ry|i)= Sum (Cy|i);
A10:P[0]
  proof
    let i such that
A11: i= 0<= len S;
    Ry|0 = <*> the carrier of FR & Cy|0 = <*> the carrier of FC;
    then Sum (Ry|i) = 0.FR & Sum (Cy|i) = 0.FC by A11,RLVECT_1:43;
    hence thesis by COMPLFLD:def 1;
  end;
A12:P[n] implies P[n+1]
  proof
    assume
A13:P[n];
    let n1 be Nat such that
A14: n1=n+1 <= len S;
    n < len S by A14,NAT_1:13;
    then
A15: Sum (Ry|n) =Sum (Cy|n) by A13;
    reconsider s1=Sum (Ry|n),s2=Ry/.n1 as Real;
    Ry|n1 = (Ry|n) ^ <*Ry/.n1*> by A14,A8,FINSEQ_5:82;
    then Sum (Ry|n1) = Sum (Ry|n) + Sum <*Ry/.n1*> by RLVECT_1:41;
    then
A16: Sum (Ry|n1) = (the addF of FR).(Sum (Ry|n),Ry/.n1) by RLVECT_1:44
    .= s1+s2 by BINOP_2:def 9;
    Cy|n1 = (Cy|n) ^ <*Cy/.n1*> by A14,A3,FINSEQ_5:82;
    then Sum (Cy|n1) = Sum (Cy|n) + Sum <*Cy/.n1*> by RLVECT_1:41;
    then
A17:Sum (Cy|n1) = Sum (Cy|n) + Cy/.n1 by RLVECT_1:44
    .= addcomplex.(Sum (Cy|n),Cy/.n1) by COMPLFLD:def 1;
    BagOrder m linearly_orders  Support Pr by POLYNOM2:18;
    then rng S = Support Pr by A7,PRE_POLY:def 2;
    then rng S c= Bags m = dom Pr by FUNCT_2:def 1;
    then
A18: dom (Pr*S) = dom S & dom (Pc*S) = dom S by A1,RELAT_1:27;
    n1 in dom S by A14,NAT_1:11,FINSEQ_3:25;
    then
A19:(Pr * S)/.n1 = (Pr * S).n1 = (Pc * S)/.n1
      by A1,A18,PARTFUN1:def 6;
    reconsider r1=(Pr * S)/.n1, r2= eval((S/.n1),xr) as Real;
    Ry/.n1 = (Pr * S)/.n1 * eval((S/.n1),xr) by A9,A14,A8,NAT_1:11
    .= r1*r2 by BINOP_2:def 11
    .= multcomplex.(r1,r2) by BINOP_2:def 5
    .= (the multF of FC).(r1,r2) by COMPLFLD:def 1
    .= (Pc * S)/.n1 * eval((S/.n1),xc) by A2,Th68,A19
    .= Cy/.n1 by A14,NAT_1:11,A3,A4;
    hence thesis by A15,A16,A17,BINOP_2:def 3;
  end;
  P[n] from NAT_1:sch 2(A10,A12);
  then Sum (Ry|len S) = Sum (Cy|len S);
  hence thesis by A3,A8;
end;

definition
  let m be Nat such that
A1: m >1;
  let M be Jpolynom of m,F_Complex;
  func Jsqrt M-> INT -valued Polynomial of m,F_Real equals :Def13:
    JsqrtSeries M;
  coherence
proof
  set c = JsqrtSeries M;
A2: dom c = Bags m =dom M by FUNCT_2:def 1;
A3:rng c c= INT
  proof
    let y be object such that
A4: y in rng c;
    consider x such that
A5: x in dom c & c.x = y by A4,FUNCT_1:def 3;
    reconsider x as bag of m by A5;
    per cases;
    suppose not x in Support c;
      then c.x = 0.F_Complex by A5,POLYNOM1:def 3
      .= 0 by COMPLFLD:def 1;
      hence thesis by A5,INT_1:def 2;
    end;
    suppose x in Support c;
      then
A6:   c.x<>0.F_Complex by POLYNOM1:def 4;
A7:   2(#)x +* (0,x.0) in Bags m by PRE_POLY:def 12;
A8:   c.x = M.( 2(#)x +* (0,x.0)) by Def12;
      then 2(#)x +* (0,x.0) in Support M by A7,A2,A6,POLYNOM1:def 3;
      then consider i be Integer such that
A9:   M.(2(#)x +* (0,x.0)) = i '*' 1_F_Complex by A1,Def10;
      M.(2(#)x +* (0,x.0)) = i by A9,Th1;
      hence thesis by A5,A8,INT_1:def 2;
    end;
  end;
  then rng c c= REAL by NUMBERS:15;
  then reconsider r=c as Series of m,F_Real by A2,FUNCT_2:2;
A10: 0.F_Complex = 0.F_Real by COMPLFLD:def 1;
A11: Support r c= Support c
  proof
    let y be object;
    assume y in Support r;
    then y in dom r & r.y<>0.F_Real by POLYNOM1:def 3;
    hence thesis by A10,POLYNOM1:def 3;
  end;
  reconsider r as Polynomial of m,F_Real by A11,POLYNOM1:def 5;
  rng r c= INT by A3;
  hence thesis by RELAT_1:def 19;
end;
end;

theorem Th70:
  for m be non trivial Nat, M be Jpolynom of m,F_Complex
    for f be Function of m,F_Real
  holds
    eval(Jsqrt M,f)=0 iff ex A be Subset of Seg m\{1} st
      (the addF of F_Complex) "**"
      SignGen(_sqrt XFS2FS(@f),the addF of F_Complex,A) = 0
proof
  let m be non trivial Nat;
  let M be Jpolynom of m,F_Complex;
  let f be Function of m,F_Real;
  reconsider F = XFS2FS(@f) as FinSequence of REAL;
  set MC = the multF of F_Complex,AC=the addF of F_Complex;
  rng (FS2XFS F) c= COMPLEX by NUMBERS:11;
  then
A1: rng (FS2XFS F) c= the carrier of F_Complex by COMPLFLD:def 1;
A2: len F = len (FS2XFS F) = len @f = m by AFINSQ_1:def 8,CARD_1:def 7;
  then reconsider xf = FS2XFS F as Function of m,F_Complex by A1,FUNCT_2:2;
A3:len _sqrt(F) =m by A2,Def11;
  then reconsider cF = _sqrt(F) as m-element FinSequence of F_Complex
  by CARD_1:def 7;
A4: rng (FS2XFS cF) c= the carrier of F_Complex by RELAT_1:def 19;
  dom (FS2XFS cF) = m by A3,AFINSQ_1:def 8;
  then reconsider fcf = FS2XFS cF as Function of m,F_Complex
  by A4,FUNCT_2:2;
A5:m>1 by NEWTON03:def 1;
A6: Jsqrt M = JsqrtSeries M by NEWTON03:def 1,Def13;
  eval(Jsqrt M,f) = eval(JsqrtSeries M,xf) by A6,Th69;
  then eval(Jsqrt M,f) = eval(M,fcf) by Th66;
  then
A7: eval(Jsqrt M,f) = SignGenOp(cF,MC,AC,Seg m\{1}) by A5,Def10;
  set B= Seg m\{1}, theE= the Enumeration of bool B;
  set CE= SignGenOp(cF,AC,bool B) * theE;
A8: SignGenOp(cF,MC,AC,B) = MC $$ ([#]dom CE,AC "**" CE ) by HILB10_7:def 13;
  defpred P[set] means for X be Element of Fin dom CE st X=$1 holds
  MC $$ ( X,AC "**" CE) = 0.F_Complex iff ex x st x in X & 0.F_Complex
  = (AC "**" CE).x;
A9: MC = multcomplex by COMPLFLD:def 1;
  MC $$ ( {}.dom CE,AC "**" CE) = the_unity_wrt MC by SETWISEO:31
  .= 1 by BINOP_2:6,COMPLFLD:def 1,A9;
  then
A10:P[{}.dom CE] by COMPLFLD:def 1;
A11: for B9 being (Element of Fin dom CE), b being Element of dom CE holds
  P[B9] & not b in B9 implies P[B9 \/ {b}]
  proof
    let B9 being (Element of Fin dom CE), b being Element of dom CE such that
A12: P[B9]& not b in B9;
    let X be Element of Fin dom CE such that
A13:  X=B9 \/ {b};
A14: MC $$ ( X,AC "**" CE) = (MC $$ (B9,AC "**" CE)) * ((AC "**" CE).b)
    by A12,A13,SETWOP_2:2;
    thus   MC $$ ( X,AC "**" CE) = 0.F_Complex  implies ex x st x in X &
    0.F_Complex = (AC "**" CE).x
    proof
      assume MC $$ ( X,AC "**" CE) = 0.F_Complex;
      then per cases by A14,VECTSP_1:12;
      suppose (MC $$ (B9,AC "**" CE))= 0.F_Complex;
        then consider x such that
A15:    x in B9 & 0.F_Complex = (AC "**" CE).x by A12;
        x in X by A15,A13,ZFMISC_1:136;
        hence thesis by A15;
      end;
      suppose
A16:    (AC "**" CE).b = 0.F_Complex;
        take b;
        thus thesis by A16,A13,ZFMISC_1:136;
      end;
    end;
    given x such that
A17: x in X & 0.F_Complex = (AC "**" CE).x;
    per cases by A17,A13,ZFMISC_1:136;
    suppose x=b;
      hence MC $$ ( X,AC "**" CE) = 0.F_Complex by A17, A14;
    end;
    suppose x in B9;
      then MC $$ ( B9,AC "**" CE) = 0.F_Complex by A17,A12;
      hence  MC $$ ( X,AC "**" CE) = 0.F_Complex by A14;
    end;
  end;
A18: for B being Element of Fin dom CE holds P[B] from SETWISEO:sch 2(A10,A11);
  then
A19: MC $$ ([#]dom CE,AC "**" CE) = 0.F_Complex  iff
  ex x st x in [#]dom CE & 0.F_Complex = (AC "**" CE).x;
A20: len CE = len theE by CARD_1:def 7;
  then
A21: dom CE = dom theE by FINSEQ_3:29;
  thus eval(Jsqrt M,f) = 0 implies
    ex A be Subset of Seg m\{1} st AC "**" SignGen(_sqrt XFS2FS(@f),AC,A) = 0
  proof
    assume eval(Jsqrt M,f)=0;
    then MC $$ ([#]dom CE,AC "**" CE) = 0.F_Complex by A8,A7,COMPLFLD:def 1;
    then consider x such that
A22: x in [#]dom CE & 0.F_Complex = (AC "**" CE).x by A18;
A23:x in dom CE by A22,HILB10_7:def 1;
    then reconsider x as Nat;
    theE.x in rng theE = bool B by A21,A23,FUNCT_1:def 3,RLAFFIN3:def 1;
    then reconsider Ex = theE.x as Subset of B;
    take Ex;
A24: (AC "**" CE).x = AC "**" (CE.x) by A23,HILB10_7:def 10;
    x in dom CE by A22,HILB10_7:def 1;
    then CE.x = SignGen(cF,AC,Ex) by HILB10_7:80;
    hence thesis by COMPLFLD:def 1,A22,A24;
  end;
  given A be Subset of Seg m\{1} such that
A25: AC "**" SignGen(_sqrt XFS2FS(@f),AC,A) = 0;
  A in bool B = rng theE = bool B by RLAFFIN3:def 1;
  then consider x such that
A26: x in dom theE & theE.x = A by FUNCT_1:def 3;
  reconsider x as Nat by A26;
A27: x in dom CE by A26,A20,FINSEQ_3:29;
A28: x in [#]dom CE by A26,A21,HILB10_7:def 1;
A29: SignGen(cF,AC,theE.x) = CE.x by A26,HILB10_7:80;
  AC "**" SignGen(cF,AC,theE.x) = 0.F_Complex by A26,A25,COMPLFLD:def 1;
  then (AC "**" CE).x = 0.F_Complex by A29,HILB10_7:def 10,A27;
  hence eval(Jsqrt M,f)=0 by A8,A7,A28,A19,COMPLFLD:def 1;
end;

registration
  let x,y,z,t be object;
  cluster <%x,y,z,t%> -> 4 -element;
  coherence
  proof
    reconsider x,y,z,t as set by TARSKI:1;
    <%x,y,z,t%> = <%x%>^<%y%>^<%z%>^<%t%> by AFINSQ_1:def 14;
    hence thesis;
  end;
end;

registration
  let x be Real;
  cluster <%x%> -> REAL-valued;
  coherence
  proof
    x in REAL by XREAL_0:def 1;
    hence thesis;
  end;
end;

registration
  let x,y,z,t be Real;
  cluster <%x,y,z,t%> -> REAL -valued;
  coherence
  proof
    <%x%>^<%y%>^<%z%>^<%t%> is REAL-valued;
    hence thesis by AFINSQ_1:def 14;
  end;
end;

theorem Th71:
  for f be real-valued FinSequence st i >1 & f.i >=0 holds
    (_sqrt f).i = sqrt (f.i)
proof
  let f be real-valued FinSequence such that
A1: i >1 & f.i >=0;
  set c = _sqrt f;
  len c = len f by Def11;
  then
A2: dom c = dom f by FINSEQ_3:29;
  per cases;
  suppose not i in dom f;
    then c.i = 0 & f.i = 0 by A2,FUNCT_1:def 2;
    hence thesis;
  end;
  suppose i in dom f;
    then
A3:(c.i)^2 = f.i & Re (c.i) >=0 & Im (c.i) >=0 by Def11,A1;
A4: sqrt (f.i)>=0 by A1,SQUARE_1:def 2;
A5: Re (sqrt (f.i)) = sqrt (f.i) & Im (sqrt (f.i)) = 0 by COMPLEX1:def 2;
    (sqrt (f.i))^2 = f.i by A1,SQUARE_1:def 2;
    hence thesis by A3,A5,Th2,A4;
  end;
end;

theorem Th72:
  for f be FinSequence of F_Complex,A be set holds
   ex i be Integer st (i = 1 or i =-1) &
       SignGen(f,the addF of F_Complex,A).x = i * (f.x)
proof
  set AF=the addF of F_Complex;
  let f be FinSequence of F_Complex,A be set;
A1:dom SignGen(f,AF,A) = dom f by HILB10_7:def 11;
  per cases;
  suppose not x in dom f;
    then SignGen(f,AF,A).x = 0 & f.x=0 by A1,FUNCT_1:def 2;
    then SignGen(f,AF,A).x = 1* (f.x);
    hence thesis;
  end;
  suppose
A2: x in dom f;
    then
A3: f.x = f/.x by PARTFUN1:def 6;
    per cases;
    suppose x in A;
      then SignGen(f,AF,A).x = (the_inverseOp_wrt AF).(f.x)
      by A1,A2,HILB10_7:def 11
      .= (comp F_Complex).(f.x) by FVSUM_1:15
      .= -(f/.x) by A3,VECTSP_1:def 13
      .= -f.x by A2,PARTFUN1:def 6
      .= (-1)*(f.x);
      hence thesis;
    end;
    suppose not x in A;
      then SignGen(f,AF,A).x
      = 1*(f.x) by A1,A2,HILB10_7:def 11;
      hence thesis;
    end;
  end;
end;

Lm1: for x,y,z,t be Complex holds
    XFS2FS <%x,y,z,t%>=<*x,y,z,t*>
proof
  let x,y,z,t be Complex;
  reconsider x,y,z,t as Element of COMPLEX by XCMPLX_0:def 2;
A1: XFS2FS <%z%> = <*z*> & XFS2FS <%t%> = <*t*> by RVSUM_4:50;
  XFS2FS <%x%> = <*x*> & XFS2FS <%y%> = <*y*> by RVSUM_4:50;
  then XFS2FS (<%x%>^<%y%>) = <*x*>^<*y*> by RVSUM_4:45;
  then XFS2FS (<%x%>^<%y%>^<%z%>) = <*x*>^<*y*>^<*z*> by A1,RVSUM_4:45;
  then XFS2FS (<%x%>^<%y%>^<%z%>^<%t%>) = <*x*>^<*y*>^<*z*>^<*t*>
    by A1,RVSUM_4:45;
  then XFS2FS (<%x%>^<%y%>^<%z%>^<%t%>) = <*x,y,z,t*> by FINSEQ_4:74;
  hence thesis by AFINSQ_1:def 14;
end;

begin :: Prime Representing Polynomial Construction

theorem Th73:
  for M be Jpolynom of 4,F_Complex
    for x1,x2,x3 be Nat st x1 is odd & x2 is odd
      for z be Integer st eval(Jsqrt M,@<%z,x1,4*x2,16*x3%>)=0 holds
        x1 is square & x2 is square  & x3 is square &
        -z <= sqrt x1+2*sqrt x2 + 4*sqrt x3
proof
  let M be Jpolynom of 4,F_Complex;
  let x1,x2,x3 be Nat such that
A1: x1 is odd & x2 is odd;
  set AF=the addF of F_Complex;
  let z be Integer such that
A2: eval(Jsqrt M,@<%z,x1,4*x2,16*x3%>)=0;
  set f=<%z,x1,4*x2,16*x3%>;
  set F = <* z,x1,4*x2,16*x3 *>;
A3: XFS2FS f= F by Lm1;
  4 is non trivial by NEWTON03:def 1;
  then consider A be Subset of Seg 4\{1} such that
A4: AF "**" SignGen(_sqrt XFS2FS(@@f),AF,A) = 0 by A2,Th70;
  set c = _sqrt XFS2FS(f);
  set S = SignGen(c,AF,A);
A5:dom S = dom c by HILB10_7:def 11;
  len F = 4 by CARD_1:def 7;
  then
A6:len S = len c = 4 by A3,Def11,CARD_1:def 7;
  then
A7:S/.1 =S.1 & S/.2 =S.2 & S/.3 =S.3 & S/.4 =S.4
  by A5,PARTFUN1:def 6,FINSEQ_3:25;
A8: AF "**" <*S/.1,S/.2,S/.3,S/.4*> = 0 by A7,A6,FINSEQ_4:76,A4;
  set iz=1;
  not 1 in A & 1 in dom S by A6,ZFMISC_1:56,FINSEQ_3:25;
  then
A9: S.1 = c.1 by HILB10_7:def 11;
  consider i1 be Integer such that
A10: (i1 = 1 or i1 =-1) & S.2 = i1 * (c.2) by Th72;
  consider i2 be Integer such that
A11: (i2 = 1 or i2 =-1) & S.3 = i2 * (c.3) by Th72;
  consider i3 be Integer such that
A12: (i3 = 1 or i3 =-1) & S.4 = i3 * (c.4) by Th72;
A13: c.1 = F.1 = z by A3,Def11;
  F.2 = x1;
  then
A14: c.2 = sqrt x1 by Th71,A3;
  F.3 = 4*x2;
  then
A15: c.3 = sqrt (4*x2) by Th71,A3
  .= 2 * sqrt x2 by SQUARE_1:20,29;
  F.4 = 16*x3;
  then
A16: c.4 = sqrt (4*4*x3) by Th71,A3
  .= sqrt (4*4) * sqrt (x3) by SQUARE_1:29
  .= 2* 2 * sqrt x3 by SQUARE_1:20,29;
A17: sqrt x1 * sqrt x1 = sqrt (x1*x1) by SQUARE_1:29
     .= sqrt (x1^2) by SQUARE_1:def 1
  .= x1 by SQUARE_1:22;
A18: sqrt x2 * sqrt x2 = sqrt (x2*x2) by SQUARE_1:29
  .= sqrt (x2^2) by SQUARE_1:def 1
  .= x2 by SQUARE_1:22;
A19: sqrt x3 * sqrt x3 = sqrt (x3*x3) by SQUARE_1:29
  .=sqrt (x3^2) by SQUARE_1:def 1
  .= x3 by SQUARE_1:22;
A20:AF=addcomplex by COMPLFLD:def 1;
A21: AF "**" <*S/.1,S/.2,S/.3,S/.4*> = AF "**" (<*S/.1,S/.2,S/.3*>^<*S/.4*>)
  by FINSEQ_4:74
  .= AF.(AF "**" <*S/.1,S/.2,S/.3*>,S/.4) by FVSUM_1:8,FINSOP_1:4
  .=AF.(AF.(AF.(S/.1,S/.2),S/.3),S/.4) by FINSOP_1:14;
  AF.(S/.1,S/.2) = (S.1) + (S.2) by A20,A7,BINOP_2:def 3;
  then AF.(AF.(S/.1,S/.2),S/.3) = (S.1) + (S.2)+(S.3) by A20,A7,BINOP_2:def 3;
  then
A22: 0 = (S.1) + (S.2) + (S.3)+(S.4) by A21,A8,A20,A7,BINOP_2:def 3;
A23: S.1<>0
  proof
    assume S.1 = 0;
    then (- (i1 * (c.2))) * (- (i1 * (c.2))) = ((S.3)+(S.4)) * ((S.3)+(S.4))
    by A22,A10;
    then
A24: x1 = 2*2*x2+(i2*i3)*16*(sqrt x2*sqrt x3) + 4*4*x3
    by A14,A15,A16,A17,A18,A19,A10,A11,A12;
    then x1 - 4*x2 - 16*x3 =(i2*i3)*16*(sqrt x2*sqrt x3);
    then reconsider ss= (i2*i3)*16*(sqrt x2*sqrt x3) as Integer;
    16*16=16^2 by SQUARE_1:def 1;
    then ss^2=ss*ss = 16^2*(x2*x3) by A11,A12,A18,A19,SQUARE_1:def 1;
    then 16 divides ss by Th3,INT_1:def 3;
    then ex i be Integer st
       ss = 16*i by INT_1:def 3;
    hence thesis by A1,A24;
  end;
  set Y = z*z+16*x3-x1-4*x2;
  ((S.1) + (S.4))*((S.1) + (S.4)) = (-(S.2)+-(S.3))*(-(S.2)+-(S.3)) by A22;
  then
A25: z*z + 2* (iz*i3)*z * 4* sqrt x3 + 4*4*x3 =
  x1 + 2* S.2 * S.3 + 2*2*x2 by A14,A15,A17,A18,A10,A11,A13,A16,A19,A9,A12;
  then
A26:Y + 8* (iz*i3)*z * sqrt x3=4*(i1*i2)*sqrt x1*sqrt x2 by A14,A15,A10,A11;
A27: Y<>0
  proof
    assume Y=0;
    then (2*(iz*i3)*z * sqrt x3)*(2*(iz*i3)*z * sqrt x3)=
     (2*(iz*i3)*z * sqrt x3)^2 = ((i1*i2)*sqrt x1*sqrt x2)^2 =
      ((i1*i2)*sqrt x1*sqrt x2) * ((i1*i2)*sqrt x1*sqrt x2) & z^2=z*z
     by A26,SQUARE_1:def 1;
    then 2*(2* z^2 * x3) = x1*x2 by A17,A18,A19,A10,A11,A12;
    hence thesis by A1;
  end;
  (Y + 8* (iz*i3)*z * sqrt x3)*(Y  + 8*  (iz*i3)*z * sqrt x3)=
    (Y + 8* (iz*i3)*z * sqrt x3)^2 = (4*(i1*i2)*sqrt x1*sqrt x2)^2=
    (4*(i1*i2)*sqrt x1*sqrt x2)*(4*(i1*i2)*sqrt x1*sqrt x2)
    by A25,A14,A15,A10,A11,SQUARE_1:def 1;
  then Y*Y + 2*Y*8* (iz*i3)*z * sqrt x3 + z*z*64*x3 = 4*4*x1*x2
    by A17,A18,A19,A10,A11,A12;
  then 2*Y*8* (iz*i3)*z * sqrt x3 = 4*4*x1*x2 - Y*Y - z*z*64*x3;
  then reconsider Y1 = 2*Y*8* (iz*i3)*z * sqrt x3 as Integer;
  (16*Y*z)^2 = (16*Y*z)*(16*Y*z) by SQUARE_1:def 1;
  then (16*Y*z)^2*x3 = Y1*Y1 = Y1^2 by A19,A12,SQUARE_1:def 1;
  then 16*Y*z divides Y1 by Th3,INT_1:def 3;
  then consider m be Integer such that
A28:  16*Y*z*m = Y1 by INT_1:def 3;
  (16*Y)*(z*m) = (16*Y)* ((iz*i3)*z * sqrt x3) by A28;
  then z*m = (iz*i3) * sqrt x3*z by A27,XCMPLX_1:5;
  then m = (iz*i3) * sqrt x3 by A23,A13,A9,XCMPLX_1:5;
  then -m = sqrt x3 or m = sqrt x3 by A12;
  then reconsider S3 = sqrt x3 as Integer;
  sqrt x3 >=0 by SQUARE_1:def 2;
  then reconsider S3 as Element of NAT by INT_1:3;
  set Z1 = (iz*2*z) - 1 +(i3*8*S3);
A29: Z1<>0
  proof
    assume Z1=0;
    then
A30: (-(sqrt 1))*(-(sqrt 1)) =
     (-(sqrt 1))^2 = ((2*i1*sqrt x1) +(i2*4*sqrt x2))^2=
     ((2*i1*sqrt x1) +(i2*4*sqrt x2))*((2*i1*sqrt x1) +(i2*4*sqrt x2))
    by SQUARE_1:def 1, A22,A13,A14,A15,A16,A9,A10,A11,A12;
    then 1-4*x1 -16*x2= 16*(i1*i2)*sqrt x1*sqrt x2 by A17,A18,A10,A11;
    then reconsider ss = 16*(i1*i2)*sqrt x1*sqrt x2 as Integer;
    16^2=16*16 by SQUARE_1:def 1;
    then ss^2=ss*ss= 16^2 * (x1*x2) by A17,A18,A10,A11,SQUARE_1:def 1;
    then 16^2 divides ss^2 by INT_1:def 3;
    then consider s be Integer such that
A31: 16*s = ss by Th3,INT_1:def 3;
    2*0+1 = 1 = 2*(2*x1+8*x2+8*s)
    by A31,A30,A17,A18,A10,A11;
    hence thesis;
  end;
  set Y1 = Z1*Z1+16*x2-1-4*x1;
A32:(- Z1 -(i2*4*sqrt x2))*(- Z1 -(i2*4*sqrt x2))=
    (- Z1 -(i2*4*sqrt x2))^2 = (sqrt 1 + (2*i1*sqrt x1))^2=
    (sqrt 1 + (2*i1*sqrt x1))*(sqrt 1 + (2*i1*sqrt x1))
    by SQUARE_1:def 1,A22,A13,A14,A15,A16,A9,A10,A11,A12;
A33: Y1<>0
  proof
    assume Y1=0;
    then (2*Z1*i2*4*sqrt x2)^2 =(2*Z1*i2*4*sqrt x2)*(2*Z1*i2*4*sqrt x2)
     = (2*(2*i1*sqrt x1))*(2*(2*i1*sqrt x1))= (2*(2*i1*sqrt x1))^2
    by A32,A17,A10,A18,A11,SQUARE_1:def 1;
    then 64*Z1^2*x2 = 64*(Z1*Z1)*x2 = 16*x1 by A17,A10,A18,A11,SQUARE_1:def 1;
    then 2*(2*Z1^2*x2) = x1;
    hence thesis by A1;
  end;
  (Y1 + 2*Z1*i2*4*sqrt x2)*(Y1 + 2*Z1*i2*4*sqrt x2)=
    (Y1 + 2*Z1*i2*4*sqrt x2)^2 = (2*(2*i1*sqrt x1))^2=
  (2*(2*i1*sqrt x1))*(2*(2*i1*sqrt x1)) & Z1^2=Z1*Z1
  by A32,A17,A10,A18,A11,SQUARE_1:def 1;
  then Y1*Y1 + 16*Y1*Z1*i2*sqrt x2 + 64*Z1^2*x2 = 16*x1
  by A10,A17,A18,A11;
  then 16*Y1*Z1*i2*sqrt x2 = 16*x1 - Y1*Y1  - 64*Z1^2*x2;
  then reconsider Y2=16*Y1*Z1*i2*sqrt x2 as Integer;
  Y2^2 =Y2*Y2= (16*Y1*Z1)*(16*Y1*Z1)*x2=
     (16*Y1*Z1)^2*x2 by A18,A11,SQUARE_1:def 1;
  then (16*Y1*Z1)^2 divides Y2^2 by INT_1:def 3;
  then consider m1 be Integer such that
A34:16*Y1*Z1*m1 = Y2 by Th3,INT_1:def 3;
  (16*Y1*Z1)*m1=(16*Y1*Z1)*(i2*sqrt x2) by A34;
  then m1 = i2 * sqrt x2 by A29,A33,XCMPLX_1:5;
  then -m1 = sqrt x2 or m1 = sqrt x2 by A11;
  then reconsider S2=sqrt x2 as Integer;
  sqrt x2 >=0 by SQUARE_1:def 2;
  then reconsider S2 as Element of NAT by INT_1:3;
  2*i1*sqrt x1 = - Z1 -1 - i2*4*S2 by A22,A13,A14,A15,A16,A9,A10,A11,A12;
  then reconsider Y3=2*i1*sqrt x1 as Integer;
  Y3^2=Y3*Y3= (2*2)*x1=2^2*x1 by A17,A10,SQUARE_1:def 1;
  then 2^2 divides Y3^2 by INT_1:def 3;
  then consider m2 be Integer such that
A35:  2*m2 = Y3 by Th3,INT_1:def 3;
  (2*i1*sqrt x1)*(2*i1*sqrt x1)=(2*i1*sqrt x1)^2 = Y3*Y3 by SQUARE_1:def 1;
  then 2*2*x1 = 2*2*(m2*m2) by A35,A17,A10;
  hence x1 is square;
A36: sqrt x1>=0 & sqrt x2>=0 & sqrt x3>=0 by SQUARE_1:def 2;
  S2^2 = x2 & S3^2 = x3 by A18,A19,SQUARE_1:def 1;
  hence x2 is square & x3 is square;
A37: (i1*sqrt x1) + (i2*2*sqrt x2) <= 1*sqrt x1+1*2*sqrt x2
  by A10,A36,XREAL_1:7,A11;
  (i1*sqrt x1) + (i2*2*sqrt x2)+(i3*4*sqrt x3) <=
  1*sqrt x1+2*sqrt x2 + 4*sqrt x3 by A37,XREAL_1:7,A12,A36;
  hence thesis by A22,A13,A14,A15,A16,A9,A10,A11,A12;
end;

theorem Th74:
  for M be Jpolynom of 4,F_Complex
    for x1,x2,x3 be Nat st x1 is square & x2 is square & x3 is square
      ex z be Integer st -z = sqrt x1 + 2* sqrt x2 + 4 *sqrt x3 &
        eval(Jsqrt M,@<%z,x1,4*x2,16*x3%>)=0
proof
  let M be Jpolynom of 4,F_Complex;
  let x1,x2,x3 be Nat such that
A1: x1 is square & x2 is square & x3 is square;
  consider m1 be Nat such that
A2: m1^2 = x1 by A1;
  consider m2 be Nat such that
A3: m2^2 = x2 by A1;
  consider m3 be Nat such that
A4: m3^2 = x3 by A1;
A5: sqrt x1 = m1 & sqrt x2= m2 & sqrt x3= m3 by A3,A4,A2,SQUARE_1:22;
  take z= -( m1 + 2*m2 + 4*m3);
  reconsider A = {} as Subset of Seg 4\{1} by XBOOLE_1:2;
  set f=<%z,x1,4*x2,16*x3%>,c = _sqrt XFS2FS(f);
  set F = <* z,x1,4*x2,16*x3 *>,AF=the addF of F_Complex;
  set S = SignGen(c,AF,A);
A6: XFS2FS f= F by Lm1;
A7:dom S = dom c by HILB10_7:def 11;
  len F = 4 by CARD_1:def 7;
  then
A8:len S = len c = 4 by A6,Def11,CARD_1:def 7;
  then
A9:S/.1=S.1 & S/.2=S.2 & S/.3=S.3 & S/.4=S.4 by A7,PARTFUN1:def 6,FINSEQ_3:25;
  then
A10: S = <*S/.1,S/.2,S/.3,S/.4*> by A8,FINSEQ_4:76;
A11:AF=addcomplex by COMPLFLD:def 1;
A12: AF "**" <*S/.1,S/.2,S/.3,S/.4*> = AF "**" (<*S/.1,S/.2,S/.3*>^<*S/.4*>)
  by FINSEQ_4:74
  .= AF.(AF "**" <*S/.1,S/.2,S/.3*>,S/.4) by FVSUM_1:8,FINSOP_1:4
  .=AF.(AF.(AF.(S/.1,S/.2),S/.3),S/.4) by FINSOP_1:14;
  AF.(S/.1,S/.2) = (S.1) + (S.2) by A11,A9,BINOP_2:def 3;
  then
A13: AF.(AF.(S/.1,S/.2),S/.3) = (S.1) + (S.2) + (S.3) by A11,A9,BINOP_2:def 3;
  A14:@@f= @f = f;
  not 1 in A & 1 in dom S & 2 in dom S & 3 in dom S & 4 in dom S
  by A8,FINSEQ_3:25;
  then
A15: S.1 = c.1 & S.2 = c.2 & S.3 = c.3 & S.4 = c.4 by HILB10_7:def 11;
A16: c.1 = F.1 = z by A6,Def11;
  F.2 = x1;
  then
A17: c.2 = sqrt x1 by Th71,A6;
  F.3 = 4*x2;
  then
A18: c.3 = sqrt (4*x2) by Th71,A6
  .= 2 * sqrt x2 by SQUARE_1:20,29;
  F.4 = 16*x3;
  then
A19: c.4 = sqrt (4*4*x3) by Th71,A6
  .= sqrt (4*4) * sqrt (x3) by SQUARE_1:29
  .= 2* 2 * sqrt x3 by SQUARE_1:20,29;
A20: 4 is non trivial by NEWTON03:def 1;
  AF "**" S = (c.1)+(c.2)+(c.3)+(c.4) by A13,A15,A10,A12,A11,BINOP_2:def 3;
  hence thesis by A5,A14,A20,Th70,A16,A17,A18,A19;
end;

theorem Th75:
  for L being right_zeroed add-associative right_complementable
       well-unital distributive non trivial doubleLoopStr,
     p being Polynomial of n,L
     ex q being Polynomial of n+m,L st
        rng q c= rng p \/ {0.L}&
        (for b be bag of n+m holds b in Support q iff b|n in Support p &
                 for i st i >= n holds b.i=0 ) &
        (for b be bag of n+m st b in Support q holds
           q.b = p.(b|n)) &
     for x being Function of n, L,
         y being Function of (n+m), L st y|n=x
       holds eval(p,x) = eval(q,y)
proof
  let L be right_zeroed add-associative right_complementable
  well-unital distributive non trivial doubleLoopStr,
  p be Polynomial of n,L;
  defpred P[Nat] means ex q be Polynomial of n+$1,L st
  rng q c= rng p \/ {0.L}&
  ( for b be bag of n+$1 holds b in Support q iff
  b|n in Support p & for i st i >= n holds b.i=0) &
  (for b be bag of n+$1 st b in Support q holds q.b = p.(b|n)) &
  for x be Function of n, L,y be Function of (n+$1), L st y|n=x
  holds eval(p,x) = eval(q,y);
A1:P[0]
  proof
    reconsider q=p as Polynomial of n+0,L;
    take q;
    thus rng q c= rng p \/ {0.L} by XBOOLE_1:7;
    thus for b be bag of n+0 holds b in Support q iff b|n in Support p &
    for i st i >= n holds b.i=0
    proof
      let b be bag of n+0;
      thus b in Support q implies b|n in Support p &
      for i st i >= n holds b.i=0
      proof
        assume b in Support q;
        hence b|n in Support p;
        let i such that
A2:     i >= n;
        not i in Segm n & Segm n = dom b by A2,NAT_1:44,PARTFUN1:def 2;
        hence thesis by FUNCT_1:def 2;
      end;
      thus thesis;
    end;
    thus for b be bag of n+0 st b in Support q holds q.b = p.(b|n);
    thus thesis;
  end;
A3:P[k] implies P[k+1]
  proof set k1=k+1;
    assume P[k];then
    consider q be Polynomial of n+k,L such that
A4: rng q c= rng p \/{0.L} and
A5: for b be bag of n+k holds b in Support q iff b|n in Support p &
    for i st i >= n holds b.i=0 and
A6:  (for b be bag of n+k st b in Support q holds
    q.b = p.(b|n) ) and
A7: for x be Function of n, L,y be Function of (n+k), L st y|n=x
      holds eval(p,x) = eval(q,y);
    reconsider P = q extended_by_0 as Polynomial of n+k1,L;
    take P;
    rng P = rng q \/ {0.L} by HILB10_2:10;
    then rng P c= rng p \/{0.L}\/{0.L} by A4,XBOOLE_1:13;
    hence rng P c= rng p \/ {0.L} by XBOOLE_1:7,12;
A8: n+k<= n+k+1 = n+k1 & n<= n+k by NAT_1:11;
A9: Segm n c= Segm (n+k) by NAT_1:39,NAT_1:11;
A10:n+k-'0 = n+k- 0;
    thus for b be bag of n+(k+1) holds b in Support P iff b|n in Support p &
    for i st i >= n holds b.i=0
    proof
      let b be bag of n+(k+1);
A11:  ((0,n+k)-cut b)|n = (b|(n+k))|n by A8,HILB10_2:3
      .= b|n by A9,RELAT_1:74;
      hereby assume
A12:    b in Support P;
        then b.(n+k) = 0 by HILB10_2:7;
        then
A13:    (0,n+k)-cut b in Support q by A12,HILB10_2:9;
        hence b|n in Support p by A5,A11;
        thus for i st i >= n holds b.i=0
        proof
          let i such that
A14:      i >= n;
          per cases by XXREAL_0:1;
          suppose i < n+k;
            then i in Segm (n+k) by NAT_1:44;
            then
A15:        (b|(n+k)).i = b.i by FUNCT_1:49;
            ((0,n+k)-cut b).i = 0 by A13,A5,A14;
            hence thesis by A15,A8,HILB10_2:3;
          end;
          suppose i = n+k;
            hence thesis by A12,HILB10_2:7;
          end;
          suppose i > n+k;
            then i >= n+k+1 by NAT_1:13;
            then not i in Segm(n+k+1) by NAT_1:44;
            then not i in dom b;
            hence thesis by FUNCT_1:def 2;
          end;
        end;
      end;
      assume
A16:  b|n in Support p & for i st i >= n holds b.i=0;
      for i st i >= n holds ((0,n+k)-cut b).i=0
      proof
        let i such that
A17:    i >=n;
A18:    ((0,n+k)-cut b).i = (b|(n+k)).i by A8,HILB10_2:3;
        per cases;
        suppose i in n+k;
          then (b|(n+k)).i = b.i by FUNCT_1:49;
          hence thesis by A17,A18,A16;
        end;
        suppose not i in n+k;
          then not i in dom (0,n+k)-cut b by A10;
          hence thesis by FUNCT_1:def 2;
        end;
      end;
      then
A19:  ((0,n+k)-cut b) in Support q by A10,A5,A16,A11;
      b.(n+k)= 0 by A16,NAT_1:11;
      hence b in Support P by HILB10_2:9,A19;
    end;
    thus for b be bag of n+(k+1) st b in Support P holds
    P.b = p.(b|n)
    proof
      let b be bag of n+(k+1) such that
A20:  b in Support P;
A21:  ((0,n+k)-cut b)|n = (b|(n+k))|n by A8,HILB10_2:3
      .= b|n by A9,RELAT_1:74;
      b.(n+k) = 0 by A20,HILB10_2:7;
      then
A22:  (0,n+k)-cut b in Support q by A20,HILB10_2:9;
      n+k+1 = n+(k+1);
      then b = (0,n+k)-cut b bag_extend (b.(n+k)) by HILB10_2:4
      .= (0,n+k)-cut b bag_extend 0 by A20,HILB10_2:7;
      hence P.b = q.((0,n+k)-cut b) by HILB10_2:6,A10
      .= p. (b|n) by A6,A22,A21;
    end;
    let x be Function of n, L,y be Function of n+k1, L such that
A23: y|n=x;
A24: rng (@y|(n+k) ) c= the carrier of L by RELAT_1:def 19;
    len (@y) = n+k1 & n+k < n+k+1 by CARD_1:def 7,NAT_1:13;
    then dom (@y|(n+k)) = n+k by AFINSQ_1:54;
    then reconsider Y= @y|(n+k) as Function of n+k,L by A24,FUNCT_2:2;
    Segm n c= Segm (n+k) by NAT_1:39,11;
    then
A25:Y |n = x by A23,RELAT_1:74;
    thus eval(P,y) = eval(q,Y) by HILB10_2:18
    .= eval(p,x) by A7,A25;
  end;
  P[k] from NAT_1:sch 2(A1,A3);
  hence thesis;
end;

theorem Th76:
  for M be Jpolynom of 4,F_Complex
    ex K2 be INT -valued Polynomial of 6,F_Real st
      (for f be Function of 6,F_Real st f.5 <>0
       holds eval(K2,f) = (power F_Real).(f/.5,8)*
         eval(Jsqrt M, @ <%- (f.0) + (f.4/f.5),f.1,f.2,f.3%>)) &
            for f be INT -valued Function of 6,F_Real st f.5 <>0 &
                  eval(K2,f) = 0 holds f.5 divides f.4
proof
  let M be Jpolynom of 4,F_Complex;
  set p = Jsqrt M; set R=F_Real;
  consider q be Polynomial of 4+2,R such that
A1:rng q c= rng p \/ {0.R} and
A2:for b be bag of 4+2 holds b in Support q iff b|4 in Support p &
                 for i st i >= 4 holds b.i=0 and
A3:for b be bag of 4+2 st b in Support q holds
           q.b = p.(b|4) and
A4:for x being Function of 4, R,
         y being Function of (4+2), R st y|4=x
       holds eval(p,x) = eval(q,y) by Th75;
  rng q c= INT by A1,INT_1:def 2;
  then reconsider q as INT -valued Polynomial of 6,R by RELAT_1:def 19;
  set Yb = (EmptyBag 6) +*(0,1),Y=Monom(-1.R,Yb),
  Zb = (EmptyBag 6) +*(4,1),Z=Monom(1.R,Zb), YZ=Y+Z;
  set Sup=SgmX(BagOrder 6, Support q);
  BagOrder 6  linearly_orders Support q by POLYNOM2:18;
  then
A5: rng Sup = Support q by PRE_POLY:def 2;
  consider S be FinSequence of Polynom-Ring (6, R) such that
A6: Subst(q,0,YZ) = Sum S & len Sup = len S and
A7: for i st i in dom S holds
  S.i = q.(Sup/.i) * Subst(Sup/.i,0, YZ) by Def4;
A8:dom S = dom Sup by A6,FINSEQ_3:29;
  4-'1 = 4-1 by XREAL_1:233;
  then
A9: 2|^(4-'1) = 2|^(2+1)
  .= 2*(2|^(1+1)) by NEWTON:6
  .= 2*(2 * 2|^1) by NEWTON:6
  .= 8;
  set E6=EmptyBag 6;
  set MAX = (EmptyBag 4) +* (0,8), MAX8 = E6+* (0,8);
A10: M.MAX = 1.F_Complex by Def10,A9;
A11: MAX in Bags 4 = dom p by FUNCT_2:def 1,PRE_POLY:def 12;
  2(#)MAX +* (0,MAX.0) = MAX
  proof
A12: dom (2(#)MAX) = 4 = dom (2(#)MAX +* (0,MAX.0)) by PARTFUN1:def 2;
    for x st x in 4 holds MAX.x = (2(#)MAX +* (0,MAX.0)).x
    proof
      let x such that
A13:  x in 4;
      per cases;
      suppose x=0;
        hence thesis by A12,A13,FUNCT_7:31;
      end;
      suppose
A14:    x<>0;
        then
A15:    MAX.x = (EmptyBag 4).x by FUNCT_7:32
        .= 0;
        2*(MAX.x) = (2(#)MAX).x by A12,A13,VALUED_1:def 5
        .= (2(#)MAX +* (0,MAX.0)).x by A14,FUNCT_7:32;
        hence thesis by A15;
      end;
    end;
    hence thesis by A12,PARTFUN1:def 2;
  end;
  then (JsqrtSeries M).MAX = M.MAX by Def12;
  then
A16: p.MAX = 1.F_Complex by Def13,A10
  .= 1.R by COMPLEX1:def 4,COMPLFLD:def 1;
  then p.MAX<>0.R;
  then
A17: MAX in Support p by A11,POLYNOM1:def 3;
A18: dom E6 = 6 & dom (EmptyBag 4) = 4 by PARTFUN1:def 2;
A19: 4 in Segm 6 & 0 in Segm 6 & 5 in Segm 6 by NAT_1:44;
A20: MAX8.0 = 8 by A18,A19,FUNCT_7:31;
A21: Segm 4 c= Segm 6 by NAT_1:39;
A22: dom (MAX8|4) = 4 by PARTFUN1:def 2,A21;
  for x st x in 4 holds (MAX8|4).x = MAX.x
  proof
    let x such that
A23: x in 4;
A24: (MAX8|4).x = MAX8.x by A23,FUNCT_1:49;
    per cases;
    suppose x =0;
      hence thesis by A18,A20,A24,A23,FUNCT_7:31;
    end;
    suppose
A25:  x<>0;
      then (MAX8|4).x = E6.x =(EmptyBag 4).x by A24,FUNCT_7:32;
      hence thesis by A25,FUNCT_7:32;
      end;
    end;
    then
A26: MAX8|4 = MAX by PARTFUN1:def 2,A22;
A27:for i st i >= 4 holds MAX8.i=0
    proof
      let i such that
A28:  i >=4;
      MAX8.i = E6.i by A28,FUNCT_7:32;
      hence thesis;
    end;
    MAX8 in Support q by A2,A26,A17,A27;
    then consider I be object such that
A29:I in dom Sup & Sup.I = MAX8 by A5,FUNCT_1:def 3;
A30: q.MAX8 = 1.R by A16,A17,A26,A27,A3,A2;
    reconsider I as Nat by A29;
A31: Sup/.I = Sup.I & S/.I = S.I by A8,A29,PARTFUN1:def 6;
    defpred P[Nat] means (YZ `^ $1).(E6 +* (4,$1)) = 1.R;
A32: YZ `^ 0 = 1_(6,R) by Th28;
    E6.4 = 0;
    then E6 +* (4,0) = E6 by FUNCT_7:35;
    then
A33: P[0] by A32,POLYNOM1:25;
A34: P[i] implies P[i+1]
    proof
      assume
A35:  P[i];
A36:  (YZ `^ (i+1)) = (YZ `^ i) *' YZ by Th29
      .= Y *' (YZ `^ i) + Z *'(YZ `^ i) by POLYNOM1:26;
A37:  (E6 +* (4,i+1)) = (E6 +* (4,i))+ Zb by Th22;
      then
A38:  Zb divides (E6 +* (4,i+1)) by PRE_POLY:50;
      (E6 +* (4,i+1)) -' Zb = (E6 +* (4,i)) by A37,PRE_POLY:48;
      then
A39:  (Zb *' (YZ `^ i)).(E6 +* (4,i+1)) = (YZ `^ i).(E6 +* (4,i)) = 1.R
      by A35,A38,POLYRED:def 1;
      Z *' (YZ `^ i) = (1.R) * (Zb *' (YZ `^ i)) by POLYRED:22;
      then
A40:  Z *' (YZ `^ i).(E6 +* (4,i+1)) = (1.R) *1.R
      by A39, POLYNOM7:def 9;
A41:  (E6 +* (4,i+1)).0 = E6.0 by FUNCT_7:32
      .=0;
      Yb.0 = 1 by A18,A19,FUNCT_7:31;
      then not Yb divides (E6 +* (4,i+1)) by A41,PRE_POLY:def 11;
      then
A42:  (Yb *' (YZ `^ i)).(E6 +* (4,i+1)) = 0.R by POLYRED:def 1;
      Y *' (YZ `^ i) = (-1.R) * (Yb *' (YZ `^ i)) by POLYRED:22;
      then Y *' (YZ `^ i).(E6 +* (4,i+1)) = (-1.R)*0.R by A42, POLYNOM7:def 9;
      then (YZ `^ (i+1)).(E6 +* (4,i+1)) = 0.R+1.R by A36,A40,POLYNOM1:15;
      hence thesis;
    end;
A43: P[i] from NAT_1:sch 2(A33,A34);
    set Z8 = E6+* (4,8);
    E6 +* (0,8) +*(0,0) = E6 +* (0,0) & E6.0 = 0 by FUNCT_7:34;
    then Subst(MAX8,0, Z8) = E6 + E6+*(4,8) by FUNCT_7:35
    .= Z8 by PRE_POLY:53;
    then
A44:Subst(Sup/.I,0, YZ).Z8 = (YZ `^ (MAX8.0)).Z8 by Th33,A29,A31
    .= 1_R by A20,A43;
A45: for i st i in dom S
    for b be bag of 6 st b in Support (q.(Sup/.i) * Subst(Sup/.i,0, YZ)) &
    b.4 >= 8 holds i= I & b = Z8
    proof
  let i such that
A46: i in dom S; set Supi = Sup/.i;
  let b be bag of 6 such that
A47: b in Support (q.(Supi) * Subst(Supi,0, YZ))
  & b.4 >= 8;
A48: Supi =Sup.i in Support q by A46,A8,A5,PARTFUN1:def 6,FUNCT_1:def 3;
  then
A49: q.(Sup/.i) <>0.R by POLYNOM1:def 3;
A50:q.(Sup/.i) = p.((Sup/.i)|4) by A48,A3;
A51:4-'0 =4-0;
  (Supi)|4 =(0,4)-cut Supi by HILB10_2:3;
  then reconsider Supi4 = (Supi)|4 as bag of 4 by A51;
A52: ( 2(#) (Supi4) +* (0,(Supi4.0))) in Bags 4 = dom M
    by PRE_POLY:def 12,FUNCT_2:def 1;
  set 2Supi4 =( 2(#) (Supi4) +* (0,(Supi4.0)));
  p = JsqrtSeries M by Def13;
  then p.Supi4 = M.( 2(#) (Supi4) +* (0,(Supi4.0))) by Def12;
  then (2(#) (Supi4) +* (0,(Supi4.0))) in Support M
  by A52,A49,A50,COMPLFLD:7,POLYNOM1:def 3;
  then
A53: degree ( 2(#) (Supi4) +* (0,(Supi4.0))) = 2|^(4-'1) by Def10;
  consider g be FinSequence of REAL such that
A54: Sum 2Supi4 = Sum g & g = 2Supi4 * canFS(support 2Supi4)
  by UPROOTS:def 3;
A55: for i st i in dom g holds 0 <= g.i by A54;
A56: 2Supi4.0 <= 8
  proof
A57: rng canFS(support 2Supi4) = support 2Supi4 by FUNCT_2:def 3;
    per cases;
    suppose
A58:  0 in support 2Supi4;
      then
A59:  0 in rng canFS(support 2Supi4) c= dom 2Supi4 by PRE_POLY:37,A57;
      consider d be object such that
A60:  d in dom canFS(support 2Supi4) &
      (canFS(support 2Supi4)).d = 0 by A58,A57,FUNCT_1:def 3;
      reconsider d as Nat by A60;
      d in dom g & g.d = 2Supi4.0 by A59,A60,A54,FUNCT_1:12,11;
      hence thesis by A54,A53,A9,A55,MATRPROB:5;
    end;
    suppose not 0 in support 2Supi4;
      hence thesis by PRE_POLY:def 7;
    end;
  end;
A61: 0 in Segm 4 = dom (2(#) (Supi4)) by NAT_1:44,PARTFUN1:def 2;
  then
A62: 2Supi4.0 = Supi4.0 by FUNCT_7:31
  .= Supi.0 by A61,FUNCT_1:49;
  defpred Q[Nat] means for b be bag of 6 st (YZ `^ $1).b <> 0.R holds
    b.4 <= $1;
A63:Q[0]
  proof
    let b be bag of 6 such that A64:(YZ `^ 0).b <> 0.R;
    b = E6 by A64,POLYNOM1:25,A32;
    hence thesis;
  end;
A65:for i st Q[i] holds Q[i+1]
  proof
    let i;
    assume
A66: Q[i];
    let b be bag of 6 such that
A67: (YZ `^ (i+1)).b <> 0.R;
    (YZ `^ (i+1)) = (YZ `^ i) *' YZ by Th29
    .= Y *' (YZ `^ i) + Z *'(YZ `^ i) by POLYNOM1:26;
    then (YZ `^ (i+1)).b = (Y *' (YZ `^ i)).b + (Z *'(YZ `^ i)).b
      by POLYNOM1:15;
    then per cases by A67;
    suppose
A68:  (Z *' (YZ `^ i)).b<>0.R;
      Z *' (YZ `^ i) = (1.R) * (Zb *' (YZ `^ i)) by POLYRED:22;
      then
A69:  (Z *' (YZ `^ i)).b = (1.R) * ((Zb *' (YZ `^ i)).b) by POLYNOM7:def 9;
      then
A70:  Zb divides b by A68,POLYRED:def 1;
      then (Zb *' (YZ `^ i)).b = (YZ `^ i).(b-'Zb) by POLYRED:def 1;
      then (b-'Zb).4 <= i by A66,A69,A68;
      then
A71:  (b.4)-'(Zb.4) <= i by PRE_POLY:def 6;
      Zb.4 = 1 by A18,A19,FUNCT_7:31;
      then b.4 -1 <= i by A71,A70,PRE_POLY:def 11,XREAL_1:233;
      then b.4 -1 + 1 <= i+1 by XREAL_1:6;
      hence thesis;
    end;
    suppose
A72:  (Y *'(YZ `^ i)).b<>0.R;
      Y *' (YZ `^ i) = (-1.R) * (Yb *' (YZ `^ i)) by POLYRED:22;
      then Y *' (YZ `^ i).b = (-1.R) *( (Yb *' (YZ `^ i)).b) by POLYNOM7:def 9;
      then
A73:  (Yb *' (YZ `^ i)).b<>0.R by A72;
      then
A74:  Yb divides b by POLYRED:def 1;
      then (Yb *' (YZ `^ i)).b = (YZ `^ i).(b-'Yb) by POLYRED:def 1;
      then (b-'Yb).4 <= i by A66,A73;
      then
A75:  (b.4)-'(Yb.4) <= i by PRE_POLY:def 6;
A76:  Yb.4 = E6.4 by FUNCT_7:32;
      (b.4)-'(Yb.4) = (b.4)- (Yb.4) by XREAL_1:233,A74,PRE_POLY:def 11;
      hence thesis by A75,A76,NAT_1:13;
    end;
  end;
A77: Q[j] from NAT_1:sch 2(A63,A65);
  (q.(Supi) * Subst(Supi,0, YZ)).b <>0.R by A47,POLYNOM1:def 3;
  then (q.(Supi)) * (Subst(Supi,0, YZ).b) <>0.R by POLYNOM7:def 9;
  then
A78:  Subst(Supi,0, YZ).b <>0.R;
  then consider s be bag of 6 such that
A79:  b = Subst(Supi,0,s) by Def3;
  (Supi+*(0,0)).4 = Supi.4=0 by A48,A2,FUNCT_7:32;
  then
A80: (Supi+*(0,0) + s).4 = 0+(s.4) by PRE_POLY:def 5;
  (YZ `^ (Supi.0) ).s<>0.R by A78,A79,Th33;
  then
A81: s.4 <= Supi.0 by A77;
  then
A82: 8 <= Supi.0 by A80,A79,A47,XXREAL_0:2;
  then
A83: Supi.0 = 8 by A62,A56,XXREAL_0:1;
A84: dom Supi = Segm 6 = dom MAX8 by PARTFUN1:def 2;
  for x st x in dom Supi holds Supi.x = MAX8.x
  proof
    let x such that
A85:x in dom Supi;
    reconsider x as Nat by A84,A85;
    per cases;
    suppose x=0;
      hence thesis by A82,A62,A56,XXREAL_0:1,A20;
    end;
    suppose
A86:  x<>0 & x <4;
      then
A87:  x in Segm 4 by NAT_1:44;
      2Supi4.x = ((EmptyBag 4)+* (0,8)).x by A83,A62,Th19,A9,A53;
      then
A88:  2Supi4.x = (EmptyBag 4).x by A86,FUNCT_7:32;
      2Supi4.x = (2(#) (Supi4)).x by A86,FUNCT_7:32
      .= 2* (Supi4.x) by VALUED_1:6;
      then Supi.x = 0 =E6.x = MAX8.x by A86,A87,A88,FUNCT_1:49,FUNCT_7:32;
      hence thesis;
    end;
    suppose
A89:  x >=4;
      then MAX8.x = E6.x by FUNCT_7:32;
      hence thesis by A89,A48,A2;
    end;
  end;
  then
A90: Supi = MAX8 by A84;
  Sup is one-to-one by POLYNOM2:18,PRE_POLY:10;
  hence i=I by A29,A46,A8,A48,A90;
A91: (YZ `^ 8 ).s<>0.R by A78,A79,Th33,A83;
  defpred R[Nat] means for b be bag of 6 st (YZ `^ $1).b <> 0.R holds
  degree b = $1;
A92:R[0] by UPROOTS:11,POLYNOM1:25,A32;
A93:for i st R[i] holds R[i+1]
  proof
    let i;
    assume
A94: R[i];
    let b be bag of 6 such that
A95: (YZ `^ (i+1)).b <> 0.R;
    (YZ `^ (i+1)) = (YZ `^ i) *' YZ by Th29
    .= Y *' (YZ `^ i) + Z *'(YZ `^ i) by POLYNOM1:26;
    then (YZ `^ (i+1)).b = (Y *' (YZ `^ i)).b+(Z *'(YZ`^ i)).b by POLYNOM1:15;
    then per cases by A95;
    suppose
A96:  (Y *' (YZ `^ i)).b<>0.R;
      Y *' (YZ `^ i) = (-1.R) * (Yb *' (YZ `^ i)) by POLYRED:22;
      then (Y *' (YZ `^ i)).b =(-1.R) *((Yb *' (YZ `^ i)).b) by POLYNOM7:def 9;
      then
A97:  (Yb *' (YZ `^ i)).b<>0.R by A96;
      then
A98:  Yb divides b by POLYRED:def 1;
      then (Yb *' (YZ `^ i)).b = (YZ `^ i).(b-'Yb) by POLYRED:def 1;
      then
A99:  degree (b-'Yb) = i by A94,A97;
      reconsider z=0 as Element of 6 by A19;
      reconsider Z={z} as Subset of 6;
      Yb = ({z},1)-bag by Th12;
      then
A100: degree Yb = card Z by UPROOTS:13
      .= 1 by CARD_1:30;
      b = (b-'Yb) +Yb by A98,PRE_POLY:47;
      hence thesis by A99,A100,UPROOTS:15;
    end;
    suppose
A101: (Z *'(YZ `^ i)).b<>0.R;
      Z *' (YZ `^ i) = (1.R) * (Zb *' (YZ `^ i)) by POLYRED:22;
      then
A102: Z *' (YZ `^ i).b = (1.R) *( (Zb *' (YZ `^ i)).b) by POLYNOM7:def 9;
      then
A103: Zb divides b by A101,POLYRED:def 1;
      then (Zb *' (YZ `^ i)).b = (YZ `^ i).(b-'Zb) by POLYRED:def 1;
      then
A104: degree (b-'Zb) = i by A94,A102,A101;
      reconsider z=4 as Element of 6 by A19;
      reconsider Z={z} as Subset of 6;
      Zb = ({z},1)-bag by Th12;
      then
A105: degree Zb = card Z by UPROOTS:13
      .= 1 by CARD_1:30;
      b = (b-'Zb) +Zb by A103,PRE_POLY:47;
      hence thesis by A104,A105,UPROOTS:15;
    end;
  end;
  R[j] from NAT_1:sch 2(A92,A93);
  then
A106: degree s = 8 by A91;
  s.4 = 8 by A81,A83,A47,A80,A79,XXREAL_0:1;
  then
A107: s = Z8 by A106,Th19;
  b = (E6+*(0,E6.0)) +s by A90,A79,FUNCT_7:34;
  then b = E6 +s by FUNCT_7:35;
  hence thesis by A107,PRE_POLY:53;
end;
A108: for i st i in dom S
  for b be bag of 6 st b in Support (q.(Sup/.i) * Subst(Sup/.i,0, YZ)) holds
    b.5=0
  proof
    let i such that
A109: i in dom S; set Supi = Sup/.i;
    let b be bag of 6 such that
A110: b in Support (q.(Supi) * Subst(Supi,0, YZ));
A111: Supi =Sup.i in Support q
    by A5,A109,A8,PARTFUN1:def 6,FUNCT_1:def 3;
A112:4-'0 =4-0;
    (Supi)|4 =(0,4)-cut Supi by HILB10_2:3;
    then reconsider Supi4 = (Supi)|4 as bag of 4 by A112;
    set 2Supi4 =( 2(#) (Supi4) +* (0,(Supi4.0)));
    defpred Q[Nat] means for b be bag of 6 st (YZ `^ $1).b<>0.R holds b.5 = 0;
A113:Q[0]
    proof
      let b be bag of 6 such that
A114: (YZ `^ 0).b <> 0.R;
      b = E6 by A114,POLYNOM1:25,A32;
      hence thesis;
    end;
A115:for i st Q[i] holds Q[i+1]
    proof
      let i;
      assume
A116: Q[i];
      let b be bag of 6 such that
A117: (YZ `^ (i+1)).b <> 0.R;
      (YZ `^ (i+1)) = (YZ `^ i) *' YZ by Th29
      .= Y *' (YZ `^ i) + Z *'(YZ `^ i) by POLYNOM1:26;
      then (YZ `^ (i+1)).b = (Y *' (YZ `^ i)).b+(Z *'(YZ `^ i)).b
      by POLYNOM1:15;
      then per cases by A117;
      suppose
A118:   (Z *' (YZ `^ i)).b<>0.R;
        Z *' (YZ `^ i) = (1.R) * (Zb *' (YZ `^ i)) by POLYRED:22;
        then
A119:   (Z *' (YZ `^ i)).b = (1.R) * ((Zb *' (YZ `^ i)).b) by POLYNOM7:def 9;
        then
A120:   Zb divides b by A118,POLYRED:def 1;
        then (Zb *' (YZ `^ i)).b = (YZ `^ i).(b-'Zb) by POLYRED:def 1;
        then
A121:   (b-'Zb).5 =0 by A116,A119,A118;
A122:   Zb.5 = E6.5 by FUNCT_7:32;
        (b.5)-'(Zb.5) = (b.5)- (Zb.5) by XREAL_1:233,A120,PRE_POLY:def 11;
        hence thesis by A121,A122,PRE_POLY:def 6;
      end;
      suppose
A123:   (Y *'(YZ `^ i)).b<>0.R;
        Y *' (YZ `^ i) = (-1.R) * (Yb *' (YZ `^ i)) by POLYRED:22;
        then Y *'(YZ `^ i).b =(-1.R) *( (Yb *' (YZ `^ i)).b) by POLYNOM7:def 9;
        then
A124:   (Yb *' (YZ `^ i)).b<>0.R by A123;
        then
A125:   Yb divides b by POLYRED:def 1;
        then (Yb *' (YZ `^ i)).b = (YZ `^ i).(b-'Yb) by POLYRED:def 1;
        then
A126:   (b-'Yb).5 = 0 by A116,A124;
A127:   Yb.5 = E6.5 by FUNCT_7:32;
        (b.5)-'(Yb.5) = (b.5)- (Yb.5) by XREAL_1:233,A125,PRE_POLY:def 11;
        hence thesis by A126,A127,PRE_POLY:def 6;
      end;
    end;
A128: Q[j] from NAT_1:sch 2(A113,A115);
    (q.(Supi) * Subst(Supi,0, YZ)).b <>0.R by A110,POLYNOM1:def 3;
    then (q.(Supi)) * (Subst(Supi,0, YZ).b) <>0.R by POLYNOM7:def 9;
    then
A129: Subst(Supi,0, YZ).b <>0.R;
    then consider s be bag of 6 such that
A130: b = Subst(Supi,0,s) by Def3;
    (Supi+*(0,0)).5 = Supi.5=0 by A111,A2,FUNCT_7:32;
    then
A131: (Supi+*(0,0) + s).5 = 0+(s.5) by PRE_POLY:def 5;
    (YZ `^ (Supi.0) ).s<>0.R by A129,A130,Th33;
    hence thesis by A131,A130,A128;
  end;
  set PR=Polynom-Ring (6, R);
  defpred W[Nat] means for i be Nat st $1=i & i <= len S holds
  for w be Polynomial of 6,R st w = Sum (S|i) holds
  (I <= i implies w.Z8 = 1_R) & (i < I implies w.Z8 = 0.R) &
  (for b be bag of 6 st b in Support w & b <> Z8 holds b.4 < 8) &
  (for b be bag of 6 st b in Support w holds b.5 =0);
A132: W[0]
  proof
    let i be Nat;
    assume
A133: 0=i & i<=len S;
    let w be Polynomial of 6,R such that
A134:w = Sum (S | i);
    thus I <= i implies w.Z8 = 1_R by A133,A29,FINSEQ_3:25;
    S | i = <*>(the carrier of PR) by A133;
    then
A135: w = 0.PR by A134,RLVECT_1:43
    .= 0_(6,R) by POLYNOM1:def 11;
    hence i < I implies w.Z8 = 0.R by POLYNOM1:22;
    thus for b be bag of 6 st b in Support w & b <> Z8 holds b.4 < 8
    proof
      let b be bag of 6;
      assume b in Support w;
      then w.b <> 0.R by POLYNOM1:def 3;
      hence thesis by A135,POLYNOM1:22;
    end;
    thus  for b be bag of 6 st b in Support w holds b.5 =0
    proof
      let b be bag of 6;
      assume b in Support w;
      then w.b <> 0.R by POLYNOM1:def 3;
      hence thesis by A135,POLYNOM1:22;
    end;
  end;
A136: Z8.4 = 8 by A19,A18,FUNCT_7:31;
A137: W[n] implies W[n+1]
  proof
    assume
A138:W[n];
    let n1 be Nat such that
A139:n1=n+1 & n1 <= len S;
    let w be Polynomial of 6,R such that
A140:w = Sum (S | n1);
    reconsider w1=Sum(S|n),Sn1=S/.n1 as Polynomial of 6,R by POLYNOM1:def 11;
A141: n1 in dom S by A139,FINSEQ_3:25,NAT_1:11;
    then
A142: S|n1 = (S|n)^<*S.n1*> & S.n1 =S/.n1
    by A139,FINSEQ_5:10,PARTFUN1:def 6;
    then
A143: w = Sum(S|n) + Sum(<*S/.n1*>) by A140,RLVECT_1:41
    .= Sum(S|n) + S/.n1 by RLVECT_1:44
    .= w1+ Sn1 by POLYNOM1:def 11;
A144: Sn1 = q.(Sup/.n1) * Subst(Sup/.n1,0, YZ) by A142,A7,A141;
A145: n < len S by A139,NAT_1:13;
A146: Z8 in Bags 6 = dom Sn1 by PRE_POLY:def 12,FUNCT_2:def 1;
    thus I <= n1 implies w.Z8 = 1_R
    proof
      assume
A147: I <= n1;
A148: w.Z8 = w1.Z8+ Sn1.Z8 by A143,POLYNOM1:15;
      per cases by A147,XXREAL_0:1;
      suppose
A149:   I=n1;
        then n <I by A139,NAT_1:13;
        then
A150:   w1.Z8 = 0.R by A145,A138;
        Sn1.Z8 = (1.R * Subst(Sup/.I,0, YZ)).Z8 by A141,A149,A29,A31,A30,A7
        .= 1.R * 1_R by A44,POLYNOM7:def 9;
        hence thesis by A148,A150;
      end;
      suppose
A151:   I <n1;
        then
A152:   I <= n by A139,NAT_1:13;
        assume w.Z8 <> 1_R;
        then Sn1.Z8<>0.R by A148,A152,A145,A138;
        then Z8 in Support Sn1 by A146,POLYNOM1:def 3;
        hence thesis by A45,A144,A141,A136,A151;
      end;
    end;
    thus n1 < I implies w.Z8 = 0.R
    proof
      assume
A153: n1 <I & w.Z8 <> 0.R;
      then n < I by NAT_1:13,A139;
      then w1.Z8 =0.R by A145,A138;
      then w.Z8 = 0.R + Sn1.Z8 by A143,POLYNOM1:15;
      then Z8 in Support Sn1 by A153,A146,POLYNOM1:def 3;
      hence thesis by A153,A45,A144,A141,A136;
    end;
    thus for b be bag of 6 st b in Support w & b<>Z8 holds b.4 < 8
    proof
      let b be bag of 6 such that
A154: b in Support w & b <> Z8;
      Support w c= Support w1 \/ Support Sn1 by A143,POLYNOM1:20;
      then per cases by XBOOLE_0:def 3,A154;
      suppose b in Support w1;
        hence thesis by A145,A154,A138;
      end;
      suppose b in Support Sn1;
        hence thesis by A154,A141,A144,A45;
      end;
    end;
    let b be bag of 6 such that
A155: b in Support w;
    Support w c= Support w1 \/ Support Sn1 by A143,POLYNOM1:20;
    then per cases by XBOOLE_0:def 3,A155;
    suppose b in Support w1;
      hence thesis by A145,A138;
    end;
    suppose b in Support Sn1;
      hence thesis by A141,A144,A108;
    end;
  end;
  set SU =Subst(q,0,YZ);
A156: S|len S=S;
A157: W[n] from NAT_1:sch 2(A132,A137);
A158: I<= len S by A6,A29,FINSEQ_3:25;
A159: for b be bag of 6 st b in Support SU  holds b.4 <= 8
  by A136,A157,A6,A156;
  defpred WW[bag of 6, Element of R] means
     ($1.4+$1.5 = 8 implies $2 = SU. ($1 +*(5,0) )) &
     ($1.4+$1.5 <> 8 implies $2=0.R);
A160:for x being Element of Bags 6 ex y be Element of R st WW[x,y]
  proof
    let x be Element of Bags 6;
    per cases;
    suppose
A161: x.4+x.5 = 8;
      take SU. (x +*(5,0) );
      thus thesis by A161;
    end;
    suppose
A162: x.4+x.5 <> 8;
      take 0.R;
      thus thesis by A162;
    end;
  end;
  consider W being Function of Bags 6,R such that
A163:  for x being Element of Bags 6 holds WW[x,W.x] from FUNCT_2:sch 3(A160);
  set SS =SgmX(BagOrder 6, Support SU);
A164: dom SU = Bags 6 =dom W by FUNCT_2:def 1;
  BagOrder 6 linearly_orders Support SU by POLYNOM2:18;
  then
A165: rng SS = Support SU by PRE_POLY:def 2;
  reconsider SS as one-to-one FinSequence of Bags 6 by POLYNOM2:18,PRE_POLY:10;
  deffunc O(object) = SS/.$1 +*(5,8-'SS/.$1.4);
  consider SW be FinSequence such that
A166: len SW = len SS and
A167: for k st k in dom SW holds SW.k =O(k) from FINSEQ_1:sch 2;
A168: dom SS = dom SW by A166,FINSEQ_3:29;
A169: rng SW c= Support W
  proof
    let y be object;
    assume y in rng SW;
    then consider z be object such that
A170:   z in dom SW & SW.z = y by FUNCT_1:def 3;
    reconsider z as Nat by A170;
A171: O(z) in Bags 6 by PRE_POLY:def 12;
A172: SW.z = O(z) by A170,A167;
A173: 6 = dom (SS/.z) by PARTFUN1:def 2;
A174: O(z).4 = SS/.z.4 by FUNCT_7:32;
A175: O(z).5 = 8-'SS/.z.4 by A19, A173,FUNCT_7:31;
    SS/.z = SS.z in rng SS by A170,A168,FUNCT_1:def 3,PARTFUN1:def 6;
    then O(z).5 = 8 - SS/.z.4 by A159,A165,A175,XREAL_1:233;
    then O(z).4+O(z).5 = 8 by A174;
    then
A176: W.O(z) = SU. (O(z) +*(5,0) ) by A163,A171;
A177: SS/.z = SS.z in rng SS by A170,A168,FUNCT_1:def 3,PARTFUN1:def 6;
    then
A178: SU. (SS/.z)<>0.R by POLYNOM1:def 3,A165;
A179: (SS/.z).5 = 0 by A157,A6,A156,A177,A165;
    SS/.z +*(5,8-'SS/.z.4) +*(5,0) = SS/.z +*(5,0) by FUNCT_7:34
    .= SS/.z by A179,FUNCT_7:35;
    hence thesis by A176,A172,A170, A178,A171,A164,POLYNOM1:def 3;
  end;
A180: Support W c= rng SW
  proof
    let z be object;
    assume
A181:z in Support W;
    then
A182:z in dom W & W.z<>0.R by POLYNOM1:def 3;
    reconsider z as bag of 6 by A181;
A183: (z +*(5,0) ) in Bags 6 by PRE_POLY:def 12;
A184: WW[z,W.z] by A181,A163;
    (z +*(5,0) ) in Support SU by A164,A183,A182,A184,POLYNOM1:def 3;
    then consider i be object such that
A185: i in dom SS & SS.i = (z +*(5,0) ) by A165,FUNCT_1:def 3;
    reconsider i as Nat by A185;
A186: SS.i = SS/.i by PARTFUN1:def 6,A185;
A187: SS/.i.4 = z.4 by A185, A186,FUNCT_7:32;
    SW.i = SS/.i +*(5,8-'SS/.i.4) by A167,A168,A185
    .= (z +*(5,0) ) +*(5,8-'SS/.i.4) by A185,PARTFUN1:def 6
    .= z    +*(5,8-'SS/.i.4) by FUNCT_7:34
    .= z by A184,A181,POLYNOM1:def 3,FUNCT_7:35,A187;
    hence thesis by A185,A168,FUNCT_1:def 3;
  end;
  then
A189: rng SW = Support W by A169,XBOOLE_0:def 10;
A190: SW is one-to-one
  proof
    let i1,i2 be object such that
A191: i1 in dom SW & i2 in dom SW & SW.i1=SW.i2;
A192: SW.i1 = O(i1) & SW.i2 = O(i2) by A191,A167;
A193:  6 = dom (SS/.i1) & 6 = dom (SS/.i2) by PARTFUN1:def 2;
A194: SS/.i1 = SS.i1 in rng SS by A191,A168,FUNCT_1:def 3,PARTFUN1:def 6;
A195: SS/.i2 = SS.i2 in rng SS by A191,A168,FUNCT_1:def 3,PARTFUN1:def 6;
A196: SS/.i1 = SS.i1 & SS/.i2 = SS.i2 by A191,A168,PARTFUN1:def 6;
    for x st x in 6 holds SS/.i1.x = SS/.i2.x
    proof
      let j be object such that
A197: j in 6 & SS/.i1.j <> SS/.i2.j;
A198: j in Segm 6 by A197;
      then reconsider j as Nat;
A199: SS/.i1.5 = 0 = SS/.i2.5 by A195,A194,A157,A6,A156,A165;
      j < 5+1 by A198,NAT_1:44;
      then
A200: j <= 5 & j<>5 by A199,NAT_1:13,A197;
      O(i1).j = (SS/.i1).j by A200,FUNCT_7:32;
      hence thesis by A192,A191,A197,A200,FUNCT_7:32;
    end;
    then
    SS/.i1 = SS/.i2 by A193;
    hence i1=i2 by A196,A191,A168,FUNCT_1:def 4;
  end;
  reconsider SW as one-to-one FinSequence of Bags 6
    by A189,A190,FINSEQ_1:def 4;
  reconsider W as Polynomial of 6,R by A180,POLYNOM1:def 5;
  reconsider RR=R as Field;
A202: dom SU = Bags 6 by FUNCT_2:def 1;
  rng W c= INT
  proof
    let y be object;
    assume
A203: y in rng W & not y in INT;
    then consider x such that
A204: x in dom W & W.x = y by FUNCT_1:def 3;
    reconsider x as bag of 6 by A204;
A205: W.x <>0 by A204,A203,INT_1:def 2;
A206:x +*(5,0) in Bags 6 by PRE_POLY:def 12;
    x.4 + x.5 =8 by A205,A163,A204;
    then W.x = SU. (x +*(5,0)) by A163,A204;
    then W.x in rng SU c= INT by A206,A202,FUNCT_1:def 3,RELAT_1:def 19;
    hence thesis by A204,A203;
  end;
  then
  reconsider W as INT -valued Polynomial of 6,R by RELAT_1:def 19;
  take W;
A207: len SW = card Support W by A189, FINSEQ_4:62;
  reconsider SSU=SU,WW=W as Polynomial of 6,RR;
A208: for f be Function of 6,F_Real, d be Element of F_Real st
  f.5 <>0 & d = f.4/f.5
  holds eval(W,f) = (power F_Real).(f/.5,8)* eval(SU, f+*(4,d))
  proof
    let f be Function of 6,F_Real,divf be Element of F_Real such that
A209: f.5 <>0 and
A210: divf = f.4/f.5;
    reconsider ff=f as Function of 6,RR;
    reconsider divff = divf as Element of RR;
    set ffd = ff +* (4,divff);
    set fd = f +* (4,divf);
    set P = (power RR).(ff/.5,8);
    set p = (power R).(f/.5,8);
    reconsider SSU=SU,WW=W as Polynomial of 6,RR;
    set PSU =P * SSU;
A211: dom SU = Bags 6 =dom PSU by FUNCT_2:def 1;
    dom f = 6 by FUNCT_2:def 1;
    then f/.5=f.5 by A19,PARTFUN1:def 6;
    then
A212:p<>0.R by A209,Th6;
A213:Support SU = Support PSU
    proof
      thus Support SU c= Support PSU
      proof
        let u be object;
        assume
A214:   u in Support SU;
        reconsider u as bag of 6 by A214;
        p*(SU.u) = PSU.u  & SU.u <> 0.R  & u in dom SU
        by A214,POLYNOM1:def 3,POLYNOM7:def 9;
        hence thesis by POLYNOM1:def 3,A211,A212;
      end;
      let u be object;
      assume
A215: u in Support PSU;
      reconsider u as bag of 6 by A215;
      p*(SU.u) = PSU.u  & PSU.u <> 0.R  & u in dom PSU
      by A215,POLYNOM1:def 3,POLYNOM7:def 9;
      then SU.u <>0.R & u in dom SU by A211;
      hence thesis by POLYNOM1:def 3;
    end;
    set SS =SgmX(BagOrder 6, Support SU);
    consider y be FinSequence of RR such that
A216: len y = len SS &
    eval(PSU,ffd) = Sum y and
A217:  for i be Element of NAT st 1 <= i & i <= len y holds
    y/.i = (PSU * SS)/.i * eval((SS/.i),ffd) by A213,POLYNOM2:def 4;
    consider yW being FinSequence of RR such that
A218: len yW = card Support WW & eval(WW,ff) = Sum yW and
A219: for i be Nat st 1 <= i & i <= len yW holds
    yW/.i = (WW * SW)/.i * eval(SW/.i,ff)
    by A180,A169,XBOOLE_0:def 10,HILB10_2:24;
    for j st 1<=j <= len y holds yW.j = y.j
    proof
      let j such that
A220: 1<=j <= len y;
A221: j in NAT by ORDINAL1:def 12;
      set SSj= SS/.j;
A222: j in dom SS & j in dom SW & j in dom y & j in dom yW
      by A220,A216,A166,FINSEQ_3:25,A218,A207;
      dom (PSU * SS) = dom SS by RELAT_1:27,A165,A211;
      then
A223: (PSU * SS)/.j = (PSU * SS).j = PSU. (SS.j) & SS.j = SSj
      by A220,A216,FINSEQ_3:25,PARTFUN1:def 6,FUNCT_1:12;
      dom (WW * SW) = dom SW by A164,A189,RELAT_1:27;
      then
A224: (WW * SW)/.j = (WW * SW).j = WW. (SW.j) & SW.j = SW/.j
      by A220,A216,A166,FINSEQ_3:25,PARTFUN1:def 6,FUNCT_1:12;
A225: SW/.j = SS/.j +*(5,8-' SS/.j.4)
      by A224,A167,A220,A216,A166,FINSEQ_3:25;
A226:  6 = dom (SS/.j) by PARTFUN1:def 2;
A227: O(j) in Bags 6 by PRE_POLY:def 12;
A228: O(j).4 = SS/.j.4 by FUNCT_7:32;
A229: O(j).5 = 8-'SS/.j.4 by A19, A226,FUNCT_7:31;
A230: SS/.j = SS.j in rng SS by A222,FUNCT_1:def 3,PARTFUN1:def 6;
      then
A231: 8 -' SS/.j.4 = 8 - SS/.j.4 by A159,A165,XREAL_1:233;
      then O(j).4+O(j).5 = 8 by A228,A229;
      then
A232: W.O(j) = SU. (O(j) +*(5,0) ) by A163,A227;
A233: SSj.5 = 0 by A230,A157,A6,A156,A165;
A234: (O(j)+*(5,0) ) = SS/.j +*(5,0) by FUNCT_7:34
      .= SS/.j by A233,FUNCT_7:35;
      set SSj5 = SSj  +* (5,0);
A235: SSj +*(5,8-'SSj.4) +* (5,0) = SSj5 by FUNCT_7:34;
A236: dom (SSj ) = 6 =dom SSj5 by PARTFUN1:def 2;
      then SSj +*(5,8-'SSj.4).5 = 8-'SSj.4 by A19,FUNCT_7:31;
      then SW/.j = SSj5  + E6+*(5,8-'SSj.4) by A235,Th15,A225;
      then
A237: eval(SW/.j,ff) = eval( SSj5,ff) * eval(E6+*(5,8-'SSj.4),ff)
      by POLYNOM2:16;
A238: eval(E6+*(5,8-'SSj.4),ff) = (power RR).(ff.5, 8-'SSj.4) by A19,Th14;
A239: eval(SSj5,ffd) = eval(SSj5 +*(4,0) + (E6 +*(4,SSj5.4)),ffd)
      & eval(SSj5,ff) = eval(SSj5 +*(4,0) + (E6 +*(4,SSj5.4)),ff) by Th15;
A240: eval(E6 +*(4,SSj5.4),ffd) = (power RR).(ffd.4, SSj5.4) &
      eval(E6 +*(4,SSj5.4),ff) = (power RR).(ff.4, SSj5.4) by A19,Th14;
A241: dom ff = 6 =dom ffd by PARTFUN1:def 2;
      then
A242: ffd.4 = divff by A19,FUNCT_7:31;
A243: (SSj5 +*(4,0)).4 =0 by A236,A19,FUNCT_7:31;
A244: SSj = SSj5 by A233,FUNCT_7:35;
A245: ff/.5 = ff.5 & ff/.4 = ff.4 by A241,A19,PARTFUN1:def 6;
A246: 8 -' SS/.j.4 in NAT & SS/.j.4 in NAT by ORDINAL1:def 12;
      divff * ff/.5 = divf *f/.5
      .= divf *f.5 by A241,A19,PARTFUN1:def 6
      .= f.4 by XCMPLX_1:87,A209,A210;
      then (power RR).(divff, SSj5.4) * (power RR).(ff/.5, SSj5.4) =
      (power RR).(ff/.4, SSj5.4) by A245,GROUP_1:52;
      then
A247: (power RR).(ff/.4, SSj5.4) * (power RR).(ff/.5, 8-'SSj.4) =
      (power RR).(divff, SSj5.4) * ((power RR).(ff/.5, SSj5.4)
      * (power RR).(ff/.5, 8-'SSj.4)) by GROUP_1:def 3
      .= (power RR).(divff, SSj5.4) * ((power RR).(ff/.5, SSj.4 + (8-'SSj.4)))
      by A246,A244,POLYNOM2:1
      .= (power RR).(divff, SSj5.4) * P by A231;
A248: eval(SW/.j,ff) = eval( SSj5,ff) * ((power RR).(ff/.5, 8-'SSj.4))
      by A241,A19,PARTFUN1:def 6,A237,A238
      .= eval(SSj5 +*(4,0),ff) *eval(E6 +*(4,SSj5.4),ff) *
      ((power RR).(ff/.5, 8-'SSj.4)) by A239,POLYNOM2:16
      .= (eval(SSj5 +*(4,0),ff)* (power RR).(ff/.4, SSj5.4)) *
      (power RR).(ff/.5, 8-'SSj.4) by A241,A19,PARTFUN1:def 6,A240
      .= eval(SSj5 +*(4,0),ff)* ((power RR).(ff/.4, SSj5.4) *
      (power RR).(ff/.5, 8-'SSj.4)) by GROUP_1:def 3
      .= eval(SSj +*(4,0),ffd) * (eval(E6 +*(4,SSj5.4),ffd) * P)
      by A240,A242,A243,Th18,A247,A244
      .= (eval(SSj +*(4,0),ffd) * eval(E6 +*(4,SSj5.4),ffd)) * P
      by GROUP_1:def 3
      .= eval(SSj,ffd) * P by A239,POLYNOM2:16,A244;
A249: (WW * SW)/.j = SU . SSj
      by A234,A224,A167,A220,A216,A166,FINSEQ_3:25,A232;
A250: (PSU * SS)/.j = p * (SU.SSj) by POLYNOM7:def 9,A223;
      y/.j = P * (WW * SW)/.j * eval(SSj,ffd) by A249,A250,A217,A220,A221
      .= (WW * SW)/.j *(P * eval(SSj,ffd)) by GROUP_1:def 3
      .= yW/.j by A216,A218,A219,A166,A207,A220,A248
      .=yW.j by A222,PARTFUN1:def 6;
      hence thesis by A222,PARTFUN1:def 6;
    end;
    then eval(PSU,ffd) = eval(W,f) by A216,A218,A166,A207,FINSEQ_1:14;
    hence thesis by POLYNOM7:29;
  end;
A251: 0 in Segm 6 & 1 in Segm 6 & 2 in Segm 6 & 3 in Segm 6 & 4 in
  Segm 6 & 5 in Segm 6 by NAT_1:44;
  thus
A252:  for f be Function of 6,F_Real st f.5 <>0
  holds eval(W,f) = (power R).(f/.5,8)*
  eval(Jsqrt M, @ <%- (f.0) + (f.4/f.5),f.1,f.2,f.3%>)
  proof
    let f be Function of 6,F_Real such that
A253:f.5 <>0;
    reconsider divf=f.4/f.5 as Element of R by XREAL_0:def 1;
    set fd = f +* (4,divf);
A254: eval(W,f) = (power F_Real).(f/.5,8)* eval(SU, f+*(4,divf))
    by A253,A208;
A255: dom f = 6 =dom fd by FUNCT_2:def 1;
A256:eval(SU,fd) = eval(q, fd+*(0,eval(YZ,fd))) by Th37,A251;
A257: eval(Zb,fd) = power(R).(fd.4,1) by A251,Th14
    .= power(R).(divf,1) by A251,A255,FUNCT_7:31
    .= divf by GROUP_1:50;
A258: fd.0 =f.0 = f/.0 by A251,A255,PARTFUN1:def 6,FUNCT_7:32;
A259:eval(Yb,fd) = power(R).(fd.0,1) by A251,Th14
    .= f/.0 by A258,GROUP_1:50;
A260: eval(YZ,fd) = eval(Y,fd) + eval(Z,fd) by POLYNOM2:23
    .= (-1.R)*eval(Yb,fd) + eval(Z,fd) by POLYNOM7:13
    .= (-1.R)*eval(Yb,fd) + (1.R)*eval(Zb,fd) by POLYNOM7:13
    .= -(f/.0) + divf by A259,A257
    .= -(f.0) + divf by A251,A255,PARTFUN1:def 6;
A261: Segm 4 c= Segm 6 by NAT_1:39;
A262: dom ((fd+*(0,-(f.0) + divf)) |4)=4 by PARTFUN1:def 2,A261;
    for x st x in 4  holds (fd+*(0,-(f.0) + divf)|4).x =
    (@<%- (f.0) + divf,f.1,f.2,f.3%>).x
    proof
      let x such that
A263: x in 4;
A264: 4 = Segm 4;
      then reconsider x as Nat by A263;
      x<4=3+1 by A263,A264,NAT_1:44;
      then x <= 3 by NAT_1:13;
      then x=0 or ... or x=3;
      then per cases;
      suppose
A265:   x=0;
        then (fd+*(0,-(f.0) + divf)).x = <%- (f.0) + divf,f.1,f.2,f.3%>.0
        by A261,A263,A255,FUNCT_7:31;
        hence thesis by A265,A263,FUNCT_1:49;
      end;
      suppose
A266:   x=1 or x=2 or x=3;
        then (fd+*(0,-(f.0) + divf)).x = fd.x by FUNCT_7:32
        .= <%- (f.0) + divf,f.1,f.2,f.3%>.x by A266,FUNCT_7:32;
        hence thesis by A263,FUNCT_1:49;
      end;
    end;
    then fd+*(0,-(f.0) + divf)|4 = (@<%- (f.0) + divf,f.1,f.2,f.3%>)
    by PARTFUN1:def 2,A262;
    hence thesis by A254,A256,A260,A4;
  end;
  let f be INT -valued Function of 6,F_Real such that
A267: f.5 <>0 & eval(W,f) = 0;
  set N=f.5 gcd f.4;
  consider g5,g4 be Integer such that
A268:    f.5 = N*g5 & f.4 = N*g4 & g5,g4 are_coprime by A267,INT_2:23;
  reconsider Nr=N,g5r=g5,g4r=g4 as Element of R by XREAL_0:def 1;
  set g = f +*(4,g4r) +*(5,g5r);
  reconsider g as Function of 6,R;
  reconsider gg = g as Function of 6,RR;
A269: (power F_Real).(f.5,8) = (power F_Real).(Nr*g5r,8) by A268
  .= ((power F_Real).(Nr,8)) * ((power F_Real).(g5r,8)) by GROUP_1:52;
A270: dom f = 6 = dom (f +*(4,g4)) & dom g = 6 =Segm 6 by PARTFUN1:def 2;
  then
A271: g.0 = (f +*(4,g4)).0 = f.0  &
  g.1 = (f +*(4,g4)).1 = f.1 & g.2 = (f +*(4,g4)).2 = f.2  &
  g.3 = (f +*(4,g4)).3 = f.3 & g.4 = (f +*(4,g4)).4 = g4 & g.5 = g5
  by NAT_1:44,FUNCT_7:32,31;
  rng g c= INT
  proof
    let y be object such that
A272:y in rng g;
    consider x such that
A273:x in dom g & g.x=y by A272,FUNCT_1:def 3;
    reconsider x as Nat by A273,A270;
    x < 6=5+1 by A273,A270,NAT_1:44;
    then x <= 5 by NAT_1:13;
    then x=0 or ... or x = 5;
    hence thesis by A271,A273,INT_1:def 2;
  end;
  then
A274: g is INT -valued by RELAT_1:def 19;
A275: (power F_Real).(Nr,8)<>0.R by A267,Th6;
A276: g.5 <>0 by A267,A271,A268;
A277: f/.5 = f.5 & g/.5 = g.5 by A270,NAT_1:44,PARTFUN1:def 6;
  0.R = (power R).(f/.5,8)*
  eval(Jsqrt M, @ <%- (f.0) + (f.4/f.5),f.1,f.2,f.3%>) by A267,A252
  .= (power R).(f/.5,8)*
  eval(Jsqrt M, @<%- (g.0) + (g.4/g.5),g.1,g.2,g.3%>)
  by A268,A267,XCMPLX_1:91,A271
  .= ((power F_Real).(Nr,8)) * ((power F_Real).(g5r,8)) *
  eval(Jsqrt M, @<%- (g.0) + (g.4/g.5),g.1,g.2,g.3%>)
  by A270,NAT_1:44,PARTFUN1:def 6,A269
  .= ((power F_Real).(Nr,8)) * (((power F_Real).(g5r,8)) *
  eval(Jsqrt M, @<%- (g.0) + (g.4/g.5),g.1,g.2,g.3%>));
  then
A278: 0.R = (((power F_Real).(g5r,8)) *
  eval(Jsqrt M, @<%- (g.0) + (g.4/g.5),g.1,g.2,g.3%>)) by A275
  .= (((power F_Real).(g/.5,8)) *
  eval(Jsqrt M, @<%- (g.0) + (g.4/g.5),g.1,g.2,g.3%>))
  by A270,NAT_1:44,FUNCT_7:31,A277
  .= eval(W,g) by A276,A252;
  set R8 = E6+* (4,8);
  R8 in Bags 6 & Z8 in Bags 6 by PRE_POLY:def 12;
  then
A279: WW[R8,W.R8] by A163;
A280: R8.5 = E6.5=0 by FUNCT_7:32;
  R8 +*(5,0) = E6 +*(5,E6.5)+*(4,8) by FUNCT_7:33
  .= Z8 by FUNCT_7:35;
  then
A281: W.R8 = 1_R by A280,A279,A18,A19,FUNCT_7:31,A158,A157,A6,A156;
  set MZ = Monom(1.R,R8);
  set MZZ = Monom(1.RR,R8);
  MZ-MZ = 0_(6,RR) by POLYNOM1:24;
  then
A282: W = MZZ-MZZ + WW by POLYNOM1:23
  .= (MZZ+(-MZZ))+WW by POLYNOM1:def 7
  .= MZZ + (-MZZ+WW) by POLYNOM1:21
  .=MZ + (W -MZ) by POLYNOM1:def 7;
  set S = SgmX(BagOrder 6, Support (WW-MZZ));
  BagOrder 6 linearly_orders Support (WW-MZZ) by POLYNOM2:18;
  then
A283: rng S = Support (WW-MZZ) by PRE_POLY:def 2;
  consider Ry be FinSequence of RR such that
A284:len Ry = len S & eval(WW-MZZ,gg) = Sum Ry and
A285: for i be Element of NAT st 1 <= i & i <= len Ry holds
  Ry/.i = ((WW-MZZ) * S)/.i * eval((S/.i),gg) by POLYNOM2:def 4;
  defpred P[Nat] means for i be Nat st i=$1 <= len S
  ex s be Integer st s*(g.5) = Sum (Ry|i);
  A286:P[0]
  proof
    let i such that
A287: i= 0<= len S;
    take s=0;
    Ry|0 = <*> the carrier of RR;
    then Sum (Ry|i) = 0.RR by A287,RLVECT_1:43;
    hence thesis;
  end;
A288: term MZ = R8 by POLYNOM7:10;
A289: MZ.R8 = coefficient(MZ) by POLYNOM7:10;
A290:P[n] implies P[n+1]
  proof
    assume
A291:P[n];
    let n1 be Nat such that
A292: n1=n+1 <= len S;
    n < len S by A292,NAT_1:13;
    then consider s be Integer such that
A293: s*(g.5) = Sum (Ry|n) by A291;
A294: n1 in dom S by A292,NAT_1:11,FINSEQ_3:25;
    then
A295: S.n1 in rng S & S.n1 = S/.n1 by FUNCT_1:def 3,PARTFUN1:def 6;
    then
A296:(WW-MZZ).(S/.n1) <>0.R by A283,POLYNOM1:def 3;
A297:(WW-MZZ).(S/.n1) = (WW+-MZZ).(S/.n1) by POLYNOM1:def 7
    .= WW.(S/.n1) + (-MZZ).(S/.n1) by POLYNOM1:15
    .= WW.(S/.n1) + -(MZZ.(S/.n1)) by POLYNOM1:17;
A298: S/.n1 <>R8
    proof
      assume S/.n1 =R8;
      then WW.(S/.n1) + -(MZZ.(S/.n1)) = 1_R + -(1_R) by A281,A289,POLYNOM7:9;
      hence thesis by A296,A297;
    end;
    MZ.(S/.n1) = 0.R by A288,A298,POLYNOM7:def 5;
    then
A299: WW.(S/.n1) <> 0.R by A295,A297,A283,POLYNOM1:def 3;
    then
A300: (S/.n1).4 + (S/.n1).5 = 8 by A163;
    then
A301: WW.(S/.n1) = SU.( S/.n1 +*(5,0)) by A163;
A302: dom (S/.n1) = 6 by PARTFUN1:def 2;
A303: (S/.n1 +* (5,0)).4 = (S/.n1).4 by FUNCT_7:32;
A304:  S/.n1 +* (5,0)<>Z8
    proof
      assume
A305: S/.n1  +* (5,0)=Z8;
      consider j be object such that
A306: j in Segm 6 & (S/.n1).j <>R8.j by A302,A298,PARTFUN1:def 2;
      reconsider j as Nat by A306;
A307: R8.5= E6.5 by FUNCT_7:32;
      j < 5+1 by A306,NAT_1:44;
      then j <= 5 & j<>5 by NAT_1:13,A306,A305,A307,A300,A136,A303;
      hence contradiction by A306,A305,FUNCT_7:32;
    end;
    S/.n1  +* (5,0) in Bags 6 by PRE_POLY:def 12;
    then ( S/.n1 +*(5,0)) in Support SU by A164,A299,A301,POLYNOM1:def 3;
    then S/.n1.5 <>0 by A300,A303,A304,A157,A6,A156;
    then reconsider O=(S/.n1.5) -1 as Nat;
A308: S/.n1 = S/.n1 +*(5,O+1) by FUNCT_7:35
    .= S/.n1 +*(5,O) + E6 +*(5,1) by Th22;
A309: eval(E6 +*(5,1),gg) = power(R).(gg.5,1) by A251,Th14
    .= g5r by GROUP_1:50,A271;
    reconsider d1= eval(S/.n1 +*(5,O),gg) as Integer by A274;
    Bags 6 = dom (W-MZ) by FUNCT_2:def 1;
    then dom ((W-MZ) * S) = dom S by A283,RELAT_1:27;
    then ((W-MZ) * S)/.n1 = ((W-MZ) * S).n1 in rng ((W-MZ) * S) c= INT
    by A294,PARTFUN1:def 6,FUNCT_1:def 3,RELAT_1:def 19;
    then reconsider d2 = ((W-MZ) * S)/.n1 as Integer;
    reconsider E1=eval(S/.n1 +*(5,O),g), E2 = eval(E6 +*(5,1),g)
    as Element of REAL;
A310:eval((S/.n1),gg) = eval(S/.n1 +*(5,O),g) * eval(E6 +*(5,1),g)
    by A308,POLYNOM2:16;
A311: Ry/.n1 = ((WW-MZZ) * S)/.n1 * eval((S/.n1),gg)
    by A292,A284,A285,NAT_1:11
    .= d2 * (E1*E2) by BINOP_2:def 11,A310
    .= (d2*d1)* g5 by A309;
    Ry|n1 = (Ry|n) ^ <*Ry/.n1*> by A292,A284,FINSEQ_5:82;
    then Sum (Ry|n1) = Sum (Ry|n) + Sum <*Ry/.n1*> by RLVECT_1:41;
    then Sum (Ry|n1) = (the addF of RR).(Sum (Ry|n),Ry/.n1) by RLVECT_1:44
    .= s*(g.5)+(d2*d1)* g5 by A311,A293, BINOP_2:def 9
    .= (g.5)*(s+d2*d1) by A271;
    hence thesis;
  end;
  P[n] from NAT_1:sch 2(A286,A290);
  then consider s be Integer such that
A312: s*(g.5) = Sum (Ry|len Ry) by A284;
A313: eval(R8,g) = power(R).(g.4,8) by A251,Th14
  .= g4 |^ 8 by NIVEN:7,A271;
A314:  eval(MZ,g) = 1.R * eval(R8,g) by POLYNOM7:13
  .= g4 |^ 8 by A313;
  eval(W,g) = eval(MZ,g) + eval(W-MZ,g) by A282,POLYNOM2:23
  .= s*(g.5) + g4 |^ 8 by A312,A284,A314;
  then
A315: g5*(-s) = g4 |^ 8 by A278,A271;
  defpred H[Nat] means g5 divides g4 |^ $1 implies g5 divides g4;
A316: H[0]
  proof
    A317: g4|^0 = 1 by NEWTON:4;
    assume g5 divides g4 |^ 0;
    then g5 = 1 or g5 = -1 by A317,INT_2:13;
    hence thesis by INT_2:12;
  end;
A318:H[j] implies H[j+1]
  proof
    assume
A319: H[j] & g5 divides g4 |^ (j+1);
    then g5 divides g4* g4 |^ j by NEWTON:6;
    hence thesis by A319,A268,INT_2:25;
  end;
  H[j] from NAT_1:sch 2(A316,A318);
  then g5 divides g4 & g5 divides g5*1 by A315,INT_1:def 3;
  then g5 divides (g5 gcd g4) by INT_2:22;
  then g5 divides 1 by A268,INT_2:def 3;
  then g5 = 1 or g5 = -1 by INT_2:13;
  then f.4 = f.5 *(-g4) or f.4 = f.5 * g4 by A268;
  hence f.5 divides f.4 by INT_1:def 3;
end;

registration
  let x be Integer;
  cluster <%x%> -> INT -valued;
  coherence
  proof
    x in INT by INT_1:def 2;
    hence thesis;
  end;
end;

registration
  let x,y,z,t be Integer;
  cluster <%x,y,z,t%> -> INT -valued;
  coherence
  proof
    <%x%>^<%y%>^<%z%>^<%t%> is INT -valued;
    hence thesis by AFINSQ_1:def 14;
  end;
end;

theorem Th77:
  ex K3 be INT -valued Polynomial of 8,F_Real st
    for x1,x2,x3,P,R,N be Nat,V be Integer st
        x1 is odd & x2 is odd & P > 0 &
        N > sqrt x1 + 2*sqrt x2 + 4*sqrt x3 +R
      holds
        (x1 is square & x2 is square  & x3 is square & P divides R & V>=0)
      iff
        ex z be Nat st for f be Function of 8,F_Real
              st f = <%z,x1,4*x2,16*x3%>^<%R,P,N,V%> holds eval(K3,f) = 0
proof
  set M = the Jpolynom of 4,F_Complex;
  set Ree = F_Real;
  reconsider RR=Ree as Field;
  consider  K2 be INT -valued Polynomial of 6,F_Real such that
A1:  (for f be Function of 6,F_Real st f.5 <>0
  holds eval(K2,f) = (power F_Real).(f/.5,8)*
  eval(Jsqrt M, @ <%- f.0 + (f.4/f.5),f.1,f.2,f.3%>)) and
A2:    for f be INT -valued Function of 6,F_Real st f.5 <>0 &
    eval(K2,f) = 0 holds f.5 divides f.4 by Th76;
  consider K28 be Polynomial of 6+2,Ree such that
A3: rng K28 c= rng K2 \/ {0.Ree} and
       for b be bag of 6+2 holds b in Support K28 iff b|6 in Support K2 &
                 for i st i >= 6 holds b.i=0 and
      for b be bag of 6+2 st b in Support K28 holds K28.b = K2.(b|6) and
A4:  for x being Function of 6, Ree,
         y being Function of (6+2), Ree st y|6=x
       holds eval(K2,x) = eval(K28,y) by Th75;
  rng K28 c= INT by A3,INT_1:def 2;
  then reconsider K28 as INT -valued Polynomial of 8,Ree by RELAT_1:def 19;
  set nb = (EmptyBag 8) +*(6,1),n=Monom(1.Ree,nb),
  vb = (EmptyBag 8) +*(7,1),v=Monom(- 1.Ree,vb),
  zb = (EmptyBag 8) +*(0,1),z=Monom(1.Ree,zb);
  reconsider v as INT -valued Polynomial of 8,Ree;
  set znv = z + n *' v;
  reconsider K3= Subst(K28,0,znv) as INT -valued Polynomial of 8,Ree;
  take K3;
A6: 0 in Segm 6 & 1 in Segm 6 & 2 in Segm 6 & 3 in Segm 6 &
  4 in Segm 6 & 5 in Segm 6 by NAT_1:44;
A7: 0 in Segm 8 & 1 in Segm 8 & 2 in Segm 8 & 3 in Segm 8 &
  4 in Segm 8 & 5 in Segm 8 & 6 in Segm 8 & 7 in Segm 8 by NAT_1:44;
  let x1,x2,x3,P,R,N be Nat,V be Integer such that
A8:    x1 is odd & x2 is odd & P > 0 &
  N > sqrt x1 + 2*sqrt x2 + 4*sqrt x3 +R;
  thus (x1 is square & x2 is square  & x3 is square & P divides R & V>=0)
  implies ex z be Nat st for f be Function of 8,F_Real
  st f = <%z,x1,4*x2,16*x3%>^<%R,P,N,V%> holds eval(K3,f) = 0
  proof
    assume
A9: x1 is square & x2 is square & x3 is square & P divides R & V>=0;
    then consider z1 be Integer such that
A10:  -z1 = sqrt x1 + 2* sqrt x2 + 4 *sqrt x3 and
A11:  eval(Jsqrt M,@<%z1,x1,4*x2,16*x3%>)=0 by Th74;
    consider d be Nat such that
A12: P*d = R by NAT_D:def 3,A9;
    set zd = - z1+d;
A13: R/P = (d*P)/(P*1) = d/1 =d by A12,A8,XCMPLX_1:91;
    set f6 = <%zd%>^<%x1%>^<%4*x2%>^<%16*x3%>^<%R%>^<%P%>;
    reconsider F6=@f6 as Function of 6,F_Real;
A14: F6.5 = P & F6.0 =zd & F6.4 = R & F6.5 = P & F6.1 = x1  &
    F6.2 = 4*x2 & F6.3 = 16*x3 by AFINSQ_1:47;
A15: eval(K2,F6) = (power F_Real).(F6/.5,8)*
    eval(Jsqrt M, @ <%- F6.0 + (F6.4/F6.5),F6.1,F6.2,F6.3%>) by A1,A8
    .= 0 by A11,A14,A13;
    set zdv = zd+N*V;
    set f8 = <%zdv%>^<%x1%>^<%4*x2%>^<%16*x3%>^<%R%>^<%P%>^<%N%>^<%V%>;
    reconsider f=@f8 as Function of 8,F_Real;
    set y = zdv + N*(-V);
    reconsider Y=y,zzR=zdv,NR=N,VR=V as Element of Ree by XREAL_0:def 1;
    reconsider Yr=Y,zzr=zzR,Nr=NR,Vr=VR as Element of RR;
    zdv is set & x1 is set & 4*x2 is set & 16*x3 is set & R is set
    & P is set & N is set & V is set by TARSKI:1;
    then
A16:f.0= zdv & f.1 = x1 & f.2 = 4*x2 & f.3 = 16*x3 & f.4 = R
    & f.5 = P & f.6 = N & f.7 = V by AFINSQ_1:49;
A17:eval(zb,f) = power(Ree).(f.0,1) by A7,Th14
    .= zzR by GROUP_1:50,A16;
A18:eval(z,f) = 1.Ree * eval(zb,f) by POLYNOM7:13
    .= zzR by A17;
A19:eval(vb,f) = power(Ree).(f.7,1) by A7,Th14
    .= VR by GROUP_1:50;
A20:eval(v,f) = (-1.Ree) * eval(vb,f) by POLYNOM7:13
    .= -VR by A19
    .= -Vr;
A21:eval(nb,f) = power(Ree).(f.6,1) by A7,Th14
    .= NR by GROUP_1:50,A16;
A22:eval(n,f) = (1.Ree) * eval(nb,f) by POLYNOM7:13
    .= Nr by A21;
A23:eval(n *' v,f) = Nr * (-Vr) by A20,A22,POLYNOM2:25
    .= multreal.(N,-VR)
    .= N*(-V) by BINOP_2:def 11;
A24: eval(znv,f) =eval(z,f) + eval(n *' v,f) by POLYNOM2:23
    .= zdv + N*(-V) by A23,A18;
A25: dom(f+*(0,Y)) = 8 =dom f by PARTFUN1:def 2;
A26:Segm 6 c= Segm 8 by NAT_1:39;
    then
A27: dom ((f+*(0,Y))|6) = 6 by PARTFUN1:def 2;
    for x st x in 6 holds f6.x = ((f+*(0,Y))|6).x
    proof
      let x such that
A28:  x in 6;
A29:  x in Segm 6 by A28;
      then reconsider x as Nat;
A30:  ((f+*(0,Y))|6).x = (f+*(0,Y)).x by A28,FUNCT_1:49;
      per cases;
      suppose x=0;
        hence thesis by A30,A14,A25,A28,A26,FUNCT_7:31;
      end;
      suppose
A31:    x<>0;
        then
A32:    (f+*(0,Y)).x = f.x by FUNCT_7:32;
        x <6=5+1 by A29,NAT_1:44;
        then x <= 5 by NAT_1:13;
        then x=0 or ... or x= 5;
        hence thesis by A31,A28,FUNCT_1:49,A16,A14,A32;
      end;
    end;
    then
A33: (f+*(0,Y))|6 = F6 by PARTFUN1:def 2,A27;
    eval(K3,f) = eval(K28, f+*(0,Y)) by A24, Th37,A7;
    then
A34: eval(K3,f) = 0 by A15,A33,A4;
    set zdv = zd+N*V;
    reconsider zdv as Element of NAT by A9,A10,INT_1:3;
    take Z=zdv;
    let F be Function of 8,F_Real such that
A35: F = <%Z,x1,4*x2,16*x3%>^<%R,P,N,V%>;
    F = <%Z%>^<%x1%>^<%4*x2%>^<%16*x3%>^<%R,P,N,V%> by A35,AFINSQ_1:def 14
    .= <%Z%>^<%x1%>^<%4*x2%>^<%16*x3%>^(<%R%>^<%P%>^<%N%>^<%V%>)
    by AFINSQ_1:def 14
    .= <%Z%>^<%x1%>^<%4*x2%>^<%16*x3%>^(<%R%>^<%P%>^<%N%>)^<%V%> by AFINSQ_1:27
    .= <%Z%>^<%x1%>^<%4*x2%>^<%16*x3%>^(<%R%>^<%P%>)^<%N%>^<%V%>
    by AFINSQ_1:27;
    hence thesis by A34,AFINSQ_1:27;
  end;
  given zz be Nat such that
A36: for f be Function of 8,F_Real st f = <%zz,x1,4*x2,16*x3%>^<%R,P,N,V%>
    holds eval(K3,f) = 0;
  <%zz,x1,4*x2,16*x3%>^<%R,P,N,V%> = @(<%zz,x1,4*x2,16*x3%>^<%R,P,N,V%>);
  then reconsider f = <%zz,x1,4*x2,16*x3%>^<%R,P,N,V%>
  as INT -valued Function of 8,F_Real;
A37:zz is set & x1 is set & 4*x2 is set & 16*x3 is set & R is set
  & P is set & N is set & V is set by TARSKI:1;
  <%zz,x1,4*x2,16*x3%> = <%zz%>^<%x1%>^<%4*x2%>^<%16*x3%> by AFINSQ_1:def 14;
  then
A38: f = <%zz%>^<%x1%>^<%4*x2%>^<%16*x3%>^(<%R%>^<%P%>^<%N%>^<%V%>)
  by AFINSQ_1:def 14
  .= <%zz%>^<%x1%>^<%4*x2%>^<%16*x3%>^(<%R%>^<%P%>^<%N%>)^<%V%> by AFINSQ_1:27
  .= <%zz%>^<%x1%>^<%4*x2%>^<%16*x3%>^(<%R%>^<%P%>)^<%N%>^<%V%> by AFINSQ_1:27
  .= <%zz%>^<%x1%>^<%4*x2%>^<%16*x3%>^<%R%>^<%P%>^<%N%>^<%V%> by AFINSQ_1:27;
  then
A39: f.0= zz & f.1 = x1 & f.2 = 4*x2 & f.3 = 16*x3 & f.4 = R
  & f.5 = P & f.6 = N & f.7 = V by A37,AFINSQ_1:49;
A40: eval(K3,f) = 0 by A36;
A41: eval(K3,f) = eval(K28, f+*(0,eval(znv,f))) by A7,Th37;
A42: dom f = Segm 8 by PARTFUN1:def 2;
  set y = - N*V + zz;
  reconsider Y=y,zzR=zz,NR=N,VR=V as Element of Ree by XREAL_0:def 1;
  reconsider Yr=Y,zzr=zzR,Nr=NR,Vr=VR as Element of RR;
A43: eval(zb,f) = power(Ree).(f.0,1) by A7,Th14
  .= zzR by GROUP_1:50,A39;
A44: eval(z,f) = 1.Ree * eval(zb,f) by POLYNOM7:13
  .= zzR by A43;
A45: eval(vb,f) = power(Ree).(f.7,1) by A7,Th14
  .= VR by GROUP_1:50,A39;
A46: eval(v,f) = (-1.Ree) * eval(vb,f) by POLYNOM7:13
  .= -VR by A45
  .= -Vr;
A47: eval(nb,f) = power(Ree).(f.6,1) by A7,Th14
  .= NR by GROUP_1:50,A39;
A48:  eval(n,f) = (1.Ree) * eval(nb,f) by POLYNOM7:13
  .= Nr by A47;
A49: eval(n *' v,f) = Nr * (-Vr) by A46,A48,POLYNOM2:25
  .= multreal.(N,-VR)
  .= N*(-V) by BINOP_2:def 11;
A50:eval(znv,f) =eval(z,f) + eval(n *' v,f) by POLYNOM2:23
  .= zz + N*(-V) by A49,A44;
  set f6 = (f+*(0,Y))|6;
A51: f6.0 = (f+*(0,Y)).0 = Y & f6.1 = (f+*(0,Y)).1 = f.1 =x1 &
  f6.2 = (f+*(0,Y)).2 = f.2 =4*x2 & f6.3 = (f+*(0,Y)).3 = f.3 =16*x3 &
  f6.4 = (f+*(0,Y)).4 = f.4 = R & f6.5 = (f+*(0,Y)).5 = f.5 =P
    by A38,A42,NAT_1:44,A6,FUNCT_1:49,FUNCT_7:31,32,A37,AFINSQ_1:49;
A52: rng f6 c= the carrier of F_Real;
  Segm 6 c= Segm 8 by NAT_1:39;
  then
A53: dom f6 = 6 by PARTFUN1:def 2;
  then reconsider f6 as Function of 6,F_Real by A52,FUNCT_2:2;
  rng (f +*(0,Y)) c= (rng f) \/{y} by FUNCT_7:100;
  then rng (f +*(0,Y)) c= INT by INT_1:def 2;
  then reconsider f6 as INT -valued Function of 6,F_Real;
A54:f6/.5 <>0 by A8,A51,A6,A53,PARTFUN1:def 6;
A55:  eval(K2,f6) = 0 by A4,A50,A40,A41;
  consider d be Nat such that
A56: P *d= R by NAT_D:def 3,A55,A51,A2,A8;
A57: R/P = (d*P)/(P*1) = d/1 =d by A56,A8,XCMPLX_1:91;
A58: (power Ree).(f6/.5,8)<>0 by A54,Th6;
  eval(K2,f6) = (power Ree).(f6/.5,8)*
  eval(Jsqrt M, @ <%- f6.0 + (f6.4/f6.5),f6.1,f6.2,f6.3%>) by A1,A8,A51;
  then
A59:eval(Jsqrt M, @ <%- y + d,x1,4*x2,16*x3%>) = 0
    by A57,A51,A4,A50,A40,A41,A58;
  then x1 is square & x2 is square & x3 is square &
  -(- y + d) <= sqrt x1+2*sqrt x2 + 4*sqrt x3 by A8,Th73;
  then
A60: - N*V + (zz - d)- (zz - d) <= sqrt x1+2*sqrt x2 + 4*sqrt x3 - (zz - d)
  by XREAL_1:9;
A61:sqrt x2 >=0 & sqrt x3 >=0 by SQUARE_1:def 2;
  0 < sqrt x1 by A8,SQUARE_1:25;
  then
A62: 0+0 < sqrt x1 + (2*sqrt x2 + 4*sqrt x3 +R) by A61;
A63: (- N*V)/(-N) >= (sqrt x1+2*sqrt x2 + 4*sqrt x3 +d - zz)/(-N)
    by A60,XREAL_1:73;
A64: (- N*V)/(-N) = V *((-N)/(-N))
  .= V*1 by A62,A8,XCMPLX_1:60;
  1*d <= P*d by XREAL_1:64,NAT_1:14,A8;
  then
A65: sqrt x1+2*sqrt x2 + 4*sqrt x3 - zz +d <=
    sqrt x1+2*sqrt x2 + 4*sqrt x3 - zz + R by A56,XREAL_1:7;
  sqrt x1+2*sqrt x2 + 4*sqrt x3 + R -zz <= sqrt x1+2*sqrt x2 +
    4*sqrt x3 + R -0 by XREAL_1:10;
  then sqrt x1+2*sqrt x2 + 4*sqrt x3 - zz +d <= sqrt x1+2*sqrt x2 +
  4*sqrt x3 + R by A65,XXREAL_0:2;
  then sqrt x1+2*sqrt x2 + 4*sqrt x3 - zz +d < N by A8,XXREAL_0:2;
  then (sqrt x1+2*sqrt x2 + 4*sqrt x3 +d - zz)/(-N) > (N)/(-N)
    by A62,A8,XREAL_1:75;
  then V > N/(-N) by A63,A64,XXREAL_0:2;
  then V > -(N/N) by XCMPLX_1:188;
  then V > -1 by A62,A8,XCMPLX_1:60;
  then V >= -1+1 by INT_1:7;
  hence thesis by A59,A8,Th73,A55,A51,A2;
end;

theorem Th78:
  for X be set, S be right_zeroed non empty addLoopStr
  for p,q be Series of X, S
  for V be set st vars p c= V & vars q c= V holds
    vars (p+q) c= V
proof
  let X be set, S be right_zeroed non empty addLoopStr;
  let p,q be Series of X, S;
  let V be set;
  assume vars p c= V & vars q c= V;
  then vars (p+q) c= vars p \/ vars q c= V by Th41,XBOOLE_1:8;
  hence thesis;
end;

theorem Th79:
  for X be Ordinal, S be add-associative right_complementable right_zeroed
    right_unital distributive non empty doubleLoopStr
  for p,q be Polynomial of X, S
  for V be set st vars p c= V & vars q c= V holds
    vars (p*'q) c= V
proof
  let X be Ordinal, S be add-associative right_complementable right_zeroed
  right_unital distributive non empty doubleLoopStr;
  let p,q be Polynomial of X, S;
  let V be set;
  assume vars p c= V & vars q c= V;
  then vars (p*'q) c= vars p \/ vars q c= V by Th43,XBOOLE_1:8;
  hence thesis;
end;

theorem Th80:
  for X be set, S be add-associative right_zeroed right_complementable
    right-distributive non empty doubleLoopStr
  for p be Series of X,S, a be Element of S
  for V be set st vars p c= V holds vars (a * p) c= V
proof
  let X be set, S be add-associative right_zeroed right_complementable
  right-distributive non empty doubleLoopStr;
  let p be Series of X,S, a be Element of S;
  let V be set; assume A1: vars p c= V;
  vars (a * p) c= vars p by Th44;
  hence thesis by A1;
end;

theorem Th81:
  for X be set, S be add-associative right_zeroed right_complementable
    non empty addLoopStr
  for p,q be Series of X, S
  for V be set st vars p c= V & vars q c= V holds vars (p-q) c= V
proof
  let X be set, S be add-associative right_zeroed right_complementable
  non empty addLoopStr;
  let p,q be Series of X, S;
  let V be set;
  assume
A1: vars p c= V & vars q c= V;
  vars (-q) = vars (q) by Th42;
  then vars (p+ -q) c= vars p \/ vars (-q) c= V by A1,Th41,XBOOLE_1:8;
  then vars (p+ -q) c= V;
  hence thesis by POLYNOM1:def 7;
end;

theorem Th82:
  ex Z be INT -valued Polynomial of 17,F_Real st
    vars Z c= {0}\/(17\8) &
  for xk be Nat st xk > 0 holds
    xk+1 is prime iff
    ex x being INT -valued Function of 17, F_Real st
       x/.8 = xk & x/.9 is positive Nat & x/.10 is positive Nat &
       x/.11 is positive Nat & x/.12 is positive Nat & x/.13 is positive Nat &
       x/.14 is Nat & x/.15 is Nat & x/.16 is Nat & x/.0 is Nat &
       eval(Z,x) = 0.F_Real
proof
  set N= 17;
  set EB = EmptyBag N;
  set VARs = N\8;
A1: n in VARs iff 8 <= n < N
  proof
    thus n in VARs implies 8 <= n < N
    proof
      assume n in VARs;
      then n in Segm N & not n in Segm 8 by XBOOLE_0:def 5;
      hence thesis by NAT_1:44;
    end;
    assume 8 <= n < N;
    then n in Segm N & not n in Segm 8 by NAT_1:44;
    hence thesis by XBOOLE_0:def 5;
  end;
  set k=8, Pk = Monom(1.F_Real,EB +*(k,1));
A2:vars Pk c= VARs
  proof
    vars Pk c= {k} c= VARs by A1,Th48,ZFMISC_1:31;
    hence vars Pk c= VARs;
  end;
A3:for x be Function of N,F_Real holds eval(Pk,x) = x /. k
  proof
    let x be Function of N,F_Real;
    k in VARs by A1;
    then eval(Pk,x) = 1.F_Real * (x/.k) by Th27;
    hence thesis;
  end;
  set f=9, Pf = Monom(1.F_Real,EB +*(f,1));
A4:vars Pf c= VARs
  proof
    vars Pf c= {f} c= VARs by A1,Th48,ZFMISC_1:31;
    hence thesis;
  end;
A5:for x be Function of N,F_Real holds eval(Pf,x) = x /. f
  proof
    let x be Function of N,F_Real;
    f in VARs by A1;
    then eval(Pf,x) = 1.F_Real * (x/.f) by Th27;
    hence thesis;
  end;
  set i=10, Pi = Monom(1.F_Real,EB +*(i,1));
A6:vars Pi c= VARs
  proof
    vars Pi c= {i} c= VARs by A1,Th48,ZFMISC_1:31;
    hence thesis;
  end;
A7:for x be Function of N,F_Real holds eval(Pi,x) = x /. i
  proof
    let x be Function of N,F_Real;
    i in VARs by A1;
    then eval(Pi,x) = 1.F_Real * (x/.i) by Th27;
    hence thesis;
  end;
  set j=11, Pj = Monom(1.F_Real,EB +*(j,1));
A8:vars Pj c= VARs
  proof
    vars Pj c= {j} c= VARs by A1,Th48,ZFMISC_1:31;
    hence thesis;
  end;
A9:for x be Function of N,F_Real holds eval(Pj,x) = x /. j
  proof
    let x be Function of N,F_Real;
    j in VARs by A1;
    then eval(Pj,x) = 1.F_Real * (x/.j) by Th27;
    hence thesis;
  end;
  set m=12, Pm = Monom(1.F_Real,EB +*(m,1));
A10:vars Pm c= VARs
  proof
    vars Pm c= {m} c= VARs by A1,Th48,ZFMISC_1:31;
    hence thesis;
  end;
A11:for x be Function of N,F_Real holds eval(Pm,x) = x /. m
  proof
    let x be Function of N,F_Real;
    m in VARs by A1;
    then eval(Pm,x) = 1.F_Real * (x/.m) by Th27;
    hence thesis;
  end;
  set u=13, Pu = Monom(1.F_Real,EB +*(u,1));
A12:vars Pu c= VARs
  proof
    vars Pu c= {u} c= VARs by A1,Th48,ZFMISC_1:31;
    hence thesis;
  end;
A13:for x be Function of N,F_Real holds eval(Pu,x) = x /. u
  proof
    let x be Function of N,F_Real;
    u in VARs by A1;
    then eval(Pu,x) = 1.F_Real * (x/.u) by Th27;
    hence thesis;
  end;
  set r=14, Pr = Monom(1.F_Real,EB +*(r,1));
A14:vars Pr c= VARs
  proof
    vars Pr c= {r} c= VARs by A1,Th48,ZFMISC_1:31;
    hence thesis;
  end;
A15:for x be Function of N,F_Real holds eval(Pr,x) = x /. r
  proof
    let x be Function of N,F_Real;
    r in VARs by A1;
    then eval(Pr,x) = 1.F_Real * (x/.r) by Th27;
    hence thesis;
  end;
  set s=15, Ps = Monom(1.F_Real,EB +*(s,1));
A16:vars Ps c= VARs
  proof
    vars Ps c= {s} c= VARs by A1,Th48,ZFMISC_1:31;
    hence thesis;
  end;
A17:for x be Function of N,F_Real holds eval(Ps,x) = x /. s
  proof
    let x be Function of N,F_Real;
    s in VARs by A1;
    then eval(Ps,x) = 1.F_Real * (x/.s) by Th27;
    hence thesis;
  end;
  set t=16, Pt = Monom(1.F_Real,EB +*(t,1));
A18:vars Pt c= VARs
  proof
    vars Pt c= {t} c= VARs by A1,Th48,ZFMISC_1:31;
    hence thesis;
  end;
A19:for x be Function of N,F_Real holds eval(Pt,x) = x /. t
  proof
    let x be Function of N,F_Real;
    t in VARs by A1;
    then eval(Pt,x) = 1.F_Real * (x/.t) by Th27;
    hence thesis;
  end;
  reconsider Hund = 100 as integer Element of F_Real by XREAL_0:def 1;
  set O = 1_(N,F_Real);
A20: vars O c= VARs by Th38;
  reconsider W = Hund *(Pf*'Pk*'(Pk+O)) as INT -valued Polynomial of N,F_Real;
A21: vars W c= VARs
  proof
    vars (Pf*'Pk) c= VARs & vars (Pk+O) c= VARs by A20,A4,A2,Th79,Th78;
    then vars (Pf*'Pk*'(Pk+O)) c= VARs by Th79;
    hence thesis by Th80;
  end;
A22:for x be Function of N,F_Real holds
    eval(W,x) = Hund * x /. f * x/.k * (x/.k+1.F_Real)
  proof
    let x be Function of N,F_Real;
    thus eval(W,x)
    = Hund * eval(Pf*'Pk*'(Pk+O),x) by POLYNOM7:29
    .= Hund * (eval(Pf*'Pk,x) * eval(Pk+O,x)) by POLYNOM2:25
    .= Hund * (eval(Pf*'Pk,x) * (eval(Pk,x)+eval(O,x)))
    by POLYNOM2:23
    .= Hund * (eval(Pf*'Pk,x) * (eval(Pk,x)+1.F_Real))
    by POLYNOM2:21
    .= Hund * (eval(Pf*'Pk,x) * (x/.k+1.F_Real)) by A3
    .= Hund * (eval(Pf,x) * eval(Pk,x) * (x/.k+1.F_Real))
    by POLYNOM2:25
    .= Hund * (eval(Pf,x) * x/.k * (x/.k+1.F_Real)) by A3
    .= Hund * (x/.f * x/.k * (x/.k+1.F_Real)) by A5
    .= Hund * x /. f * x/.k * (x/.k+1.F_Real);
  end;
  reconsider U = (Hund *((Pu*'Pu*'Pu)*'(W*'W*'W)))+O
  as INT -valued Polynomial of N,F_Real;
A23: vars U c= VARs
  proof
    vars (Pu*'Pu) c= VARs & vars (W*'W) c= VARs by A21,A12,Th79;
    then vars (Pu*'Pu*'Pu) c= VARs & vars (W*'W*'W) c= VARs
    by A21,A12,Th79;
    then vars ((Pu*'Pu*'Pu)*'(W*'W*'W)) c= VARs by Th79;
    then vars (Hund *((Pu*'Pu*'Pu)*'(W*'W*'W))) c= VARs by Th80;
    hence thesis by A20,Th78;
  end;
A24:for x be Function of N,F_Real holds
    eval(U,x) = Hund * ((x /. u)|^3 ) * eval(W,x)|^3 + 1.F_Real
  proof
    let x be Function of N,F_Real;
A25: eval(Pu,x) = x /. u by A13;
A26: eval(Pu*'Pu*'Pu,x) = eval(Pu*'Pu,x) * eval(Pu,x) by POLYNOM2:25
    .= (x/.u) * (x/.u) * (x/.u) by A25,POLYNOM2:25
    .= (x/.u)|^(1+1) * (x/.u)|^1 by NEWTON:6
    .= (x/.u)|^(1+1+1) by NEWTON:6;
A27: eval(W*'W*'W,x) = eval(W*'W,x) * eval(W,x) by POLYNOM2:25
    .= eval(W,x) * eval(W,x) * eval(W,x) by POLYNOM2:25
    .= eval(W,x)|^(1+1) * eval(W,x)|^1 by NEWTON:6
    .= eval(W,x)|^(1+1+1) by NEWTON:6;
    thus eval(U,x)
    =eval(Hund *((Pu*'Pu*'Pu)*'(W*'W*'W)),x) + eval(O,x) by POLYNOM2:23
    .=eval(Hund *((Pu*'Pu*'Pu)*'(W*'W*'W)),x) + 1.F_Real by POLYNOM2:21
    .=Hund *eval((Pu*'Pu*'Pu)*'(W*'W*'W),x) + 1.F_Real by POLYNOM7:29
    .=Hund *(eval(Pu*'Pu*'Pu,x)*
    eval((W*'W*'W),x)) + 1.F_Real by POLYNOM2:25
    .=Hund * ((x /. u)|^3 ) * eval(W,x)|^3 + 1.F_Real by A26,A27;
  end;
  reconsider M = Hund *(Pm*'U*'W)+O as INT -valued Polynomial of N,F_Real;
A28: vars M c= VARs
  proof
    vars (Pm*'U) c= VARs by A23,A10,Th79;
    then vars (Pm*'U*'W) c= VARs by A21,Th79;
    then vars (Hund *(Pm*'U*'W)) c= VARs by Th80;
    hence thesis by Th78,A20;
  end;
A29:for x be Function of N,F_Real holds
  eval(M,x) = Hund * (x /. m) * eval(U,x) * eval(W,x) + 1.F_Real
  proof
    let x be Function of N,F_Real;
    thus eval(M,x) = eval(Hund *(Pm*'U*'W),x) + eval(O,x) by POLYNOM2:23
    .=eval(Hund *(Pm*'U*'W),x) + 1.F_Real by POLYNOM2:21
    .=Hund * eval(Pm*'U*'W,x) + 1.F_Real by POLYNOM7:29
    .=Hund * (eval(Pm*'U,x)*eval(W,x)) + 1.F_Real by POLYNOM2:25
    .=Hund * (eval(Pm,x)*eval(U,x)* eval(W,x))+ 1.F_Real by POLYNOM2:25
    .=Hund * ((x/.m) *eval(U,x)* eval(W,x))+ 1.F_Real by A11
    .=Hund * (x /. m) * eval(U,x) * eval(W,x) + 1.F_Real;
  end;
  reconsider S= (M-O)*'Ps+Pk+O as INT -valued Polynomial of N,F_Real;
A30: vars S c= VARs
  proof
    vars (M-O) c= VARs by Th81,A28,A20;
    then vars((M-O)*'Ps) c= VARs by A16,Th79;
    then vars((M-O)*'Ps+Pk) c= VARs by A2,Th78;
    hence thesis by A20,Th78;
  end;
A31:for x be Function of N,F_Real holds
      eval(S,x) = (eval(M,x) - 1.F_Real) * (x/.s) + (x/.k) + 1.F_Real
  proof
    let x be Function of N,F_Real;
    thus eval(S,x)
    = eval((M-O)*'Ps+Pk,x) + eval(O,x) by POLYNOM2:23
    .= eval((M-O)*'Ps+Pk,x) +1.F_Real by POLYNOM2:21
    .= eval((M-O)*'Ps,x)+eval(Pk,x) +1.F_Real by POLYNOM2:23
    .= eval((M-O)*'Ps,x)+(x/.k) +1.F_Real by A3
    .= (eval(M-O,x)*eval(Ps,x))+(x/.k) +1.F_Real by POLYNOM2:25
    .= ((eval(M,x) - eval(O,x))*eval(Ps,x))+(x/.k) +1.F_Real by POLYNOM2:24
    .= ((eval(M,x) - 1.F_Real)*eval(Ps,x))+(x/.k) +1.F_Real by POLYNOM2:21
    .=(eval(M,x) - 1.F_Real) * (x/.s) + (x/.k) + 1.F_Real by A17;
  end;
  reconsider T= (M*'U-O)*'Pt+W-Pk+O as INT -valued Polynomial of N,F_Real;
A32: vars T c= VARs
  proof
    vars (M*'U) c= VARs by A23,A28,Th79;
    then vars (M*'U-O) c= VARs by A20,Th81;
    then vars ((M*'U-O)*'Pt) c= VARs by A18,Th79;
    then vars ((M*'U-O)*'Pt+W) c= VARs by A21,Th78;
    then vars ((M*'U-O)*'Pt+W-Pk) c= VARs by Th81,A2;
    hence thesis by A20,Th78;
  end;
A33:for x be Function of N,F_Real holds
    eval(T,x) = (eval(M,x)*eval(U,x) - 1.F_Real)*(x/.t)+
    eval(W,x)-(x/.k)+1.F_Real
  proof
    let x be Function of N,F_Real;
    thus eval(T,x)
    = eval((M*'U-O)*'Pt+W-Pk,x) + eval(O,x) by POLYNOM2:23
    .=eval((M*'U-O)*'Pt+W-Pk,x) + 1.F_Real by POLYNOM2:21
    .=eval((M*'U-O)*'Pt+W,x)-eval(Pk,x) + 1.F_Real by POLYNOM2:24
    .=eval((M*'U-O)*'Pt+W,x)-(x/.k)+1.F_Real by A3
    .=eval((M*'U-O)*'Pt,x)+eval(W,x)-(x/.k)+1.F_Real by POLYNOM2:23
    .=(eval(M*'U-O,x)*eval(Pt,x))+eval(W,x)-(x/.k)+1.F_Real by POLYNOM2:25
    .=(eval(M*'U-O,x)*(x/.t))+eval(W,x)-(x/.k)+1.F_Real by A19
    .=((eval(M*'U,x)-eval(O,x))* (x/.t))+eval(W,x)-(x/.k)+1.F_Real
    by POLYNOM2:24
    .=((eval(M*'U,x)-1.F_Real)* (x/.t))+eval(W,x)-(x/.k)+1.F_Real
    by POLYNOM2:21
    .=((eval(M,x)*eval(U,x)-1.F_Real)* (x/.t))+eval(W,x)-(x/.k)+1.F_Real
    by POLYNOM2:25;
  end;
  reconsider Two=2 as integer Element of F_Real by XREAL_0:def 1;
  reconsider Q= Two*(M*'W)-(W*'W)-O as INT -valued Polynomial of N,F_Real;
A34: vars Q c= VARs
  proof
    vars (M*'W) c= VARs by A28,A21,Th79;
    then vars (Two*(M*'W)) c= VARs & vars (W*'W) c= VARs by A21,Th79,Th80;
    then vars (Two*(M*'W)-(W*'W)) c= VARs by Th81;
    hence thesis by A20,Th81;
  end;
A35:for x be Function of N,F_Real holds
  eval(Q,x) = Two*eval(M,x)*eval(W,x) - eval(W,x)^2 - 1.F_Real
  proof
    let x be Function of N,F_Real;
    thus eval(Q,x) = eval(Two*(M*'W)-(W*'W),x) - eval(O,x) by POLYNOM2:24
    .= eval(Two*(M*'W)-(W*'W),x) - 1.F_Real by POLYNOM2:21
    .= eval(Two*(M*'W),x)-eval(W*'W,x) - 1.F_Real by POLYNOM2:24
    .= Two*eval(M*'W,x)-eval(W*'W,x) - 1.F_Real by POLYNOM7:29
    .= Two*eval(M*'W,x)-eval(W,x)*eval(W,x) - 1.F_Real by POLYNOM2:25
    .= Two*(eval(M,x)*eval(W,x))-eval(W,x)*eval(W,x) - 1.F_Real
    by POLYNOM2:25
    .=Two*eval(M,x)*eval(W,x) - eval(W,x)^2 - 1.F_Real by SQUARE_1:def 1;
  end;
  reconsider L= (Pk+O)*'Q as INT -valued Polynomial of N,F_Real;
A36: vars L c= VARs
  proof
    vars (Pk+O) c= VARs by A2,A20,Th78;
    hence thesis by A34,Th79;
  end;
A37:for x be Function of N,F_Real holds
      eval(L,x) = (x/.k + 1.F_Real)*eval(Q,x)
  proof
    let x be Function of N,F_Real;
    thus eval(L,x) = eval(Pk+O,x) * eval(Q,x) by POLYNOM2:25
    .= (eval(Pk,x)+eval(O,x)) * eval(Q,x) by POLYNOM2:23
    .= (eval(Pk,x)+1.F_Real) * eval(Q,x) by POLYNOM2:21
    .= (x/.k + 1.F_Real)*eval(Q,x) by A3;
  end;
  reconsider A= M*'(U+O) as INT -valued Polynomial of N,F_Real;
A38: vars A c= VARs
  proof
    vars (U+O) c= VARs by A20,A23,Th78;
    hence thesis by A28,Th79;
  end;
A39:for x be Function of N,F_Real holds
  eval(A,x) = eval(M,x)*(eval(U,x) + 1.F_Real)
  proof
    let x be Function of N,F_Real;
    thus eval(A,x) = eval(M,x)*eval(U+O,x) by POLYNOM2:25
    .= eval(M,x)*(eval(U,x)+eval(O,x)) by POLYNOM2:23
    .= eval(M,x)*(eval(U,x) + 1.F_Real) by POLYNOM2:21;
  end;
  reconsider B= W+O as INT -valued Polynomial of N,F_Real;
A40: vars B c= VARs by A20,A21,Th78;
A41:for x be Function of N,F_Real holds eval(B,x) = eval(W,x) + 1.F_Real
  proof
    let x be Function of N,F_Real;
    thus eval(B,x) = eval(W,x)+eval(O,x) by POLYNOM2:23
    .= eval(W,x) + 1.F_Real by POLYNOM2:21;
  end;
  reconsider C= Pr+W+O as INT -valued Polynomial of N,F_Real;
A42: vars C c= VARs
  proof
    vars (Pr+W) c= VARs by A14,A21,Th78;
    hence thesis by A20,Th78;
  end;
A43:for x be Function of N,F_Real holds
    eval(C,x) = (x/.r) + eval(W,x) + 1.F_Real
  proof
    let x be Function of N,F_Real;
    thus eval(C,x) = eval(Pr+W,x)+eval(O,x) by POLYNOM2:23
    .= eval(Pr+W,x)+1.F_Real by POLYNOM2:21
    .= eval(Pr,x) + eval(W,x) + 1.F_Real by POLYNOM2:23
    .= (x/.r) + eval(W,x) + 1.F_Real by A15;
  end;
  reconsider D= (A*'A-O)*'(C*'C)+O as INT -valued Polynomial of N,F_Real;
A44: vars D c= VARs
  proof
    vars (A*'A) c= VARs by A38,Th79;
    then vars (A*'A-O) c= VARs & vars (C*'C) c= VARs by A42,A20,Th81,Th79;
    then vars ((A*'A-O)*'(C*'C)) c= VARs by Th79;
    hence thesis by A20,Th78;
  end;
A45:for x be Function of N,F_Real holds
  eval(D,x) = (eval(A,x)^2 - 1.F_Real)* eval(C,x)^2+ 1.F_Real
  proof
    let x be Function of N,F_Real;
    thus eval(D,x) = eval((A*'A-O)*'(C*'C),x)+eval(O,x) by POLYNOM2:23
    .= eval((A*'A-O)*'(C*'C),x)+1.F_Real by POLYNOM2:21
    .= (eval(A*'A-O,x)*eval(C*'C,x))+1.F_Real by POLYNOM2:25
    .= (eval(A*'A-O,x)*(eval(C,x)*eval(C,x)))+1.F_Real by POLYNOM2:25
    .= ((eval(A*'A,x)-eval(O,x))*(eval(C,x)*eval(C,x)))+1.F_Real
    by POLYNOM2:24
    .= ((eval(A*'A,x)-eval(O,x))*eval(C,x)^2)+1.F_Real by SQUARE_1:def 1
    .= ((eval(A*'A,x)-1.F_Real)*eval(C,x)^2)+1.F_Real by POLYNOM2:21
    .= ((eval(A,x)*eval(A,x)-1.F_Real)*eval(C,x)^2)+1.F_Real
    by POLYNOM2:25
    .=(eval(A,x)^2 - 1.F_Real)* eval(C,x)^2+ 1.F_Real by SQUARE_1:def 1;
  end;
  reconsider E= Two*(Pi*'C*'C*'L*'D) as INT -valued Polynomial of N,F_Real;
A46: vars E c= VARs
  proof
    vars (Pi*'C) c= VARs by A42,A6,Th79;
    then vars (Pi*'C*'C) c= VARs by A42,Th79;
    then vars (Pi*'C*'C*'L) c= VARs by A36,Th79;
    then vars (Pi*'C*'C*'L*'D) c= VARs by A44,Th79;
    hence thesis by Th80;
  end;
A47:for x be Function of N,F_Real holds
  eval(E,x) = Two *(x/.i)*(eval(C,x)^2)* eval(L,x)*eval(D,x)
  proof
    let x be Function of N,F_Real;
A48:eval(C,x)*eval(C,x) = eval(C,x)^2 by SQUARE_1:def 1;
    thus eval(E,x) = Two* eval(Pi*'C*'C*'L*'D,x)
    by POLYNOM7:29
    .= Two* (eval(Pi*'C*'C*'L,x)*eval(D,x)) by POLYNOM2:25
    .= Two* (eval(Pi*'C*'C,x)*eval(L,x)*eval(D,x)) by POLYNOM2:25
    .= Two* (eval(Pi*'C,x)*eval(C,x)*eval(L,x)*eval(D,x))
    by POLYNOM2:25
    .= Two* (eval(Pi,x)*eval(C,x)*eval(C,x)*eval(L,x)*eval(D,x))
    by POLYNOM2:25
    .= Two* (eval(Pi,x)*(eval(C,x)*eval(C,x))*eval(L,x)*eval(D,x))
    .= Two* ((x/.i)*(eval(C,x)*eval(C,x))*eval(L,x)*eval(D,x)) by A7
    .=Two *(x/.i)*(eval(C,x)^2)* eval(L,x)*eval(D,x) by A48;
  end;
  reconsider F= (A*'A-O)*'(E*'E)+O as INT -valued Polynomial of N,F_Real;
A49: vars F c= VARs
  proof
    vars (A*'A) c= VARs by A38,Th79;
    then vars (A*'A-O) c= VARs & vars (E*'E) c= VARs by A46,A20,Th81,Th79;
    then vars ((A*'A-O)*'(E*'E)) c= VARs by Th79;
    hence thesis by A20,Th78;
  end;
A50:for x be Function of N,F_Real holds
  eval(F,x) = (eval(A,x)^2 - 1.F_Real)* eval(E,x)^2+ 1.F_Real
  proof
    let x be Function of N,F_Real;
    thus eval(F,x) = eval((A*'A-O)*'(E*'E),x)+eval(O,x) by POLYNOM2:23
    .= eval((A*'A-O)*'(E*'E),x)+1.F_Real by POLYNOM2:21
    .= (eval(A*'A-O,x)*eval(E*'E,x))+1.F_Real by POLYNOM2:25
    .= (eval(A*'A-O,x)*(eval(E,x)*eval(E,x)))+1.F_Real by POLYNOM2:25
    .= (eval(A*'A-O,x)*eval(E,x)^2)+1.F_Real by SQUARE_1:def 1
    .= ((eval(A*'A,x)-eval(O,x))*eval(E,x)^2)+1.F_Real by POLYNOM2:24
    .= ((eval(A*'A,x)-1.F_Real)*eval(E,x)^2)+1.F_Real by POLYNOM2:21
    .= ((eval(A,x)*eval(A,x)-1.F_Real)*eval(E,x)^2)+1.F_Real by POLYNOM2:25
    .= (eval(A,x)^2 - 1.F_Real)* eval(E,x)^2+ 1.F_Real by SQUARE_1:def 1;
  end;
  reconsider G= A+F*'(F-A) as INT -valued Polynomial of N,F_Real;
A51: vars G c= VARs
  proof
    vars (F-A) c= VARs by A38,A49,Th81;
    then vars (F*'(F-A)) c= VARs by A49,Th79;
    hence thesis by A38,Th78;
  end;
A52:for x be Function of N,F_Real holds
  eval(G,x) = eval(A,x)+eval(F,x)*(eval(F,x) - eval(A,x))
  proof
    let x be Function of N,F_Real;
    thus eval(G,x) = eval(A,x)+eval(F*'(F-A),x) by POLYNOM2:23
    .=eval(A,x)+eval(F,x) *eval(F-A,x) by POLYNOM2:25
    .= eval(A,x)+eval(F,x)*(eval(F,x) - eval(A,x)) by POLYNOM2:24;
  end;
  reconsider H= B+Two*((Pj-O)*'C) as INT -valued Polynomial of N,F_Real;
A53: vars H c= VARs
  proof
    vars (Pj-O) c= VARs by A8,A20,Th81;
    then vars ((Pj-O)*'C) c= VARs by A42,Th79;
    then vars (Two*((Pj-O)*'C)) c= VARs by Th80;
    hence thesis by A40,Th78;
  end;
A54:for x be Function of N,F_Real holds
  eval(H,x) = eval(B,x)+Two*(x/.j - 1.F_Real)*eval(C,x)
  proof
    let x be Function of N,F_Real;
    thus eval(H,x) = eval(B,x)+eval(Two*((Pj-O)*'C),x) by POLYNOM2:23
    .=eval(B,x)+Two*eval((Pj-O)*'C,x) by POLYNOM7:29
    .=eval(B,x)+Two*(eval(Pj-O,x)*eval(C,x)) by POLYNOM2:25
    .=eval(B,x)+Two*((eval(Pj,x)-eval(O,x))*eval(C,x)) by POLYNOM2:24
    .=eval(B,x)+Two*((eval(Pj,x)-1.F_Real)*eval(C,x)) by POLYNOM2:21
    .=eval(B,x)+Two*((x/.j-1.F_Real)*eval(C,x)) by A9
    .=eval(B,x)+Two*(x/.j - 1.F_Real)*eval(C,x);
  end;
  reconsider I= (G*'G-O)*'(H*'H)+O as INT -valued Polynomial of N,F_Real;
A55: vars I c= VARs
  proof
    vars (G*'G) c= VARs by A51,Th79;
    then vars (G*'G-O) c= VARs & vars (H*'H) c= VARs by A53,A20,Th81,Th79;
    then vars ((G*'G-O)*'(H*'H)) c= VARs by Th79;
    hence thesis by A20,Th78;
  end;
A56:for x be Function of N,F_Real holds
      eval(I,x) = (eval(G,x)^2 - 1.F_Real)* eval(H,x)^2+ 1.F_Real
  proof
    let x be Function of N,F_Real;
    thus eval(I,x) = eval((G*'G-O)*'(H*'H),x)+eval(O,x)
    by POLYNOM2:23
    .= eval((G*'G-O)*'(H*'H),x)+1.F_Real by POLYNOM2:21
    .= (eval(G*'G-O,x)*eval(H*'H,x))+1.F_Real by POLYNOM2:25
    .= (eval(G*'G-O,x)*(eval(H,x)*eval(H,x)))+1.F_Real by POLYNOM2:25
    .= (eval(G*'G-O,x)*eval(H,x)^2)+1.F_Real by SQUARE_1:def 1
    .= ((eval(G*'G,x)-eval(O,x))*eval(H,x)^2)+1.F_Real by POLYNOM2:24
    .= ((eval(G*'G,x)-1.F_Real)*eval(H,x)^2)+1.F_Real by POLYNOM2:21
    .= ((eval(G,x)*eval(G,x)-1.F_Real)*eval(H,x)^2)+1.F_Real
    by POLYNOM2:25
    .= (eval(G,x)^2 - 1.F_Real)* eval(H,x)^2+ 1.F_Real by SQUARE_1:def 1;
  end;
  reconsider X1= (M*'M-O)*'(S*'S)+O as INT -valued Polynomial of N,F_Real;
A57: vars X1 c= VARs
  proof
    vars (M*'M) c= VARs by A28,Th79;
    then vars (M*'M-O) c= VARs & vars (S*'S) c= VARs by A20,Th81,A30,Th79;
    then vars ((M*'M-O)*'(S*'S)) c= VARs by Th79;
    hence thesis by A20,Th78;
  end;
A58:for x be Function of N,F_Real holds
      eval(X1,x) = (eval(M,x)^2 - 1.F_Real)* eval(S,x)^2+ 1.F_Real
  proof
    let x be Function of N,F_Real;
    thus eval(X1,x) = eval((M*'M-O)*'(S*'S),x)+eval(O,x) by POLYNOM2:23
    .= eval((M*'M-O)*'(S*'S),x)+1.F_Real by POLYNOM2:21
    .= (eval(M*'M-O,x)*eval(S*'S,x))+1.F_Real by POLYNOM2:25
    .= (eval(M*'M-O,x)*(eval(S,x)*eval(S,x)))+1.F_Real by POLYNOM2:25
    .= (eval(M*'M-O,x)*(eval(S,x)^2))+1.F_Real by SQUARE_1:def 1
    .= ((eval(M*'M,x)-eval(O,x))*eval(S,x)^2)+1.F_Real by POLYNOM2:24
    .= ((eval(M*'M,x)-1.F_Real)*eval(S,x)^2)+1.F_Real by POLYNOM2:21
    .= ((eval(M,x)*eval(M,x)-1.F_Real)*eval(S,x)^2)+1.F_Real by POLYNOM2:25
    .= (eval(M,x)^2 - 1.F_Real)* eval(S,x)^2+ 1.F_Real by SQUARE_1:def 1;
  end;
  reconsider X2= (M*'U*'(M*'U)-O)*'(T*'T)+O as
   INT -valued Polynomial of N,F_Real;
A59: vars X2 c= VARs
  proof
    vars (M*'U) c= VARs by A23,A28,Th79;
    then vars ((M*'U)*'(M*'U)) c= VARs by Th79;
    then vars ((M*'U)*'(M*'U)-O) c= VARs & vars (T*'T) c= VARs
    by A20,Th81,A32,Th79;
    then vars ((M*'U*'(M*'U)-O)*'(T*'T)) c= VARs by Th79;
    hence thesis by A20,Th78;
  end;
A60:for x be Function of N,F_Real holds
      eval(X2,x) = ((eval(M,x)*eval(U,x))^2 - 1.F_Real)* eval(T,x)^2+ 1.F_Real
  proof
    let x be Function of N,F_Real;
    eval(M*'U,x) = eval(M,x) * eval(U,x) by POLYNOM2:25;
    then
A61: eval(M*'U*'(M*'U),x) =
    (eval(M,x) * eval(U,x))*(eval(M,x) * eval(U,x)) & eval(O,x) = 1.F_Real &
    eval(T*'T,x) = eval(T,x) * eval(T,x) by POLYNOM2:21,25;
    thus eval(X2,x) = eval((M*'U*'(M*'U)-O)*'(T*'T),x)+1.F_Real
    by POLYNOM2:23,A61
    .= eval(M*'U*'(M*'U)-O,x)*eval(T*'T,x)+1.F_Real by POLYNOM2:25
    .= (eval(M*'U*'(M*'U),x) - 1.F_Real)*eval(T*'T,x)+1.F_Real
    by A61,POLYNOM2:24
    .= ( (eval(M,x) * eval(U,x))*(eval(M,x) * eval(U,x)) - 1.F_Real) *
       eval(T,x)^2 +1.F_Real by A61,SQUARE_1:def 1
    .= ( (eval(M,x) * eval(U,x))^2 - 1.F_Real) * eval(T,x)^2 +1.F_Real
    by SQUARE_1:def 1;
  end;
  reconsider X3= D*'F*'I as INT -valued Polynomial of N,F_Real;
A62: vars X3 c= VARs
  proof
    vars (D*'F) c= VARs by A44,A49,Th79;
    hence thesis by A55,Th79;
  end;
A63:for x be Function of N,F_Real holds
  eval(X3,x) = eval(D,x) *eval(F,x) * eval(I,x)
  proof
    let x be Function of N,F_Real;
    eval(D*'F,x) = eval(D,x) * eval(F,x) by POLYNOM2:25;
    hence thesis by POLYNOM2:25;
  end;
  reconsider P= F*'L as INT -valued Polynomial of N,F_Real;
A64: vars P c= VARs by A49,A36,Th79;
A65: for x be Function of N,F_Real holds eval(P,x) = eval(F,x) * eval(L,x)
     by POLYNOM2:25;
  reconsider R= (H-C)*'L + F*'(Pf+O)*'Q +
    F*'(Pk+O) *'((W*'W-O)*'S*'Pu-W*'W*'(Pu*'Pu) +O)
    as INT -valued Polynomial of N,F_Real;
A66: vars R c= VARs
  proof
    vars(H-C) c= VARs by A53,A42,Th81;
    then
A67: vars((H-C)*'L) c= VARs by A36,Th79;
    vars(Pf+O) c= VARs by A4,A20,Th78;
    then vars (F*'(Pf+O)) c= VARs by A49,Th79;
    then vars (F*'(Pf+O)*'Q) c= VARs by A34,Th79;
    then
A68:vars ((H-C)*'L + F*'(Pf+O)*'Q) c= VARs by A67,Th78;
    vars(Pk+O) c= VARs by A20,A2,Th78;
    then
A69:vars (F*'(Pk+O)) c= VARs by A49,Th79;
A70: vars (W*'W) c= VARs by A21,Th79;
    then vars (W*'W-O) c= VARs by A20,Th81;
    then vars ((W*'W-O)*'S) c= VARs by A30,Th79;
    then
A71: vars ((W*'W-O)*'S*'Pu) c= VARs by A12,Th79;
    vars (Pu*'Pu) c= VARs by A12,Th79;
    then vars (W*'W*'(Pu*'Pu)) c= VARs by A70,Th79;
    then vars ((W*'W-O)*'S*'Pu-W*'W*'(Pu*'Pu)) c= VARs by A71,Th81;
    then vars ((W*'W-O)*'S*'Pu-W*'W*'(Pu*'Pu)+O) c= VARs by A20,Th78;
    then vars (F*'(Pk+O) *'((W*'W-O)*'S*'Pu-W*'W*'(Pu*'Pu) +O)) c= VARs
    by A69,Th79;
    hence thesis by A68,Th78;
  end;
A72:for x be Function of N,F_Real holds eval(R,x) =
  (eval(H,x)-eval(C,x))*eval(L,x) + eval(F,x)*(x/.f+1.F_Real)*eval(Q,x) +
  eval(F,x)*(x/.k+1.F_Real) *
  ((eval(W,x)^2-1.F_Real)*eval(S,x)*x/.u-eval(W,x)^2*(x/.u)^2 +1.F_Real)
  proof
    let x be Function of N,F_Real;
A73: eval((H-C)*'L,x) = eval(H-C,x) *eval(L,x) by POLYNOM2:25
    .= (eval(H,x)-eval(C,x))*eval(L,x) by POLYNOM2:24;
A74:eval(F*'(Pf+O)*'Q,x) = eval(F*'(Pf+O),x)*eval(Q,x) by POLYNOM2:25
    .=eval(F,x)*eval(Pf+O,x)*eval(Q,x) by POLYNOM2:25
    .=eval(F,x)*(eval(Pf,x)+eval(O,x))*eval(Q,x) by POLYNOM2:23
    .=eval(F,x)*(eval(Pf,x)+1.F_Real)*eval(Q,x) by POLYNOM2:21
    .=eval(F,x)*(x/.f+1.F_Real)*eval(Q,x) by A5;
A75:eval (F*'(Pk+O),x) = eval (F,x)*eval(Pk+O,x) by POLYNOM2:25
    .=eval (F,x)*(eval(Pk,x)+eval(O,x)) by POLYNOM2:23
    .=eval (F,x)*(eval(Pk,x)+1.F_Real) by POLYNOM2:21
    .=eval (F,x)*(x/.k+1.F_Real) by A3;
A76: eval(W*'W,x) = eval(W,x)*eval(W,x) = eval(W,x)^2
    by POLYNOM2:25,SQUARE_1:def 1;
    then eval(W*'W-O,x) = eval(W,x)*eval(W,x)-eval(O,x) by POLYNOM2:24;
    then eval((W*'W-O)*'S,x) = (eval(W,x)*eval(W,x)-eval(O,x)) *eval(S,x)
    by POLYNOM2:25;
    then
A77: eval((W*'W-O)*'S*'Pu,x) =
    (eval(W,x)*eval(W,x)-eval(O,x)) *eval(S,x)*eval(Pu,x) &
    eval(O,x)=1.F_Real & eval(Pu,x) = x/.u by A13,POLYNOM2:21,25;
A78:eval(Pu,x) = x/.u by A13;
A79: eval(W*'W*'(Pu*'Pu),x) = eval(W*'W,x)*eval(Pu*'Pu,x) by POLYNOM2:25
    .=eval(W*'W,x)*(x/.u * x/.u) by A78,POLYNOM2:25
    .=(eval(W,x)*eval(W,x))*(x/.u * x/.u) by POLYNOM2:25;
    A80:eval((W*'W-O)*'S*'Pu-W*'W*'(Pu*'Pu) +O,x) =
    eval((W*'W-O)*'S*'Pu-W*'W*'(Pu*'Pu),x) +eval(O,x)
    by POLYNOM2:23
    .=eval((W*'W-O)*'S*'Pu-W*'W*'(Pu*'Pu),x) +1.F_Real by POLYNOM2:21
    .=(eval((W*'W-O)*'S*'Pu,x)-eval(W*'W*'(Pu*'Pu),x))+1.F_Real by POLYNOM2:24
    .=(eval(W,x)^2-1.F_Real) *eval(S,x)*(x/.u)
    - (eval(W,x)*eval(W,x)*(x/.u * x/.u )) +1.F_Real by A77,A79,SQUARE_1:def 1;
    A81: eval (F*'(Pk+O) *'((W*'W-O)*'S*'Pu-W*'W*'(Pu*'Pu) +O),x)=
    eval (F*'(Pk+O),x)*eval((W*'W-O)*'S*'Pu-W*'W*'(Pu*'Pu)+O,x) by POLYNOM2:25
    .= eval (F,x)*(x/.k+1.F_Real)*
    ((eval(W,x)^2-1.F_Real) *eval(S,x)*(x/.u)
    - eval(W,x)^2*(x/.u)^2 +1.F_Real) by A76,A80,A75,SQUARE_1:def 1;
    eval(R,x) = eval((H-C)*'L + F*'(Pf+O)*'Q,x)+
    eval (F*'(Pk+O) *'((W*'W-O)*'S*'Pu-W*'W*'(Pu*'Pu) +O),x)
    by POLYNOM2:23;
    hence thesis by A81,A73,A74,POLYNOM2:23;
  end;
  reconsider Eight = 8 as integer Element of F_Real by XREAL_0:def 1;
  reconsider V1= Eight*(Pf*'Pu*'S*'T*'(Pr-Pm*'S*'T*'U))
               as INT -valued Polynomial of N,F_Real;
A82: vars V1 c= VARs
  proof
    vars(Pf*'Pu) c= VARs by A4,A12,Th79;
    then vars(Pf*'Pu*'S) c= VARs by A30,Th79;
    then
A83:vars(Pf*'Pu*'S*'T) c= VARs by A32,Th79;
    vars(Pm*'S) c= VARs by A10,A30,Th79;
    then vars(Pm*'S*'T) c= VARs by A32,Th79;
    then vars(Pm*'S*'T*'U) c= VARs by A23,Th79;
    then vars(Pr-Pm*'S*'T*'U) c= VARs by A14,Th81;
    then vars(Pf*'Pu*'S*'T*'(Pr-Pm*'S*'T*'U)) c= VARs by A83,Th79;
    hence thesis by Th80;
  end;
A84:for x be Function of N,F_Real holds
  eval(V1,x) = Eight*((x/.f)*(x/.u)*eval(S,x)*eval(T,x)*
  ((x/.r)-(x/.m)*eval(S,x)*eval(T,x)*eval(U,x)))
  proof
    let x be Function of N,F_Real;
    eval(Pm*'S*'T*'U,x) = eval(Pm*'S*'T,x)*eval(U,x) by POLYNOM2:25
    .= eval(Pm*'S,x)*eval(T,x)*eval(U,x) by POLYNOM2:25
    .= eval(Pm,x)*eval(S,x)*eval(T,x)*eval(U,x) by POLYNOM2:25
    .= (x/.m)*eval(S,x)*eval(T,x)*eval(U,x) by A11;
    then
A85:eval(Pr-Pm*'S*'T*'U,x) =
    eval(Pr,x) - (x/.m)*eval(S,x)*eval(T,x)*eval(U,x) by POLYNOM2:24
    .= x/.r - (x/.m)*eval(S,x)*eval(T,x)*eval(U,x) by A15;
    eval(Pf*'Pu,x) = eval(Pf,x)* eval(Pu,x) by POLYNOM2:25
    .= (x/.f)* eval(Pu,x) by A5
    .= (x/.f)* (x/.u) by A13;
    then eval(Pf*'Pu*'S,x) =
    (x/.f)* (x/.u) * eval(S,x) by POLYNOM2:25;
    then eval(Pf*'Pu*'S*'T,x) =
    (x/.f)* (x/.u) * eval(S,x) * eval(T,x) by POLYNOM2:25;
    then eval(Pf*'Pu*'S*'T*'(Pr-Pm*'S*'T*'U),x) =
    (x/.f)* (x/.u) * eval(S,x) * eval(T,x) *
    (x/.r - (x/.m)*eval(S,x)*eval(T,x)*eval(U,x)) by A85,POLYNOM2:25;
    hence thesis by POLYNOM7:29;
  end;
  reconsider Four = 4 as integer Element of F_Real by XREAL_0:def 1;
  reconsider V2= Four*((Pu*'Pu)*'(S*'S)*'(T*'T))
               as INT -valued Polynomial of N,F_Real;
A86: vars V2 c= VARs
  proof
    vars(Pu*'Pu) c= VARs & vars(S*'S) c= VARs by A30,A12,Th79;
    then vars((Pu*'Pu)*'(S*'S)) c= VARs & vars(T*'T) c= VARs by A32,Th79;
    then vars((Pu*'Pu)*'(S*'S)*'(T*'T)) c= VARs by Th79;
    hence thesis by Th80;
  end;
A87: for x be Function of N,F_Real holds
    eval(V2,x) = Four*(x/.u)^2*(eval(S,x)^2)*(eval(T,x)^2)
  proof
    let x be Function of N,F_Real;
A88: eval(Pu*'Pu,x) = eval(Pu,x) * eval(Pu,x) & eval(Pu,x) = x/.u
    by POLYNOM2:25,A13;
A89: eval(S*'S,x) = eval(S,x) * eval(S,x) &
    eval(T*'T,x) = eval(T,x) * eval(T,x) by POLYNOM2:25;
    then eval((Pu*'Pu)*'(S*'S),x) = (x/.u) * (x/.u) * (eval(S,x) * eval(S,x))
    by A88,POLYNOM2:25;
    then
A90:eval((Pu*'Pu)*'(S*'S)*'(T*'T),x) =
    (x/.u) * (x/.u) * (eval(S,x) * eval(S,x)) * (eval(T,x) * eval(T,x))
    by A89,POLYNOM2:25;
    thus eval(V2,x) = Four*eval((Pu*'Pu)*'(S*'S)*'(T*'T),x) by POLYNOM7:29
    .= Four* ((x/.u)*(x/.u))*(eval(S,x) * eval(S,x))*(eval(T,x)*eval(T,x))
    by A90
    .= Four* (x/.u)^2 * (eval(S,x) * eval(S,x)) * (eval(T,x) * eval(T,x))
    by SQUARE_1:def 1
    .= Four* (x/.u)^2 * (eval(S,x)^2) * (eval(T,x) * eval(T,x))
    by SQUARE_1:def 1
    .= Four*(x/.u)^2 * (eval(S,x)^2) * (eval(T,x)^2) by SQUARE_1:def 1;
  end;
  reconsider V3=(Four*Pf*'Pf-O)*'((Pr-Pm*'S*'T*'U)*'(Pr-Pm*'S*'T*'U))
       as INT -valued Polynomial of N,F_Real;
A91: vars V3 c= VARs
  proof
    vars(Pm*'S) c= VARs by A10,A30,Th79;
    then vars(Pm*'S*'T) c= VARs by A32,Th79;
    then vars(Pm*'S*'T*'U) c= VARs by A23,Th79;
    then vars(Pr-Pm*'S*'T*'U) c= VARs by A14,Th81;
    then
A92: vars((Pr-Pm*'S*'T*'U)*'(Pr-Pm*'S*'T*'U)) c= VARs by Th79;
    vars(Pf*'Pf) c= VARs by A4,Th79;
    then vars(Four*Pf*'Pf) c= VARs by Th80;
    then vars(Four*Pf*'Pf-O) c= VARs by A20,Th81;
    hence thesis by A92,Th79;
  end;
A93: for x be Function of N,F_Real holds
    eval(V3,x) = (Four*(x/.f)^2-1.F_Real)*
    ((x/.r)-(x/.m)*eval(S,x)*eval(T,x)*eval(U,x))^2
  proof
    let x be Function of N,F_Real;
    eval(Pm*'S*'T*'U,x) = eval(Pm*'S*'T,x)*eval(U,x) by POLYNOM2:25
    .= eval(Pm*'S,x)*eval(T,x)*eval(U,x) by POLYNOM2:25
    .= eval(Pm,x)*eval(S,x)*eval(T,x)*eval(U,x) by POLYNOM2:25
    .= (x/.m)*eval(S,x)*eval(T,x)*eval(U,x) by A11;
    then
A94:eval(Pr-Pm*'S*'T*'U,x) =
    eval(Pr,x) - (x/.m)*eval(S,x)*eval(T,x)*eval(U,x) by POLYNOM2:24
    .= x/.r - (x/.m)*eval(S,x)*eval(T,x)*eval(U,x) by A15;
    eval(Pf,x) = x/.f by A5;
    then eval(Pf*'Pf,x) = (x/.f)*(x/.f) by POLYNOM2:25;
    then eval(Four*Pf*'Pf,x) = Four*((x/.f)*(x/.f)) by POLYNOM7:29;
    then
A95: eval(Four*Pf*'Pf-O,x) = Four*((x/.f)*(x/.f))-eval(O,x)
    by POLYNOM2:24
    .= Four*((x/.f)*(x/.f))-1.F_Real by POLYNOM2:21
    .= Four*((x/.f)^2)-1.F_Real by SQUARE_1:def 1;
    eval((Pr-Pm*'S*'T*'U)*'(Pr-Pm*'S*'T*'U),x)
    = eval(Pr-Pm*'S*'T*'U,x) * eval(Pr-Pm*'S*'T*'U,x) by POLYNOM2:25;
    then eval(V3,x) = eval(Four*Pf*'Pf-O,x)* (eval(Pr-Pm*'S*'T*'U,x) *
    eval(Pr-Pm*'S*'T*'U,x)) by POLYNOM2:25
    .=(Four*((x/.f)^2)-1.F_Real) *
    ((x/.r - (x/.m)*eval(S,x)*eval(T,x)*eval(U,x)) *
    (x/.r - (x/.m)*eval(S,x)*eval(T,x)*eval(U,x))) by A95,A94;
    hence thesis by SQUARE_1:def 1;
  end;
  reconsider N1=(M*'S)+(Two*(M*'U*'T))
       as INT -valued Polynomial of N,F_Real;
A96: vars N1 c= VARs
  proof
A97:vars(M*'S) c= VARs by A28,A30,Th79;
    vars(M*'U) c= VARs by A28,A23,Th79;
    then vars(M*'U*'T) c= VARs by A32,Th79;
    then vars(Two*(M*'U*'T)) c= VARs by Th80;
    hence thesis by A97,Th78;
  end;
A98: for x be Function of N,F_Real holds
    eval(N1,x) = (eval(M,x)*eval(S,x))+(Two*eval(M,x)*eval(U,x)*eval(T,x))
  proof
    let x be Function of N,F_Real;
A99: eval(M*'S,x) = eval(M,x) * eval(S,x) by POLYNOM2:25;
    eval(M*'U,x) = eval(M,x) * eval(U,x) by POLYNOM2:25;
    then eval(M*'U*'T,x) = eval(M,x) * eval(U,x) * eval(T,x) by POLYNOM2:25;
    then eval(Two*(M*'U*'T),x) = Two*(eval(M,x) * eval(U,x) * eval(T,x))
      by POLYNOM7:29;
    hence thesis by A99,POLYNOM2:23;
  end;
  reconsider N2=Four*(A*'A*'C*'E*'G*'H)
       as INT -valued Polynomial of N,F_Real;
A100: vars N2 c= VARs
  proof
    vars(A*'A) c= VARs by A38,Th79;
    then vars(A*'A*'C) c= VARs by A42,Th79;
    then vars(A*'A*'C*'E) c= VARs by A46,Th79;
    then vars(A*'A*'C*'E*'G) c= VARs by A51,Th79;
    then vars(A*'A*'C*'E*'G*'H) c= VARs by A53,Th79;
    hence thesis by Th80;
  end;
A101: for x be Function of N,F_Real holds eval(N2,x) =
    Four*(eval(A,x)*eval(A,x)*eval(C,x)*eval(E,x)*eval(G,x)*eval(H,x))
  proof
    let x be Function of N,F_Real;
    eval(A*'A*'C*'E*'G*'H,x) = eval(A*'A*'C*'E*'G,x)*eval(H,x)
    by POLYNOM2:25
    .= eval(A*'A*'C*'E,x)*eval(G,x)*eval(H,x) by POLYNOM2:25
    .= eval(A*'A*'C,x)*eval(E,x)*eval(G,x)*eval(H,x) by POLYNOM2:25
    .= eval(A*'A,x)*eval(C,x)*eval(E,x)*eval(G,x)*eval(H,x) by POLYNOM2:25
    .= eval(A,x)*eval(A,x)*eval(C,x)*eval(E,x)*eval(G,x)*eval(H,x)
    by POLYNOM2:25;
    hence thesis by POLYNOM7:29;
  end;
  reconsider V = V1-V2-V3-O as INT -valued Polynomial of N,F_Real;
  reconsider NN=N1+N2+R+O as INT -valued Polynomial of N,F_Real;
A102: vars V c= VARs
  proof
    vars(V1-V2) c= VARs by A82,A86,Th81;
    then vars(V1-V2-V3) c= VARs by A91,Th81;
    hence thesis by A20,Th81;
  end;
A103: vars NN c= VARs
  proof
    vars(N1+N2) c= VARs by A96,A100,Th78;
    then vars(N1+N2+R) c= VARs by A66,Th78;
    hence thesis by A20,Th78;
  end;
A104: for x be Function of N,F_Real st
     x/.k is positive Nat & x/.f is positive Nat & x/.i is positive Nat &
     x/.j is positive Nat & x/.m is positive Nat & x/.u is positive Nat &
     x/.r is Nat & x/.s is Nat & x/.t is Nat
  holds
   eval(X1,x) is odd Nat & eval(X2,x) is odd Nat & eval(X3,x) is Nat &
   eval(P,x) is positive Nat & eval(R,x) is Nat &
     eval(NN,x) is Nat &
     eval(NN,x)>sqrt eval(X1,x)+2*sqrt eval(X2,x)+4*sqrt eval(X3,x)+eval(R,x)
  proof
    let x be Function of N,F_Real such that
A105: x/.k is positive Nat & x/.f is positive Nat & x/.i is positive Nat &
    x/.j is positive Nat & x/.m is positive Nat & x/.u is positive Nat &
    x/.r is Nat & x/.s is Nat & x/.t is Nat;
    reconsider xk=x/.k, xf=x/.f,xi = x/.i,xj = x/.j,xm = x/.m,
    xu = x/.u as positive Nat by A105;
    reconsider xr=x/.r, xs=x/.s,xt = x/.t as Nat by A105;
A106: eval(W,x) = Hund * x /. f * x/.k * (x/.k+1.F_Real) by A22;
    then
A107: eval(W,x) = Hund * xf * xk * (xk+1.F_Real);
    then reconsider eW=eval(W,x) as Element of NAT by INT_1:3;
A108: eval(U,x) = Hund * ((xu)|^3 ) * eW|^3 + 1.F_Real by A24;
    then reconsider eU=eval(U,x) as positive Nat;
A109: eval(M,x) = Hund * (x /. m) * eval(U,x) * eval(W,x) +
    1.F_Real by A29;
    then eval(M,x) = Hund * xm * eU * eW  + 1.F_Real;
    then reconsider eM=eval(M,x) as positive Nat;
    eval(S,x) = (eval(M,x) - 1.F_Real) * (x/.s) + (x/.k) + 1.F_Real by A31;
    then
A110: eval(S,x) = (eM - 1.F_Real) * xs + xk  + 1.F_Real;
    then reconsider eS=eval(S,x) as Element of NAT by INT_1:3;
A111: eval(T,x) = (eval(M,x)*eval(U,x) - 1.F_Real)*(x/.t)+
    eval(W,x)-(x/.k)+1.F_Real by A33;
A112: 100*xf*xk*(xk+1) >= 1*(xk+1) by NAT_1:14,XREAL_1:64;
    eW > xk by A112,A106,NAT_1:13;
    then eW-xk > 0 by XREAL_1:50;
    then (eM*eU-1)*xt +(eW-xk) >=0+0;
    then reconsider eT=eval(T,x) as Element of NAT by A111,INT_1:3;
A113: eval(Q,x) = Two*eval(M,x)*eval(W,x) - eval(W,x)^2 - 1.F_Real by A35;
    Hund * xm * eU * eW+1 >0+1 by A107,XREAL_1:6;
    then eM >= 1+1 & eW>=1 by A107,A109,NAT_1:8;
    then eM*eW>=(1+1)*1 by XREAL_1:66;
    then
A114: eM*eW - 1 >= 1 by XREAL_1:19;
    100 * xm * eU * eW >= 1*eW by XREAL_1:64,NAT_1:14;
    then eM > eW by A109,NAT_1:13;
    then
A115:eM*eW > eW*eW = eW^2 by A107,XREAL_1:68,SQUARE_1:def 1;
    then
A116: eM*eW+eM*eW > eM*eW+eW^2 by XREAL_1:8;
    then eM*eW+eM*eW -(eW^2+1) > eM*eW+eW^2 -(eW^2+1) by XREAL_1:9;
    then reconsider eQ=eval(Q,x) as positive Nat by A113,A114;
    eval(L,x) = (x/.k + 1.F_Real)*eval(Q,x) by A37;
    then eval(L,x) = (xk + 1.F_Real)*eQ;
    then reconsider eL=eval(L,x) as positive Nat;
A117: eval(A,x) = eval(M,x)*(eval(U,x) + 1.F_Real) by A39;
    then
A118:eval(A,x) = eM*(eU + 1.F_Real);
    eM >=1 & eU+1>=1+1 by XREAL_1:6,NAT_1:14;
    then
A119: eM*(eU + 1.F_Real)>=1*2 by XREAL_1:66;
    reconsider eA=eval(A,x) as positive Nat by A118;
    eval(B,x) = eval(W,x) + 1.F_Real by A41;
    then eval(B,x) = eW + 1.F_Real;
    then reconsider eB=eval(B,x) as positive Nat;
    eval(C,x) = (x/.r) + eval(W,x) + 1.F_Real by A43;
    then eval(C,x) = xr + eW + 1.F_Real;
    then reconsider eC=eval(C,x) as positive Nat;
A120: eval(D,x) = (eA^2 - 1.F_Real)* eC^2+ 1.F_Real by A45;
A121: eA^2=eA*eA <>0 by SQUARE_1:def 1;
    reconsider eD=eval(D,x) as positive Nat by A121,A120;
A122: eval(E,x) = Two *(x/.i)*(eval(C,x)^2)* eval(L,x)*eval(D,x) by A47;
    then
A123:eval(E,x) = Two *(xi)*(eC^2)* eL*eD;
A124:eC*eC=eC^2 by SQUARE_1:def 1;
    then reconsider eE=eval(E,x) as positive Nat by A123;
A125:eval(F,x) = (eA^2 - 1.F_Real)* eE^2+ 1.F_Real by A50;
    reconsider eF=eval(F,x) as positive Nat by A121,A125;
A126: eval(G,x) = eval(A,x)+eval(F,x)*(eval(F,x) - eval(A,x)) by A52;
A127: eE^2=eE*eE>=1 by NAT_1:14,SQUARE_1:def 1;
    eA-1 >=2-1 by A117,A119,XREAL_1:9;
    then
A128: (eA-1) *(eA+1)>= 1*(eA+1) by XREAL_1:64;
    then (eA-1) *(eA+1)*eE^2>= 1*(eA+1)*1 by A127,XREAL_1:66;
    then (eA-1) *(eA+1)*eE^2+1>= eA+1+0 by XREAL_1:7;
    then eF>eA by A121,A125,NAT_1:13;
    then eF-eA>eA-eA by XREAL_1:14;
    then reconsider eG=eval(G,x) as positive Nat by A126;
    eval(H,x) = eval(B,x)+Two*(x/.j - 1.F_Real)*eval(C,x) by A54;
    then
A129:eval(H,x) = eB+Two*(xj - 1.F_Real)*eC;
    reconsider eH=eval(H,x) as positive Nat by A129;
A130:eval(I,x) = (eG^2 - 1.F_Real)* eH^2+ 1.F_Real by A56;
    eG^2=eG*eG <>0 by SQUARE_1:def 1;
    then reconsider eI=eval(I,x) as positive Nat by A130;
A131: eval(X1,x) = (eM^2 - 1.F_Real)* eS^2+ 1.F_Real by A58;
A132: eM^2=eM*eM <>0 by SQUARE_1:def 1;
    then reconsider eX1=eval(X1,x) as Nat by A131;
A133: eM = 2*(50* xm * eU * eW)+1 by A109;
    hence eval(X1,x) is odd Nat by A132,A131;
A134: eval(X2,x) = ((eval(M,x)*eval(U,x))^2 - 1.F_Real)* eval(T,x)^2+
      1.F_Real by A60;
    then
A135: eval(X2,x) = ((eM*eU)^2 - 1.F_Real)* eT^2+ 1.F_Real;
A136: (eM*eU)^2=(eM*eU)*(eM*eU) <>0 by SQUARE_1:def 1;
    then reconsider eX2=eval(X2,x) as Nat by A135;
    eU = 2*(50 * (xu|^3 ) * eW|^3) + 1.F_Real by A108;
    hence eval(X2,x) is odd Nat by A133,A136,A135;
A137: eval(X3,x) = eval(D,x) *eval(F,x) * eval(I,x) by A63;
    then
A138: eval(X3,x) = eD*eF*eI;
    then reconsider eX3 = eval(X3,x) as Nat;
    thus eval(X3,x) is Nat by A138;
    eval(P,x) = eval(F,x) * eval(L,x) by A65;
    then eval(P,x) = eF * eL;
    hence eval(P,x) is positive Nat;
A139: eval(R,x) =
    (eval(H,x)-eval(C,x))*eval(L,x) + eval(F,x)*(x/.f+1.F_Real)*eval(Q,x) +
    eval(F,x)*(x/.k+1.F_Real) *
    ((eval(W,x)^2-1.F_Real)*eval(S,x)*x/.u-eval(W,x)^2*(x/.u)^2 +1.F_Real)
    by A72;
    then eval(R,x) =
    (eH-eC)*eL + eF*(xf+1)*eQ + eF*(xk+1) * ((eW^2-1)*eS*xu-eW^2*(xu)^2 +1);
    then reconsider eR = eval(R,x) as Integer;
    xk+1>=1 by NAT_1:14;
    then
A140: eF*(xk+1)>= eF *1 by XREAL_1:66;
    eE>=1 by NAT_1:14;
    then
A141: eE^2 = eE*eE>= eE *1 by XREAL_1:66,SQUARE_1:def 1;
A142: eA*eA=eA^2 by SQUARE_1:def 1;
    eA^2-1 >=1 by A142,A128,NAT_1:14;
    then (eA^2-1)*eE^2 +1>  eE by NAT_1:13,A141,XREAL_1:66;
    then
A143: eF*(xk+1) > eE by A125,A140,XXREAL_0:2;
    Two *xi*eC*eD >=1 by NAT_1:14;
    then Two *xi*eC*eD *(eC*eL) >= 1*(eC*eL) by XREAL_1:66;
    then eF*(xk+1) > eC*eL by A124,A143,A122,XXREAL_0:2;
    then eF*(xk+1) - eC*eL > 0 by XREAL_1:50;
    then
A144: eF*(xk+1) - eC*eL + (eH*eL + eF*(xk+1) * (eW^2-1)*eS*xu) >= 0+0
    by A107,A115;
    eM*eW+eM*eW >= eM*eW+eW^2+1 by A116,NAT_1:13;
    then
A145: eM*eW+eM*eW -(eW^2+1) >= eM*eW+eW^2 +1 -(eW^2+1) by XREAL_1:6;
    Hund * xf * xk >=1 by NAT_1:14;
    then
A146: eW >= (xk+1)*1 by A106,XREAL_1:66;
    then eM*eW >= (xk+1)*eM by XREAL_1:66;
    then
A147: eQ >= (xk+1)*eM by A145,A113,XXREAL_0:2;
A148: xu >=1 by NAT_1:14;
A149: 100 * xm  >=1 by NAT_1:14;
    xu|^(2+1) = xu|^2 *xu by NEWTON:6
    .= xu^2 *xu by NEWTON:81;
    then
A150: xu|^3 >= xu^2*1 by A148,XREAL_1:66;
    eW>=1 by A107,NAT_1:14;
    then eW|^3 >= eW by PREPOWER:12;
    then xu|^3 * eW|^3 >= xu^2*eW by A150,XREAL_1:66;
    then 100*(xu|^3 * eW|^3) >= 1*(xu^2*eW) by XREAL_1:66;
    then eU > xu^2*eW by A108,NAT_1:13;
    then eU*eW >= xu^2*eW*eW by XREAL_1:66;
    then 100 * xm * (eU * eW) >= 1*(xu^2*eW*eW) by A149,XREAL_1:66;
    then eM > xu^2*eW*eW by A109,NAT_1:13;
    then (xk+1)*eM>= (xk+1) * (xu^2*eW*eW) by XREAL_1:66;
    then eQ >= (xk+1) * (xu^2*eW*eW) & xf+1 >=1 by A147,XXREAL_0:2,NAT_1:14;
    then (xf+1)*eQ >= (xk+1) * (xu^2*eW*eW)*1 by XREAL_1:66;
    then eF*((xf+1)*eQ) >= eF*((xk+1) * eW^2*(xu)^2)
    by A115,XREAL_1:66;
    then eF*(xf+1)*eQ - eF*(xk+1) * eW^2*(xu)^2 >=0 by XREAL_1:48;
    then
A151: (eH-eC)*eL + eF*(xk+1) + eF*(xk+1) * (eW^2-1)*eS*xu +
    (eF*(xf+1)*eQ - eF*(xk+1) * eW^2*(xu)^2) >=0 by A144;
    hence eval(R,x) is Nat by A139;
A152: eval(N1,x) = (eval(M,x)*eval(S,x))+
    (Two*eval(M,x)*eval(U,x)*eval(T,x)) by A98;
    then eval(N1,x) = eM*eS+(2*eM*eU*eT);
    then reconsider eN1 = eval(N1,x) as Nat;
A153:eval(N2,x) = Four*(eval(A,x)*eval(A,x)*eval(C,x)*
    eval(E,x)*eval(G,x)*eval(H,x)) by A101;
    then eval(N2,x) = 4* (eA *eA*eC *eE*eH *eG);
    then reconsider eN2 = eval(N2,x) as Nat;
    eW - (xk+1)*1 >=0 by A146,XREAL_1:48;
    then eW - xk-1 +2 >= 0+2 by XREAL_1:6;
    then (eM*eU - 1)*xt+(eW-xk+1) >=0+2 by XREAL_1:7;
    then
A154: eT^2=eT*eT>=1 by A111,NAT_1:14,SQUARE_1:def 1;
    then (eM*eU)^2 * eT^2 - (eT^2-1) <= (eM*eU)^2 * eT^2 -0
    by XREAL_1:6;
    then eX2 <= (eM*eU*eT)*(eM*eU*eT) by A134,A154,A136;
    then eX2 <= (eM*eU*eT)^2 by SQUARE_1:def 1;
    then sqrt eX2 <= sqrt ((eM*eU*eT)^2) = eM*eU*eT by SQUARE_1:22,26;
    then
A155: 2* sqrt eX2 <= 2*(eM*eU*eT) by XREAL_1:64;
A156: eS^2=eS*eS>=1 by A110,NAT_1:14,SQUARE_1:def 1;
    then eM^2 * eS^2 - (eS^2-1) <= (eM)^2 * eS^2 -0 by XREAL_1:6;
    then
A157: eX1 <= (eM)^2 * eS^2 & eM*eM=eM^2 by A131,SQUARE_1:def 1;
    eX1 <= (eM*eS)*(eM*eS) by A156,A157;
    then eX1 <= (eM*eS)^2 by SQUARE_1:def 1;
    then sqrt eX1 <= sqrt ((eM*eS)^2) = eM*eS by SQUARE_1:22,26;
    then
A158: sqrt eX1 + 2* sqrt eX2 <= eN1 by A152,A155,XREAL_1:7;
    eC^2=eC*eC>=1 by NAT_1:14,SQUARE_1:def 1;
    then
A159: eA^2 *eC^2 - (eC^2-1) <= eA^2 *eC^2 -0 by XREAL_1:6;
A160: eE^2=eE*eE>=1 by NAT_1:14,SQUARE_1:def 1;
    then eA^2 *eE^2 - (eE^2-1) <= eA^2 *eE^2 -0 by XREAL_1:6;
    then
A161:eD*eF <= eA^2 *eC^2*(eA^2 *eE^2) by A120,A125,A159,XREAL_1:66;
A162: eH^2=eH*eH>=1 by NAT_1:14,SQUARE_1:def 1;
    then eG^2 *eH^2 - (eH^2-1) <= eG^2 *eH^2 -0 by XREAL_1:6;
    then eD*eF*eI <= eA^2 *eC^2*(eA^2 *eE^2)*(eG^2 *eH^2)
    by A130,A161,XREAL_1:66;
    then eX3 <= eA*eA *(eC*eC)*(eA*eA *(eE*eE))*((eG*eG) *(eH*eH))
    by A137,A124,A121,A162,A160,SQUARE_1:def 1;
    then eX3 <= (eA *eA*eC *eE*eH *eG)*(eA *eA*eC *eE*eH *eG);
    then eX3 <= (eA *eA*eC *eE*eH *eG)^2 by SQUARE_1:def 1;
    then sqrt eX3 <= sqrt (eA *eA*eC *eE*eH *eG)^2 = eA *eA*eC *eE*eH *eG
    by SQUARE_1:22,26;
    then
A163: 4* sqrt eX3 <= eN2 by A153,XREAL_1:64;
A164: eval(NN,x) = eval(N1+N2+R,x)+eval(O,x) by POLYNOM2:23
    .= eval(N1+N2+R,x)+1.F_Real by POLYNOM2:21
    .= eval(N1+N2,x)+eval(R,x)+1.F_Real by POLYNOM2:23
    .= eval(N1,x)+eval(N2,x) +eval(R,x)+1.F_Real by POLYNOM2:23
    .= eN1+eN2+eR+1;
A165: eN1+eN2 +eR+1 > eN1+eN2 +eR+0 by XREAL_1:6;
    eN1+eN2 >= sqrt eX1 + 2* sqrt eX2 +4* sqrt eX3 by A158,A163,XREAL_1:7;
    then eN1+eN2 +eR >= sqrt eX1 + 2* sqrt eX2 +4* sqrt eX3 +eR by XREAL_1:6;
    hence thesis by A151,A139,A164,A165,XXREAL_0:2;
  end;
  consider K3 be INT -valued Polynomial of 8,F_Real such that
  A166: for x1,x2,x3,P,R,N be Nat,V be Integer st
    x1 is odd & x2 is odd & P > 0 &
    N > sqrt x1 + 2*sqrt x2 + 4*sqrt x3 +R
  holds
  (x1 is square & x2 is square  & x3 is square & P divides R & V>=0)
  iff
  ex z be Nat st for f be Function of 8,F_Real
  st f = <%z,x1,4*x2,16*x3%>^<%R,P,N,V%> holds eval(K3,f) = 0 by Th77;
  consider Z be Polynomial of 8+9,F_Real such that
A167:  rng Z c= rng K3 \/ {0.F_Real} and
A168: for b be bag of 8+9 holds b in Support Z iff b|8 in Support K3 &
  for i st i >= 8 holds b.i=0 and
  for b be bag of 8+9 st b in Support Z holds
  Z.b = K3.(b|8) and
A169: for x being Function of 8, F_Real,
          y being Function of (8+9), F_Real st y|8=x
    holds eval(K3,x) = eval(Z,y) by Th75;
  rng Z c= INT by A167,INT_1:def 2;
  then reconsider Z as INT -valued Polynomial of N,F_Real
  by RELAT_1:def 19;
  reconsider Z1 = Subst(Z,1,X1) as INT -valued Polynomial of N,F_Real;
  reconsider Z2 = Subst(Z1,2,Four*X2) as INT -valued Polynomial of N,F_Real;
  reconsider Z3 =Subst(Z2,3,(Four*Four)*X3)
  as INT -valued Polynomial of N,F_Real;
  reconsider Z4 = Subst(Z3,4,R) as INT -valued Polynomial of N,F_Real;
  reconsider Z5 = Subst(Z4,5,P) as INT -valued Polynomial of N,F_Real;
  reconsider Z6 = Subst(Z5,6,NN) as INT -valued Polynomial of N,F_Real;
  reconsider Z7 = Subst(Z6,7,V) as INT -valued Polynomial of N,F_Real;
  take Z7;
A170: for xk be Nat st xk > 0 holds
  xk+1 is prime iff ex x being INT -valued Function of N, F_Real st
  x/.k = xk & x/.f is positive Nat & x/.i is positive Nat &
  x/.j is positive Nat & x/.m is positive Nat & x/.u is positive Nat &
  x/.r is Nat & x/.s is Nat & x/.t is Nat & x/.0 is Nat &
  eval(Z7,x) = 0.F_Real
  proof
    let k1 be Nat such that
A171:k1 > 0;
    thus k1+1 is prime implies ex x being INT -valued Function of N, F_Real st
    x/.k = k1 & x/.f is positive Nat & x/.i is positive Nat &
    x/.j is positive Nat & x/.m is positive Nat & x/.u is positive Nat &
    x/.r is Nat & x/.s is Nat & x/.t is Nat & x/.0 is Nat &
    eval(Z7,x) = 0.F_Real
    proof
      assume k1+1 is prime;
      then consider f1,i1,j1,m1,u1 be positive Nat,r1,s1,t1 be Nat,
      A1,B1,C1,D1,E1,F1,G1,H1,I1,L1,W1,U1,M1,S1,T1,Q1 be Integer such that
A172: D1*F1*I1 is square & (M1^2-1)*S1^2 +1 is square &
      ((M1*U1)^2 -1)*T1^2 + 1 is square and
A173:  (4*f1^2 -1)*(r1-m1*S1*T1*U1)^2 + 4*u1^2*S1^2*T1^2 <
      8*f1*u1*S1*T1*(r1-m1*S1*T1*U1) and
A174: F1*L1 divides (H1-C1)*L1 + F1*(f1+1)*Q1 + F1*(k1+1)
      *((W1^2-1)*S1*u1-W1^2*u1^2 +1) and
A175: A1 = M1*(U1+1) and
A176: B1 = W1+1 and
A177: C1 = r1 + W1 + 1 and
A178: D1 = (A1^2-1)*C1^2+1 and
A179: E1 = 2*i1*C1^2*L1*D1 and
A180: F1= (A1^2 -1) *E1^2+1 and
A181: G1 = A1+F1*(F1-A1) and
A182: H1 = B1+2*(j1-1)*C1 and
A183: I1 = (G1^2-1)*H1^2+1 and
A184: L1 = (k1+1)*Q1 and
A185: W1 = 100*f1*k1*(k1+1) and
A186: U1 = 100 * (u1|^3)*(W1|^3)+1 and
A187: M1 = 100 * m1 * U1 *W1+1 and
A188: S1 = (M1-1)*s1+k1+1 and
A189: T1 = (M1*U1-1)*t1 +W1-k1+1 and
A190: Q1 = 2*M1*W1-W1^2-1 by A171, HILB10_8:23;
      set zz = <%0%>^<%0%>^<%0%>^<%0%>^<%0%>^<%0%>^<%0%>^<%0%>;
      set vv=<%k1%>^<%f1%>^<%i1%>^<%j1%>^<%m1%>^<%u1%>^<%r1%>^<%s1%>^<%t1%>;
      set x = @(zz^vv);
      reconsider x as INT -valued Function of N, F_Real;
A191: len zz = 8 by AFINSQ_1:49;
A192: len vv = 9 =Segm 9 by AFINSQ_1:50;
A193: dom x = N = Segm N by FUNCT_2:def 1;
A194: 0 in dom vv & 1 in dom vv & 2 in dom vv & 3 in dom vv & 4 in dom vv
      &5 in dom vv & 6 in dom vv & 7 in dom vv & 8 in dom vv by A192,NAT_1:44;
A195: x/.k = x.(8+0) by A193,NAT_1:44,PARTFUN1:def 6
      .= vv.0 by A194,A191,AFINSQ_1:def 3
      .= k1 by AFINSQ_1:50;
A196: x/.f = x.(8+1) by A193,NAT_1:44,PARTFUN1:def 6
      .= vv.1 by A194,A191,AFINSQ_1:def 3
      .= f1 by AFINSQ_1:50;
A197: x/.i = x.(8+2) by A193,NAT_1:44,PARTFUN1:def 6
      .= vv.2 by A194,A191,AFINSQ_1:def 3
      .= i1 by AFINSQ_1:50;
A198: x/.j = x.(8+3) by A193,NAT_1:44,PARTFUN1:def 6
      .= vv.3 by A194,A191,AFINSQ_1:def 3
      .= j1 by AFINSQ_1:50;
A199: x/.m = x.(8+4) by A193,NAT_1:44,PARTFUN1:def 6
      .= vv.4 by A194,A191,AFINSQ_1:def 3
      .= m1 by AFINSQ_1:50;
A200: x/.u = x.(8+5) by A193,NAT_1:44,PARTFUN1:def 6
      .= vv.5 by A194,A191,AFINSQ_1:def 3
      .= u1 by AFINSQ_1:50;
A201: x/.r = x.(8+6) by A193,NAT_1:44,PARTFUN1:def 6
      .= vv.6 by A194,A191,AFINSQ_1:def 3
      .= r1 by AFINSQ_1:50;
A202: x/.s = x.(8+7) by A193,NAT_1:44,PARTFUN1:def 6
      .= vv.7 by A194,A191,AFINSQ_1:def 3
      .= s1 by AFINSQ_1:50;
A203: x/.t = x.(8+8) by A193,NAT_1:44,PARTFUN1:def 6
      .= vv.8 by A194,A191,AFINSQ_1:def 3
      .= t1;
A204:  eval(W,x) = Hund * x /. f * x/.k * (x/.k+1.F_Real) by A22;
A205: U1=eval(U,x) by A186,A200,A204,A185,A195,A196,A24;
A206: eval(M,x) = Hund * (x /.m) *eval(U,x)*eval(W,x) +1.F_Real by A29;
      then
A207: M1 = eval(M,x)
      by A187,A199,A186,A200,A204,A185,A195,A196,A24;
A208: eval(S,x) = (eval(M,x) - 1.F_Real)*(x/.s)+(x/.k)+1.F_Real by A31;
      then
A209: S1 = eval(S,x) by A188,A202,A195,A206,
      A187,A199,A186,A200,A204,A185,A196,A24;
A210: eval(T,x) = (eval(M,x)*eval(U,x) - 1.F_Real)*(x/.t)+
      eval(W,x)-(x/.k)+1.F_Real by A33;
A211: eval(Q,x) = Two*eval(M,x)*eval(W,x) - eval(W,x)^2-1.F_Real by A35;
      then
A212: Q1 = eval(Q,x) by A190,A206,
      A187,A199,A186,A200,A204,A185,A195,A196,A24;
A213: eval(L,x) = (x/.k + 1.F_Real)*eval(Q,x) by A37;
A214: eval(A,x) = eval(M,x)*(eval(U,x) + 1.F_Real) by A39;
A215: eval(B,x) = eval(W,x) + 1.F_Real by A41;
A216: eval(C,x) = (x/.r) + eval(W,x) + 1.F_Real by A43;
A217: D1 = eval(D,x) by A45,A178,A214,A175,A206,A187,A199,A204,A185,A195,
      A196,A205,A216,A177,A201;
A218: eval(E,x) = Two *(x/.i)*(eval(C,x)^2)* eval(L,x)*eval(D,x) by A47;
A219: F1 = eval(F,x) by A50,A180,A214,A175,A206,A187,A199,A204,A185,A195,
      A196,A205,A218,A179,A197,A213,A184,A211,A190,A216,A177,A201,A217;
A220: eval(G,x) = eval(A,x)+eval(F,x)*(eval(F,x) - eval(A,x)) by A52;
A221: eval(H,x) = eval(B,x)+Two*(x/.j - 1.F_Real)*eval(C,x) by A54;
A222: I1 = eval(I,x) by A56,A183,A220,A181,A214,A175,A206,A187,A199,A204,A185,
      A195,A196,A205,A219,A221,A182,A215,A176,A198,A216,A177,A201;
      reconsider X11=eval(X1,x),X21=eval(X2,x) as odd Nat
      by A104,A171,A195,A196,A197,A198,A199,A200,A201,A202,A203;
      reconsider X31= eval(X3,x),R1=eval(R,x),NN1=eval(NN,x) as Nat
      by A171,A195,A196,A197,A198,A199,A200,A201,A202,A203,A104;
      reconsider P1=eval(P,x) as positive Nat
      by A171,A195,A196,A197,A198,A199,A200,A201,A202,A203,A104;
A223: X11 = (M1^2 - 1)* S1^2+ 1 by A58,A208,A207,A188,A202,A195;
A224: X21 = ((M1*U1)^2 - 1)* T1^2+ 1 by A60,A206,A205,A210,A189,A204,
      A185,A195,A196,A203,A187,A199;
A225: eval(X3,x) = eval(D,x) *eval(F,x) * eval(I,x) by A63;
A226: eval(P,x) = eval(F,x) * eval(L,x) by A65;
A227:eval(R,x) =
      (eval(H,x)-eval(C,x))*eval(L,x) + eval(F,x)*(x/.f+1.F_Real)*eval(Q,x) +
      eval(F,x)*(x/.k+1.F_Real) *
      ((eval(W,x)^2-1.F_Real)*eval(S,x)*x/.u-eval(W,x)^2*(x/.u)^2 +1.F_Real)
      by A72;
      reconsider V11 = eval(V1,x),V21 = eval(V2,x),V31 = eval(V3,x)
      as Integer;
A228: eval(V1,x) = Eight*((x/.f)*(x/.u)*eval(S,x)*eval(T,x)*
      ((x/.r)-(x/.m)*eval(S,x)*eval(T,x)*eval(U,x))) by A84;
A229: eval(V3,x) = (Four*(x/.f)^2-1.F_Real)*
      ((x/.r)-(x/.m)*eval(S,x)*eval(T,x)*eval(U,x))^2 by A93;
      reconsider VV=V11-V21-V31-1 as Integer;
A230: NN1 > sqrt X11 + 2* sqrt X21 +4* sqrt X31 + R1
      by A171,A195,A196,A197,A198,A199,A200,A201,A202,A203,A104;
A231: eval(V,x) = eval(V1-V2-V3,x)-eval(O,x) by POLYNOM2:24
      .= eval(V1-V2-V3,x)-1.F_Real by POLYNOM2:21
      .= eval(V1-V2,x)-eval(V3,x)-1.F_Real by POLYNOM2:24
      .= eval(V1,x)-eval(V2,x)-eval(V3,x)-1.F_Real by POLYNOM2:24;
      V31 + V21 < V11 & VV+1 = V11 -(V31 + V21) by A173,A228,A87,A200,A208,
      A210,A189,A206,A204,A185,A195,A196,A203,A187,A199,A229,A201,A205,
      A188,A202;
      then
A232: 0 < VV+1 by XREAL_1:50;
      consider z1 be Nat such that
A233:  for f be Function of 8,F_Real
        st f = <%z1,X11,4*X21,16*X31%>^<%R1,P1,NN1,VV%> holds
      eval(K3,f) = 0 by A166,A230,A172,A223,A224,A225,A217,A213,A184,A195,
      A200,A204,A185,A196,A216,A177,A201,A222,A232,A174,A226,
      A227,A221,A182,A215,A198,A219,A212,A209,A176;
      set yy = <%z1%>^<%0%>^<%0%>^<%0%>^<%0%>^<%0%>^<%0%>^<%0%>;
      set p = @(yy^vv);
      reconsider p as INT -valued Function of N, F_Real;
A234: N=Segm N;
      then
A235: 0 in N & 1 in N & 2 in N & 3 in N & 4 in N & 5 in N & 6 in N &
      7 in N by NAT_1:44;
      set p7 = p+*(7,eval(V,p));
A236: eval(Z7,p) = eval(Z6,p7) by Th37,A234,NAT_1:44;
      set p6 = p7+*(6,eval(NN,p));
      not 7 in vars NN by A1,A103;
      then 7 in N\vars NN by A235,XBOOLE_0:def 5;
      then eval(NN,p7) = eval(NN,p) by Th53;
      then
A237: eval(Z6,p7) = eval(Z5,p6) by Th37,A234,NAT_1:44;
      set p5 = p6+*(5,eval(P,p));
      not 6 in vars P & not 7 in vars P by A64,A1;
      then
A238: 6 in N\vars P & 7 in N\vars P by A235,XBOOLE_0:def 5;
      then eval(P,p6) = eval(P,p7) by Th53
      .= eval(P,p) by A238,Th53;
      then
A239:eval(Z5,p6)= eval(Z4,p5) by Th37,A234,NAT_1:44;
      set p4 = p5+*(4,eval(R,p));
      not 5 in vars R & not 6 in vars R & not 7 in vars R by A66,A1;
      then
A240: 5 in N\vars R & 6 in N\vars R & 7 in N\vars R by A235,XBOOLE_0:def 5;
      then eval(R,p5) = eval(R,p6) by Th53
      .= eval(R,p7) by A240,Th53
      .= eval(R,p) by A240,Th53;
      then
A241: eval(Z4,p5)= eval(Z3,p4) by Th37,A234,NAT_1:44;
A242: vars ((Four*Four)*X3) c= VARs by Th80,A62;
      set p3 = p4+*(3,eval((Four*Four)*X3,p));
      not 4 in vars ((Four*Four)*X3) & not 5 in vars ((Four*Four)*X3) &
      not 6 in vars ((Four*Four)*X3) & not 7 in vars ((Four*Four)*X3)
      by A1,A242;
      then
A243: 4 in N\vars ((Four*Four)*X3) & 5 in N\vars ((Four*Four)*X3) &
      6 in N\vars ((Four*Four)*X3) & 7 in N\vars ((Four*Four)*X3)
      by A235,XBOOLE_0:def 5;
      then eval((Four*Four)*X3,p4) = eval((Four*Four)*X3,p5) by Th53
      .= eval((Four*Four)*X3,p6) by A243,Th53
      .= eval((Four*Four)*X3,p7) by A243,Th53
      .= eval((Four*Four)*X3,p) by A243,Th53;
      then
A244: eval(Z3,p4)= eval(Z2,p3) by Th37,A234,NAT_1:44;
A245: vars (Four*X2) c= VARs by Th80,A59;
      set p2 = p3+*(2,eval(Four*X2,p));
      not 3 in vars (Four*X2) & not 4 in vars (Four*X2) &
      not 5 in vars (Four*X2) &
      not 6 in vars (Four*X2) & not 7 in vars (Four*X2) by A1,A245;
      then A246: 3 in N\vars (Four*X2) & 4 in N\vars (Four*X2) &
      5 in N\vars (Four*X2) &
      6 in N\vars (Four*X2) & 7 in N\vars (Four*X2) by A235,XBOOLE_0:def 5;
      then eval(Four*X2,p3) = eval(Four*X2,p4) by Th53
      .= eval(Four*X2,p5) by A246,Th53
      .= eval(Four*X2,p6) by A246,Th53
      .= eval(Four*X2,p7) by A246,Th53
      .= eval(Four*X2,p) by A246,Th53;
      then
A247: eval(Z2,p3)= eval(Z1,p2) by Th37,A234,NAT_1:44;
      set p1 = p2+*(1,eval(X1,p));
      not 2 in vars X1 & not 3 in vars X1 & not 4 in vars X1 &
      not 5 in vars X1 & not 6 in vars X1 & not 7 in vars X1 by A1,A57;
      then
A248: 2 in N\vars X1 & 3 in N\vars X1 & 4 in N\vars X1 &
      5 in N\vars X1 &
      6 in N\vars X1 & 7 in N\vars X1 by A235,XBOOLE_0:def 5;
      then eval(X1,p2) = eval(X1,p3) by Th53
      .= eval(X1,p4) by A248,Th53
      .= eval(X1,p5) by A248,Th53
      .= eval(X1,p6) by A248,Th53
      .= eval(X1,p7) by A248,Th53
      .= eval(X1,p) by A248,Th53;
      then
A249: eval(Z1,p2)= eval(Z,p1) by Th37,A234,NAT_1:44;
A250: len yy = 8 by AFINSQ_1:49;
A251:  dom p1 = N & Segm 8 c= Segm N by NAT_1:39,PARTFUN1:def 2;
      then
A252: dom (p1|8) =8  & rng (p1|8) c= rng p1 c= the carrier of F_Real
      by RELAT_1:62,70;
      then reconsider p8 = p1|8 as Function of 8, F_Real by FUNCT_2:2;
      set ZR= <%z1,X11,4*X21,16*X31%>^<%R1,P1,NN1,VV%>;
A253: ZR=
      (<%z1%>^<%X11%>^<%4*X21%>^<%16*X31%>)^<%R1,P1,NN1,VV%> by AFINSQ_1:def 14
      .= (<%z1%>^<%X11%>^<%4*X21%>^<%16*X31%>)^(<%R1%>^<%P1%>^<%NN1%>^<%VV%>)
      by AFINSQ_1:def 14
      .= (<%z1%>^<%X11%>^<%4*X21%>^<%16*X31%>)^(<%R1%>^<%P1%>^<%NN1%>)^<%VV%>
      by AFINSQ_1:27
      .= (<%z1%>^<%X11%>^<%4*X21%>^<%16*X31%>)^(<%R1%>^<%P1%>)^<%NN1%>^<%VV%>
      by AFINSQ_1:27
      .= (<%z1%>^<%X11%>^<%4*X21%>^<%16*X31%>)^<%R1%>^<%P1%>^<%NN1%>^<%VV%>
      by AFINSQ_1:27;
      then
A254: dom ZR = 8 by AFINSQ_1:49;
A255: dom p1 =N & dom p2=N & dom p3 =N & dom p4=N
      & dom p5 =N & dom p6=N & dom p7 =N & dom p = N by FUNCT_2:def 1;
A256: dom (x+*(0,z1)) = dom x = N = dom p by FUNCT_2:def 1,FUNCT_7:30;
      for ii be object st ii in dom p holds p.ii = (x+*(0,z1)).ii
      proof
        let ii be object such that
A257:   ii in dom p;
        reconsider ii as Nat by A257;
        per cases;
        suppose
A258:     ii=0;
A259:     0 in Segm 8 by NAT_1:44;
          p.0 = yy.0 by A259,A250,AFINSQ_1:def 3
          .= z1 by AFINSQ_1:49;
          hence thesis by A258,A256,A257,FUNCT_7:31;
        end;
        suppose
A260:     ii<>0;
          per cases;
          suppose ii < Segm 8;
            then
A261:       ii in 8 =Segm(7+1) by NAT_1:44;
A262:       x.ii = zz.ii by A191,A261,AFINSQ_1:def 3;
A263:       p.ii = yy.ii by A261,A250,AFINSQ_1:def 3;
            ii = 0 or ... or ii=7 by A261,NAT_1:61;
            then yy.ii = 0 = zz.ii by A260,AFINSQ_1:49;
            hence thesis by A260,FUNCT_7:32,A262,A263;
          end;
          suppose ii>=8;
            then reconsider jj=ii-8 as Nat by NAT_1:21;
            ii in Segm N by A257;
            then jj+8 < 8+9 by NAT_1:44;
            then
A264:       jj in dom vv by A192,NAT_1:44,XREAL_1:6;
A265:       p.ii = (yy^vv).(8+jj)
            .= vv.jj by A264,A250,AFINSQ_1:def 3;
            x.ii = (zz^vv).(8+jj)
            .= vv.jj by A264,A191,AFINSQ_1:def 3;
            hence thesis by A260,FUNCT_7:32,A265;
          end;
        end;
      end;
      then
A266: x+*(0,z1) = p by A256;
A267: z1 in the carrier of F_Real by XREAL_0:def 1;
      0 in Segm 8 by NAT_1:44;
      then
A268: p.0 = yy.0 by A250,AFINSQ_1:def 3
      .= z1 by AFINSQ_1:49;
      for ii be object st ii in dom ZR holds ZR.ii=p8.ii
      proof
        let ii be object such that
A269:   ii in dom ZR;
        reconsider ii as Nat by A269;
A270:   p8.ii = p1.ii & ii in dom p1 by A251,A269,A254,FUNCT_1:49;
        ii in Segm(7+1) by A269,A253,AFINSQ_1:49;
        then ii=0 or ... or ii=7 by NAT_1:61;
        then per cases;
        suppose
A271:     ii=0;
          p1.0 = p2.0 = p3.0 = p4.0 by FUNCT_7:32;
          then p1.0 = p5.0 = p6.0 = p7.0 = p.0 by FUNCT_7:32;
          hence thesis by A253,AFINSQ_1:49,A268,A271,A270;
        end;
        suppose
A272:     ii=1;
          not 0 in vars X1 by A1,A57;
          then
A273:     0 in N\vars X1 by A235,XBOOLE_0:def 5;
          p1.1 = eval(X1,p) by A255,A251,A269,A254,A272,FUNCT_7:31
          .= eval(X1,x) by A273,A267,Th53,A266;
          hence thesis by A270,A272,A253,AFINSQ_1:49;
        end;
        suppose
A274:     ii=2;
          not 0 in vars X2 by A1,A59;
          then
A275:     0 in N\vars X2 by A235,XBOOLE_0:def 5;
          p1.2 = p2.2 by FUNCT_7:32
          .= eval(Four*X2,p) by A255,A251,
          A269,A254,A274,FUNCT_7:31
          .= Four*eval(X2,p) by POLYNOM7:29
          .= Four* eval(X2,x) by A275,A267,Th53,A266;
          hence thesis by A270,A274,A253,AFINSQ_1:49;
        end;
        suppose
A276:     ii=3;
          not 0 in vars X3 by A1,A62;
          then
A277:     0 in N\vars X3 by A235,XBOOLE_0:def 5;
          p1.3 = p2.3 by FUNCT_7:32
          .= p3.3 by FUNCT_7:32
          .= eval((Four*Four)*X3,p) by A255,A251,
          A269,A254,A276,FUNCT_7:31
          .= (Four*Four)*eval(X3,p) by POLYNOM7:29
          .= (Four*Four)* eval(X3,x) by A277,A267,Th53,A266;
          hence thesis by A270,A276,A253,AFINSQ_1:49;
        end;
        suppose
A278:     ii=4;
          not 0 in vars R by A1,A66;
          then
A279:     0 in N\vars R by A235,XBOOLE_0:def 5;
          p1.4 = p2.4 by FUNCT_7:32
          .= p3.4 by FUNCT_7:32
          .= p4.4 by FUNCT_7:32
          .= eval(R,p) by A255,A251,A269,A254,A278,FUNCT_7:31
          .= eval(R,x) by A279,A267,Th53,A266;
          hence thesis by A270,A278,A253,AFINSQ_1:49;
        end;
        suppose
A280:     ii=5;
          not 0 in vars P by A1,A64;
          then
A281:     0 in N\vars P by A235,XBOOLE_0:def 5;
          p1.5 = p2.5 by FUNCT_7:32
          .= p3.5 by FUNCT_7:32
          .= p4.5 by FUNCT_7:32
          .= p5.5 by FUNCT_7:32
          .= eval(P,p) by A255,A251,A269,A254,A280,FUNCT_7:31
          .= eval(P,x) by A281,A267,Th53,A266;
          hence thesis by A270,A280,A253,AFINSQ_1:49;
        end;
        suppose
A282:     ii=6;
          not 0 in vars NN by A1,A103;
          then
A283:     0 in N\vars NN by A235,XBOOLE_0:def 5;
          p1.6 = p2.6 by FUNCT_7:32
          .= p3.6 by FUNCT_7:32
          .= p4.6 by FUNCT_7:32
          .= p5.6 by FUNCT_7:32
          .= p6.6 by FUNCT_7:32
          .= eval(NN,p) by A255,A251,A269,A254,A282,FUNCT_7:31
          .= eval(NN,x) by A283,A267,Th53,A266;
          hence thesis by A270,A282,A253,AFINSQ_1:49;
        end;
        suppose
A284:     ii=7;
          not 0 in vars V by A1,A102;
          then
A285:     0 in N\vars V by A235,XBOOLE_0:def 5;
          p1.7 = p2.7 by FUNCT_7:32
          .= p3.7 by FUNCT_7:32
          .= p4.7 by FUNCT_7:32
          .= p5.7 by FUNCT_7:32
          .= p6.7 by FUNCT_7:32
          .= p7.7 by FUNCT_7:32
          .= eval(V,p) by A255,A251,A269,A254,A284,FUNCT_7:31
          .= eval(V,x) by A285,A267,Th53,A266;
          hence thesis by A231,A270,A284,A253;
        end;
      end;
      then p8 = ZR by A254,A252;
      then
A286: eval(K3,p8) = 0 by A233;
      take p;
      p/.k = (yy^vv).(8+0) by A255,A193,NAT_1:44,PARTFUN1:def 6
      .= vv.0 by A194,A250,AFINSQ_1:def 3;
      hence p/.k = k1 by AFINSQ_1:50;
A287: dom p = N by FUNCT_2:def 1;
      p/.f = (yy^vv).(8+1) by A287,A193,NAT_1:44,PARTFUN1:def 6
      .= vv.1 by A194,A250,AFINSQ_1:def 3;
      hence p/.f is positive Nat by AFINSQ_1:50;
      p/.i = (yy^vv).(8+2) by A287,A193,NAT_1:44,PARTFUN1:def 6
      .= vv.2 by A194,A250,AFINSQ_1:def 3;
      hence p/.i is positive Nat by AFINSQ_1:50;
      p/.j = (yy^vv).(8+3) by A287,A193,NAT_1:44,PARTFUN1:def 6
      .= vv.3 by A194,A250,AFINSQ_1:def 3;
      hence p/.j is positive Nat by AFINSQ_1:50;
      p/.m = (yy^vv).(8+4) by A287,A193,NAT_1:44,PARTFUN1:def 6
      .= vv.4 by A194,A250,AFINSQ_1:def 3;
      hence p/.m is positive Nat by AFINSQ_1:50;
      p/.u = (yy^vv).(8+5) by A287,A193,NAT_1:44,PARTFUN1:def 6
      .= vv.5 by A194,A250,AFINSQ_1:def 3;
      hence p/.u is positive Nat by AFINSQ_1:50;
      p/.r = (yy^vv).(8+6) by A287,A193,NAT_1:44,PARTFUN1:def 6
      .= vv.6 by A194,A250,AFINSQ_1:def 3;
      hence p/.r is Nat by AFINSQ_1:50;
      p/.s = (yy^vv).(8+7) by A287,A193,NAT_1:44,PARTFUN1:def 6
      .= vv.7 by A194,A250,AFINSQ_1:def 3;
      hence p/.s is Nat by AFINSQ_1:50;
      p/.t = (yy^vv).(8+8) by A287,A193,NAT_1:44,PARTFUN1:def 6
      .= vv.8 by A194,A250,AFINSQ_1:def 3;
      hence p/.t is Nat;
      thus p/.0 is Nat by A268,A287,A193,NAT_1:44,PARTFUN1:def 6;
      thus thesis by A236,A237,A239,A241,A244,A247,A249,A169,A286;
    end;
    given x be INT -valued Function of N, F_Real such that
A288: x/.k = k1 and
A289:  x/.f is positive Nat &
    x/.i is positive Nat &
    x/.j is positive Nat &
    x/.m is positive Nat &
    x/.u is positive Nat &
    x/.r is Nat & x/.s is Nat & x/.t is Nat & x/.0 is Nat &
    eval(Z7,x) = 0.F_Real;
    reconsider f1=x/.f,i1=x/.i,j1=x/.j,m1=x/.m,u1=x/.u as positive Nat by A289;
    reconsider r1=x/.r,s1=x/.s,t1=x/.t,z1=x/.0 as Nat by A289;
A290: eval(W,x) = Hund * x /. f * x/.k * (x/.k+1.F_Real) by A22;
    reconsider W1=eval(W,x) as Integer;
A291: eval(U,x)= Hund * (u1|^3 ) * W1|^3 + 1 by A24;
    reconsider U1=eval(U,x) as Integer;
A292: eval(M,x) = Hund * (x /. m) * eval(U,x) * eval(W,x)+1.F_Real by A29;
    reconsider M1=eval(M,x) as Integer;
    eval(S,x) = (eval(M,x) - 1.F_Real) * (x/.s) + (x/.k) + 1.F_Real by A31;
    then
A293: eval(S,x) = (M1 - 1) * s1 + k1  + 1 by A288;
    reconsider S1=eval(S,x) as Integer;
    eval(T,x) = (eval(M,x)*eval(U,x) - 1.F_Real)*(x/.t)+
    eval(W,x)-(x/.k)+1.F_Real by A33;
    then
A294: eval(T,x) = (M1*U1 - 1)*(t1)+ W1-k1 +1 by A288;
    reconsider T1 = eval(T,x) as Integer;
A295: eval(Q,x) = Two*eval(M,x)*eval(W,x) - eval(W,x)^2 - 1.F_Real by A35;
    reconsider Q1 = eval(Q,x) as Integer;
A296: eval(L,x) = (x/.k + 1.F_Real)*eval(Q,x) by A37;
    reconsider L1 = eval(L,x) as Integer;
A297: eval(A,x) = eval(M,x)*(eval(U,x) + 1.F_Real) by A39;
    reconsider A1 = eval(A,x) as Integer;
A298:eval(B,x) = eval(W,x) + 1.F_Real by A41;
    reconsider B1 = eval(B,x) as Integer;
A299: eval(C,x) = (x/.r) + eval(W,x) + 1.F_Real by A43;
    reconsider C1 = eval(C,x) as Integer;
A300: eval(D,x) = (A1^2 - 1)* C1^2+ 1 by A45;
    reconsider D1 = eval(D,x) as Integer;
    eval(E,x) = Two *(x/.i)*(eval(C,x)^2)* eval(L,x)*eval(D,x) by A47;
    then
A301:eval(E,x) = 2 *i1*(C1^2)* L1*D1;
    reconsider E1 = eval(E,x) as Integer;
A302:eval(F,x) = (A1^2 - 1)* E1^2+ 1 by A50;
    reconsider  F1 = eval(F,x) as Integer;
A303:  eval(G,x) = eval(A,x)+eval(F,x)*(eval(F,x) - eval(A,x)) by A52;
    reconsider G1 = eval(G,x) as Integer;
    eval(H,x) = eval(B,x)+Two*(x/.j - 1.F_Real)*eval(C,x) by A54;
    then
A304: eval(H,x) = B1+2*(j1 - 1)*C1;
    reconsider H1 = eval(H,x) as Integer;
A305:eval(I,x) = (G1^2 - 1)* H1^2+ 1 by A56;
    reconsider I1 = eval(I,x) as Integer;
    reconsider X11=eval(X1,x),X21=eval(X2,x) as odd Nat by A104,A171,A289,A288;
    reconsider X31= eval(X3,x),R1=eval(R,x),NN1=eval(NN,x) as Nat
    by A171,A289,A288,A104;
    reconsider P1=eval(P,x) as positive Nat by A171,A289,A288,A104;
    reconsider V11 = eval(V1,x),V21 = eval(V2,x),V31 = eval(V3,x)
    as Integer;
    reconsider VV=V11-V21-V31-1 as Integer;
A306:X11 = (M1^2 - 1)* S1^2+ 1 by A58;
A307: eval(X2,x) = ((eval(M,x)*eval(U,x))^2 - 1.F_Real)* eval(T,x)^2+
    1.F_Real by A60;
A308:  eval(X3,x) = eval(D,x) *eval(F,x) * eval(I,x) by A63;
A309:  eval(P,x) = eval(F,x) * eval(L,x) by A65;
A310:  eval(R,x) =
    (eval(H,x)-eval(C,x))*eval(L,x) + eval(F,x)*(x/.f+1.F_Real)*eval(Q,x) +
    eval(F,x)*(x/.k+1.F_Real) *
    ((eval(W,x)^2-1.F_Real)*eval(S,x)*x/.u-eval(W,x)^2*(x/.u)^2 +1.F_Real)
    by A72;
    reconsider V11 = eval(V1,x),V21 = eval(V2,x),V31 = eval(V3,x)
    as Integer;
A311: eval(V1,x) = Eight*((x/.f)*(x/.u)*eval(S,x)*eval(T,x)*
    ((x/.r)-(x/.m)*eval(S,x)*eval(T,x)*eval(U,x))) by A84;
A312: eval(V3,x) = (Four*(x/.f)^2-1.F_Real)*
    ((x/.r)-(x/.m)*eval(S,x)*eval(T,x)*eval(U,x))^2 by A93;
    reconsider VV=V11-V21-V31-1 as Integer;
A313: eval(V,x) = eval(V1-V2-V3,x)-eval(O,x) by POLYNOM2:24
    .= eval(V1-V2-V3,x)-1.F_Real by POLYNOM2:21
    .= eval(V1-V2,x)-eval(V3,x)-1.F_Real by POLYNOM2:24
    .= eval(V1,x)-eval(V2,x)-eval(V3,x)-1.F_Real by POLYNOM2:24;
A314: NN1 > sqrt X11 + 2*sqrt X21+4* sqrt X31 + R1 by A171,A289,A288,A104;
A315: N=Segm N;
    then
A316: 0 in N & 1 in N & 2 in N & 3 in N & 4 in N & 5 in N & 6 in N & 7 in N
    by NAT_1:44;
    set x7 = x+*(7,eval(V,x));
A317:eval(Z7,x) = eval(Z6,x7) by Th37,A315,NAT_1:44;
    set x6 = x7+*(6,eval(NN,x));
    not 7 in vars NN by A1,A103;
    then 7 in N\vars NN by A316,XBOOLE_0:def 5;
    then eval(NN,x7) = eval(NN,x) by Th53;
    then
A318: eval(Z6,x7) = eval(Z5,x6) by Th37,A315,NAT_1:44;
    set x5 = x6+*(5,eval(P,x));
    not 6 in vars P & not 7 in vars P by A1,A64;
    then
A319: 6 in N\vars P & 7 in N\vars P by A316,XBOOLE_0:def 5;
    then eval(P,x6) = eval(P,x7) by Th53
    .= eval(P,x) by A319,Th53;
    then
A320: eval(Z5,x6)= eval(Z4,x5) by Th37,A315,NAT_1:44;
    set x4 = x5+*(4,eval(R,x));
    not 5 in vars R & not 6 in vars R & not 7 in vars R by A1,A66;
    then
A321: 5 in N\vars R & 6 in N\vars R & 7 in N\vars R
    by A316,XBOOLE_0:def 5;
    then eval(R,x5) = eval(R,x6) by Th53
    .= eval(R,x7) by A321,Th53
    .= eval(R,x) by A321,Th53;
    then
A322:eval(Z4,x5)= eval(Z3,x4) by Th37,A315,NAT_1:44;
A323: vars ((Four*Four)*X3) c= VARs by Th80,A62;
    set x3 = x4+*(3,eval((Four*Four)*X3,x));
    not 4 in vars ((Four*Four)*X3) & not 5 in vars ((Four*Four)*X3) &
    not 6 in vars ((Four*Four)*X3) & not 7 in vars ((Four*Four)*X3)
    by A1,A323;
    then
A324: 4 in N\vars ((Four*Four)*X3) & 5 in N\vars ((Four*Four)*X3) &
    6 in N\vars ((Four*Four)*X3) & 7 in N\vars ((Four*Four)*X3)
    by A316,XBOOLE_0:def 5;
    then eval((Four*Four)*X3,x4) = eval((Four*Four)*X3,x5) by Th53
    .= eval((Four*Four)*X3,x6) by A324,Th53
    .= eval((Four*Four)*X3,x7) by A324,Th53
    .= eval((Four*Four)*X3,x) by A324,Th53;
    then
A325:eval(Z3,x4)= eval(Z2,x3) by Th37,A315,NAT_1:44;
A326: vars (Four*X2) c= VARs by Th80,A59;
    set x2 = x3+*(2,eval(Four*X2,x));
    not 3 in vars (Four*X2) & not 4 in vars (Four*X2) &
    not 5 in vars (Four*X2) &
    not 6 in vars (Four*X2) & not 7 in vars (Four*X2)
    by A1,A326;
    then
A327: 3 in N\vars (Four*X2) & 4 in N\vars (Four*X2) &
    5 in N\vars (Four*X2) &
    6 in N\vars (Four*X2) & 7 in N\vars (Four*X2) by A316,XBOOLE_0:def 5;
    then eval(Four*X2,x3) = eval(Four*X2,x4) by Th53
    .= eval(Four*X2,x5) by A327,Th53
    .= eval(Four*X2,x6) by A327,Th53
    .= eval(Four*X2,x7) by A327,Th53
    .= eval(Four*X2,x) by A327,Th53;
    then
A328: eval(Z2,x3)= eval(Z1,x2) by Th37,A315,NAT_1:44;
    set x1 = x2+*(1,eval(X1,x));
    not 2 in vars X1 & not 3 in vars X1 & not 4 in vars X1 &
    not 5 in vars X1 & not 6 in vars X1 & not 7 in vars X1 by A1,A57;
    then
A329: 2 in N\vars X1 & 3 in N\vars X1 & 4 in N\vars X1 &
    5 in N\vars X1 &
    6 in N\vars X1 & 7 in N\vars X1 by A316,XBOOLE_0:def 5;
    then eval(X1,x2) = eval(X1,x3) by Th53
    .= eval(X1,x4) by A329,Th53
    .= eval(X1,x5) by A329,Th53
    .= eval(X1,x6) by A329,Th53
    .= eval(X1,x7) by A329,Th53
    .= eval(X1,x) by A329,Th53;
    then
A330: eval(Z1,x2)= eval(Z,x1) by Th37,A315,NAT_1:44;
    dom x1 = N & Segm 8 c= Segm N by NAT_1:39,PARTFUN1:def 2;
    then dom (x1|8) =8  & rng (x1|8) c= rng x1 c= the carrier of F_Real
    by RELAT_1:62,70;
    then reconsider x8 = x1|8 as Function of 8, F_Real by FUNCT_2:2;
A331: for f be Function of 8,F_Real st
    f= <%z1,X11,4*X21,16*X31%>^<%R1,P1,NN1,VV%>
    holds 0 = eval(K3,f)
    proof
      let ff be Function of 8,F_Real such that
A332: ff= <%z1,X11,4*X21,16*X31%>^<%R1,P1,NN1,VV%>;
A333: ff =
      (<%z1%>^<%X11%>^<%4*X21%>^<%16*X31%>)^<%R1,P1,NN1,VV%>
      by A332,AFINSQ_1:def 14
      .= (<%z1%>^<%X11%>^<%4*X21%>^<%16*X31%>)^(<%R1%>^<%P1%>^<%NN1%>^<%VV%>)
      by AFINSQ_1:def 14
      .= (<%z1%>^<%X11%>^<%4*X21%>^<%16*X31%>)^(<%R1%>^<%P1%>^<%NN1%>)^<%VV%>
      by AFINSQ_1:27
      .= (<%z1%>^<%X11%>^<%4*X21%>^<%16*X31%>)^(<%R1%>^<%P1%>)^<%NN1%>^<%VV%>
      by AFINSQ_1:27
      .= (<%z1%>^<%X11%>^<%4*X21%>^<%16*X31%>)^<%R1%>^<%P1%>^<%NN1%>^<%VV%>
      by AFINSQ_1:27;
      then
A334: dom ff = Segm 8 by AFINSQ_1:49;
A335: dom x = N & dom x1 =N & dom x2=N & dom x3 =N & dom x4=N
      & dom x5 =N & dom x6=N & dom x7 =N by FUNCT_2:def 1;
A336: 8 = dom x8 by FUNCT_2:def 1;
      for ii be object st ii in dom ff holds ff.ii = x8.ii
      proof
        let ii be object such that
A337:   ii in dom ff;
        reconsider ii as Nat by A337,A333;
A338:   x8.ii = x1.ii & ii in dom x1 by A337,FUNCT_1:49,A336,RELAT_1:57;
        ii in Segm(7+1) by A337;
        then ii=0 or ... or ii=7 by NAT_1:61;
        then
        per cases;
        suppose
A339:     ii=0;
          then
A340:     ff.ii = z1 by A333,AFINSQ_1:49;
          x1.0 = x2.0 = x3.0 = x4.0 by FUNCT_7:32;
          then x1.0 = x5.0 = x6.0 = x7.0 = x.0 by FUNCT_7:32;
          hence thesis by A340,A339,A338,A335,PARTFUN1:def 6;
        end;
        suppose
A341:     ii=1;
          x1.1 = eval(X1,x) by A335,A338,A341,FUNCT_7:31;
          hence thesis by A338,A341,A333,AFINSQ_1:49;
        end;
        suppose
A342:     ii=2;
          x1.2 = x2.2 by FUNCT_7:32
          .= eval(Four*X2,x) by A335,A338,A342,FUNCT_7:31
          .= Four*eval(X2,x) by POLYNOM7:29;
          hence thesis by A338,A342,A333,AFINSQ_1:49;
        end;
        suppose
A343:     ii=3;
          x1.3 = x2.3 by FUNCT_7:32
          .= x3.3 by FUNCT_7:32
          .= eval((Four*Four)*X3,x) by A335,A338,A343,FUNCT_7:31
          .= (Four*Four)*eval(X3,x) by POLYNOM7:29;
          hence thesis by A338,A343,A333,AFINSQ_1:49;
        end;
        suppose
A344:     ii=4;
          x1.4 = x2.4 by FUNCT_7:32
          .= x3.4 by FUNCT_7:32
          .= x4.4 by FUNCT_7:32
          .= eval(R,x) by A335,A338,A344,FUNCT_7:31;
          hence thesis by A338,A344,A333,AFINSQ_1:49;
        end;
        suppose
A345:     ii=5;
          x1.5 = x2.5 by FUNCT_7:32
          .= x3.5 by FUNCT_7:32
          .= x4.5 by FUNCT_7:32
          .= x5.5 by FUNCT_7:32
          .= eval(P,x) by A335,A338,A345,FUNCT_7:31;
          hence thesis by A338,A345,A333,AFINSQ_1:49;
        end;
        suppose
A346:     ii=6;
          x1.6 = x2.6 by FUNCT_7:32
          .= x3.6 by FUNCT_7:32
          .= x4.6 by FUNCT_7:32
          .= x5.6 by FUNCT_7:32
          .= x6.6 by FUNCT_7:32
          .= eval(NN,x) by A335,A338,A346,FUNCT_7:31;
          hence thesis by A338,A346,A333,AFINSQ_1:49;
        end;
        suppose
A347:     ii=7;
          x1.7 = x2.7 by FUNCT_7:32
          .= x3.7 by FUNCT_7:32
          .= x4.7 by FUNCT_7:32
          .= x5.7 by FUNCT_7:32
          .= x6.7 by FUNCT_7:32
          .= x7.7 by FUNCT_7:32
          .= eval(V,x) by A335,A338,A347,FUNCT_7:31;
          hence thesis by A313,A338,A347,A333;
        end;
      end;
      then ff=x8 by A334;
      hence thesis by A289,A169,A317,A318,A320,A322,A325,A328,A330;
    end;
    then
A348: X11 is square & X21 is square  & X31 is square & P1 divides R1 &
      VV>=0 by A166,A314;
    V11-V21-V31-1+1 > 0 by A331,A166,A314;
    then V11-(V21+V31)+ (V21+V31) > 0+(V21+V31) by XREAL_1:8;
    then (4*f1^2 -1)*(r1-m1*S1*T1*U1)^2 + 4*u1^2*S1^2*T1^2 <
    8*f1*u1*S1*T1*(r1-m1*S1*T1*U1) by A311,A87,A312;
    hence thesis by A171,HILB10_8:23,A297,A298,A299,A300,A301,A302,A303,
      A304,A305,A296,A290,A288,A291,A292,A293,A294,A295,A348,A308,
      A307,A306,A309,A310;
  end;
A349: vars Z c= 8
  proof
    let y be object;
    assume y in vars Z;
    then consider b be bag of N such that
A350: b in Support Z & b.y <> 0 by Def5;
    y in dom b = N =Segm N by PARTFUN1:def 2,A350,FUNCT_1:def 2;
    then reconsider y as Nat;
    y in Segm 8 by A168,A350,NAT_1:44;
    hence thesis;
  end;
  vars Z\{1} c= 8\{1} by A349,XBOOLE_1:33;
  then
A351: (vars Z\{1})\/vars X1 c= 8\(Seg 1)\/VARs by A57,XBOOLE_1:13,FINSEQ_1:2;
  vars Z1 c= (vars Z\ {1})\/vars X1 by Th47;
  then
A352:vars Z1 c= 8\Seg 1 \/ VARs by A351;
A353: vars (Four*X2) c= VARs by Th80,A59;
  not 2 in VARs by A1;
  then VARs\{2} = VARs by ZFMISC_1:57;
  then (8\Seg 1 \/ VARs)\{2} = (8\Seg 1\{2}) \/ VARs by XBOOLE_1:42
  .= (8\(Seg 1\/{1+1})) \/ VARs by XBOOLE_1:41
  .= (8\(Seg 2)) \/ VARs by FINSEQ_1:9;
  then vars Z1\{2} c= (8\Seg 2) \/ VARs by A352,XBOOLE_1:33;
  then
A354: (vars Z1\{2})\/vars (Four*X2) c= (8\Seg 2) \/ VARs \/VARs
  = (8\Seg 2) \/ (VARs \/VARs) by A353,XBOOLE_1:4,XBOOLE_1:13;
  vars Z2 c= (vars Z1\{2})\/vars (Four*X2) by Th47;
  then
A355: vars Z2 c= (8\Seg 2) \/ VARs by A354;
A356: vars ((Four*Four)*X3) c= VARs by Th80,A62;
  not 3 in VARs by A1;
  then VARs\{3} = VARs by ZFMISC_1:57;
  then (8\Seg 2 \/ VARs)\{3} = (8\Seg 2\{3}) \/ VARs by XBOOLE_1:42
  .= (8\(Seg 2\/{2+1})) \/ VARs by XBOOLE_1:41
  .= (8\(Seg 3)) \/ VARs by FINSEQ_1:9;
  then vars Z2\{3} c= (8\Seg 3) \/ VARs by A355,XBOOLE_1:33;
  then
A357: (vars Z2\{3})\/vars ((Four*Four)*X3) c= (8\Seg 3) \/ VARs \/VARs
  = (8\Seg 3) \/ (VARs \/VARs) by A356,XBOOLE_1:4,13;
  vars Z3 c= (vars Z2\{3})\/vars ((Four*Four)*X3) by Th47;
  then
A358: vars Z3 c= (8\Seg 3) \/ VARs by A357;
  not 4 in VARs by A1;
  then VARs\{4} = VARs by ZFMISC_1:57;
  then(8\Seg 3 \/ VARs)\{4} = (8\Seg 3\{4}) \/ VARs by XBOOLE_1:42
  .= (8\(Seg 3\/{3+1})) \/ VARs by XBOOLE_1:41
  .= (8\(Seg 4)) \/ VARs by FINSEQ_1:9;
  then vars Z3\{4} c= (8\Seg 4) \/ VARs by A358,XBOOLE_1:33;
  then
A359: (vars Z3\{4})\/(vars R) c= (8\Seg 4) \/ VARs \/VARs
  = (8\Seg 4) \/ (VARs \/VARs) by A66,XBOOLE_1:4,13;
  vars Z4 c= (vars Z3\{4})\/vars R by Th47;
  then
A360: vars Z4 c= (8\Seg 4) \/ VARs by A359;
  not 5 in VARs by A1;
  then VARs\{5} = VARs by ZFMISC_1:57;
  then (8\Seg 4 \/ VARs)\{5} = (8\Seg 4\{5}) \/ VARs by XBOOLE_1:42
  .= (8\(Seg 4\/{4+1})) \/ VARs by XBOOLE_1:41
  .= (8\(Seg 5)) \/ VARs by FINSEQ_1:9;
  then vars Z4\{5} c= (8\Seg 5) \/ VARs by A360,XBOOLE_1:33;
  then
A361: (vars Z4\{5})\/(vars P) c= (8\Seg 5) \/ VARs \/VARs
  = (8\Seg 5) \/ (VARs \/VARs) by A64,XBOOLE_1:4,13;
  vars Z5 c= (vars Z4\{5})\/vars P by Th47;
  then
A362: vars Z5 c= (8\Seg 5) \/ VARs by A361;
  not 6 in VARs by A1;
  then VARs\{6} = VARs by ZFMISC_1:57;
  then (8\Seg 5 \/ VARs)\{6} = (8\Seg 5\{6}) \/ VARs by XBOOLE_1:42
  .= (8\(Seg 5\/{5+1})) \/ VARs by XBOOLE_1:41
  .= (8\(Seg 6)) \/ VARs by FINSEQ_1:9;
  then vars Z5\{6} c= (8\Seg 6) \/ VARs by A362,XBOOLE_1:33;
  then
A363: (vars Z5\{6})\/(vars NN) c= (8\Seg 6) \/ VARs \/VARs
  = (8\Seg 6) \/ (VARs \/VARs) by A103,XBOOLE_1:4,13;
  vars Z6 c= (vars Z5\{6})\/vars NN by Th47;
  then
A364: vars Z6 c= (8\Seg 6) \/ VARs by A363;
  not 7 in VARs by A1;
  then VARs\{7} = VARs by ZFMISC_1:57;
  then (8\Seg 6 \/ VARs)\{7} = (8\Seg 6\{7}) \/ VARs by XBOOLE_1:42
  .= (8\(Seg 6\/{6+1})) \/ VARs by XBOOLE_1:41
  .= (8\(Seg 7)) \/ VARs by FINSEQ_1:9;
  then vars Z6\{7} c= (8\Seg 7) \/ VARs by A364,XBOOLE_1:33;
  then
A365: (vars Z6\{7})\/(vars V) c= (8\Seg 7) \/ VARs \/VARs
  = (8\Seg 7) \/ (VARs \/VARs) by A102,XBOOLE_1:4,13;
A366: vars Z7 c= (vars Z6\{7})\/vars V by Th47;
A367:not 0 in Seg 7 by FINSEQ_1:1;
  7+1 = {0} \/ Seg 7 by AFINSQ_1:4;
  then 8\Seg 7 = ({0} \Seg 7)\/(Seg 7 \Seg 7) by XBOOLE_1:42
  .= {0} by A367,ZFMISC_1:59;
  hence vars Z7 c= {0} \/ VARs by A366,A365;
  let xk be Nat;
  thus thesis by A170;
end;

theorem Th83:
  for L being right_zeroed add-associative right_complementable
       well-unital distributive non trivial doubleLoopStr,
     p being Polynomial of n+m,L st vars p c= n
     ex q being Polynomial of n,L st
        vars q c= n
         & rng q c= rng p &
        (for b be bag of n+m holds b|n in Support q &
         (for i st i >= n holds b.i=0) iff b in Support p)&
        (for b be bag of n+m st b in Support p holds
           q.(b|n) = p.b) &
     for x being Function of (n+m), L,
         y being Function of n, L st x|n=y
       holds eval(p,x) = eval(q,y)
proof
  let L be right_zeroed add-associative right_complementable
  well-unital distributive non trivial doubleLoopStr,
  p be Polynomial of n+m,L;
  assume
A1: vars p c= n;
  defpred P[Nat] means $1 <=m &
  ex q being Polynomial of n+$1,L st
  vars q c= n & rng q c= rng p &
  (for b be bag of n+m holds b|(n+$1) in Support q &
  (for i st i >= n+$1 holds b.i=0)
  iff b in Support p)&
  (for b be bag of n+m st b in Support p holds q.(b|(n+$1)) = p.b) &
  for x being Function of (n+m), L,y being Function of n+$1, L st x|(n+$1)=y
  holds eval(p,x) = eval(q,y);
A2: ex k st P[k]
  proof
    take m;
    thus m <= m;
    take q=p;
    thus vars q c= n & rng q c= rng p by A1;
    thus for b be bag of n+m holds b|(n+m) in Support q
    & (for i st i >= n+m holds b.i=0 ) iff b in Support p
    proof
      let b be bag of n+m;
      for i st i >= n+m holds b.i=0
      proof
        let i;
        assume i >=n+m;
        then not i in Segm (n+m) by NAT_1:44;
        then not i in dom b;
        hence thesis by FUNCT_1:def 2;
      end;
      hence thesis;
    end;
    thus thesis;
  end;
A3:for k being Nat st k <> 0 & P[k] ex n being Nat st n < k & P[n]
  proof
    let k1 be Nat such that
A4: k1 <> 0 & P[k1];
    consider q be Polynomial of n+k1,L such that
A5: vars q c= n and
A6: rng q c= rng p and
A7:   for b be bag of n+m holds b|(n+k1) in Support q
    & (for i st i >= n+k1 holds b.i=0 ) iff b in Support p and
A8: for b be bag of n+m st b in Support p holds q.(b|(n+k1)) = p.b and
A9: for x being Function of (n+m), L,
      y being Function of n+k1, L st x|(n+k1)=y
      holds eval(p,x) = eval(q,y) by A4;
    reconsider k=k1-1 as Nat by A4;
    reconsider q1=q as Polynomial of n+k+1,L;
    take k;
    k1=k+1;
    hence k < k1 by NAT_1:13;
A10: n+(k+1) <= n+m by A4,XREAL_1:7;
A11: Segm(n+k+1) c= Segm(n+m) by A4,XREAL_1:7,NAT_1:39;
A12:k+1 <= m by A4;
    thus k <=m by A12,NAT_1:13;
    take Q=q1 removed_last;
A13: vars Q c= (vars q1)\{n+k} by Th52;
    vars q1\{n+k} c= n\{n+k} c= n by A5,XBOOLE_1:35;
    hence vars Q c= n by A13;
A14:dom Q = Bags (n+k) & dom q1 = Bags (n+k+1) by PARTFUN1:def 2;
    thus rng Q c= rng p
    proof
      let y be object;
      assume y in rng Q;
      then consider x such that
A15:  x in dom Q & Q.x = y by FUNCT_1:def 3;
      reconsider x as Element of Bags(n+k) by A15;
A16:  Q.x = q1.(x bag_extend 0) by Def6;
      q1.(x bag_extend 0) in rng q1 by A14,FUNCT_1:def 3;
      hence thesis by A16,A6,A15;
    end;
A17:n+k < n+k+1 by NAT_1:13;
    then
A18:Segm(n+k) c= Segm(n+k+1) & n+k in Segm(n+k+1) by NAT_1:39,44;
    thus for b be bag of n+m holds b| (n+k) in Support Q &
    (for i st i >= n+k holds b.i=0) iff b in Support p
    proof
      let b be bag of n+m;
      thus b|(n+k) in Support Q & (for i st i >= n+k holds b.i=0)
      implies b in Support p
      proof
        assume
A19:    b|(n+k) in Support Q & (for i st i >= n+k holds b.i=0);
        then reconsider b1=b|(n+k) as Element of Bags(n+k);
        q1.(b1 bag_extend 0) = Q.b1<>0.L by Def6,A19,POLYNOM1:def 3;
        then
A20:    b1 bag_extend 0 in Support q1 by A14,POLYNOM1:def 3;
        b|(n+k+1) is bag of n+k+1
        proof
          per cases by A10,XXREAL_0:1;
          suppose n+k+1=n+m;
            hence thesis;
          end;
          suppose n+k+1<n+m;
            then n+k+1 in Segm(n+m) by NAT_1:44;
            hence thesis by BAGORDER:20;
          end;
        end;
        then reconsider bn=b|(n+k+1) as Element of Bags(n+k+1)
        by PRE_POLY:def 12;
        b.(n+k) = 0 by A19;
        then bn|(n+k) = b1 & bn.(n+k) = 0 by FUNCT_1:49,RELAT_1:74,A18;
        then
A21:    bn in Support q1 by A20,HILBASIS:def 1;
        for i st i >= n+k+1 holds b.i=0
        proof
          let i;
          assume i >= n+k+1;
          then i > n+k by NAT_1:13;
          hence thesis by A19;
        end;
        hence b in Support p by A7,A21;
      end;
      assume
A22:  b in Support p;
      then
A23:  b|(n+k1) in Support q & (for i st i >= n+k1 holds b.i=0 ) by A7;
      then reconsider bn = b|(n+k1) as Element of Bags(n+k+1);
A24:  q.bn<>0.L by A23,POLYNOM1:def 4;
A25:  bn.(n+k) = b.(n+k) by A18,FUNCT_1:49;
      not n+k in Segm n by NAT_1:11,44;
      then
A26:  not n+k in vars p by A1;
      then b.(n+k)=0 by A22,Def5;
      then
A27:  bn = (0,n+k)-cut bn bag_extend 0 by A25,HILB10_2:4;
A28:  n+k-'0 = n+k-0;
      then reconsider c = (0,n+k)-cut bn as Element of Bags(n+k)
      by PRE_POLY:def 12;
      c = bn|(n+k) by HILB10_2:3,A17;
      then
A29:  c = b|(n+k) by RELAT_1:74,A18;
A30:  Q.c = q1.(c bag_extend 0) by Def6;
      for i st i >= n+k holds b.i=0
      proof
        let i;assume i >=n+k;
        then i=n+k or i > n+k by XXREAL_0:1;
        then i=n+k or i >= n+k+1 by NAT_1:13;
        hence thesis by A26,A22,Def5,A7;
      end;
      hence thesis by A30,A27,A28,A24,POLYNOM1:def 4,A29;
    end;
A31: not n+k in Segm n by NAT_1:11,44;
    then
A32:not n+k in vars p by A1;
    thus for b be bag of n+m st b in Support p holds
    Q.(b|(n+k)) = p.b
    proof
      let b be bag of n+m such that
A33:  b in Support p;
      b|(n+k1) in Support q & (for i st i >= n+k1 holds b.i=0 ) by A7,A33;
      then reconsider bn = b|(n+k1) as Element of Bags(n+k+1);
A34:  bn.(n+k) = b.(n+k) by A18,FUNCT_1:49;
      b.(n+k)=0 by A33,Def5,A32;
      then
A35:  bn = (0,n+k)-cut bn bag_extend 0 by A34,HILB10_2:4;
A36:  n+k-'0 = n+k-0;
      then reconsider c = (0,n+k)-cut bn as Element of Bags(n+k)
      by PRE_POLY:def 12;
      c = bn|(n+k) by HILB10_2:3,A17;
      then
A37:  c = b|(n+k) by RELAT_1:74,A18;
      Q.c = q1.bn by Def6,A35,A36;
      hence thesis by A37,A33,A8;
    end;
    let x be Function of (n+m), L,
    y be Function of n+k,L such that
A38: x|(n+k)=y;
A39:rng (x| (n+k+1)) c= the carrier of L by RELAT_1:def 19;
    n+k+1 c= dom x by A11,FUNCT_2:def 1;
    then dom (x|(n+k+1)) = n+k+1 =n+k1 by RELAT_1:62;
    then reconsider z = x| (n+k+1) as Function of n+k1,L by A39,FUNCT_2:2;
A40:eval(p,x) = eval(q,z) by A9;
    z | (n+k) = y by A38,RELAT_1:74,A18;
    hence thesis by A40,A31,A5,Th51;
  end;
  P[0] from NAT_1:sch 7(A2,A3);
  hence thesis;
end;

theorem Th84:
  for X be Ordinal
  for L be non empty ZeroStr
  for s be Series of X,L
  for perm be Permutation of X
    holds vars (s permuted_by perm) c= perm.:vars(s)
proof
  let X be Ordinal;
  let L be non empty ZeroStr;
  let s be Series of X,L;
  let perm be Permutation of X;
  set S=s permuted_by perm;
  let x;
  assume x in vars S;
  then consider b be bag of X such that
A1: b in Support S & b.x <> 0 by Def5;
A2: b*perm in Support s by A1,HILB10_2:21;
  reconsider B=b*perm as bag of X;
A3: x in dom b =X by A1,FUNCT_1:def 2,PARTFUN1:def 2;
  rng perm =X=dom perm by FUNCT_2:def 3,52;
  then consider y be object such that
A4: y in dom perm & perm.y =x by A3,FUNCT_1:def 3;
  y in dom (b*perm) by A4,A3, FUNCT_1:11;
  then B.y <>0 by A1,A4,FUNCT_1:12;
  then y in vars(s) by A2,Def5;
  hence thesis by A4,FUNCT_1:def 6;
end;

::$N Prime Representing Polynomial with 10 Variables

theorem
  ex Poly be INT -valued Polynomial of 10,F_Real st
    for k be positive Nat holds
       k+1 is prime
    iff ex v being natural-valued Function of 10,F_Real st
          v.1 = k & eval(Poly,v) = 0.F_Real
proof
  consider p1 be INT -valued Polynomial of 17,F_Real such that
A1: vars p1 c= {0}\/(17\8) and
A2: for xk be Nat st xk > 0 holds xk+1 is prime iff
    ex x being INT -valued Function of 17, F_Real st
     x/.8 = xk & x/.9 is positive Nat & x/.10 is positive Nat &
     x/.11 is positive Nat & x/.12 is positive Nat & x/.13 is positive Nat &
     x/.14 is Nat & x/.15 is Nat & x/.16 is Nat & x/.0 is Nat &
     eval(p1,x) = 0.F_Real by Th82;
  set N=16,IN=idseq N,E=9,IE=idseq E;
  IN|E =IE by FINSEQ_3:51;
  then consider f be FinSequence such that
A3: IN = IE^f by FINSEQ_1:80;
  set R=f^IE,Z= id {0},RZ=R+*Z;
A4: rng IE misses rng f & f is one-to-one by A3,FINSEQ_3:91;
A5: rng IN = rng IE \/rng f = rng R by A3,FINSEQ_1:31;
A6: R is one-to-one by A4,FINSEQ_3:91;
A7: N= len IN = len IE+len f=len R & len IE = E by A3,FINSEQ_1:22;
  then
A8: dom R = Seg N by FINSEQ_1:def 3;
A9: rng Z = {0} = dom Z;
  not 0 in Seg N by FINSEQ_1:1;
  then rng Z misses rng R by A5,ZFMISC_1:50;
  then
A10: RZ is one-to-one by A6,FUNCT_4:92;
A11: {0}\/Seg N = N+1 by AFINSQ_1:4;
  then
A12: dom RZ = N+1 by A8,A9,FUNCT_4:def 1;
  rng RZ c= rng Z \/rng R by FUNCT_4:17;
  then reconsider RZ as Function of N+1,N+1 by A5,A11,A12,FUNCT_2:2;
  card (N+1) = card (N+1);
  then RZ is onto by A10,FINSEQ_4:63;
  then reconsider RZ as Permutation of 17 by A10;
A13: not 0 in Seg N by FINSEQ_1:1;
A14: {0} c= {0}\/Seg 7 by XBOOLE_1:7;
A15: 16+1 = {0}\/Seg N & 7+1 = {0}\/Seg 7 by AFINSQ_1:4;
  then
A16: 17\8 = ({0}\ ({0}\/Seg 7)) \/ (Seg N \ ({0}\/Seg 7)) by XBOOLE_1:42
  .= {}\/(Seg N\ ({0}\/Seg 7)) by A14
  .= {}\/(Seg N\{0}\Seg 7) by XBOOLE_1:41
  .= Seg N\Seg 7 by A13,ZFMISC_1:57;
A17: not 0 in Seg 7 by FINSEQ_1:1;
  then {0}\Seg 7= {0} & {0} misses Seg 7 by ZFMISC_1:59,50;
  then {0}\/(17\8) = 17\Seg 7 by A15,A16,XBOOLE_1:42;
  then
A18: RZ.: (vars p1) c= RZ.: (17\Seg 7 ) by A1,RELAT_1:123;
A19: Z = 0 .--> 0 = {0}-->0 by FUNCT_4:96,FUNCOP_1:def 9;
  then
A20:RZ.:Seg 7 = R.: Seg 7 by A17,ZFMISC_1:50,BOOLMARK:3;
A21: R.: Seg 7 =(R|7).:Seg 7 by RELAT_1:129
  .=f.:dom f by A7,FINSEQ_1:def 3
  .=rng f by RELAT_1:113;
  RZ.:17= RZ.:dom RZ by A11,A8,A9,FUNCT_4:def 1
  .= rng RZ by RELAT_1:113
  .= 17 by FUNCT_2:def 3;
  then
A22: RZ.:(vars p1) c= 17 \rng f by A18,FUNCT_1:64,A20,A21;
A23: Segm 17 \ rng f c= Segm 10
  proof
    let y be object such that
A24:  y in Segm 17 \ rng f;
    assume
A25:  not y in Segm 10;
    reconsider y as Nat by A24;
A26:  y >=9+1 by A25,NAT_1:44;
    then
A27:  y > 9 by NAT_1:13;
    then reconsider y1=y-9 as Nat by NAT_1:21;
    y < N+1 by A24,NAT_1:44;
    then
A28:  y <= N by NAT_1:13;
    then 9-9 < y-9 <= N-9 by A27,XREAL_1:6;
    then 1<= y1 <= len f by NAT_1:14,A7;
    then
A29:  y1 in dom f by FINSEQ_3:25;
    then
A30:  f.y1 = IN.(y1+E) by A7,A3,FINSEQ_1:def 7;
    1<=y by A26,NAT_1:14;
    then y in Seg N by A28;
    then f.y1 =y by A30,FINSEQ_2:49;
    then y in rng f by A29,FUNCT_1:def 3;
    hence thesis by A24,XBOOLE_0:def 5;
  end;
A31: rng RZ = 17 by FUNCT_2:def 3;
A32: RZ.0=0 by A19,FUNCT_4:113;
A33: 0 in Segm 17 by NAT_1:44;
  then
A34: RZ".0 = 0 by A32,A12,FUNCT_1:32;
A35: for i st 1<=i<=9 holds RZ".i = i+7 & RZ.(i+7) = i
  proof
    let i such that
A36:  1<=i<=9;
A37:  i in dom IE & i in Seg 9 by A36;
    not i+7 in dom Z;
    then
A38:  RZ.(i+7) = R.(i+7) by FUNCT_4:11
    .= IE.i by A37,A7,FINSEQ_1:def 7
    .= i by A37,FINSEQ_2:49;
    i+7<=9+7 by A36,XREAL_1:6;
    then i+7 < 16+1 by NAT_1:13;
    then i+7 in Segm 17 by NAT_1:44;
    hence thesis by A38,A12,FUNCT_1:32;
  end;
  set P2 = p1 permuted_by RZ;
A39: rng P2 = rng p1 c= INT by HILB10_2:26,RELAT_1:def 19;
  then reconsider p2=P2 as INT -valued Polynomial of 10+7,F_Real
  by RELAT_1:def 19;
  vars p2 c= RZ.:(vars p1) by Th84;
  then vars p2 c= Segm 10 by A23,A22;
  then consider p3 be Polynomial of 10,F_Real such that
A40:vars p3 c= 10 & rng p3 c= rng p2 and
  for b be bag of 10+7 holds b|10 in Support p3 &
  (for i st i >= 10 holds b.i=0) iff b in Support p2 and
  for b be bag of 10+7 st b in Support p2 holds
  p3.(b|10) = p2.b and
A41:for x being Function of (10+7), F_Real,
    y being Function of 10, F_Real st x|10=y
    holds eval(p2,x) = eval(p3,y) by Th83;
A42: for xk be Nat st xk > 0 holds
  xk+1 is prime iff ex x being INT -valued Function of 10, F_Real st
  x.0 is Nat &x.1 = xk & x.2 is positive Nat &
  x.3 is positive Nat & x.4 is positive Nat & x.5 is positive Nat &
  x.6 is positive Nat & x.7 is Nat & x.8 is Nat & x.9 is Nat &
  eval(p3,x) = 0.F_Real
  proof
    let xk be Nat such that
A43:  xk > 0;
    thus xk+1 is prime implies
    ex x being INT -valued Function of 10, F_Real st
    x.0 is Nat & x.1 = xk & x.2 is positive Nat & x.3 is positive Nat &
    x.4 is positive Nat & x.5 is positive Nat & x.6 is positive Nat &
    x.7 is Nat & x.8 is Nat & x.9 is Nat & eval(p3,x) = 0.F_Real
    proof
      assume xk+1 is prime;
      then consider x be INT -valued Function of 17, F_Real such that
A44:  x/.8 = xk & x/.9 is positive Nat & x/.10 is positive Nat &
      x/.11 is positive Nat & x/.12 is positive Nat & x/.13 is positive Nat &
      x/.14 is Nat & x/.15 is Nat & x/.16 is Nat & x/.0 is Nat and
A45:  eval(p1,x) = 0.F_Real by A2,A43;
      reconsider xRZ=x*(RZ") as INT -valued Function of 10+7, F_Real;
A46:  dom xRZ = 17 & Segm 10 c= Segm 17 by NAT_1:39,PARTFUN1:def 2;
      then dom (xRZ|10)=10 & rng (xRZ|10)c= rng xRZ c= the carrier of F_Real
      by RELAT_1:62,70;
      then reconsider y = xRZ|10 as INT -valued Function of 10,F_Real
      by FUNCT_2:2;
      take y;
      0 in dom xRZ by A46,NAT_1:44;
      then
A47:  (RZ".0) in dom x by FUNCT_1:11;
      0 in Segm 10 by NAT_1:44;
      then y.0 = xRZ.0 by FUNCT_1:49
      .= x .(RZ".0) by A46,NAT_1:44,FUNCT_1:12
      .= x/.0 by A47,A34,PARTFUN1:def 6;
      hence y.0 is Nat by A44;
A48:  for i st 1<=i<=9 holds y.i = x/.(i+7)
      proof
        let i such that
A49:    1<=i<=9;
A50:    i < 17 by A49,XXREAL_0:2;
        then i in dom xRZ by A46,NAT_1:44;
        then
A51:    i+7 = (RZ".i) in dom x by A49,A35,FUNCT_1:11;
        i<9+1 by A49,NAT_1:13;
        then i in Segm 10 by NAT_1:44;
        hence y.i = xRZ.i by FUNCT_1:49
        .= x.(RZ".i) by A50,A46,NAT_1:44,FUNCT_1:12
        .= x/.(i+7) by A51,PARTFUN1:def 6;
      end;
      then y.1 = x/.(1+7);
      hence y.1 = xk by A44;
A52:  y.2 = x/.(2+7) & y.3 = x/.(3+7) &
      y.4 = x/.(4+7) & y.5 = x/.(5+7) &
      y.6 = x/.(6+7) & y.7 = x/.(7+7) &
      y.8 = x/.(8+7) & y.9 = x/.(9+7) by A48;
      0.F_Real = eval(p2,xRZ) by HILB10_2:25,A45
      .= eval(p3,y) by A41;
      hence thesis by A52,A44;
    end;
    given x being INT -valued Function of 10, F_Real such that
A53: x.0 is Nat & x.1 = xk & x.2 is positive Nat &
    x.3 is positive Nat & x.4 is positive Nat & x.5 is positive Nat &
    x.6 is positive Nat & x.7 is Nat & x.8 is Nat & x.9 is Nat &
    eval(p3,x) = 0.F_Real;
    reconsider X7 = 7-->0 as XFinSequence of REAL;
    reconsider xx7=@x^X7 as 10+7 -element XFinSequence of REAL;
    reconsider XX7= @xx7 as INT -valued Function of 17, F_Real;
A54: len (@x) = 10 by CARD_1:def 7;
A55: (@x^X7)|10 = @x|10 by A54,AFINSQ_1:58
    .= @x;
A56:dom XX7 = 17 by FUNCT_2:def 1;
    XX7*RZ*RZ" = XX7*(RZ*RZ") by RELAT_1:36
    .=XX7*(id 17) by A31,FUNCT_1:39
    .= XX7 by A56,RELAT_1:51;
    then
A57: eval(P2,XX7) = eval(p1,XX7*RZ) by HILB10_2:25;
    ex y being INT -valued Function of 17, F_Real st
    y/.8 = xk & y/.9 is positive Nat & y/.10 is positive Nat &
    y/.11 is positive Nat & y/.12 is positive Nat & y/.13 is positive Nat &
    y/.14 is Nat & y/.15 is Nat & y/.16 is Nat & y/.0 is Nat &
    eval(p1,y) = 0.F_Real
    proof
      take y = XX7*RZ;
A58:  dom y = 17 by FUNCT_2:def 1;
A59:  for i st 1<=i<=9 holds y/.(7+i) = x.i
      proof
        let i such that
A60:    1<=i<=9;
        i+7 <= 9+7 by A60,XREAL_1:6;
        then i+7 < 16+1 by NAT_1:13;
        then
A61:    i+7 in Segm 17 by NAT_1:44;
        then
A62:    y/.(7+i) = y.(7+i) by A58,PARTFUN1:def 6
        .= XX7.(RZ.(7+i)) by A61,A58,FUNCT_1:12;
A63:    i = RZ.(7+i) in dom XX7 by A60,A35,A61,A58,FUNCT_1:11;
        i <9+1 by A60,NAT_1:13;
        then i in Segm 10 by NAT_1:44;
        hence thesis by A63,A62,A54,AFINSQ_1:def 3;
      end;
A64:  0 in Segm 17 by NAT_1:44;
A65:  y/.0 = y.0 by A33,A58,PARTFUN1:def 6
      .= XX7.(RZ.0) by A64,A58,FUNCT_1:12;
A66:  0 in Segm 10 by NAT_1:44;
      x.1 = y/.(1+7)& x.2 = y/.(2+7) & x.3 = y/.(3+7) &
      x.4 = y/.(4+7) & x.5 = y/.(5+7) & x.6 = y/.(6+7) & x.7 = y/.(7+7) &
      x.8 = y/.(8+7) & x.9 = y/.(9+7) by A59;
      hence thesis by A53,A66,A65,A32,A54,AFINSQ_1:def 3,A55,A41,A57;
    end;
    hence thesis by A2,A43;
  end;
  rng p3 c= INT by A39,A40;
  then reconsider p3 as INT -valued Polynomial of 10,F_Real by RELAT_1:def 19;
  set EB = EmptyBag 10,O = 1_(10,F_Real);
  set P2 = Monom(1.F_Real,EB +*(2,1)) + O;
  set P3 = Monom(1.F_Real,EB +*(3,1)) + O;
  set P4 = Monom(1.F_Real,EB +*(4,1)) + O;
  set P5 = Monom(1.F_Real,EB +*(5,1)) + O;
  set P6 = Monom(1.F_Real,EB +*(6,1)) + O;
  reconsider Z2 = Subst(p3,2,P2) as INT -valued Polynomial of 10,F_Real;
  reconsider Z3 = Subst(Z2,3,P3) as INT -valued Polynomial of 10,F_Real;
  reconsider Z4 = Subst(Z3,4,P4) as INT -valued Polynomial of 10,F_Real;
  reconsider Z5 = Subst(Z4,5,P5) as INT -valued Polynomial of 10,F_Real;
  reconsider Z6 = Subst(Z5,6,P6) as INT -valued Polynomial of 10,F_Real;
  take Z6;
  let k be positive Nat;
A67:vars O = {} by Th38;
A68: 6 in Segm 10 by NAT_1:44;
A69: 5 in Segm 10 by NAT_1:44;
A70: vars Monom(1.F_Real,EB +*(5,1)) \/vars O c= {5}\/{} by A67,Th48;
  vars P5 c= vars Monom(1.F_Real,EB +*(5,1)) \/vars O by Th41;
  then vars P5 c= {5} by A70;
  then not 6 in vars P5 by TARSKI:def 1;
  then
A71: 6 in 10\vars P5 by A68,XBOOLE_0:def 5;
A72: 4 in Segm 10 by NAT_1:44;
A73: vars Monom(1.F_Real,EB +*(4,1)) \/vars O c= {4}\/{} by A67,Th48;
  vars P4 c= vars Monom(1.F_Real,EB +*(4,1)) \/vars O by Th41;
  then vars P4 c= {4} by A73;
  then not 5 in vars P4 & not 6 in vars P4 by TARSKI:def 1;
  then
A74: 5 in 10\vars P4 & 6 in 10\vars P4 by A69,A68,XBOOLE_0:def 5;
A75: 3 in Segm 10 by NAT_1:44;
A76: vars Monom(1.F_Real,EB +*(3,1)) \/vars O c= {3}\/{} by A67,Th48;
  vars P3 c= vars Monom(1.F_Real,EB +*(3,1)) \/vars O by Th41;
  then vars P3 c= {3} by A76;
  then not 4 in vars P3 & not 5 in vars P3 & not 6 in vars P3 by TARSKI:def 1;
  then
A77: 4 in 10\vars P3 & 5 in 10\vars P3 & 6 in 10\vars P3
    by A72,A69,A68,XBOOLE_0:def 5;
A78: 2 in Segm 10 by NAT_1:44;
A79: vars Monom(1.F_Real,EB +*(2,1)) \/vars O c= {2}\/{} by A67,Th48;
  vars P2 c= vars Monom(1.F_Real,EB +*(2,1)) \/vars O by Th41;
  then vars P2 c= {2} by A79;
  then not 3 in vars P2 & not 4 in vars P2 & not 5 in vars P2 &
  not 6 in vars P2 by TARSKI:def 1;
  then
A80: 3 in 10\vars P2 & 4 in 10\vars P2 & 5 in 10\vars P2 &
    6 in 10\vars P2 by A75,A72,A69,A68,XBOOLE_0:def 5;
  thus k+1 is prime
  implies ex v being natural-valued Function of 10,F_Real st
  v.1 = k & eval(Z6,v) = 0.F_Real
  proof
    assume k+1 is prime;
    then consider x be INT -valued Function of 10, F_Real such that
A81:x.0 is Nat &
    x.1 = k & x.2 is positive Nat & x.3 is positive Nat &
    x.4 is positive Nat & x.5 is positive Nat & x.6 is positive Nat &
    x.7 is Nat & x.8 is Nat & x.9 is Nat and
A82:eval(p3,x) = 0.F_Real by A42;
    reconsider x0 =x.0,x1=x.1,x7=x.7,x8=x.8,x9=x.9 as Element of NAT
    by A81,ORDINAL1:def 12;
    reconsider x2=x.2-1,x3=x.3-1,x4=x.4-1,x5=x.5-1,x6=x.6-1
    as Element of NAT by A81,NAT_1:20;
    set v = <%x0%>^<%x1%>^<%x2%>^<%x3%>^<%x4%>^<%x5%>^<%x6%>^<%x7%>^<%x8%>;
    set V=v^<%x9%>;
    reconsider VV=@V as natural-valued Function of 10,F_Real;
    take VV;
A83: len v = 9 by AFINSQ_1:50;
A84: len V =Segm 10 by CARD_1:def 7;
A85: 2 in Segm 9 & 3 in Segm 9 & 4 in Segm 9 & 5 in Segm 9 & 6 in Segm 9
    by NAT_1:44;
    set VV6 = VV+*(6,eval(P6,VV));
A86: eval(Z6,VV) =eval(Z5,VV6) by A68,Th37;
A87: eval(P6,VV) = eval(Monom(1.F_Real,EB +*(6,1)),VV) +
    eval(O,VV) by POLYNOM2:23
    .= 1.F_Real * (VV/.6) + eval(O,VV) by A68,Th27
    .= VV/.6+1 by POLYNOM2:21
    .= VV.6 +1 by A84,NAT_1:44,PARTFUN1:def 6
    .= v.6+1 by A85,A83,AFINSQ_1:def 3
    .= x6+1 by AFINSQ_1:50;
    set VV5 = VV6+*(5,eval(P5,VV));
    eval(P5,VV6) = eval(P5,VV) by Th53,A71;
    then
A88: eval(Z5,VV6) =eval(Z4,VV5) by A69,Th37;
A89: eval(P5,VV) = eval(Monom(1.F_Real,EB +*(5,1)),VV) +
    eval(O,VV) by POLYNOM2:23
    .= 1.F_Real * (VV/.5) + eval(O,VV) by A69,Th27
    .= VV/.5+1 by POLYNOM2:21
    .= VV.5 +1 by A84,NAT_1:44,PARTFUN1:def 6
    .= v.5+1 by A85,A83,AFINSQ_1:def 3
    .= x5+1 by AFINSQ_1:50;
    set VV4 = VV5+*(4,eval(P4,VV));
    eval(P4,VV5) = eval(P4,VV6) by Th53,A74
    .=eval(P4,VV) by Th53,A74;
    then
A90: eval(Z4,VV5) =eval(Z3,VV4) by A72,Th37;
A91: eval(P4,VV) = eval(Monom(1.F_Real,EB +*(4,1)),VV) +
    eval(O,VV) by POLYNOM2:23
    .= 1.F_Real * (VV/.4) + eval(O,VV) by A72,Th27
    .= VV/.4+1 by POLYNOM2:21
    .= VV.4 +1 by A84,NAT_1:44,PARTFUN1:def 6
    .= v.4+1 by A85,A83,AFINSQ_1:def 3
    .= x4+1 by AFINSQ_1:50;
    set VV3 = VV4+*(3,eval(P3,VV));
    eval(P3,VV4) = eval(P3,VV5) by Th53,A77
    .= eval(P3,VV6) by Th53,A77
    .=eval(P3,VV) by Th53,A77;
    then
A92: eval(Z3,VV4) =eval(Z2,VV3) by A75,Th37;
A93: eval(P3,VV) = eval(Monom(1.F_Real,EB +*(3,1)),VV) +
    eval(O,VV) by POLYNOM2:23
    .= 1.F_Real * (VV/.3) + eval(O,VV) by A75,Th27
    .= VV/.3+1 by POLYNOM2:21
    .= VV.3 +1 by A84,NAT_1:44,PARTFUN1:def 6
    .= v.3+1 by A85,A83,AFINSQ_1:def 3
    .= x3+1 by AFINSQ_1:50;
    set VV2 = VV3+*(2,eval(P2,VV));
A94: eval(P2,VV3) = eval(P2,VV4) by Th53,A80
    .= eval(P2,VV5) by Th53,A80
    .= eval(P2,VV6) by Th53,A80
    .=eval(P2,VV) by Th53,A80;
A95: eval(P2,VV) = eval(Monom(1.F_Real,EB +*(2,1)),VV) +
    eval(O,VV) by POLYNOM2:23
    .= 1.F_Real * (VV/.2) + eval(O,VV) by A78,Th27
    .= VV/.2+1 by POLYNOM2:21
    .= VV.2 +1 by A84,NAT_1:44,PARTFUN1:def 6
    .= v.2+1 by A85,A83,AFINSQ_1:def 3
    .= x2+1 by AFINSQ_1:50;
A96:Segm 10 =dom VV2 by FUNCT_2:def 1;
    1 in Segm 9 by NAT_1:44;
    then VV.1 = v.1 by A83,AFINSQ_1:def 3
    .= x1 by AFINSQ_1:50;
    hence VV.1 = k by A81;
    for y be object st y in dom VV2 holds x.y = VV2.y
    proof
      let y be object;
      assume
A97:  y in dom VV2;
      then reconsider y as Nat by A84;
      y <9+1 by A97,A84,NAT_1:44;
      then y <= 9 by NAT_1:13;
      then y =0 or...or y=9;
      then per cases;
      suppose
A98:    y=0 or y = 1 or y=7 or y=8 or y =9;
        then
A99:   VV2.y = VV3.y by FUNCT_7:32
        .= VV4.y by A98,FUNCT_7:32
        .= VV5.y by A98,FUNCT_7:32
        .= VV6.y by A98,FUNCT_7:32
        .= VV.y by A98,FUNCT_7:32;
        VV.y = x.y
        proof
          per cases;
          suppose y =9;
            hence thesis;
          end;
          suppose
A100:       y <>9;
            then y in Segm 9 by A98,NAT_1:44;
            hence VV.y = v.y by A83,AFINSQ_1:def 3
            .= x.y by A98,A100,AFINSQ_1:50;
          end;
        end;
        hence thesis by A99;
      end;
      suppose
A101:   y =2 or...or y=6;
A102:   dom VV6 = 10 & dom VV5 = 10 by FUNCT_2:def 1;
A103:   dom VV4 = 10 & dom VV3 = 10 by FUNCT_2:def 1;
        per cases by A101;
        suppose
A104:     y=6;
          then VV2.y = VV3.y by FUNCT_7:32
          .= VV4.y by A104,FUNCT_7:32
          .= VV5.y by A104,FUNCT_7:32
          .= VV6.y by A104,FUNCT_7:32
          .= eval(P6,VV) by A104,A84,NAT_1:44,FUNCT_7:31;
          hence thesis by A87,A104;
        end;
        suppose
A105:     y=5;
          then VV2.y = VV3.y by FUNCT_7:32
          .= VV4.y by A105,FUNCT_7:32
          .= VV5.y by A105,FUNCT_7:32
          .= eval(P5,VV) by A102,A105,A69,FUNCT_7:31;
          hence thesis by A89,A105;
        end;
        suppose
A106:     y=4;
          then VV2.y = VV3.y by FUNCT_7:32
          .= VV4.y by A106,FUNCT_7:32
          .= eval(P4,VV) by A102,A106,A72,FUNCT_7:31;
          hence thesis by A91,A106;
        end;
        suppose
A107:     y=3;
          then VV2.y = VV3.y by FUNCT_7:32
          .= eval(P3,VV) by A103,A107,A75,FUNCT_7:31;
          hence thesis by A93,A107;
        end;
        suppose y=2;
          hence thesis by A95,A103,A78,FUNCT_7:31;
        end;
      end;
    end;
    then x = VV2 by A96;
    hence thesis by A82,A88,A86,A90,A92,A94,A78,Th37;
  end;
  given VV be natural-valued Function of 10,F_Real such that
A108:VV.1 = k & eval(Z6,VV) = 0.F_Real;
A109: dom VV =Segm 10 by FUNCT_2:def 1;
  set VV6 = VV+*(6,eval(P6,VV));
A110: eval(Z6,VV) =eval(Z5,VV6) by A68,Th37;
A111: eval(P6,VV) = eval(Monom(1.F_Real,EB +*(6,1)),VV) +
  eval(O,VV) by POLYNOM2:23
  .= 1.F_Real * (VV/.6) + eval(O,VV) by A68,Th27
  .= VV/.6+1 by POLYNOM2:21
  .= VV.6 +1 by A109,NAT_1:44,PARTFUN1:def 6;
  then reconsider e6=eval(P6,VV) as Element of INT by INT_1:def 1;
  set VV5 = VV6+*(5,eval(P5,VV));
  eval(P5,VV6) = eval(P5,VV) by Th53,A71;
  then
A112: eval(Z5,VV6) =eval(Z4,VV5) by A69,Th37;
A113: eval(P5,VV) = eval(Monom(1.F_Real,EB +*(5,1)),VV) +
  eval(O,VV) by POLYNOM2:23
  .= 1.F_Real * (VV/.5) + eval(O,VV) by A69,Th27
  .= VV/.5+1 by POLYNOM2:21
  .= VV.5 +1 by A109,NAT_1:44,PARTFUN1:def 6;
  then reconsider e5=eval(P5,VV) as Element of INT by INT_1:def 1;
  set VV4 = VV5+*(4,eval(P4,VV));
  eval(P4,VV5) = eval(P4,VV6) by Th53,A74
  .=eval(P4,VV) by Th53,A74;
  then
A114: eval(Z4,VV5) =eval(Z3,VV4) by A72,Th37;
A115: eval(P4,VV) = eval(Monom(1.F_Real,EB +*(4,1)),VV) +
  eval(O,VV) by POLYNOM2:23
  .= 1.F_Real * (VV/.4) + eval(O,VV) by A72,Th27
  .= VV/.4+1 by POLYNOM2:21
  .= VV.4 +1 by A109,NAT_1:44,PARTFUN1:def 6;
  then reconsider e4=eval(P4,VV) as Element of INT by INT_1:def 1;
  set VV3 = VV4+*(3,eval(P3,VV));
  eval(P3,VV4) = eval(P3,VV5) by Th53,A77
  .= eval(P3,VV6) by Th53,A77
  .=eval(P3,VV) by Th53,A77;
  then
A116: eval(Z3,VV4) =eval(Z2,VV3) by A75,Th37;
A117: eval(P3,VV) = eval(Monom(1.F_Real,EB +*(3,1)),VV) +
  eval(O,VV) by POLYNOM2:23
  .= 1.F_Real * (VV/.3) + eval(O,VV) by A75,Th27
  .= VV/.3+1 by POLYNOM2:21
  .= VV.3 +1 by A109,NAT_1:44,PARTFUN1:def 6;
  then reconsider e3=eval(P3,VV) as Element of INT by INT_1:def 1;
  set VV2 = VV3+*(2,eval(P2,VV));
  eval(P2,VV3) = eval(P2,VV4) by Th53,A80
  .= eval(P2,VV5) by Th53,A80
  .= eval(P2,VV6) by Th53,A80
  .=eval(P2,VV) by Th53,A80;
  then
A118: eval(Z2,VV3) =eval(p3,VV2) by A78,Th37;
A119: eval(P2,VV) = eval(Monom(1.F_Real,EB +*(2,1)),VV) +
  eval(O,VV) by POLYNOM2:23
  .= 1.F_Real * (VV/.2) + eval(O,VV) by A78,Th27
  .= VV/.2+1 by POLYNOM2:21
  .= VV.2 +1 by A109,NAT_1:44,PARTFUN1:def 6;
  then reconsider e2=eval(P2,VV) as Element of INT by INT_1:def 1;
  VV2= VV+*(6,e6)+*(5,e5)+*(4,e4)+*(3,e3)+*(2,e2);
  then reconsider VV2 as INT -valued Function of 10, F_Real;
A120:for y be Nat st y=0 or y = 1 or y=7 or y=8 or y =9
  holds VV2.y = VV.y
  proof
    let y be Nat;
    assume
A121: y=0 or y = 1 or y=7 or y=8 or y =9;
    hence VV2.y = VV3.y by FUNCT_7:32
    .= VV4.y by A121,FUNCT_7:32
    .= VV5.y by A121,FUNCT_7:32
    .= VV6.y by A121,FUNCT_7:32
    .= VV.y by A121,FUNCT_7:32;
  end;
  VV.0 is Nat & VV.7 is Nat &VV.8 is Nat & VV.9 is Nat;
  then
A122:VV2.0 is Nat & VV2.7 is Nat & VV2.8 is Nat & VV2.9 is Nat by A120;
A123:VV2.1 = k by A120,A108;
A124:VV2.6 = VV3.6 by FUNCT_7:32
  .= VV4.6 by FUNCT_7:32
  .= VV5.6 by FUNCT_7:32
  .= VV6.6 by FUNCT_7:32
  .= eval(P6,VV) by A109,NAT_1:44,FUNCT_7:31;
A125:dom VV6 = 10 & dom VV5 = 10 by FUNCT_2:def 1;
A126:dom VV4 = 10 & dom VV3 = 10 by FUNCT_2:def 1;
A127:VV2.5 = VV3.5 by FUNCT_7:32
  .= VV4.5 by FUNCT_7:32
  .= VV5.5 by FUNCT_7:32
  .= eval(P5,VV) by A125,A69,FUNCT_7:31;
A128: VV2.4 = VV3.4 by FUNCT_7:32
  .= VV4.4 by FUNCT_7:32
  .= eval(P4,VV) by A125,A72,FUNCT_7:31;
A129: VV2.3 = VV3.3 by FUNCT_7:32
  .= eval(P3,VV) by A126,A75,FUNCT_7:31;
  VV2.2 = VV.2+1 by A119,A126,A78,FUNCT_7:31;
  hence thesis by A42,A122,A123,A124,A127,A113,A128,A129,A117,A108,A115,
    A118,A116,A114,A112,A110,A111;
end;

Messung
CHZG
8010010093

¤ Dauer der Verarbeitung: 1.821 Sekunden  (vorverarbeitet am  2026-11-23) ¤

*© Formatika GbR, Deutschland







                                                                                                                                                                                                                                                                                                                                                                                                     

 

Neuigkeiten

Aktuelles
Motto des Tages

letze Version des Elbe Quellennavigators


letze Version des Demonstrationsprogramms Goedel
letze Version des Bille Abgleichprogramms
Version

Jenseits des Üblichen ....

Besucher

Besucher

Statistik
#Sources=1,187,842
#Domains=881,837