
theorem Th14:
  for X being non empty set ex f being Function of BoolePoset X,
product (X --> BoolePoset {0}) st f is isomorphic & for Y being Subset of X
   holds
  f.Y = chi(Y,X)
proof
  let X be non empty set;
  set XB = X --> BoolePoset {0};
  deffunc F(set) = chi($1,X);
  consider f being Function such that
A1: dom f = bool X and
A2: for Y being set st Y in bool X holds f.Y = F(Y) from FUNCT_1:sch 5;
  LattPOSet BooleLatt {0} = RelStr(#the carrier of BooleLatt {0}, LattRel(
    BooleLatt {0})#) by LATTICE3:def 2;
  then
A3: the carrier of BoolePoset{0} = the carrier of BooleLatt{0}
            by YELLOW_1:def 2
    .= bool {{}} by LATTICE3:def 1
    .= {0,1} by CARD_1:49,ZFMISC_1:24;
A4: rng f c= product Carrier XB
  proof
    let y be object;
    assume y in rng f;
    then consider x being object such that
A5: x in dom f & y = f.x by FUNCT_1:def 3;
    reconsider x as set by TARSKI:1;
A6: dom chi(x,X) = X by FUNCT_3:def 3
      .= dom (Carrier XB) by PARTFUN1:def 2;
A7: for z being object st z in dom Carrier XB
holds chi(x,X).z in (Carrier XB).z
    proof
      let z be object;
      assume z in dom (Carrier XB);
      then
A8:   z in X;
      then ex R being 1-sorted st R = XB.z & (Carrier XB).z = the carrier of R
      by PRALG_1:def 15;
      then
A9:   (Carrier XB).z = {0,1} by A3,A8,FUNCOP_1:7;
      per cases;
      suppose
        z in x;
        then chi(x,X).z = 1 by A8,FUNCT_3:def 3;
        hence thesis by A9,TARSKI:def 2;
      end;
      suppose
        not z in x;
        then chi(x,X).z = 0 by A8,FUNCT_3:def 3;
        hence thesis by A9,TARSKI:def 2;
      end;
    end;
    chi(x,X) = y by A1,A2,A5;
    hence thesis by A6,A7,CARD_3:def 5;
  end;
  LattPOSet BooleLatt X = RelStr(#the carrier of BooleLatt X, LattRel(
    BooleLatt X)#) by LATTICE3:def 2;
  then
A10: the carrier of BoolePoset X = the carrier of BooleLatt X by YELLOW_1:def 2
    .= bool X by LATTICE3:def 1;
A11: the carrier of product XB = product Carrier XB by YELLOW_1:def 4;
  then reconsider
  f as Function of BoolePoset X, product (X --> BoolePoset {0}) by A10,A1,A4,
FUNCT_2:def 1,RELSET_1:4;
A12: for A,B being Element of BoolePoset X holds A <= B iff f.A <= f.B
  proof
    let A,B be Element of BoolePoset X;
A13: f.A = chi(A,X) & f.B = chi(B,X) by A10,A2;
    hereby
      assume A <= B;
      then
A14:  A c= B by YELLOW_1:2;
      for i being object st i in X ex R being RelStr, xi,yi being Element of
      R st R = XB.i & xi = chi(A,X).i & yi = chi(B,X).i & xi <= yi
      proof
        let i be object;
        assume
A15:    i in X;
        take R = BoolePoset {0};
        per cases;
        suppose
A16:      i in A;
          reconsider xi = 1, yi = 1 as Element of R by A3,TARSKI:def 2;
          take xi,yi;
          thus R = XB.i by A15,FUNCOP_1:7;
          thus xi = chi(A,X).i by A15,A16,FUNCT_3:def 3;
          thus yi = chi(B,X).i by A14,A15,A16,FUNCT_3:def 3;
          thus xi <= yi;
        end;
        suppose
A17:      not i in A;
          thus thesis
          proof
            per cases;
            suppose
A18:          i in B;
              reconsider xi = 0, yi = 1 as Element of R by A3,TARSKI:def 2;
              take xi,yi;
              thus R = XB.i by A15,FUNCOP_1:7;
              thus xi = chi(A,X).i by A15,A17,FUNCT_3:def 3;
              thus yi = chi(B,X).i by A15,A18,FUNCT_3:def 3;
              xi c= yi;
              hence xi <= yi by YELLOW_1:2;
            end;
            suppose
