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
  for F being ManySortedSigmaField of I,Sigma st F is_independent_wrt P
  & a in tailSigmaField(F,I) holds P.a=0 or P.a=1
proof
  let F be ManySortedSigmaField of I,Sigma;
  reconsider T=tailSigmaField(F,I) as SigmaField of Omega by Th15;
  set Ie=I\{}I;
A1: a in tailSigmaField(F,I) implies a in sigUn(F,Ie)
  proof
    assume
A2: a in tailSigmaField(F,I);
    sigUn(F,Ie) in futSigmaFields(F,I) by Def7;
    hence thesis by A2,SETFAM_1:def 1;
  end;
  assume
A3: F is_independent_wrt P;
A4: for E being finite Subset of I for p,q st p in sigUn(F,E) & q in
  tailSigmaField(F,I) holds p,q are_independent_respect_to P
  proof
    let E be finite Subset of I;
    let p,q;
    assume that
A5: p in sigUn(F,E) and
A6: q in tailSigmaField(F,I);
    for E being finite Subset of I holds q in sigUn(F,I\E)
    proof
      let E be finite Subset of I;
      sigUn(F,I\E) in futSigmaFields(F,I) by Def7;
      hence thesis by A6,SETFAM_1:def 1;
    end;
    then
A7: q in sigUn(F,I\E);
    per cases;
    suppose
A8:   E <> {} & I\E <> {};
      then reconsider E as non empty Subset of I;
      reconsider IE=I\E as non empty Subset of I by A8;
      E misses IE by XBOOLE_1:79;
      then P.(p /\ q) = P.p * P.q by A3,A5,A7,Th14;
      hence thesis by PROB_2:def 4;
    end;
    suppose
A9:   not (E <> {} & I\E <> {});
      reconsider e={} as Subset of I by XBOOLE_1:2;
A10:  for u,v st u in {{},Omega} holds u,v are_independent_respect_to P
      proof
        let u,v;
        assume
