reserve a,b,i,k,m,n for Nat;
reserve s,z for non zero Nat;
reserve r for Real;
reserve c for Complex;
reserve e1,e2,e3,e4,e5 for ExtReal;

theorem Th17:
  for a,b,m being Integer st a < b
  ex k st m < (b-a)*k+1-a & k = |. [/ (m+a-1)/(b-a) + 1 \] .|
  proof
    let a,b,m be Integer;
    assume a < b;
    then
A1: a-a < b-a by XREAL_1:14;
    set x = (m+a-1)/(b-a) + 1;
A2: (b-a)*x/(b-a) = x by A1,XCMPLX_1:89;
A3: now
      assume m >= (b-a)*x+1-a;
      then m+a >= (b-a)*x+1-a+a by XREAL_1:6;
      then m+a-1 >= (b-a)*x+1-1 by XREAL_1:9;
      then (m+a-1)/(b-a) >= x+0 by A1,A2,XREAL_1:72;
      hence contradiction by XREAL_1:8;
    end;
    take k = |.[/x\].|;
A4: x <= [/x\] by INT_1:def 7;
    [/x\] <= k by ABSVALUE:4;
    then x <= k by A4,XXREAL_0:2;
    then (b-a)*x <= (b-a)*k by A1,XREAL_1:64;
    then (b-a)*x+1 <= (b-a)*k+1 by XREAL_1:6;
    then (b-a)*x+1-a <= (b-a)*k+1-a by XREAL_1:9;
    hence thesis by A3,XXREAL_0:2;
  end;
