let X be non empty set ; :: thesis: for S being SigmaField of X
for f being PartFunc of X,REAL st f is_simple_func_in S holds
ex F being Finite_Sep_Sequence of S ex a being FinSequence of REAL st
( dom f = union (rng F) & dom F = dom a & ( for n being Nat st n in dom F holds
for x being set st x in F . n holds
f . x = a . n ) )

let S be SigmaField of X; :: thesis: for f being PartFunc of X,REAL st f is_simple_func_in S holds
ex F being Finite_Sep_Sequence of S ex a being FinSequence of REAL st
( dom f = union (rng F) & dom F = dom a & ( for n being Nat st n in dom F holds
for x being set st x in F . n holds
f . x = a . n ) )

let f be PartFunc of X,REAL; :: thesis: ( f is_simple_func_in S implies ex F being Finite_Sep_Sequence of S ex a being FinSequence of REAL st
( dom f = union (rng F) & dom F = dom a & ( for n being Nat st n in dom F holds
for x being set st x in F . n holds
f . x = a . n ) ) )

assume f is_simple_func_in S ; :: thesis: ex F being Finite_Sep_Sequence of S ex a being FinSequence of REAL st
( dom f = union (rng F) & dom F = dom a & ( for n being Nat st n in dom F holds
for x being set st x in F . n holds
f . x = a . n ) )

then consider F being Finite_Sep_Sequence of S such that
A1: dom f = union (rng F) and
A2: for n being Nat
for x, y being Element of X st n in dom F & x in F . n & y in F . n holds
f . x = f . y ;
defpred S1[ Nat, Real] means for x being set st x in F . $1 holds
$2 = f . x;
A3: for k being Nat st k in Seg (len F) holds
ex y being Element of REAL st S1[k,y]
proof
let k be Nat; :: thesis: ( k in Seg (len F) implies ex y being Element of REAL st S1[k,y] )
assume k in Seg (len F) ; :: thesis: ex y being Element of REAL st S1[k,y]
then A4: k in dom F by FINSEQ_1:def 3;
then A5: F . k in rng F by FUNCT_1:3;
per cases ( F . k = {} or F . k <> {} ) ;
suppose A6: F . k = {} ; :: thesis: ex y being Element of REAL st S1[k,y]
take In (0,REAL) ; :: thesis: S1[k, In (0,REAL)]
thus S1[k, In (0,REAL)] by A6; :: thesis: verum
end;
suppose F . k <> {} ; :: thesis: ex y being Element of REAL st S1[k,y]
then consider x1 being object such that
A7: x1 in F . k by XBOOLE_0:def 1;
reconsider fx1 = f . x1 as Element of REAL by XREAL_0:def 1;
take fx1 ; :: thesis: S1[k,fx1]
rng F c= bool X by XBOOLE_1:1;
hence S1[k,fx1] by A2, A4, A5, A7; :: thesis: verum
end;
end;
end;
consider a being FinSequence of REAL such that
A8: ( dom a = Seg (len F) & ( for k being Nat st k in Seg (len F) holds
S1[k,a . k] ) ) from FINSEQ_1:sch 5(A3);
take F ; :: thesis: ex a being FinSequence of REAL st
( dom f = union (rng F) & dom F = dom a & ( for n being Nat st n in dom F holds
for x being set st x in F . n holds
f . x = a . n ) )

take a ; :: thesis: ( dom f = union (rng F) & dom F = dom a & ( for n being Nat st n in dom F holds
for x being set st x in F . n holds
f . x = a . n ) )

for n being Nat st n in dom F holds
for x being set st x in F . n holds
a . n = f . x
proof
let n be Nat; :: thesis: ( n in dom F implies for x being set st x in F . n holds
a . n = f . x )

assume n in dom F ; :: thesis: for x being set st x in F . n holds
a . n = f . x

then n in Seg (len F) by FINSEQ_1:def 3;
hence for x being set st x in F . n holds
a . n = f . x by A8; :: thesis: verum
end;
hence ( dom f = union (rng F) & dom F = dom a & ( for n being Nat st n in dom F holds
for x being set st x in F . n holds
f . x = a . n ) ) by A1, A8, FINSEQ_1:def 3; :: thesis: verum