reserve i,j,n,n1,n2,m,k,l,u for Nat,
        r,r1,r2 for Real,
        x,y for Integer,
        a,b for non trivial Nat,
        F for XFinSequence,
        cF,cF1,cF2 for complex-valued XFinSequence,
        c,c1,c2 for Complex;
reserve x,y,x1,u,w for Nat;

theorem Th19:
  for x1,w,u being Nat st x1*w,1 are_congruent_mod u
    for x being Nat holds
  Product (1+(x1 * idseq x)), x1|^x * (x!) * ((w+x) choose x)
    are_congruent_mod u
proof
  let x1,w,u be Nat such that
A1: x1*w,1 are_congruent_mod u;
  consider b be Integer such that
A2:  u*b = x1*w-1 by A1, INT_1:def 5;
  defpred P[Nat] means
    Product (1+(x1*(idseq $1))), x1|^$1 * ($1!) * ((w+$1) choose $1)
    are_congruent_mod u;
  x1|^0=1 & 0! =1 & (w+0) choose 0 =1 by NEWTON:4,12,19;
  then
A3: P[0] by RVSUM_1:94,INT_1:11;
A4: P[n] implies P[n+1]
  proof set n1=n+1;
    set P = Product (1+(x1*(idseq n)));
    set L=x1|^n * (n!) * ((w+n) choose n);
    assume P[n];
    then consider a be Integer such that
A5:   u*a = P - L by INT_1:def 5;
A6: (1+x1*<*n1*>) = 1+<*x1*n1*> by RVSUM_1:47
      .= <*1+x1*n1*> by BASEL_1:2;
    idseq n1 = (idseq n)^<*n+1*> by FINSEQ_2:51;
    then x1*(idseq n1) = (x1*(idseq n))^(x1*<*n+1*>) by NEWTON04:43;
    then
A7:   1+ x1*(idseq n1) = (1+x1*(idseq n))^(1+x1*<*n+1*>) by BASEL_1:3;
    w+n>= n & w+n-n=w by NAT_1:11;
    then (w+n) choose n = (w+n)! / ((n!)*(w!)) by NEWTON:def 3;
    then
A8: n! * ((w+n) choose n) = (n!)*((w+n)!) / ((n!) *(w!)) by XCMPLX_1:74
      .= ((w+n)!) / (w!) by XCMPLX_1:91;
    w+n1>= n1 & w+n1-n1=w by NAT_1:11;
    then (w+n1) choose n1 = (w+n1)! / ((n1!)*(w!)) by NEWTON:def 3;
    then
A9:    n1! * ((w+n1) choose n1) = (n1!)*((w+n1)!) / ((n1!) *(w!))
       by XCMPLX_1:74
       .= ((w+n+1)!) / (w!) by XCMPLX_1:91
       .= ((w+n)!*(w+n+1)) / (w!) by NEWTON:15
       .= (w+n+1)* (((w+n)!)/ (w!)) by XCMPLX_1:74
       .= (w+n1) * (n!) * ((w+n) choose n) by A8;
    x1|^n1 = x1 |^n * x1 by NEWTON:6;
    then x1|^n1 * (n1!) * ((w+n1) choose n1)
       = x1|^n*x1 * ((n1!) * ((w+n1) choose n1))
      .= x1|^n*x1 * ((w+n+1) * (n!) * ((w+n) choose n)) by A9
      .= (w+n1) * x1 * L;
    then Product (1+(x1*(idseq n1))) - x1|^n1 * (n1!) * ((w+n1) choose n1)
    = P * (1+x1*n1) - x1*(w+n1) * L by A7,A6,RVSUM_1:96
    .= P * (1+x1*n1) - (x1*w*L) -( x1*n1*L)
    .= P * (1+x1*n1) - (u*b+1)*L -( x1*n1*L) by A2
    .= (P -L )* (1+x1*n1) - (u*b*1)*L
    .= u*a*(1+x1*n1)-  u*b*L by A5
    .= u*(a*(1+x1*n1)-  b*L);
    hence thesis by INT_1:def 5;
  end;
  P[n] from NAT_1:sch 2(A3,A4);
  hence thesis;
end;
