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

theorem KeyLemma:
  for f being Function st
  dom f is subset-closed & f is union-distributive &
  dom f is d.union-closed holds
  for a, y being set st a in dom f &
  y in f.a ex x being set st x in a & y in f.{x}
  proof
    let f be Function;
    assume
A1: dom f is subset-closed;
    then reconsider C = dom f as subset-closed set;
A2: {} is Subset of dom f by XBOOLE_1:2;
    assume that
A3: f is union-distributive and
AB: dom f is d.union-closed;
    let a, y be set;
    assume that
A4: a in dom f and
A5: y in f.a;
    consider b being set such that
    b is finite and
A6: b c= a and
A7: y in f.b by A1,A4,A5,Th21,AB,A3;
A9: dom f = C; then
    {} in dom f by A4,CLASSES1:def 1,XBOOLE_1:2;
    then f.{} = union (f.:{}) by A3,A2,ZFMISC_1:2,COHSP_1:def 9
      .= {} by ZFMISC_1:2;
    then reconsider b as non empty set by A7;
    reconsider A = the set of all {x} where x is Element of b as set;
A10: b in dom f by A4,A6,A9,CLASSES1:def 1;
A11: A c= dom f
    proof
      let X be object;
      reconsider xx=X as set by TARSKI:1;
      assume X in A;
      then ex x being Element of b st X = {x};
      hence thesis by A9,A10,CLASSES1:def 1;
    end;
    now
      let X be set;
      assume X in A;
      then ex x being Element of b st X = {x};
      hence X c= b;
    end; then
A12: union A in dom f by A9,A10,CLASSES1:def 1,ZFMISC_1:76;
    reconsider A as Subset of dom f by A11;
    b c= union A
    proof
      let x be object;
      assume x in b;
      then {x} in A;
      then {x} c= union A by ZFMISC_1:74;
      hence thesis by ZFMISC_1:31;
    end;
    then
A13: f.b c= f.union A by A3,A10,A12,COHSP_1:def 11;
    f.union A = union (f.:A) by A3,A12,COHSP_1:def 9;
    then consider Y being set such that
A14: y in Y and
A15: Y in f.:A by A7,A13,TARSKI:def 4;
    consider X being object such that
    X in dom f and
A16: X in A and
A17: Y = f.X by A15,FUNCT_1:def 6;
    reconsider X as set by A16;
    consider x being Element of b such that
A18: X = {x} by A16;
    reconsider x as set;
    take x;
    x in b;
    hence x in a by A6;
    thus y in f.{x} by A14,A17,A18;
  end;
