reserve i,i1,i2,i3,i4,i5,j,r,a,b,x,y for Integer,
  d,e,k,n for Nat,
  fp,fk for FinSequence of INT,
  f,f1,f2 for FinSequence of REAL,
  p for Prime;
reserve fr for FinSequence of REAL;
reserve fr,f for FinSequence of INT;

theorem Th8:
  for fp st len fp = n+1 & p>2 & not p divides fp.(n+1) holds for
fr st (for d st d in dom fr holds (Poly-INT fp).(fr.d) mod p=0) & (for d,e st d
  in dom fr & e in dom fr & d<>e holds not fr.d,fr.e are_congruent_mod p) holds
  len fr <= n
proof
  defpred P[Nat] means for fp st len fp = $1+1 & p>2 & not p divides fp.($1+1)
holds for fr st (for d st d in dom fr holds (Poly-INT fp).(fr.d) mod p = 0) & (
  for d,e st d in dom fr & e in dom fr & d<>e holds not fr.d,fr.e
  are_congruent_mod p) holds len fr <= $1;
A1: for n st P[n] holds P[n+1]
  proof
    let n;
    assume
A2: P[n];
    let fp;
    assume that
A3: len fp = (n+1)+1 and
A4: p>2 and
A5: not p divides fp.(n+1+1);
    per cases;
    suppose
A6:   for x holds (Poly-INT fp).x mod p <> 0;
      assume ex fr st (for d st d in dom fr holds (Poly-INT fp).(fr.d) mod p
      =0) & (for d,e st d in dom fr & e in dom fr & d<>e holds not fr.d,fr.e
      are_congruent_mod p) & len fr > n+1;
      then consider fr such that
A7:   for d st d in dom fr holds (Poly-INT fp).(fr.d) mod p=0 and
      for d,e st d in dom fr & e in dom fr & d<>e holds not fr.d,fr.e
      are_congruent_mod p and
A8:   len fr > n+1;
      fr <> {} by A8;
      then (Poly-INT fp).(fr.1) mod p=0 by A7,FINSEQ_5:6;
      hence contradiction by A6;
    end;
    suppose
      ex a being Integer st (Poly-INT fp).a mod p = 0;
      then consider a being Integer such that
A9:   (Poly-INT fp).a mod p=0;
      assume ex f st (for d st d in dom f holds (Poly-INT fp).(f.d) mod p =
      0) & (for d,e st d in dom f & e in dom f & d<>e holds not f.d,f.e
      are_congruent_mod p) & len f > n+1;
      then consider f such that
A10:  for d st d in dom f holds (Poly-INT fp).(f.d) mod p = 0 and
A11:  for d,e st d in dom f & e in dom f & d<>e holds not f.d,f.e
      are_congruent_mod p and
A12:  len f > n+1;
      consider fk,r such that
A13:  len fk = n+1 and
A14:  for x being Element of INT holds (Poly-INT fp).x =(x-a)*(
      Poly-INT fk).x +r and
A15:  fp.(n+2)=fk.(n+1) by A3,Th6;
      a is Element of INT by INT_1:def 2;
      then
A16:  (Poly-INT fp).a mod p =((a-a)*(Poly-INT fk).a +r) mod p by A14
        .= r mod p;
A17:  for d being Element of NAT st d in dom f holds p divides (f.d -a)*(
      Poly-INT fk).(f.d)
      proof
        let d be Element of NAT;
        f.d is Element of INT by INT_1:def 2;
        then
A18:    (Poly-INT fp).(f.d) mod p = (((f.d-a)*(Poly-INT fk).(f.d)) +r)
        mod p by A14
          .=(((f.d-a)*(Poly-INT fk).(f.d)) mod p + (r mod p)) mod p by NAT_D:66
          .= ((f.d-a)*(Poly-INT fk).(f.d)) mod p by A9,A16,NAT_D:65;
        assume d in dom f;
        then ((f.d-a)*(Poly-INT fk).(f.d)) mod p = 0 by A10,A18;
        hence thesis by INT_1:62;
      end;
      per cases;
      suppose
A19:    for d st d in dom f holds not p divides (f.d - a);
        for d st d in dom f holds (Poly-INT fk).(f.d) mod p = 0
        proof
          let d;
          assume
A20:      d in dom f;
          then p divides (f.d -a)*(Poly-INT fk).(f.d) by A17;
          then p divides (f.d -a) or p divides (Poly-INT fk).(f.d) by Th7;
          hence thesis by A19,A20,INT_1:62;
        end;
        then len f <= n by A2,A4,A5,A13,A15,A11;
        hence contradiction by A12,XREAL_1:145;
      end;
      suppose
        ex d st d in dom f & p divides (f.d - a);
        then consider d9 being Element of NAT such that
