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,c,d,e for Integer;

theorem Th11:
  for a,b,c,d,i1,i2,i3 holds
    {p: a*p.i1 = b*p.i2+c*p.i3+d} is diophantine Subset of n -xtuples_of NAT
proof
  let a,b,c,d be Integer,i1,i2,i3;
  set F=F_Real;
  reconsider ar=a,br=b,cr = c,dr = d as integer Element of F by XREAL_0:def 1;
  set D = {p: a*p.i1 = b*p.i2+c*p.i3+d};
  D c= n -xtuples_of NAT
  proof
    let y be object;
    assume y in D;
    then ex p st y=p & a*p.i1 = b*p.i2+c*p.i3+d;
    hence thesis by HILB10_2:def 5;
  end;
  then reconsider D as Subset of n -xtuples_of NAT;
  per cases;
  suppose n=0;
    then D is diophantine Subset of n -xtuples_of NAT;
    hence thesis;
  end;
  suppose A1: n<>0;
    set Q= ar*1_1(i1,F) - br*1_1(i2,F)- cr*1_1(i3,F) -dr*1_(n,F);
    reconsider Q as INT -valued Polynomial of n+0,F_Real;
    for s be object holds
      s in D iff ex x be n-element XFinSequence of NAT,
      y be 0-element XFinSequence of NAT st
      s=x &  eval(Q,@(x^y)) = 0
    proof
      let s be object;
      thus s in D implies ex x be n-element XFinSequence of NAT,
        y be 0-element XFinSequence of NAT st
        s=x &  eval(Q,@(x^y)) = 0
      proof
        assume s in D;
        then consider p such that
        A2: s=p & a*p.i1 = b*p.i2+c*p.i3+d;
        reconsider Z=<%>NAT as 0-element XFinSequence of NAT;
        take pZ=p,Z;
        A3: eval(dr*1_(n,F),@p) = dr*eval(1_(n,F),@p) by POLYNOM7:29
        .= dr* 1.F by POLYNOM2:21
        .= d;
        A4:eval(ar*1_1(i1,F),@p) = ar*eval(1_1(i1,F),@p) by POLYNOM7:29
        .= a*(p.i1) by A1,Th1;
        A5:eval(br*1_1(i2,F),@p) =
        br*eval(1_1(i2,F),@p) by POLYNOM7:29
        .= b*(p.i2) by A1,Th1;
        A6:eval(cr*1_1(i3,F),@p) =
        cr*eval(1_1(i3,F),@p) by POLYNOM7:29
        .= c*(p.i3) by A1,Th1;
        eval(Q,@(p^Z)) = eval(ar*1_1(i1,F) -
        br*1_1(i2,F)- cr*1_1(i3,F),@p) -eval(dr*1_(n,F),@p) by POLYNOM2:24
        .= eval(ar*1_1(i1,F) - br*1_1(i2,F),@p)
        - eval(cr*1_1(i3,F),@p)-eval(dr*1_(n,F),@p) by POLYNOM2:24
        .= eval(ar*1_1(i1,F),@p) - eval(br*1_1(i2,F),@p)
        - eval(cr*1_1(i3,F),@p)-eval(dr*1_(n,F),@p) by POLYNOM2:24
        .= 0 by A2,A3,A4,A5,A6;
        hence thesis by A2;
      end;
      given p be n-element XFinSequence of NAT,
      Z be 0-element XFinSequence of NAT such that
      A7: s=p & eval(Q,@(p^Z)) = 0;
      A8: eval(dr*1_(n,F),@p) = dr*eval(1_(n,F),@p) by POLYNOM7:29
      .= dr* 1.F by POLYNOM2:21
      .= d;
      A9:eval(ar*1_1(i1,F),@p) = ar*eval(1_1(i1,F),@p) by POLYNOM7:29
      .= a*(p.i1) by A1,Th1;
      A10:eval(br*1_1(i2,F),@p) =
      br*eval(1_1(i2,F),@p) by POLYNOM7:29
      .= b*(p.i2) by A1,Th1;
      A11:eval(cr*1_1(i3,F),@p) =
      cr*eval(1_1(i3,F),@p) by POLYNOM7:29
      .= c*(p.i3) by A1,Th1;
      eval(Q,@(p^Z))
      = eval(ar*1_1(i1,F) - br*1_1(i2,F)- cr*1_1(i3,F),@p)
      -eval(dr*1_(n,F),@p) by POLYNOM2:24
      .= eval(ar*1_1(i1,F) - br*1_1(i2,F),@p)
      - eval(cr*1_1(i3,F),@p)-eval(dr*1_(n,F),@p) by POLYNOM2:24
      .=     eval(ar*1_1(i1,F),@p) - eval(br*1_1(i2,F),@p)
      - eval(cr*1_1(i3,F),@p)-eval(dr*1_(n,F),@p) by POLYNOM2:24
      .= a*(p.i1) - b*(p.i2) - c*(p.i3) -d by A8,A9,A10,A11;
      then a*p.i1 = b*p.i2+c*p.i3+d by A7;
      hence thesis by A7;
    end;
    then D is diophantine;
    hence thesis;
  end;
end;