A11:    u in {{},Omega};
        per cases;
        suppose
          u={};
          hence thesis by PROB_2:19,23;
        end;
        suppose
          u<>{};
          then u=[#]Sigma by A11,TARSKI:def 2;
          hence thesis by PROB_2:19,24;
        end;
      end;
      Union (F|{}) = {} by ZFMISC_1:2;
      then
A12:  sigUn(F,e) = {{},Omega} by Th3;
      p,q are_independent_respect_to P
      proof
        per cases;
        suppose
          E={};
          hence thesis by A5,A12,A10;
        end;
        suppose
          E<>{};
          hence thesis by A7,A9,A12,A10,PROB_2:19;
        end;
      end;
      hence thesis;
    end;
  end;
A13: for p,q st p in finSigmaFields(F,I) & q in tailSigmaField(F,I) holds p,
  q are_independent_respect_to P
  proof
    let p,q;
    assume that
A14: p in finSigmaFields(F,I) and
A15: q in tailSigmaField(F,I);
    ex E being finite Subset of I st p in sigUn(F,E) by A14,Def10;
    hence thesis by A4,A15;
  end;
  Union (F|Ie) c= sigma finSigmaFields(F,I)
  proof
    let x be object;
    assume x in Union (F|Ie);
    then x in union rng F;
    then consider y such that
A16: x in y and
A17: y in rng F by TARSKI:def 4;
    consider i being object such that
A18: i in dom F and
A19: y=F.i by A17,FUNCT_1:def 3;
A20: x in finSigmaFields(F,I)
    proof
      reconsider Fi=F.i as SigmaField of Omega by A18,Def2;
A21:  sigma(Fi) c= Fi & Fi c= sigma(Fi) by PROB_1:def 9;
      i in I by A18;
      then for z being object holds
            z in {i} implies z in I by TARSKI:def 1;
      then reconsider E={i} as finite Subset of I by TARSKI:def 3;
A22:  dom (F|{i}) = dom F /\ {i} by RELAT_1:61
        .= {i} by A18,ZFMISC_1:46;
      then rng (F|{i}) = {(F|{i}).i} by FUNCT_1:4;
      then
A23:  union rng (F|{i}) = (F|{i}).i by ZFMISC_1:25;
      i in dom (F|{i}) by A22,TARSKI:def 1;
      then Union F|{i} = F.i by A23,FUNCT_1:47;
      then sigUn(F,E) = F.i by A21;
      hence thesis by A16,A19,Def10;
    end;
    finSigmaFields(F,I) c= sigma finSigmaFields(F,I) by PROB_1:def 9;
    hence thesis by A20;
  end;
  then
A24: T c= sigma(T) & sigUn(F,Ie) c= sigma finSigmaFields(F,I) by PROB_1:def 9;
A25: for u,v st u in sigUn(F,Ie) & v in tailSigmaField(F,I) holds u,v
  are_independent_respect_to P
  proof
    for x,y st x in finSigmaFields(F,I) & y in finSigmaFields(F,I) holds
    x /\ y in finSigmaFields(F,I)
    proof
      let x,y;
      assume that
A26:  x in finSigmaFields(F,I) and
A27:  y in finSigmaFields(F,I);
      consider E1 being finite Subset of I such that
A28:  x in sigUn(F,E1) by A26,Def10;
      consider E2 being finite Subset of I such that
A29:  y in sigUn(F,E2) by A27,Def10;
A30:  for E1,E2 being finite Subset of I holds z in sigUn(F,E1) implies z
      in sigUn(F,E1 \/ E2)
      proof
        let E1,E2 be finite Subset of I;
        reconsider E3 = E1 \/ E2 as finite Subset of I;
A31:    Union (F|E1) c= Union (F|E3)
        proof
          let X be object;
          assume X in Union (F|E1);
          then consider S such that
A32:      X in S and
A33:      S in rng (F|E1) by TARSKI:def 4;
          F|(E3) = (F|E1) \/ (F|E2) by RELAT_1:78;
          then rng (F|E3) = rng (F|E1) \/ rng(F|E2) by RELAT_1:12;
          then S in rng (F|E3) by A33,XBOOLE_0:def 3;
          hence thesis by A32,TARSKI:def 4;
        end;
        Union (F|E3) c= sigma Union(F|E3) by PROB_1:def 9;
        then Union (F|E1) c= sigma Union(F|E3) by A31;
        then
A34:    sigma Union(F|E1) c= sigma Union(F|E3) by PROB_1:def 9;
        assume z in sigUn(F,E1);
        hence thesis by A34;
      end;
      then
A35:  y in sigUn(F,E2 \/ E1) by A29;
      x in sigUn(F,E1 \/ E2) by A28,A30;
      then x /\ y in sigUn(F,E1 \/ E2) by A35,FINSUB_1:def 2;
      hence thesis by Def10;
    end;
    then
A36: finSigmaFields(F,I) is intersection_stable by FINSUB_1:def 2;
    let u,v;
A37: finSigmaFields(F,I) is non empty
    proof
      set E = the finite Subset of I;
      {} in sigUn(F,E) by PROB_1:4;
      hence thesis by Def10;
    end;
A38: tailSigmaField(F,I) c= Sigma
    proof
      set Ie=I\{}I;
      let x be object;
      assume
A39:  x in tailSigmaField(F,I);
      Union (F|Ie) c= Sigma
      proof
        let y be object;
        assume y in Union (F|Ie);
        then ex S st y in S & S in rng (F|Ie) by TARSKI:def 4;
        hence thesis;
      end;
      then
A40:  sigma Union (F|Ie) c= Sigma by PROB_1:def 9;
      sigUn(F,Ie) in futSigmaFields(F,I) by Def7;
      then x in sigma Union (F|Ie) by A39,SETFAM_1:def 1;
      hence thesis by A40;
    end;
A41: finSigmaFields(F,I) c= Sigma
    proof
      let x be object;
      assume x in finSigmaFields(F,I);
      then consider E being finite Subset of I such that
A42:  x in sigUn(F,E) by Def10;
      Union (F|E) c= Sigma
      proof
        let y be object;
        assume y in Union (F|E);
        then ex S st y in S & S in rng (F|E) by TARSKI:def 4;
        hence thesis;
      end;
      then sigma Union (F|E) c= Sigma by PROB_1:def 9;
      hence thesis by A42;
    end;
    assume u in sigUn(F,Ie) & v in tailSigmaField(F,I);
    hence thesis by A13,A24,A37,A41,A36,A38,Th10;
  end;
  assume a in tailSigmaField(F,I);
  then a,a are_independent_respect_to P by A1,A25;
  then P.(a /\ a) = P.a * P.a by PROB_2:def 4;
  hence thesis by Th2;
end;
