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;
reserve n,m,k for Nat,
        p,q for n-element XFinSequence of NAT,
        i1,i2,i3,i4,i5,i6 for Element of n,
        a,b,d,f for Integer;

theorem Th29:
  for i1,i2,i3 st n <> 0 holds {p: p.i1 >= p.i3 & p.i2 = p.i1 choose p.i3}
    is diophantine Subset of n -xtuples_of NAT
proof
  let i1,i2,i3;set n6=n+6;
  defpred R[XFinSequence of NAT] means
    $1.i1 >= $1.i3 & $1.i2 = $1.i1 choose $1.i3;
  set RR = {p: R[p]};
  assume A1: n<>0;
    n=n+0;then
    reconsider X=i1,Y=i2,Z=i3,U=n,V=n+1,Y1=n+2,Y2=n+3,Y3=n+4,U1=n+5
    as Element of n+6 by HILB10_3:2,3;
    defpred P1[XFinSequence of NAT] means $1.Y1 = ($1.X) |^ ($1.Z);
A2: {p where p is n6-element XFinSequence of NAT:P1[p]}
        is diophantine Subset of n6 -xtuples_of NAT by HILB10_3:24;
    defpred P2[XFinSequence of NAT] means $1.Y2 = ($1.U1) |^ ($1.X);
A3: {p where p is n6-element XFinSequence of NAT:P2[p]}
        is diophantine Subset of n6 -xtuples_of NAT by HILB10_3:24;
    defpred P3[XFinSequence of NAT] means $1.Y3 = ($1.U) |^ ($1.Z);
A4: {p where p is n6-element XFinSequence of NAT:P3[p]}
        is diophantine Subset of n6 -xtuples_of NAT by HILB10_3:24;
    defpred P4[XFinSequence of NAT] means 1*$1.U > 1*$1.Y1+0;
A5: {p where p is n6-element XFinSequence of NAT:P4[p]}
        is diophantine Subset of n6 -xtuples_of NAT by HILB10_3:7;
    defpred P5[XFinSequence of NAT] means
        1*$1.V = [\ (1*$1.Y2) / (1*$1.Y3) /] & (1*$1.Y3) <> 0;
A6: {p where p is n6-element XFinSequence of NAT:P5[p]}
        is diophantine Subset of n6 -xtuples_of NAT by Th28;
    defpred P6[XFinSequence of NAT] means
              1*$1.Y, 1*$1.V are_congruent_mod 1*$1.U;
A7: {p where p is n6-element XFinSequence of NAT:P6[p]}
        is diophantine Subset of n6 -xtuples_of NAT by HILB10_3:21;
    defpred P7[XFinSequence of NAT] means 1*$1.U > 1*$1.Y+0;
A8: {p where p is n6-element XFinSequence of NAT:P7[p]}
        is diophantine Subset of n6 -xtuples_of NAT by HILB10_3:7;
    defpred P8[XFinSequence of NAT] means
              1*$1.X >= 1*$1.Z+0;
A9:{p where p is n6-element XFinSequence of NAT:P8[p]}
        is diophantine Subset of n6 -xtuples_of NAT by HILB10_3:8;
    defpred P9[XFinSequence of NAT] means
              1*$1.U1 = 1*$1.U+1;
A10:{p where p is n6-element XFinSequence of NAT:P9[p]}
        is diophantine Subset of n6 -xtuples_of NAT by HILB10_3:6;
    defpred P12[XFinSequence of NAT] means P1[$1] & P2[$1];
A11:{p where p is n6-element XFinSequence of NAT:P12[p]}
        is diophantine Subset of n6 -xtuples_of NAT from HILB10_3:sch 3(A2,A3);
    defpred P123[XFinSequence of NAT] means P12[$1] & P3[$1];
A12:{p where p is n6-element XFinSequence of NAT:P123[p]}
        is diophantine Subset of n6 -xtuples_of NAT
      from HILB10_3:sch 3(A11,A4);
    defpred P1234[XFinSequence of NAT] means P123[$1] & P4[$1];
A13:{p where p is n6-element XFinSequence of NAT:P1234[p]}
        is diophantine Subset of n6 -xtuples_of NAT
      from HILB10_3:sch 3(A12,A5);
    defpred P12345[XFinSequence of NAT] means P1234[$1] & P5[$1];
A14:{p where p is n6-element XFinSequence of NAT:P12345[p]}
        is diophantine Subset of n6 -xtuples_of NAT
      from HILB10_3:sch 3(A13,A6);
    defpred P123456[XFinSequence of NAT] means P12345[$1] & P6[$1];