A21:    d9 in dom f and
A22:    p divides (f.d9 - a);
        set f9 = f - {f.d9};
A23:    for d st d in dom f9 holds not p divides (f9.d - a)
        proof
          given k being Nat such that
A24:      k in dom f9 and
A25:      p divides (f9.k -a);
          f9.k in rng f9 by A24,FUNCT_1:3;
          then
A26:      f9.k in rng f \ {f.d9} by FINSEQ_3:65;
          then f9.k in rng f by XBOOLE_0:def 5;
          then consider w being object such that
A27:      w in dom f and
A28:      f.w = f9.k by FUNCT_1:def 3;
          reconsider w as Element of NAT by A27;
          p divides ((f.w - a)-(f.d9 - a)) by A22,A25,A28,Th1; then
A29:      f.w,f.d9 are_congruent_mod p;
          not f9.k in {f.d9} by A26,XBOOLE_0:def 5;
          then w <> d9 by A28,TARSKI:def 1;
          hence contradiction by A11,A21,A27,A29;
        end;
A30:    for d st d in dom f9 holds (Poly-INT fk).(f9.d) mod p = 0
        proof
          let d;
          assume
A31:      d in dom f9;
          then f9.d in rng f9 by FUNCT_1:3;
          then f9.d in rng f \ {f.d9} by FINSEQ_3:65;
          then f9.d in rng f by XBOOLE_0:def 5;
          then ex w being object st w in dom f & f.w = f9.d by FUNCT_1:def 3;
          then p divides (f9.d -a)*(Poly-INT fk).(f9.d) by A17;
          then p divides (f9.d -a) or p divides (Poly-INT fk).(f9.d) by Th7;
          hence thesis by A23,A31,INT_1:62;
        end;
A32:    f is one-to-one
        by A11,INT_1:11;
        then
A33:    f9 is one-to-one by FINSEQ_3:87;
A34:    for d,e st d in dom f9 & e in dom f9 & d<>e holds not f9.d,f9.e
        are_congruent_mod p
        proof
          let d,e;
          assume that
A35:      d in dom f9 and
A36:      e in dom f9 and
A37:      d<>e;
          f9.e in rng f9 by A36,FUNCT_1:3;
          then f9.e in rng f \ {f.d9} by FINSEQ_3:65;
          then f9.e in rng f by XBOOLE_0:def 5;
          then consider w2 being object such that
A38:      w2 in dom f and
A39:      f9.e = f.w2 by FUNCT_1:def 3;
          f9.d in rng f9 by A35,FUNCT_1:3;
          then f9.d in rng f \ {f.d9} by FINSEQ_3:65;
          then f9.d in rng f by XBOOLE_0:def 5;
          then consider w1 being object such that
A40:      w1 in dom f and
A41:      f9.d = f.w1 by FUNCT_1:def 3;
          reconsider w1,w2 as Element of NAT by A40,A38;
          w1 <> w2 by A33,A35,A36,A37,A41,A39;
          hence thesis by A11,A40,A41,A38,A39;
        end;
        f.d9 in rng f by A21,FUNCT_1:3;
        then len f9 = len f - 1 by A32,FINSEQ_3:90;
        then len f9 > (n+1)-1 by A12,XREAL_1:9;
        hence contradiction by A2,A4,A5,A13,A15,A30,A34;
      end;
    end;
  end;
A42: P[0]
  proof
    let fp;
    assume that
A43: len fp = 0+1 and
    p>2 and
A44: not p divides fp.(0+1);
    assume ex fr st (for d st d in dom fr holds (Poly-INT fp).(fr.d) mod p=0)
    & (for d,e st d in dom fr & e in dom fr & d<>e holds not fr.d,fr.e
    are_congruent_mod p) & len fr > 0;
    then consider fr such that
A45: for d st d in dom fr holds (Poly-INT fp).(fr.d) mod p=0 and
    for d,e st d in dom fr & e in dom fr & d<>e holds not fr.d,fr.e
    are_congruent_mod p and
A46: len fr > 0;
    fr <> {} by A46;
    then
A47: (Poly-INT fp).(fr.1) mod p=0 by A45,FINSEQ_5:6;
A48: fr.1 in INT by INT_1:def 2;
    (Poly-INT fp).(fr.1) = (INT --> fp.1).(fr.1) by A43,Th3
      .= fp.1 by A48,FUNCOP_1:7;
    hence contradiction by A44,A47,Lm1;
  end;
  for n holds P[n] from NAT_1:sch 2(A42,A1);
  hence thesis;
end;
