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

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