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

theorem
  not ( z = +infty & y = +infty or z = -infty & y = -infty ) & x < z - y
  implies x <> +infty & y <> +infty & z <> -infty & x + y < z
proof
  assume that
A1: not ( z=+infty & y=+infty or z=-infty & y=-infty ) and
A2: x < z - y;
  per cases;
  suppose
A3: x = -infty;
A4: -infty <= z by XXREAL_0:5;
    z<>-infty by A1,A2,A3,Th14;
    then
A5: -infty < z by A4,XXREAL_0:1;
    y<>+infty by A1,A2,A3,Th13;
    hence thesis by A3,A5,Def2;
  end;
  suppose
A6: x <> -infty;
A7: z - y <= +infty by XXREAL_0:4;
    then x in REAL by A2,A6,XXREAL_0:14;
    then reconsider a = x as Real;
A8: -infty <= x by XXREAL_0:5;
    then
A9: z <> -infty by A1,A2,Th14;
A10: y <> +infty by A1,A2,A8,Th13;
    per cases;
    suppose
A11:  y = -infty;
      -infty <= z by XXREAL_0:5;
      then -infty < z by A1,A11,XXREAL_0:1;
      hence thesis by A2,A7,A11,Def2;
    end;
    suppose
      y <> -infty;
      then y in REAL by A10,XXREAL_0:14;
      then reconsider b = y as Real;
      per cases;
      suppose
A12:    z = +infty;
        a+b in REAL by XREAL_0:def 1;
        hence thesis by A12,XXREAL_0:9;
      end;
      suppose
        z <> +infty;
        then z in REAL by A9,XXREAL_0:14;
        then reconsider c = z as Real;
        z - y = c - b;
        then a + b < c by A2,XREAL_1:20;
        hence thesis;
      end;
    end;
  end;
end;
