reserve p,q,r for FinSequence,
  x,y for object;

theorem Th17:
  for R being Relation, p being RedSequence of R,
      i,j being Nat st i in dom p & j in dom p & i <= j holds
   R reduces p.i,p.j
proof
  let R be Relation, p be RedSequence of R, i,j be Nat;
  defpred Q[Nat] means i+$1 in dom p implies R reduces p.i,p.(i+$1);
  assume that
A1: i in dom p and
A2: j in dom p and
A3: i <= j;
  consider k being Nat such that
A4: j = i+k by A3,NAT_1:10;
  now
A5: i >= 1 by A1,Lm1;
    let j be Nat such that
A6: i+j in dom p implies R reduces p.i,p.(i+j) and
A7: i+(j+1) in dom p;
A8: i+(j+1) = i+j+1;
    then
A9: i+j < len p by A7,Lm2;
    then i+j in dom p by A5,Lm3;
    then [p.(i+j),p.(i+(j+1))] in R by A7,A8,Def2;
    then R reduces p.(i+j), p.(i+(j+1)) by Th15;
    hence R reduces p.i,p.(i+(j+1)) by A6,A5,A9,Lm3,Th16;
  end;
  then
A10: for k being Nat st Q[k] holds Q[k+1];
A11: Q[ 0 ] by Th12;
A12: for j being Nat holds Q[j] from NAT_1:sch 2(A11,A10);
  thus thesis by A2,A12,A4;
end;
