reserve a,a1,a2,b,c,d for Ordinal,
  n,m,k for Nat,
  x,y,z,t,X,Y,Z for set;
reserve f,g for Function;
reserve A,B,C for array;

theorem Th41:
  Swap(id X,x,y) is one-to-one
  proof
A1: dom id X = X;
    per cases;
    suppose
A2:   x in X & y in X;
      set g = id X;
      set f = Swap(g,x,y);
      let z,t be object; assume
A3:   z in dom f & t in dom f & f.z = f.t;
A4:   g.z = z & g.t = t & g.x = x & g.y = y by A2,A3,FUNCT_1:17; then
A5:   (z = x implies f.z = y) & (z = y implies f.z = x) &
      (z <> x & z <> y implies f.z = z)
      by A2,A1,Th29,Th31,Th33;
      (t = x implies f.t = y) & (t = y implies f.t = x) &
      (t <> x & t <> y implies f.t = t)
      by A2,A1,A4,Th29,Th31,Th33;
      hence z = t by A3,A5;
    end;
    suppose
      not (x in X & y in X);
      hence thesis by A1,FUNCT_7:def 12;
    end;
  end;
