reserve i,j,n,k,m for Nat,
     a,b,x,y,z for object,
     F,G for FinSequence-yielding FinSequence,
     f,g,p,q for FinSequence,
     X,Y for set,
     D for non empty set;

theorem Th21:
  for f be Function st b<>x & b <> y holds
    b in Swap(f,x,y).a iff b in f.a
proof
  let f be Function such that
A1: b<>x & b <> y;
  thus b in Swap(f,x,y).a implies b in f.a
  proof
    assume
A2:   b in Swap(f,x,y).a;
    then a in dom Swap(f,x,y) by FUNCT_1:def 2;
    then
A3:   a in dom f by Def4;
    per cases;
    suppose x in f.a;
      then Swap(f,x,y).a = ((f.a)\{x} )\/{y} by Def4,A3;
      then b in ((f.a)\{x} ) by A2,A1,ZFMISC_1:136;
      hence thesis;
    end;
    suppose not x in f.a;
      then Swap(f,x,y).a = (f.a)\/{x} by A3,Def4;
      hence thesis by A2,A1,ZFMISC_1:136;
    end;
  end;
  assume
A4: b in f.a;
  then
A5: a in dom f by FUNCT_1:def 2;
  b in (f.a)\{x} by ZFMISC_1:56,A4,A1;
  then
A6: b in ((f.a)\{x} )\/{y} by XBOOLE_0:def 3;
  per cases;
  suppose  x in f.a;
    hence thesis by A6,Def4,A5;
  end;
  suppose not x in f.a;
    then Swap(f,x,y).a = (f.a)\/{x} by A5,Def4;
    hence thesis by A4,ZFMISC_1:136;
  end;
end;
