reserve x,y,z,w for ExtReal,
  r for Real;
reserve f,g for ExtReal;

theorem Th45:
  x is real implies (y + x <= z iff y <= z - x)
proof
  assume
A1: x is real;
A2: (z - x) + x = z
  proof
    per cases by XXREAL_0:14;
    suppose
      z in REAL;
      then reconsider a = x, b = z as Real by A1;
      thus (z - x) + x = (b - a) + a .= z;
    end;
    suppose
A3:   z = -infty;
      hence (z - x) + x = -infty + x by A1,Th14
        .= z by A1,A3,Def2;
    end;
    suppose
A4:   z = +infty;
      hence (z - x) + x = +infty + x by A1,Th13
        .= z by A1,A4,Def2;
    end;
  end;
  hereby
A5: (y + x) - x = y
    proof
      per cases by XXREAL_0:14;
      suppose
        y in REAL;
        then reconsider a = x, b = y as Element of REAL by A1,XXREAL_0:14;
        (y + x) - x = (b + a) - a .= y;
        hence thesis;
      end;
      suppose
A6:     y = -infty or y = +infty;
        per cases by A6;
        suppose
A7:       y = -infty;
          hence (y + x) - x = -infty - x by A1,Def2
            .= y by A1,A7,Th14;
        end;
        suppose
A8:       y = +infty;
          hence (y + x) - x = +infty - x by A1,Def2
            .= y by A1,A8,Th13;
        end;
      end;
    end;
    assume y + x <= z;
    hence y <= z - x by A5,Th37;
  end;
  assume y <= z - x;
  hence thesis by A2,Th36;
end;
