 reserve X,a,b,c,x,y,z,t for set;
 reserve R for Relation;

theorem ThProposition9: :: Proposition 9 L
  for A being finite non empty set,
      L being Function of bool A, bool A st
  L.A = A &
  (for X being Subset of A holds L.X c= L.(L.X)) &
  (for X,Y being Subset of A holds L.(X /\ Y) = L.X /\ L.Y) holds
  ex R being non empty finite transitive RelStr st
  the carrier of R = A & L = LAp R
  proof
    let A be finite non empty set;
    let L be Function of bool A,bool A;
    assume
A0: L.A = A &
    (for X being Subset of A holds L.X c= L.(L.X)) &
    (for X,Y being Subset of A holds L.(X /\ Y) = L.X /\ L.Y);
    set H = Flip L;
LL: L = Flip H by ROUGHS_2:23;
C1: H.{} = {} by A0,ROUGHS_2:19;
    (for X,Y being Subset of A holds H.(X \/ Y) = H.X \/ H.Y)
      by A0,ROUGHS_2:22; then
    consider R being non empty finite RelStr such that
A1: the carrier of R = A & LAp R = L & UAp R = H &
        for x,y being Element of R holds
        [x,y] in the InternalRel of R iff x in H.{y} by YaoTh3,LL,C1;
    for x, y, z being object
    st x in the carrier of R & y in the carrier of R &
    z in the carrier of R & [x,y] in the InternalRel of R &
    [y,z] in the InternalRel of R holds [x,z] in the InternalRel of R
    proof
      let x,y,z be object;
      assume
B1:   x in the carrier of R & y in the carrier of R &
      z in the carrier of R & [x,y] in the InternalRel of R &
      [y,z] in the InternalRel of R;
      reconsider z as Element of R by B1;
      reconsider xx = x as Element of R by B1;
      reconsider w = x, yw = y as Element of R by B1;
      reconsider XX = {xx} as Subset of R;
zz:   L is /\-preserving by A0,ROUGHS_4:def 10;
      reconsider xx = {x}, yy = {y} as Subset of A by ZFMISC_1:31,A1,B1;
      yy in bool A; then
      reconsider Hy = H.{y} as Subset of A by FUNCT_2:5;
ZX:   {y} c= H.{z} by A1,ZFMISC_1:31,B1;
      reconsider Hz = H.{z} as Subset of A by A1,FUNCT_2:5;
      reconsider az = {z} as Subset of A by A1;
G1:   H.yy c= H.Hz by ROUGHS_4:def 8,zz,ZX;
      H.(H.az) c= H.az by R224,A0; then
BL:   H.{y} c= H.{z} by G1,XBOOLE_1:1;
      w in H.{yw} by B1,A1;
      hence thesis by A1,BL;
    end;
    then R is transitive by ORDERS_2:def 3,RELAT_2:def 8;
    hence thesis by A1;
  end;
