defpred S1[ object ] means ( $1 = inf I & $1 in I );
defpred S2[ object ] means ( $1 = sup I & $1 in I );
defpred S3[ object ] means $1 in ].(inf I),(sup I).[;
deffunc H1( object ) -> Element of REAL = In ((Rdiff (f,(In ($1,REAL)))),REAL);
deffunc H2( object ) -> Element of REAL = In ((Ldiff (f,(In ($1,REAL)))),REAL);
deffunc H3( object ) -> Element of REAL = In ((diff (f,(In ($1,REAL)))),REAL);
A2: for r being Element of REAL holds
( ( S1[r] implies not S2[r] ) & ( S1[r] implies not S3[r] ) & ( S2[r] implies not S3[r] ) ) by A1, XXREAL_1:4;
consider IT being PartFunc of REAL,REAL such that
A3: ( ( for r being Element of REAL holds
( r in dom IT iff ( S1[r] or S2[r] or S3[r] ) ) ) & ( for r being Element of REAL st r in dom IT holds
( ( S1[r] implies IT . r = H1(r) ) & ( S2[r] implies IT . r = H2(r) ) & ( S3[r] implies IT . r = H3(r) ) ) ) ) from SCHEME1:sch 9(A2);
take IT ; :: thesis: ( dom IT = I & ( for x being Real st x in I holds
( ( x = inf I implies IT . x = Rdiff (f,x) ) & ( x = sup I implies IT . x = Ldiff (f,x) ) & ( x <> inf I & x <> sup I implies IT . x = diff (f,x) ) ) ) )

now :: thesis: for r being set st r in dom IT holds
r in I
let r be set ; :: thesis: ( r in dom IT implies b1 in I )
assume r in dom IT ; :: thesis: b1 in I
per cases then ( S1[r] or S2[r] or S3[r] ) by A3;
suppose A5: S3[r] ; :: thesis: b1 in I
then reconsider r1 = r as Real ;
( inf I < r1 & r1 < sup I ) by A5, XXREAL_1:4;
hence r in I by XXREAL_2:83; :: thesis: verum
end;
end;
end;
then A6: dom IT c= I ;
now :: thesis: for r being set st r in I holds
r in dom IT
end;
then A8: I c= dom IT ;
hence dom IT = I by A6, XBOOLE_0:def 10; :: thesis: for x being Real st x in I holds
( ( x = inf I implies IT . x = Rdiff (f,x) ) & ( x = sup I implies IT . x = Ldiff (f,x) ) & ( x <> inf I & x <> sup I implies IT . x = diff (f,x) ) )

thus for x being Real st x in I holds
( ( x = inf I implies IT . x = Rdiff (f,x) ) & ( x = sup I implies IT . x = Ldiff (f,x) ) & ( x <> inf I & x <> sup I implies IT . x = diff (f,x) ) ) :: thesis: verum
proof
let x be Real; :: thesis: ( x in I implies ( ( x = inf I implies IT . x = Rdiff (f,x) ) & ( x = sup I implies IT . x = Ldiff (f,x) ) & ( x <> inf I & x <> sup I implies IT . x = diff (f,x) ) ) )
assume A9: x in I ; :: thesis: ( ( x = inf I implies IT . x = Rdiff (f,x) ) & ( x = sup I implies IT . x = Ldiff (f,x) ) & ( x <> inf I & x <> sup I implies IT . x = diff (f,x) ) )
per cases ( x = inf I or x = sup I or ( x <> inf I & x <> sup I ) ) ;
suppose A10: x = inf I ; :: thesis: ( ( x = inf I implies IT . x = Rdiff (f,x) ) & ( x = sup I implies IT . x = Ldiff (f,x) ) & ( x <> inf I & x <> sup I implies IT . x = diff (f,x) ) )
then IT . x = H1(x) by A3, A8, A9;
hence ( ( x = inf I implies IT . x = Rdiff (f,x) ) & ( x = sup I implies IT . x = Ldiff (f,x) ) & ( x <> inf I & x <> sup I implies IT . x = diff (f,x) ) ) by A10, A1; :: thesis: verum
end;
suppose A11: x = sup I ; :: thesis: ( ( x = inf I implies IT . x = Rdiff (f,x) ) & ( x = sup I implies IT . x = Ldiff (f,x) ) & ( x <> inf I & x <> sup I implies IT . x = diff (f,x) ) )
then IT . x = H2(x) by A3, A8, A9;
hence ( ( x = inf I implies IT . x = Rdiff (f,x) ) & ( x = sup I implies IT . x = Ldiff (f,x) ) & ( x <> inf I & x <> sup I implies IT . x = diff (f,x) ) ) by A11, A1; :: thesis: verum
end;
suppose A12: ( x <> inf I & x <> sup I ) ; :: thesis: ( ( x = inf I implies IT . x = Rdiff (f,x) ) & ( x = sup I implies IT . x = Ldiff (f,x) ) & ( x <> inf I & x <> sup I implies IT . x = diff (f,x) ) )
A13: x in ].(inf I),(sup I).[
proof
A14: ( I is closed_interval implies x in ].(inf I),(sup I).[ ) by A9, A12, Lm1;
A15: ( I is right_open_interval implies x in ].(inf I),(sup I).[ ) by A9, A12, Lm2;
( I is left_open_interval implies x in ].(inf I),(sup I).[ ) by A9, A12, Lm3;
hence x in ].(inf I),(sup I).[ by A14, A15, A9, Lm4, MEASURE5:1; :: thesis: verum
end;
then ( inf I < x & x < sup I ) by XXREAL_1:4;
then x in I by XXREAL_2:83;
then IT . x = H3(x) by A3, A8, A13;
hence ( ( x = inf I implies IT . x = Rdiff (f,x) ) & ( x = sup I implies IT . x = Ldiff (f,x) ) & ( x <> inf I & x <> sup I implies IT . x = diff (f,x) ) ) by A12; :: thesis: verum
end;
end;
end;