reserve x,y,X,X1,Y,Z for set;
reserve L for Lattice;
reserve F,H for Filter of L;
reserve p,q,r for Element of L;
reserve L1, L2 for Lattice;
reserve a1,b1 for Element of L1;
reserve a2 for Element of L2;
reserve f for Homomorphism of L1,L2;
reserve B for Element of Fin the carrier of L;
reserve DL for distributive Lattice;
reserve f for Homomorphism of DL,L2;
reserve 0L for lower-bounded Lattice,
  B,B1,B2 for Element of Fin the carrier of 0L,
  b for Element of 0L;
reserve f for UnOp of the carrier of 0L;
reserve 1L for upper-bounded Lattice,
  B,B1,B2 for Element of Fin the carrier of 1L,
  b for Element of 1L;
reserve f,g for UnOp of the carrier of 1L;
reserve DL for distributive upper-bounded Lattice,
  B for Element of Fin the carrier of DL,
  p for Element of DL,
  f for UnOp of the carrier of DL;
reserve CL for C_Lattice;
reserve IL for implicative Lattice;
reserve f for Homomorphism of IL,CL;
reserve i,j,k for Element of IL;
reserve BL for Boolean Lattice;
reserve f for Homomorphism of BL,CL;
reserve A for non empty Subset of BL;
reserve a1,a,b,c,p,q for Element of BL;
reserve B,B0,B1,B2,A1,A2 for Element of Fin the carrier of BL;
reserve F,H for Field of BL;

theorem Th42:
  for AF being non empty ClosedSubset of BL st Bottom BL in AF &
  Top BL in AF for B holds B c= SetImp AF implies ex B0 st B0 c= SetImp AF &
  FinJoin( B,comp BL) = FinMeet B0
proof
  let AF be non empty ClosedSubset of BL such that
A1: Bottom BL in AF and
A2: Top BL in AF;
  set C={ FinJoin A1 "\/" FinJoin(A2,comp BL): A1 c= AF & A2 c= AF};
A3: C c= SetImp AF
  proof
    let x be object;
    assume x in C;
    then consider A1,A2 such that
A4: x = FinJoin A1 "\/" FinJoin(A2,comp BL) and
A5: A1 c= AF & A2 c= AF;
    consider p,q such that
A6: p = FinMeet A2 & q = FinJoin A1;
A7: x = p` "\/" q by A4,A6,Th41;
    p in AF & q in AF by A1,A2,A5,A6,Th17,Th24;
    hence thesis by A7,Th37;
  end;
  defpred X[Element of Fin the carrier of BL] means $1 c= SetImp AF implies
  ex B0 st B0 c= C & FinJoin($1,comp BL) = FinMeet B0;
  let B;
  assume
A8: B c= SetImp AF;
A9: for B9 being Element of Fin the carrier of BL, b being Element of BL
  st X[B9] holds X[B9 \/ {.b.}]
  proof
    set J = the L_join of BL;
    let B9 be Element of Fin the carrier of BL, b be Element of BL;
    assume
A10: B9 c= SetImp AF implies ex B1 st B1 c= C & FinJoin(B9,comp BL) =
    FinMeet B1;
    assume
A11: B9 \/ {b} c= SetImp AF;
    then consider B1 such that
A12: B1 c= C and
A13: FinJoin(B9,comp BL) = FinMeet B1 by A10,ZFMISC_1:137;
    b in SetImp AF by A11,ZFMISC_1:137;
    then consider p,q such that
A14: b = p` "\/" q and
A15: p in AF and
A16: q in AF by Th37;
A17: for x,b holds x in (J[:](id BL,b)).:B1 implies ex a st a in B1 & x =
    a "\/" b
    proof
      let x,b;
      assume
A18:  x in (J[:](id BL,b)).:B1;
      (J[:](id BL,b)).:B1 c= the carrier of BL by FUNCT_2:36;
      then reconsider x as Element of BL by A18;
      consider a such that
A19:  a in B1 and
A20:  x = (J[:](id BL,b)).a by A18,FUNCT_2:65;
      x = J.(id BL.a,b) by A20,FUNCOP_1:48
        .= a "\/" b by FUNCT_1:18;
      hence thesis by A19;
    end;
A21: (J[:](id BL,p)).:B1 c= C
    proof
      let x be object;
      assume x in (J[:](id BL,p)).:B1;
      then consider a such that
