reserve a,b,c,d,e for Real;
reserve X,Y for set,
          Z for non empty set,
          r for Real,
          s for ExtReal,
          A for Subset of REAL,
          f for real-valued Function;
reserve I for non empty closed_interval Subset of REAL,
       TD for tagged_division of I,
        D for Division of I,
        T for Element of set_of_tagged_Division(D),
        f for PartFunc of I,REAL;
reserve f for Function of I,REAL;
reserve f,g for HK-integrable Function of I,REAL,
          r for Real;

theorem Th37:
  for f being bounded Function of I,REAL holds
  |. upper_bound (rng f) - lower_bound (rng f) .| = 0 iff f is constant
  proof
    let f be bounded Function of I,REAL;
A1: rng f is real-bounded by INTEGRA1:15;
    hereby
      assume |. upper_bound (rng f) - lower_bound (rng f) .| = 0;
      then upper_bound (rng f) - lower_bound (rng f) = 0;
      then ex r be Real st rng f = {r} by A1,Th10;
      hence f is constant;
    end;
    assume f is constant;
    then consider y be Element of REAL such that
A2: rng f = {y} by FUNCT_2:111;
    upper_bound rng f = y & lower_bound rng f = y by A2,SEQ_4:9;
    hence |. upper_bound (rng f) - lower_bound (rng f) .| = 0;
  end;
