reserve n for Nat,
        i,j,i1,i2,i3,i4,i5,i6 for Element of n,
        p,q,r for n-element XFinSequence of NAT;
reserve i,j,n,n1,n2,m,k,l,u,e,p,t for Nat,
        a,b for non trivial Nat,
        x,y for Integer,
        r,q for Real;

theorem Th13:
  Px(a,n), p|^n + Py(a,n)*(a-p) are_congruent_mod  2*a*p-p^2-1
proof
  set D=a^2-'1;
  set P=2*a*p-p^2-1;
  defpred T[Nat] means
    Px(a,$1) -  Py(a,$1)*(a-p), p|^$1 are_congruent_mod  P;
  defpred P[Nat] means T[$1] & T[$1+1];
A1:P[0]
  proof
A2: Px(a,0)= 1 & Py(a,0)= 0 & p|^0 =1 by HILB10_1:3,NEWTON:4;
    Px(a,0+1) = Px(a,0)*a + Py(a,0)*D &
    Py(a,0+1) = Px(a,0) + Py(a,0)*a by HILB10_1:6;
    hence thesis by A2,INT_1:11;
  end;
A3:P[k] implies P[k+1]
  proof
    set k1=k+1,k2=k1+1;
    set X = Px(a,k), X1=Px(a,k1),X2=Px(a,k2);
    set Y = Py(a,k), Y1=Py(a,k1),Y2=Py(a,k2);
    assume
A4:   P[k];
    k2=k+2;
    then
A5:   X2 = 2*a*X1 - X & Y2 = 2*a*Y1 - Y by Th12;
A6:   2*a,2*a are_congruent_mod 2*a*p-p^2-1 by INT_1:11;
A7:   2*a*(X1 -  Y1*(a-p)), 2*a*(p|^k1) are_congruent_mod P
      by A4,A6,INT_1:18;
    X2 - Y2*(a-p) = 2*a*(X1- Y1*(a-p)) - (X- Y*(a-p)) by A5;
    then
A8:   X2 - Y2*(a-p),  2*a*(p|^k1)-(p|^k) are_congruent_mod P
      by A7,A4,INT_1:17;
A9:  p|^k1= p*p|^k by NEWTON:6;
A10:(p^2)*(p|^k) = (p|^k)*(p|^2) by NEWTON:81
                .= p|^ (k+2) by NEWTON:8;
A11: P = 2*a*p-1-p^2;
    2*a*p -1, p^2 are_congruent_mod P &
    (p|^k),(p|^k) are_congruent_mod P by A11,INT_1:def 4,11;
    then (2*a*p -1)*(p|^k), p|^k2 are_congruent_mod P by A10,INT_1:18;
    hence thesis by A4,A9,A8,INT_1:15;
  end;
  P[k] from NAT_1:sch 2(A1,A3);
  then P divides Px(a,n)-Py(a,n)*(a-p) - p|^n by INT_1:def 4;
  then P divides Px(a,n)- (p|^n + Py(a,n)*(a-p));
  hence thesis by INT_1:def 4;
end;