A22:  a in B1 and
A23:  x = a "\/" p by A17;
      a in C by A12,A22;
      then consider A1,A2 such that
A24:  a = FinJoin A1 "\/" FinJoin(A2,comp BL) and
A25:  A1 c= AF & A2 c= AF;
      ex A19,A29 being Element of Fin the carrier of BL st x = FinJoin
      A19 "\/" FinJoin (A29,comp BL) & A19 c= AF & A29 c= AF
      proof
        take A19=A1 \/ {.p.};
        take A29=A2;
        x = (FinJoin A1 "\/" p) "\/" FinJoin(A2,comp BL) by A23,A24,
LATTICES:def 5
          .= FinJoin(A19) "\/" FinJoin(A29,comp BL) by Th14;
        hence thesis by A15,A25,ZFMISC_1:137;
      end;
      hence thesis;
    end;
A26: (J[:](id BL,q`)).:B1 c= C
    proof
      let x be object;
      assume x in (J[:](id BL,q`)).:B1;
      then consider a such that
A27:  a in B1 and
A28:  x = a "\/" q` by A17;
      a in C by A12,A27;
      then consider A1,A2 such that
A29:  a = FinJoin A1 "\/" FinJoin(A2,comp BL) and
A30:  A1 c= AF & A2 c= AF;
      ex A19,A29 being Element of Fin the carrier of BL st x = FinJoin
      A19 "\/" FinJoin (A29,comp BL) & A19 c= AF & A29 c= AF
      proof
        take A19=A1;
        take A29=A2 \/ {.q.};
        x = FinJoin A1 "\/" (FinJoin(A2,comp BL) "\/" q`) by A28,A29,
LATTICES:def 5
          .= FinJoin(A19) "\/" FinJoin(A29,comp BL) by Th38;
        hence thesis by A16,A30,ZFMISC_1:137;
      end;
      hence thesis;
    end;
    take (J[:](id BL,p)).:B1 \/ (J[:](id BL,q`)).:B1;
    b` = p`` "/\" q` by A14,LATTICES:24
      .= p "/\" q`;
    then FinJoin(B9 \/ {.b.} ,comp BL) = FinMeet B1 "\/" (p "/\" q`) by A13
,Th38
      .= (FinMeet B1 "\/" p) "/\" (FinMeet B1 "\/" q`) by LATTICES:11
      .= FinMeet((J[:](id BL,p)).:B1) "/\" (FinMeet B1 "\/" q`) by Th25
      .= FinMeet((J[:](id BL,p)).:B1) "/\" FinMeet ((J[:] (id BL,q`)).:B1)
    by Th25
      .= FinMeet ((J[:](id BL,p)).:B1 \/ (J[:](id BL,q`)).:B1) by Th23;
    hence thesis by A21,A26,XBOOLE_1:8;
  end;
A31: X[{}.the carrier of BL]
  proof
    assume {}.the carrier of BL c= SetImp AF;
    take B0={.Bottom BL.};
A32: B0 c= C
    proof
      let x be object;
      assume x in B0;
      then
A33:  x = Bottom BL by TARSKI:def 1;
      ex A1,A2 st x = FinJoin A1 "\/" FinJoin(A2,comp BL) & A1 c= AF & A2 c= AF
      proof
        take A1={.Bottom BL.};
        take A2={.Top BL.};
        thus x = Bottom BL "\/" Bottom BL by A33
          .= Bottom BL "\/" (Top BL)` by Th29
          .=FinJoin A1 "\/" (Top BL)` by Th9
          .=FinJoin A1 "\/" (FinMeet A2)` by Th10
          .=FinJoin A1 "\/" FinJoin (A2,comp BL) by Th41;
        thus A1 c= AF by A1,ZFMISC_1:31;
        thus thesis by A2,ZFMISC_1:31;
      end;
      hence thesis;
    end;
    FinJoin ({}.the carrier of BL,comp BL)= Bottom BL by Lm1
      .=FinMeet {.Bottom BL.} by Th10;
    hence thesis by A32;
  end;
  for B being Element of Fin the carrier of BL holds X[B] from SETWISEO
  :sch 4(A31,A9);
  then ex B1 st B1 c= C & FinJoin(B,comp BL) = FinMeet B1 by A8;
  hence thesis by A3,XBOOLE_1:1;
end;
