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 Th31:
  x in X implies swap({X},x,y) = { (X\{x}) \/{y} }
proof
  assume
A1: x in X;
  thus swap({X},x,y) c= { X\{x} \/{y} }
  proof
    let a be object;
    assume a in swap({X},x,y);
    then per cases by XBOOLE_0:def 3;
    suppose a in {(A\{x}) \/{y} where A is Element of {X}: x in A};
      then consider A be Element of {X} such that
A2:     a= A\{x} \/{y} & x in A;
      A=X by TARSKI:def 1;
      hence thesis by A2,TARSKI:def 1;
    end;
    suppose a in {A\/{x}
      where A is Element of {X}: not x in A & A in {X}};
      then ex A be Element of {X} st
      a=A\/{x} & not x in A & A in {X};
      hence thesis by A1,TARSKI:def 1;
    end;
  end;
  let a be object;
  assume a in { (X\{x}) \/{y}  };
  then a=(X\{x}) \/{y} & X in {X} by TARSKI:def 1;
  then a in {(A\{x}) \/{y} where A is Element of {X}: x in A} by A1;
  hence thesis by XBOOLE_0:def 3;
end;
