reserve i,j,k,n,n1,n2,m for Nat;
reserve a,r,x,y for Real;
reserve A for non empty closed_interval Subset of REAL;
reserve C for non empty set;
reserve X for set;

theorem Th25:
  for f,g being Function of A,REAL st f|A is bounded & a>=0 & (for
  x,y st x in A & y in A holds |.g.x-g.y.|<=a*|.f.x-f.y.|) holds upper_bound
  rng g - lower_bound rng g <= a*(upper_bound rng f - lower_bound rng f)
proof
  let f,g be Function of A,REAL;
  assume that
A1: f|A is bounded and
A2: a>=0 and
A3: for x,y st x in A & y in A holds |.g.x-g.y.|<=a*|.f.x-f.y.|;
A4: rng f is bounded_above by A1,INTEGRA1:13;
A5: dom f = A by FUNCT_2:def 1;
A6: rng f is bounded_below by A1,INTEGRA1:11;
A7: for x,y st x in A & y in A holds |.f.x-f.y.|<= upper_bound rng f -
  lower_bound rng f
  proof
    let x,y;
    assume that
A8: x in A and
A9: y in A;
    now
      per cases;
      suppose
        f.x >= f.y;
        then f.x - f.y >= 0 by XREAL_1:48;
        then |.f.x-f.y.| = f.x - f.y by ABSVALUE:def 1;
        then
A10:    |.f.x-f.y.| + f.y = f.x;
        f.y in rng f by A5,A9,FUNCT_1:def 3;
        then
A11:    lower_bound rng f <= f.y by A6,SEQ_4:def 2;
        f.x in rng f by A5,A8,FUNCT_1:def 3;
        then f.x <= upper_bound rng f by A4,SEQ_4:def 1;
        then f.y <= upper_bound rng f - |.f.x-f.y.| by A10,XREAL_1:19;
        then lower_bound rng f <= upper_bound rng f - |.f.x-f.y.| by A11,
XXREAL_0:2;
        then lower_bound rng f + |.f.x-f.y.| <= upper_bound rng f by
XREAL_1:19;
        hence thesis by XREAL_1:19;
      end;
      suppose
        f.x < f.y;
        then f.x - f.y < 0 by XREAL_1:49;
        then |.f.x-f.y.| = -(f.x-f.y) by ABSVALUE:def 1
          .= f.y - f.x;
        then
A12:    |.f.x-f.y.| + f.x = f.y;
        f.x in rng f by A5,A8,FUNCT_1:def 3;
        then
A13:    lower_bound rng f <= f.x by A6,SEQ_4:def 2;
        f.y in rng f by A5,A9,FUNCT_1:def 3;
        then f.y <= upper_bound rng f by A4,SEQ_4:def 1;
        then f.x <= upper_bound rng f - |.f.x-f.y.| by A12,XREAL_1:19;
        then lower_bound rng f <= upper_bound rng f - |.f.x-f.y.| by A13,
XXREAL_0:2;
        then lower_bound rng f + |.f.x-f.y.| <= upper_bound rng f by
XREAL_1:19;
        hence thesis by XREAL_1:19;
      end;
    end;
    hence thesis;
  end;
  for x,y st x in A & y in A holds |.g.x-g.y.|<= a*(upper_bound rng f -
  lower_bound rng f )
  proof
    let x,y;
    assume that
A14: x in A and
A15: y in A;
A16: |.g.x-g.y.|<=a*|.f.x-f.y.| by A3,A14,A15;
    a*|.f.x-f.y.|<=a*(upper_bound rng f - lower_bound rng f) by A2,A7,A14,A15,
XREAL_1:64;
    hence thesis by A16,XXREAL_0:2;
  end;
  hence thesis by Th24;
end;
