reserve x,y,X,Y for set;
reserve C,D,E for non empty set;
reserve SC for Subset of C;
reserve SD for Subset of D;
reserve SE for Subset of E;
reserve c,c1,c2 for Element of C;
reserve d,d1,d2 for Element of D;
reserve e for Element of E;
reserve f,f1,g for PartFunc of C,D;
reserve t for PartFunc of D,C;
reserve s for PartFunc of D,E;
reserve h for PartFunc of C,E;
reserve F for PartFunc of D,D;

theorem Th22:
  SD = f.: X iff for d holds d in SD iff ex c st c in dom f & c in X & d = f/.c
proof
  thus SD = f.:X implies for d holds d in SD iff ex c st c in dom f & c in X &
  d = f/.c
  proof
    assume
A1: SD = f.:X;
    let d;
    thus d in SD implies ex c st c in dom f & c in X & d = f/.c
    proof
      assume d in SD;
      then consider x being object such that
A2:   x in dom f and
A3:   x in X and
A4:   d = (f qua Function).x by A1,FUNCT_1:def 6;
      reconsider x as Element of C by A2;
      take x;
      thus x in dom f & x in X by A2,A3;
      thus thesis by A2,A4,PARTFUN1:def 6;
    end;
    given c such that
A5: c in dom f and
A6: c in X & d = f/.c;
    f/.c = (f qua Function).c by A5,PARTFUN1:def 6;
    hence thesis by A1,A5,A6,FUNCT_1:def 6;
  end;
  assume that
A7: for d holds d in SD iff ex c st c in dom f & c in X & d = f/.c and
A8: SD <> f.:X;
  consider x being object such that
A9: not (x in SD iff x in f.:X) by A8,TARSKI:2;
  now
    per cases by A9;
    suppose
A10:  x in SD & not x in f.:X;
      then reconsider x as Element of D;
      consider c such that
A11:  c in dom f and
A12:  c in X and
A13:  x = f/.c by A7,A10;
      x = (f qua Function).c by A11,A13,PARTFUN1:def 6;
      hence contradiction by A10,A11,A12,FUNCT_1:def 6;
    end;
    suppose
A14:  x in f.:X & not x in SD;
      then consider y being object such that
A15:  y in dom f and
A16:  y in X and
A17:  x = (f qua Function).y by FUNCT_1:def 6;
      reconsider y as Element of C by A15;
      x = f/.y by A15,A17,PARTFUN1:def 6;
      hence contradiction by A7,A14,A15,A16;
    end;
  end;
  hence contradiction;
end;
