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 Th19:
  for a,b,c,i1,i2,i3 holds
   {p: a* p.i1 = b*p.i2-' c*p.i3} is diophantine Subset of n -xtuples_of NAT
proof
  let a,b,c be Integer,i1,i2,i3;
  defpred P[XFinSequence of NAT] means a*$1.i1 = b*$1.i2+(- c)*$1.i3+0;
  defpred Q[XFinSequence of NAT] means b*$1.i2>= c*$1.i3+0;
  defpred R[XFinSequence of NAT] means a*$1.i1 = 0*$1.i2*$1.i3;
  defpred S[XFinSequence of NAT] means b*$1.i2+0 < c*$1.i3;
  defpred PQ[XFinSequence of NAT] means P[$1] & Q[$1];
  A1:{p: P[p]} is diophantine Subset of n -xtuples_of NAT by Th11;
  A2:{p: Q[p]} is diophantine Subset of n -xtuples_of NAT by Th8;
  {p: P[p] &  Q[p]} is diophantine Subset of n -xtuples_of NAT
     from IntersectionDiophantine(A1,A2);
  then A3: {p: PQ[p]} is diophantine Subset of n -xtuples_of NAT;
  defpred RS[XFinSequence of NAT] means R[$1] & S[$1];
  A4:{p: R[p]} is diophantine Subset of n -xtuples_of NAT by Th9;
  A5:{p: S[p]} is diophantine Subset of n -xtuples_of NAT by Th7;
  {p: R[p] &  S[p]} is diophantine Subset of n -xtuples_of NAT
    from IntersectionDiophantine(A4,A5);
  then A6: {p: RS[p]} is diophantine Subset of n -xtuples_of NAT;
  defpred PQRS[XFinSequence of NAT] means PQ[$1] or RS[$1];
  defpred T[XFinSequence of NAT] means  a* $1.i1 = b*$1.i2-' c*$1.i3;
  A7: {p:PQ[p] or RS[p]} is diophantine Subset of n -xtuples_of NAT
  from UnionDiophantine(A3,A6);
  A8: PQRS[p] iff T[p]
  proof
    thus PQRS[p] implies T[p]
    proof
      assume PQRS[p];
      then (a* p.i1 = b*p.i2+(- c)*p.i3+0 & b*p.i2- c*p.i3>=0) or
      (a*p.i1 = 0*p.i2*p.i3 & b*p.i2- c*p.i3 < 0) by XREAL_1:48,49;
      hence thesis by XREAL_0:def 2;
    end;
    assume T[p];
    then (a* p.i1 = b*p.i2 -c*p.i3+0 & b*p.i2- c*p.i3>=0) or
    (a* p.i1 = 0 & b*p.i2- c*p.i3<0) by XREAL_0:def 2;
    hence thesis by XREAL_1:48,49;
  end;
  {p: PQRS[p]} = {q: T[q]} from Eq(A8);
  hence thesis by A7;
end;
