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

theorem
  (z = -infty & y = +infty implies x <= 0) & (z = +infty & y = -infty
  implies x <= 0) implies (x - y <= z implies x <= z + y)
proof
  assume that
A1: z = -infty & y = +infty implies x <= 0 and
A2: z = +infty & y = -infty implies x <= 0 and
A3: x - y <= z;
  per cases by XXREAL_0:14;
  suppose
A4: z = -infty;
    per cases by A3,A4,Th19,XXREAL_0:6;
    suppose
      x = -infty;
      hence thesis by XXREAL_0:5;
    end;
    suppose
      y = +infty;
      hence thesis by A1,A4;
    end;
  end;
  suppose
A5: z = +infty;
    per cases;
    suppose
      y = -infty;
      hence thesis by A2,A5;
    end;
    suppose
      y <> -infty;
      then z + y = +infty by A5,Def2;
      hence thesis by XXREAL_0:3;
    end;
  end;
  suppose
A6: z in REAL;
    per cases by A3,A6,XXREAL_0:13;
    suppose
A7:   x-y in REAL;
      per cases by A7,Th21;
      suppose
        y = +infty;
        then z + y = +infty by A6,Def2;
        hence thesis by XXREAL_0:3;
      end;
      suppose
        x = -infty;
        hence thesis by XXREAL_0:5;
      end;
      suppose
        x in REAL & y in REAL;
        then reconsider a = x, b = y, c = z as Element of REAL by A6;
        a - b <= c by A3;
        then a <= b + c by XREAL_1:20;
        hence thesis;
      end;
    end;
    suppose
A8:   x-y = -infty;
      per cases by A8,Th19;
      suppose
        x = -infty;
        hence thesis by XXREAL_0:5;
      end;
      suppose
        y = +infty;
        then z + y = +infty by A6,Def2;
        hence thesis by XXREAL_0:3;
      end;
    end;
  end;
end;
