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 Th19:
  g = X|`f iff (for c holds c in dom g iff c in dom f & f/.c in X)
  & for c st c in dom g holds g/.c = f/.c
proof
  thus g = X|`f implies (for c holds c in dom g iff c in dom f & f/.c in X) &
  for c st c in dom g holds g/.c = f/.c
  proof
    assume
A1: g = X|`f;
    now
      let c;
      thus c in dom g implies c in dom f & f/.c in X
      proof
        assume c in dom g;
        then c in dom f & (f qua Function).c in X by A1,FUNCT_1:54;
        hence thesis by PARTFUN1:def 6;
      end;
      assume that
A2:   c in dom f and
A3:   f/.c in X;
      (f qua Function).c in X by A2,A3,PARTFUN1:def 6;
      hence c in dom g by A1,A2,FUNCT_1:54;
    end;
    hence for c holds c in dom g iff c in dom f & f/.c in X;
    let c;
    assume
A4: c in dom g;
    then (g qua Function).c = (f qua Function).c by A1,FUNCT_1:55;
    then
A5: g/.c = (f qua Function).c by A4,PARTFUN1:def 6;
    c in dom f by A1,A4,FUNCT_1:54;
    hence thesis by A5,PARTFUN1:def 6;
  end;
  assume that
A6: for c holds c in dom g iff c in dom f & f/.c in X and
A7: for c st c in dom g holds g/.c = f/.c;
A8: now
    let x be object;
    thus x in dom g implies x in dom f & (f qua Function).x in X
    proof
      assume
A9:   x in dom g;
      then reconsider x1=x as Element of C;
      x1 in dom f & f/.x1 in X by A6,A9;
      hence thesis by PARTFUN1:def 6;
    end;
    assume that
A10: x in dom f and
A11: (f qua Function).x in X;
    reconsider x1=x as Element of C by A10;
    f/.x1 in X by A10,A11,PARTFUN1:def 6;
    hence x in dom g by A6,A10;
  end;
  now
    let x be object;
    assume
A12: x in dom g;
    then reconsider x1=x as Element of C;
    g/.x1 = f/.x1 by A7,A12;
    then
A13: (g qua Function).x1 = f/.x1 by A12,PARTFUN1:def 6;
    x1 in dom f by A6,A12;
    hence (g qua Function).x = (f qua Function).x by A13,PARTFUN1:def 6;
  end;
  hence thesis by A8,FUNCT_1:53;
end;
