reserve i, x, I for set,
  A, B, M for ManySortedSet of I,
  f, f1 for Function;
reserve SF, SG for SubsetFamily of M;
reserve E, T for Element of Bool M;
reserve g, h for SetOp of M;
reserve S for 1-sorted;
reserve MS for many-sorted over S;

theorem Th40:
  for D being ClosureSystem of S for f being SetOp of the Sorts of
  D st for x being Element of Bool the Sorts of D holds f.x = Cl x holds f is
  reflexive monotonic idempotent
proof
  let D be ClosureSystem of S, f be SetOp of the Sorts of D such that
A1: for x being Element of Bool the Sorts of D holds f.x = Cl x;
  set M = the Sorts of D;
A2: f is reflexive
  proof
    let x be Element of Bool M;
    consider F being SubsetFamily of M such that
A3: Cl x = meet |:F:| and
A4: F = { X where X is Element of Bool the Sorts of D : x c=' X & X in
    the Family of D } by Def22;
A5: for Z1 being ManySortedSet of the carrier of S st Z1 in F holds x c=' Z1
    proof
      let Z1 be ManySortedSet of the carrier of S;
      assume Z1 in F;
      then
      ex a being Element of Bool M st Z1 = a & x c=' a & a in the Family of
      D by A4;
      hence thesis;
    end;
    f.x = meet |:F:| by A1,A3;
    hence thesis by A5,Th24;
  end;
A6: f is monotonic
  proof
    let x, y be Element of Bool M such that
A7: x c=' y;
    consider Fy being SubsetFamily of M such that
A8: Cl y = meet |:Fy:| and
A9: Fy = { X where X is Element of Bool the Sorts of D : y c=' X & X
    in the Family of D } by Def22;
    consider Fx being SubsetFamily of M such that
A10: Cl x = meet |:Fx:| and
A11: Fx = { X where X is Element of Bool the Sorts of D : x c=' X & X
    in the Family of D } by Def22;
    |:Fy:| c=' |:Fx:|
    proof
      let i be object such that
A12:  i in the carrier of S;
      thus |:Fy:|.i c= |:Fx:|.i
      proof
        let q be object such that
A13:    q in |:Fy:|.i;
        per cases;
        suppose
          Fy is empty;
          then reconsider Fy9 = Fy as empty SubsetFamily of M;
          |:Fy9:|.i is empty;
          hence thesis by A13;
        end;
        suppose
          Fy is non empty;
          then |:Fy:|.i = { e.i where e is Element of Bool M : e in Fy } by A12
,Th14;
          then consider w being Element of Bool M such that
A14:      q = w.i and
A15:      w in Fy by A13;
A16:      ex r being Element of Bool M st r = w & y c=' r & r in the
          Family of D by A9,A15;
          then x c=' w by A7,PBOOLE:13;
          then
A17:      w in Fx by A11,A16;
          then |:Fx:|.i = { e.i where e is Element of Bool M : e in Fx } by A12
,Th14;
          hence thesis by A14,A17;
        end;
      end;
    end;
    then meet |:Fx:| c=' meet |:Fy:| by MSSUBFAM:46;
    then meet |:Fx:| c=' f.y by A1,A8;
    hence thesis by A1,A10;
  end;
  f is idempotent
  proof
    let x be Element of Bool M;
    consider F being SubsetFamily of M such that
A18: Cl x = meet |:F:| and
A19: F = { X where X is Element of Bool the Sorts of D : x c=' X & X
    in the Family of D } by Def22;
    F c= the Family of D
    proof
      let k be object;
      assume k in F;
      then
      ex q being Element of Bool M st k = q & x c=' q & q in the Family of
      D by A19;
      hence thesis;
    end;
    then
A20: meet |:F:| in the Family of D by Def7;
    thus f.x = meet |:F:| by A1,A18
      .= f.(meet |:F:|) by A1,A20,Th38
      .= f.(f.x) by A1,A18;
  end;
  hence thesis by A2,A6;
end;
