
theorem Th29:  :: Proposition 1 2H 4H
  for A being non empty finite set,
      U being Function of bool A, bool A st
    U.{} = {} &
    (for X, Y being Subset of A holds U.(X \/ Y) = U.X \/ U.Y) holds
  ex R being non empty finite RelStr st
    the carrier of R = A & U = UAp R
  proof
    let A be non empty finite set;
    let L be Function of bool A, bool A;
    assume that
A1: L.{} = {} and
A2: for X, Y being Subset of A holds L.(X \/ Y) = L.X \/ L.Y;
    defpred P[set,set] means $1 in L.{$2};
    consider R being Relation of A such that
A3: for x, y being Element of A holds
      [x,y] in R iff P[x,y] from RELSET_1:sch 2;
    reconsider RR = RelStr (#A, R#) as non empty finite RelStr;
    take RR;
A4: for y be Element of RR, Y be Subset of RR st Y = {y} holds UAp Y = L.Y
    proof
      let y be Element of RR, Y be Subset of RR;
      assume
A5:   Y = {y};
      thus UAp Y c= L.Y
      proof
        let x be object; assume x in UAp Y; then
        consider a being Element of RR such that
A6:     a = x & Class (the InternalRel of RR, a) meets Y;
        consider z being object such that
A7:     z in Class (the InternalRel of RR, a) & z in Y by A6,XBOOLE_0:3;
        z = y by A7,TARSKI:def 1,A5; then
        [x,y] in R by A6,A7,EQREL_1:18;
        hence thesis by A5,A3,A6;
      end;
      let x be object;
      assume
A8:   x in L.Y;
A9:   y in Y by TARSKI:def 1,A5;
A10:    L.Y in bool A by FUNCT_2:5; then
      [x,y] in R by A3,A8,A5; then
      y in Class (R, x) by EQREL_1:18; then
      Class (the InternalRel of RR, x) meets Y by A9,XBOOLE_0:3;
      hence thesis by A10,A8;
    end;
    dom L = bool A by FUNCT_2:def 1; then
A11: dom UAp RR = dom L by FUNCT_2:def 1;
    for x being object st x in dom UAp RR holds (UAp RR).x = L.x
    proof
      let x be object;
      assume
A12:    x in dom UAp RR;
      per cases;
      suppose x <> {}; then
        reconsider X = x as finite non empty Subset of RR by A12;
        defpred P[finite non empty Subset of RR] means (UAp RR).$1 = L.$1;
A13:     for x being Element of RR st x in X holds P[{x}]
        proof
          let x be Element of RR;
          assume x in X;
          set I = {x};
          (UAp RR).I = UAp I by Def11 .= L.I by A4;
          hence thesis;
        end;
A14:     for x being Element of RR,
            B being non empty finite Subset of RR
         st x in X & B c= X & not x in B & P[B] holds P[B \/ {x}]
        proof
          let x be Element of RR, B be non empty finite Subset of RR;
          assume x in X & B c= X & not x in B & P[B]; then
A15:       UAp B = L.B by Def11;
          set I = {x};
          (UAp RR).(B \/ {x}) = UAp (B \/ I) by Def11
                             .= (UAp B) \/ (UAp I) by Th13
                             .= (L.B) \/ L.I by A4,A15
                             .= L.(B \/ I) by A2;
          hence thesis;
        end;
        P[X] from CHAIN_1:sch 2(A13,A14);
        hence thesis;
      end;
      suppose
A16:      x = {};
        UAp {}RR = L.{} by A1;
        hence thesis by Def11,A16;
      end;
    end;
    hence thesis by A11,FUNCT_1:2;
  end;
