reserve Omega, I for non empty set;
reserve Sigma for SigmaField of Omega;
reserve P for Probability of Sigma;
reserve D, E, F for Subset-Family of Omega;
reserve  B, sB for non empty Subset of Sigma;
reserve b for Element of B;
reserve a for Element of Sigma;
reserve p, q, u, v for Event of Sigma;
reserve n, m for Element of NAT;
reserve S, S9, X, x, y, z, i, j for set;

theorem Th5:
  Indep(B,P) is Dynkin_System of Omega
proof
A1: for b holds P.({} /\ b) = P.{} * P.b
  proof
    let b;
    reconsider b as Event of Sigma;
    P.({} /\ b) = 0 by VALUED_0:def 19;
    hence thesis;
  end;
  reconsider Indp=Indep(B,P) as Subset-Family of Omega by XBOOLE_1:1;
  {} is Element of Sigma by PROB_1:22;
  then
A2: {} in Indep(B,P) by A1,Def1;
A3: for g being SetSequence of Omega st rng g c= Indep(B,P) & g is
  disjoint_valued holds Union g in Indep(B,P)
  proof
    let g be SetSequence of Omega;
    assume that
A4: rng g c= Indep(B,P) and
A5: g is disjoint_valued;
    now
      let n be Nat;
      g.n is Element of Sigma
      proof
        per cases;
        suppose
          n in dom g;
          then g.n in rng g by FUNCT_1:3;
          hence thesis by A4,TARSKI:def 3;
        end;
        suppose
          not n in dom g;
          then g.n = {} by FUNCT_1:def 2;
          hence thesis by PROB_1:4;
        end;
      end;
      hence g.n is Event of Sigma;
    end;
    then reconsider g as SetSequence of Sigma by PROB_1:25;
    reconsider Ug = Union g as Element of Sigma by PROB_1:26;
    for n,b holds P.(g.n /\ b) = P.(g.n) * P.b
    proof
      let n,b;
      g.n in Indep(B,P)
      proof
        per cases;
        suppose
          n in dom g;
          then g.n in rng g by FUNCT_1:3;
          hence thesis by A4;
        end;
        suppose
          not n in dom g;
          hence thesis by A2,FUNCT_1:def 2;
        end;
      end;
      hence thesis by Def1;
    end;
    then for b holds P.(Ug /\ b) = P.Ug * P.b by A5,Th4;
    hence thesis by Def1;
  end;
  for Z being Subset of Omega st Z in Indep(B,P) holds Z` in Indep(B,P)
  proof
    let Z be Subset of Omega;
    assume
A6: Z in Indep(B,P);
    then reconsider Z as Event of Sigma;
    reconsider Z9=Z` as Element of Sigma by PROB_1:20;
    for b being Element of B holds P.(Z` /\ b) = P.Z` * P.b
    proof
      let b be Element of B;
      P.(b /\ Z) = P.b * P.Z by A6,Def1;
      then b,Z are_independent_respect_to P by PROB_2:def 4;
      then b, ([#]Sigma\Z) are_independent_respect_to P by PROB_2:25;
      hence thesis by PROB_2:def 4;
    end;
    then Z9 in Indep(B,P) by Def1;
    hence thesis;
  end;
  then Indp is Dynkin_System of Omega by A2,A3,DYNKIN:def 5;
  hence thesis;
end;
