reserve X for non empty set,
  Y for set,
  S for SigmaField of X,
  F for sequence of S,
  f,g for PartFunc of X,REAL,
  A,B for Element of S,
  r,s for Real,
  a for Real,
  n for Nat;
reserve X for non empty set,
  S for SigmaField of X,
  f,g for PartFunc of X,REAL,
  A for Element of S,
  r for Real,
  p for Rational;
reserve X for non empty set,
  f,g for PartFunc of X,REAL,
  r for Real ;
reserve X for non empty set,
  S for SigmaField of X,
  f,g for PartFunc of X,REAL,
  A for Element of S;
reserve X for non empty set,
  Y for set,
  S for SigmaField of X,
  f,g,h for PartFunc of X,REAL,
  A for Element of S,
  r for Real;
reserve X for non empty set,
  S for SigmaField of X,
  f,g for PartFunc of X,REAL ,
  A,B for Element of S,
  r,s for Real;

theorem
  ex f be PartFunc of X,REAL st f is_simple_func_in S & dom f = A & for
  x be object st x in A holds f.x=r
proof
  defpred P[object] means $1 in A;
  deffunc F(object) = r;
A1: for x be object st P[x] holds F(x) in REAL by XREAL_0:def 1;
  consider f be PartFunc of X,REAL such that
A2: (for x be object holds x in dom f iff x in X & P[x]) &
for x be object st
  x in dom f holds f.x = F(x) from PARTFUN1:sch 3(A1);
  take f;
A3: A c= dom f
  by A2;
A4: dom f c= A
  by A2;
  ex F being Finite_Sep_Sequence of S st (dom f = union rng F & for n
being Nat, x,y being Element of X st n in dom F & x in F.n & y in F.n holds f.x
  = f.y)
  proof
    set F = <* dom f *>;
A5: rng F = {dom f} by FINSEQ_1:38;
    then rng F = {A} by A4,A3,XBOOLE_0:def 10;
    then reconsider F as FinSequence of S by FINSEQ_1:def 4;
    now
      let i,j be Nat such that
A6:   i in dom F and
A7:   j in dom F & i <> j;
A8:   dom F = Seg 1 by FINSEQ_1:38;
      then i = 1 by A6,FINSEQ_1:2,TARSKI:def 1;
      hence F.i misses F.j by A7,A8,FINSEQ_1:2,TARSKI:def 1;
    end;
    then reconsider F as Finite_Sep_Sequence of S by MESFUNC3:4;
    take F;
    thus dom f = union rng F by A5,ZFMISC_1:25;
    hereby
      let n be Nat;
      let x,y be Element of X;
      assume that
A9:   n in dom F and
A10:  x in F.n and
A11:  y in F.n;
      dom F = Seg 1 by FINSEQ_1:38;
      then
A12:  n = 1 by A9,FINSEQ_1:2,TARSKI:def 1;
      then x in dom f by A10,FINSEQ_1:40;
      then
A13:  f.x = r by A2;
      y in dom f by A11,A12,FINSEQ_1:40;
      hence f.x = f.y by A2,A13;
    end;
  end;
  hence f is_simple_func_in S;
  thus dom f = A by A4,A3;
  thus thesis by A2;
end;