A15:{p where p is n6-element XFinSequence of NAT:P123456[p]}
       is diophantine Subset of n6 -xtuples_of NAT
     from HILB10_3:sch 3(A14,A7);
   defpred P1234567[XFinSequence of NAT] means P123456[$1] & P7[$1];
A16:{p where p is n6-element XFinSequence of NAT:P1234567[p]}
       is diophantine Subset of n6 -xtuples_of NAT
     from HILB10_3:sch 3(A15,A8);
   defpred P12345678[XFinSequence of NAT] means P1234567[$1] & P8[$1];
A17:{p where p is n6-element XFinSequence of NAT:P12345678[p]}
       is diophantine Subset of n6 -xtuples_of NAT
     from HILB10_3:sch 3(A16,A9);
   defpred P123456789[XFinSequence of NAT] means P12345678[$1] & P9[$1];
   set PP = {p where p is n6-element XFinSequence of NAT:P123456789[p]};
A18:PP is diophantine Subset of n6 -xtuples_of NAT
     from HILB10_3:sch 3(A17,A10);
   reconsider PPn = {p|n where p is n6-element XFinSequence of NAT: p in PP}
     as diophantine Subset of n -xtuples_of NAT by NAT_1:11,HILB10_3:5,A18;
A19: PPn c= RR
     proof
       let x be object;
       assume x in PPn;
       then consider p be n6-element XFinSequence of NAT such that
A20:     x = p|n & p in PP;
       ex q be n6-element XFinSequence of NAT st q=p & P123456789[q] by A20;
       then
A21:     p.X>=p.Z & p.Y = p.X choose p.Z by Th16;
       (p|n).X = p.i1 & (p|n).Y = p.i2 & (p|n).Z = p.i3 by A1,HILB10_3:4;
       hence thesis by A21,A20;
     end;
     RR c= PPn
     proof
       let x be object;
       assume x in RR;
       then consider p such that
A22:     x=p & R[p];
       consider u,v,y1,y2,y3 be Nat such that
A23:     y1 = (p.i1)|^p.i3 & y2 = (u+1)|^p.i1 & y3 = u|^(p.i3) &
         u > y1 & v = [\y2/y3/] & p.i2,v are_congruent_mod u &
         p.i2 < u & p.i1 >=p.i3 by A22,Th16;
       reconsider u1=u+1 as Element of NAT;
       reconsider u,v,y1,y2,y3 as Element of NAT by ORDINAL1:def 12;
       set Y = <%u%>^<%v%>^<%y1%>^<%y2%>^<%y3%>^<%u1%>;
       set PY = p ^ Y;
A24:   len p = n & len Y = 6 by CARD_1:def 7;
A25:   PY|n =p by A24,AFINSQ_1:57;
A26:   PY.i3 = (PY|n).i3 by A1,HILB10_3:4
         .= p.i3 by A24,AFINSQ_1:57;
       0 in dom Y by AFINSQ_1:66;
       then
A27:     PY.(n+0) = Y.0 by A24,AFINSQ_1:def 3
         .= u by AFINSQ_1:47;
       1 in dom Y by A24,AFINSQ_1:66;
       then
A28:     PY.(n+1) = Y.1 by A24,AFINSQ_1:def 3
         .= v by AFINSQ_1:47;
       2 in dom Y by A24,AFINSQ_1:66;
       then
A29:     PY.(n+2) = Y.2 by A24,AFINSQ_1:def 3
         .= y1 by AFINSQ_1:47;
       3 in dom Y by A24,AFINSQ_1:66;
       then
A30:     PY.(n+3) = Y.3 by A24,AFINSQ_1:def 3
         .= y2 by AFINSQ_1:47;
       4 in dom Y by A24,AFINSQ_1:66;
       then
A31:     PY.(n+4) = Y.4 by A24,AFINSQ_1:def 3
         .= y3 by AFINSQ_1:47;
       5 in dom Y by A24,AFINSQ_1:66;
       then
A32:     PY.(n+5) = Y.5 by A24,AFINSQ_1:def 3
         .= u1 by AFINSQ_1:47;
       P123456789[PY] by A23,A25,A1,HILB10_3:4,A26,A27,A28,A29,A30,A31,A32;
       then PY in PP;
       hence thesis by A25,A22;
     end;
     hence thesis by A19,XBOOLE_0:def 10;
end;
