reserve X,X1,X2,Y,Y1,Y2 for set, p,x,x1,x2,y,y1,y2,z,z1,z2 for object;
reserve f,g,g1,g2,h for Function,
  R,S for Relation;

theorem Th2:
  dom f = dom g & (for x st x in dom f holds f.x = g.x) implies f = g
proof
  assume that
A1: dom f = dom g and
A2: for x st x in dom f holds f.x = g.x;
  let x,y be object;
  thus [x,y] in f implies [x,y] in g
  proof
    assume
A3: [x,y] in f;
    then
A4: x in dom f by XTUPLE_0:def 12;
    reconsider y as set by TARSKI:1;
    f.x = y by A3,Def2,A4;
    then g.x = y by A2,A4;
    hence thesis by A1,A4,Def2;
  end;
  assume
A5: [x,y] in g;
  then
A6: x in dom g by XTUPLE_0:def 12;
    reconsider y as set by TARSKI:1;
  g.x = y by A5,Def2,A6;
  then f.x = y by A1,A2,A6;
  hence thesis by A1,A6,Def2;
end;
