reserve x for object;
reserve D for set;
reserve p for PartialPredicate of D;
reserve D for non empty set;
reserve p,q,r for PartialPredicate of D;

theorem Th30:
  PP_and(p,PP_or(q,r)) = PP_or(PP_and(p,q),PP_and(p,r))
  proof
    set qr = PP_or(q,r);
    set a = PP_and(p,qr);
    set pq = PP_and(p,q);
    set pr = PP_and(p,r);
    set b = PP_or(pq,pr);
A1: dom qr = {d where d is Element of D:
     d in dom q & q.d = TRUE or d in dom r & r.d = TRUE
     or d in dom q & q.d = FALSE & d in dom r & r.d = FALSE} by Def4;
A2: dom a = {d where d is Element of D:
     d in dom p & p.d = FALSE or d in dom qr & qr.d = FALSE
     or d in dom p & p.d = TRUE & d in dom qr & qr.d = TRUE} by Th16;
A3: dom pq = {d where d is Element of D:
     d in dom p & p.d = FALSE or d in dom q & q.d = FALSE
     or d in dom p & p.d = TRUE & d in dom q & q.d = TRUE} by Th16;
A4: dom pr = {d where d is Element of D:
     d in dom p & p.d = FALSE or d in dom r & r.d = FALSE
     or d in dom p & p.d = TRUE & d in dom r & r.d = TRUE} by Th16;
A5: dom b = {d where d is Element of D:
     d in dom pq & pq.d = TRUE or d in dom pr & pr.d = TRUE
     or d in dom pq & pq.d = FALSE & d in dom pr & pr.d = FALSE} by Def4;
    thus dom a = dom b
    proof
      thus dom a c= dom b
      proof
        let d be object;
        assume d in dom a;
        then per cases by Th17;
        suppose d in dom p & p.d = FALSE;
          then d in dom pq & pq.d = FALSE & d in dom pr & pr.d = FALSE
          by A3,A4,Th19;
          hence thesis by A5;
        end;
        suppose d in dom qr & qr.d = FALSE;
          then d in dom q & q.d = FALSE & d in dom r & r.d = FALSE
          by Th13;
          then d in dom pq & pq.d = FALSE & d in dom pr & pr.d = FALSE
          by A3,A4,Th19;
          hence thesis by A5;
        end;
        suppose that
A6:       d in dom p & p.d = TRUE and
A7:       d in dom qr & qr.d = TRUE;
          d in dom q & q.d = TRUE or d in dom r & r.d = TRUE
          by A7,Th10;
          then d in dom pq & pq.d = TRUE or d in dom pr & pr.d = TRUE
          by A3,A4,A6,Th18;
          hence thesis by A5;
        end;
      end;
      let d be object;
      assume d in dom b;
      then per cases by Th8;
      suppose
A8:    d in dom pq & pq.d = TRUE;
        then
A9:    d in dom p & p.d = TRUE by Th23;
        d in dom q & q.d = TRUE by A8,Th23;
        then d in dom qr & qr.d = TRUE by A1,Def4;
        hence thesis by A2,A9;
      end;
      suppose
A10:    d in dom pr & pr.d = TRUE;
        then
A11:    d in dom p & p.d = TRUE by Th23;
        d in dom r & r.d = TRUE by A10,Th23;
        then d in dom qr & qr.d = TRUE by A1,Def4;
        hence thesis by A2,A11;
      end;
      suppose d in dom pq & pq.d = FALSE & d in dom pr & pr.d = FALSE;
        then (d in dom p & p.d = FALSE or d in dom q & q.d = FALSE)
        & (d in dom p & p.d = FALSE or d in dom r & r.d = FALSE)
        by Th25;
        then d in dom p & p.d = FALSE or d in dom qr & qr.d = FALSE
        by A1,Def4;
        hence thesis by A2;
      end;
    end;
    let d be object;
    assume d in dom a;
    then per cases by Th17;
    suppose
A12:  d in dom p & p.d = FALSE;
      then d in dom pq & pq.d = FALSE & d in dom pr & pr.d = FALSE
      by A3,A4,Th19;
      hence b.d = FALSE by Def4
      .= a.d by A12,Th19;
    end;
    suppose
A13:  d in dom qr & qr.d = FALSE;
      then d in dom q & q.d = FALSE & d in dom r & r.d = FALSE
      by Th13;
      then d in dom pq & pq.d = FALSE & d in dom pr & pr.d = FALSE
      by A3,A4,Th19;
      hence b.d = FALSE by Def4
      .= a.d by A13,Th19;
    end;
    suppose that
A14:  d in dom p & p.d = TRUE and
A15:  d in dom qr & qr.d = TRUE;
      d in dom q & q.d = TRUE or d in dom r & r.d = TRUE
      by A15,Th10;
      then d in dom pq & pq.d = TRUE or d in dom pr & pr.d = TRUE
      by A3,A4,A14,Th18;
      hence b.d = TRUE by Def4
      .= a.d by A14,A15,Th18;
    end;
  end;
