reserve X for set;

theorem
for f being PartFunc of X,ExtREAL holds
 dom f = eq_dom(f,-infty) \/ (great_dom(f,-infty) /\ less_dom(f,+infty))
         \/ eq_dom(f,+infty)
proof
   let f be PartFunc of X,ExtREAL;
   set A1 = eq_dom(f,-infty), A2 = great_dom(f,-infty) /\ less_dom(f,+infty),
       A3 = eq_dom(f,+infty);
   now let x be object;
    assume A1: x in dom f;
    per cases by XXREAL_0:14;
    suppose f.x in REAL; then
     f.x > -infty & f.x < +infty by XXREAL_0:9,12; then
     x in great_dom(f,-infty) & x in less_dom(f,+infty)
       by A1,MESFUNC1:def 11,def 13; then
A2:  x in A2 by XBOOLE_0:def 4;
     A2 c= A1 \/ A2 & A1 \/ A2 c= A1 \/ A2 \/ A3 by XBOOLE_1:7;
     hence x in A1 \/ A2 \/ A3 by A2;
    end;
    suppose f.x = +infty; then
A3:  x in A3 by A1,MESFUNC1:def 15;
     A3 c= A1 \/ A2 \/ A3 by XBOOLE_1:7;
     hence x in A1 \/ A2 \/ A3 by A3;
    end;
    suppose f.x = -infty; then
A4:  x in A1 by A1,MESFUNC1:def 15;
     A1 c= A1 \/ A2 & A1 \/ A2 c= A1 \/ A2 \/ A3 by XBOOLE_1:7;
     hence x in A1 \/ A2 \/ A3 by A4;
    end;
   end; then
A5:dom f c= A1 \/ A2 \/ A3;
   now let x be object;
    assume x in A1 \/ A2 \/ A3; then
A6: x in A1 \/ A2 or x in A3 by XBOOLE_0:def 3;
    per cases by A6,XBOOLE_0:def 3;
    suppose x in A1;
     hence x in dom f by MESFUNC1:def 15;
    end;
    suppose x in A2; then
     x in great_dom(f,-infty) by XBOOLE_0:def 4;
     hence x in dom f by MESFUNC1:def 13;
    end;
    suppose x in A3;
     hence x in dom f by MESFUNC1:def 15;
    end;
   end; then
   A1 \/ A2 \/ A3 c= dom f;
   hence thesis by A5;
end;
