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 Th17:
  f = id X iff dom f = X & for x st x in X holds f.x = x
proof
  hereby
    assume
A1: f = id X;
    hence
A2: dom f = X;
    let x;
    assume
A3: x in X;
    then [x,x] in f by A1,RELAT_1:def 10;
    hence f.x = x by A2,A3,Def2;
  end;
  assume that
A4: dom f = X and
A5: for x st x in X holds f.x = x;
  now
    let x,y be object;
    hereby
      assume
A6:   [x,y] in f;
      hence
A7:   x in X by A4,Th1;
      y = f.x by A6,Th1;
      hence x = y by A5,A7;
    end;
    assume
A8: x in X;
    then f.x = x by A5;
    hence x = y implies [x,y] in f by A4,A8,Th1;
  end;
  hence thesis by RELAT_1:def 10;
end;
