reserve i, j, k, l, m, n, t for Nat;

theorem
  (n div k) div i = n div (k*i)
proof
  now
    per cases;
    suppose i = 0;
      hence (n div k) div i = n div (k*i);
    end;
    suppose
A2:   i <> 0;
      now
        per cases;
        suppose k = 0;
          hence thesis;
        end;
        suppose
A4:       k <> 0;
          consider t2 be Nat such that
A5:       n div k = i * ((n div k) div i) + t2 and
A6:       t2 < i by A2,NAT_D:def 1;
          t2 + 1 <= i by A6,NAT_1:13;
          then
A7:       k * (t2 + 1) <= k * i by XREAL_1:64;
          consider t1 be Nat such that
A8:       n = k * (n div k) + t1 and
A9:       t1 < k by A4,NAT_D:def 1;
          k * t2 + t1 < k * t2 + k * 1 by A9,XREAL_1:6;
          then (k * t2 + t1) - (k * i) < (k * (t2 + 1)) - (k * (t2 + 1)) by A7,
XREAL_1:14;
          then
A10:      k * t2 + t1 < 0 + k * i by XREAL_1:19;
          n = k * i * ((n div k) div i) + (k * t2 + t1) by A8,A5;
          hence thesis by A10,NAT_D:def 1;
        end;
      end;
      hence thesis;
    end;
  end;
  hence thesis;
end;
