reserve f, g, h for Function;
reserve x, y, z, u, X for set,
  A for non empty set,
  n for Element of NAT,
  f for Function of X, X;
reserve f for c=-monotone Function of bool X, bool X,
  S for Subset of X;
reserve X, Y for non empty set,
  f for Function of X, Y,
  g for Function of Y, X;

theorem Th9:
  ex Xa, Xb, Ya, Yb being set st Xa misses Xb & Ya misses Yb & Xa
  \/ Xb = X & Ya \/ Yb = Y & f.:Xa = Ya & g.:Yb = Xb
proof
  deffunc F(set)= X\g.:(Y\f.:$1);
A1: for x being set st x in bool X holds F(x) in bool X;
  consider h being Function of bool X, bool X such that
A2: for x being set st x in bool X holds h.x =F(x) from FUNCT_2:sch 11(A1);
  now
    let x, y be set;
    assume that
A3: x in dom h and
A4: y in dom h and
A5: x c= y;
    f.:x c= f.:y by A5,RELAT_1:123;
    then Y \ f.:y c= Y \ f.:x by XBOOLE_1:34;
    then g.:(Y \ f.:y) c= g.:(Y \ f.:x) by RELAT_1:123;
    then X \ g.:(Y \ f.:x) c= X \ g.:(Y \ f.:y) by XBOOLE_1:34;
    then h.x c= X \ g.:(Y \ f.:y) by A2,A3;
    hence h.x c= h.y by A2,A4;
  end;
  then reconsider h as c=-monotone Function of bool X, bool X by COHSP_1:def 11
;
  take Xa = lfp (X, h);
  take Xb = X \ Xa;
  take Ya = f.:Xa;
  take Yb = Y \ Ya;
  thus Xa misses Xb by XBOOLE_1:79;
  thus Ya misses Yb by XBOOLE_1:79;
  thus Xa \/ Xb = X by XBOOLE_1:45;
  thus Ya \/ Yb = Y by XBOOLE_1:45;
  thus f.:Xa = Ya;
A6: Xa is_a_fixpoint_of h by Th4;
  thus g.:Yb = X/\g.:(Y\f.:Xa) by XBOOLE_1:28
    .= X\(X\g.:(Y\f.:Xa)) by XBOOLE_1:48
    .= X\h.Xa by A2
    .= Xb by A6;
end;
