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,Def2;
    then
A5: -infty < z by A4,XXREAL_0:1;
    y<>-infty by A1,A2,A3,Def2;
    hence thesis by A3,A5,Th14;
  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,Def2;
A10: y <> -infty by A1,A2,A8,Def2;
    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,Th13;
    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:19;
        hence thesis;
      end;
    end;
  end;
end;
