reserve Omega, Omega1, Omega2 for non empty set;
reserve Sigma for SigmaField of Omega;
reserve S1 for SigmaField of Omega1;
reserve S2 for SigmaField of Omega2;

theorem Th5:
  for F being Function of Omega,REAL st
  F is Real-Valued-Random-Variable of Sigma holds
  { x where x is Element of Borel_Sets : F"x is Element of Sigma }
  is SigmaField of REAL
  proof
    let F be Function of Omega,REAL;
    assume A1: F is Real-Valued-Random-Variable of Sigma;
    set S = { x where x is Element of Borel_Sets : F"x is Element of Sigma };
    for x be object st x in S holds x in Borel_Sets
    proof
      let z be object;
      assume z in S;
      then ex x be Element of Borel_Sets st x=z & F"x is Element of Sigma;
      hence z in Borel_Sets;
    end; then
    A2: S c= Borel_Sets;
    set r0 = the Element of REAL;
    A3: halfline(r0) in Family_of_halflines;
    Family_of_halflines c= sigma(Family_of_halflines) by PROB_1:def 9;
    then reconsider y0 = halfline(r0) as Element of Borel_Sets by A3;
    F"y0 is Element of Sigma by Th4,A1; then
    A4: y0 in S;
    A5: for A be Subset of REAL st A in S holds A` in S
    proof
      let A be Subset of REAL;
      assume A in S; then
      consider x be Element of Borel_Sets such that
      A6: A= x & F"x is Element of Sigma;
      A7: F"(REAL \ x) = F"REAL \ F"x by FUNCT_1:69
      .= Omega \ F"x by FUNCT_2:40;
      REAL is Element of Borel_Sets by PROB_1:5; then
      A8: REAL \ x is Element of Borel_Sets by PROB_1:6;
      Omega is Element of Sigma by PROB_1:5;
      then
      Omega \ F"x is Element of Sigma by A6,PROB_1:6;
      hence A` in S by A6,A7,A8;
    end;
    for A1 being SetSequence of REAL
    st rng A1 c= S holds Intersection A1 in S
    proof
      let A1 be SetSequence of REAL;
      assume A9: rng A1 c= S;
      then A10:
      rng A1 c= Borel_Sets by A2; then
      A11: Intersection A1 in Borel_Sets by PROB_1:15;
      reconsider B1 = Intersection A1
        as Element of Borel_Sets by PROB_1:15,A10;
      deffunc G(set) = F"(A1.$1);
      A12: for n be Element of NAT holds G(n) is Element of Sigma
      proof
        let n be Element of NAT;
        A1.n in rng A1 by FUNCT_2:112; then
        A1.n in S by A9; then
        ex x be Element of Borel_Sets st
        x= A1.n & F"x is Element of Sigma;
        hence G(n) is Element of Sigma;
      end;
      consider D be Function of NAT,Sigma such that
      A13:for n be Element of NAT holds D.n = G(n) from FUNCT_2:sch 9(A12);
      D in Funcs(NAT,Sigma) by FUNCT_2:8; then
      A14:ex f being Function st D = f & dom f = NAT & rng f c= Sigma
      by FUNCT_2:def 2;
      rng D c= bool Omega;
      then reconsider D as SetSequence of Omega by FUNCT_2:6;
      A15: Intersection D in Sigma by A14,PROB_1:15;
      F"(Intersection A1) = Intersection D by A13,Th3;
      hence Intersection A1 in S by A11,A15;
    end;
    hence S is SigmaField of REAL by PROB_1:15,A4,A5,XBOOLE_1:1,A2;
  end;