A19:          not i in B;
              reconsider xi = 0, yi = 0 as Element of R by A3,TARSKI:def 2;
              take xi,yi;
              thus R = XB.i by A15,FUNCOP_1:7;
              thus xi = chi(A,X).i by A15,A17,FUNCT_3:def 3;
              thus yi = chi(B,X).i by A15,A19,FUNCT_3:def 3;
              thus xi <= yi;
            end;
          end;
        end;
      end;
      hence f.A <= f.B by A11,A13,YELLOW_1:def 4;
    end;
    assume f.A <= f.B;
    then consider h1,h2 being Function such that
A20: h1 = f.A and
A21: h2 = f.B and
A22: for i be object st i in X ex R being RelStr, xi,yi being Element of
    R st R = XB.i & xi = h1.i & yi = h2.i & xi <= yi by A11,YELLOW_1:def 4;
    A c= B
    proof
      let i be object;
      assume
A23:  i in A;
      then consider R being RelStr, xi,yi being Element of R such that
A24:  R = XB.i and
A25:  xi = h1.i and
A26:  yi = h2.i and
A27:  xi <= yi by A10,A22;
      reconsider a = xi, b = yi as Element of BoolePoset {0} by A10,A23,A24,
FUNCOP_1:7;
A28:  a <= b by A10,A23,A24,A27,FUNCOP_1:7;
A29:  xi = chi(A,X).i by A10,A2,A20,A25
        .= 1 by A10,A23,FUNCT_3:def 3;
A30:  yi <> 0
      proof
        assume yi = 0;
        then {0} c= 0 by A29,A28,YELLOW_1:2,CARD_1:49;
        hence thesis;
      end;
A31:  R = BoolePoset {0} by A10,A23,A24,FUNCOP_1:7;
      chi(B,X).i = h2.i by A10,A2,A21
        .= 1 by A3,A26,A31,A30,TARSKI:def 2;
      hence thesis by FUNCT_3:36;
    end;
    hence thesis by YELLOW_1:2;
  end;
  product Carrier XB c= rng f
  proof
    let z be object;
    assume z in product Carrier XB;
    then consider g being Function such that
A32: z = g and
A33: dom g = dom (Carrier XB) and
A34: for y being object st y in dom (Carrier XB) holds g.y in (Carrier XB
    ).y by CARD_3:def 5;
    set A = g"{1};
A35: A c= X
    proof
      let a be object;
      assume a in A;
      then a in dom g by FUNCT_1:def 7;
      hence thesis by A33;
    end;
A36: dom chi(A,X) = X by FUNCT_3:def 3
      .= dom g by A33,PARTFUN1:def 2;
    for a being object st a in dom chi(A,X) holds chi(A,X).a = g.a
    proof
      let a be object;
      assume
A37:  a in dom chi(A,X);
      then a in X;
      then a in dom (Carrier XB) by PARTFUN1:def 2;
      then
A38:  g.a in (Carrier XB).a by A34;
      ex R being 1-sorted st R = XB.a & (Carrier XB).a = the carrier of R
      by A37,PRALG_1:def 15;
      then (Carrier XB).a = {0,1} by A3,A37,FUNCOP_1:7;
      then
A39:  g.a = 0 or g.a = 1 by A38,TARSKI:def 2;
      per cases;
      suppose
        a in A;
        then chi(A,X).a = 1 & g.a in {1} by A37,FUNCT_1:def 7,FUNCT_3:def 3;
        hence thesis by TARSKI:def 1;
      end;
      suppose
A40:    not a in A;
        g.a <> 1
        proof
          assume g.a = 1;
          then g.a in {1} by TARSKI:def 1;
          hence thesis by A36,A37,A40,FUNCT_1:def 7;
        end;
        hence thesis by A37,A39,A40,FUNCT_3:def 3;
      end;
    end;
    then z = chi(A,X) by A32,A36,FUNCT_1:2
      .= f.A by A2,A35;
    hence thesis by A1,A35,FUNCT_1:def 3;
  end;
  then
A41: rng f = the carrier of product XB by A11;
  take f;
  for A,B being Element of BoolePoset X st f.A = f.B holds A = B
  proof
    let A, B be Element of BoolePoset X;
    assume
A42: f.A = f.B;
    f.A = chi(A,X) & f.B = chi(B,X) by A10,A2;
    hence thesis by A10,A42,FUNCT_3:38;
  end;
  then f is one-to-one;
  hence f is isomorphic by A41,A12,WAYBEL_0:66;
  thus thesis by A2;
end;
