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
  f is_simple_func_in S & g is_simple_func_in S implies f+g is_simple_func_in S
proof
  assume
A1: f is_simple_func_in S & g is_simple_func_in S;
  per cases;
  suppose
A2: dom(f+g) = {};
    ex F being Finite_Sep_Sequence of S st (dom(f+g) = 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+g
    ).x = (f+g).y)
    proof
      reconsider EMPTY = {} as Element of S by PROB_1:4;
      set F = <*EMPTY*>;
A3:   dom F = Seg 1 by FINSEQ_1:38;
A4:   now
        let i,j be Nat;
        assume that
A5:     i in dom F and
A6:     j in dom F & i <> j;
        i = 1 by A3,A5,FINSEQ_1:2,TARSKI:def 1;
        hence F.i misses F.j by A3,A6,FINSEQ_1:2,TARSKI:def 1;
      end;
A7:   for n be Nat st n in dom F holds F.n = EMPTY
      proof
        let n be Nat;
        assume n in dom F;
        then n = 1 by A3,FINSEQ_1:2,TARSKI:def 1;
        hence thesis by FINSEQ_1:40;
      end;
      reconsider F as Finite_Sep_Sequence of S by A4,MESFUNC3:4;
      take F;
      union rng F = union bool {} by FINSEQ_1:39,ZFMISC_1:1;
      hence dom(f+g) = union rng F by A2;
      thus thesis by A7;
    end;
    hence thesis;
  end;
  suppose
A8: dom(f+g) <> {};
A9: dom(f+g) = dom f /\ dom g by VALUED_1:def 1;
    dom f is Element of S & dom g is Element of S by A1,Th71;
    then dom(f+g) in S by A9,FINSUB_1:def 2;
    then
A10: f|dom(f+g) is_simple_func_in S & g|dom(f+g) is_simple_func_in S by A1,Th70
;
    dom(f|dom(f+g)) = dom f /\ dom(f+g) by RELAT_1:61;
    then
A11: dom(f|dom(f+g)) = dom f /\ dom f /\ dom g by A9,XBOOLE_1:16;
    dom(g|dom(f+g)) = dom g /\ dom(f+g) by RELAT_1:61;
    then
A12: dom(g|dom(f+g)) = dom g /\ dom g /\ dom f by A9,XBOOLE_1:16;
    then
A13: dom(g|dom(f+g)) = dom(f+g) by VALUED_1:def 1;
A14: dom(f|dom(f+g) + g|dom(f+g)) = dom(f|dom(f+g)) /\ dom(g|dom(f+g))
     by VALUED_1:def 1
      .= dom(f+g) by A11,A12,VALUED_1:def 1;
A15: for x be Element of X st x in dom(f|dom(f+g) + g|dom(f+g)) holds (f|
    dom(f+g) + g|dom(f+g)).x = (f+g).x
    proof
      let x be Element of X;
      assume
A16:  x in dom(f|dom(f+g) + g|dom(f+g));
      then (f|dom(f+g) + g|dom(f+g)).x = (f|dom(f+g)).x + (g|dom(f+g)).x
      by VALUED_1:def 1
        .= f.x + (g|dom(f+g)).x by A14,A16,FUNCT_1:49
        .= f.x + g.x by A14,A16,FUNCT_1:49;
      hence thesis by A14,A16,VALUED_1:def 1;
    end;
    dom(f|dom(f+g)) = dom(f+g) by A11,VALUED_1:def 1;
    then f|dom(f+g) + g|dom(f+g) is_simple_func_in S by A8,A10,A13,Lm1;
    hence thesis by A14,A15,PARTFUN1:5;
  end;
end;
