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 Th13:
  swap(X\/Y,x,y)=swap(X,x,y)\/swap(Y,x,y)
proof
  thus swap(X\/Y,x,y) c= swap(X,x,y)\/swap(Y,x,y)
  proof
    let a be object;
    assume a in swap(X\/Y,x,y);
    then per cases by XBOOLE_0:def 3;
    suppose a in {(A\{x})\/{y} where A is Element of X\/Y: x in A};
      then consider A be Element of X\/Y such that
A1:     a =(A\{x})\/{y} & x in A;
      X\/Y <>{} by A1,SUBSET_1:def 1;
      then A in X or A in Y by XBOOLE_0:def 3;
      then a in {(A\{x})\/{y} where A is Element of X: x in A} or
      a in {(A\{x})\/{y} where A is Element of Y: x in A} by A1;
      then a in swap(X,x,y) or a in swap(Y,x,y) by XBOOLE_0:def 3;
      hence thesis by XBOOLE_0:def 3;
    end;
    suppose a in {A\/{x} where A is Element of X\/Y :
      not x in A & A in X\/Y};
      then consider A be Element of X\/Y such that
A2:     a =A\/{x} & not x in A & A in X\/Y;
      A in X or A in Y by A2, XBOOLE_0:def 3;
      then a in {A\/{x} where A is Element of X: not x in A & A in X} or
      a in {A\/{x} where A is Element of Y: not x in A & A in Y} by A2;
      then a in swap(X,x,y) or a in swap(Y,x,y) by XBOOLE_0:def 3;
      hence thesis by XBOOLE_0:def 3;
    end;
  end;
A3: swap(X,x,y) c= swap(X\/Y,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
A4:     a =(A\{x})\/{y} & x in A;
      X<>{} by A4,SUBSET_1:def 1;
      then A in X\/Y by XBOOLE_0:def 3;
      then a in {(A\{x})\/{y} where A is Element of X\/Y: x in A} by A4;
      hence thesis by XBOOLE_0:def 3;
    end;
    suppose a in {A\/{x} where A is Element of X : not x in A & A in X};
      then consider A be Element of X such that
A5:     a =A\/{x} & not x in A & A in X;
      A in X\/Y by A5,XBOOLE_0:def 3;
      then a in {A\/{x} where A is Element of X\/Y: not x in A & A in X\/Y}
        by A5;
      hence thesis by XBOOLE_0:def 3;
    end;
  end;
  swap(Y,x,y) c= swap(X\/Y,x,y)
  proof
    let a be object;
    assume a in swap(Y,x,y);
    then per cases by XBOOLE_0:def 3;
    suppose a in {(A\{x})\/{y} where A is Element of Y: x in A};
      then consider A be Element of Y such that
A6:     a =(A\{x})\/{y} & x in A;
      Y<>{} by A6,SUBSET_1:def 1;
      then A in X\/Y by XBOOLE_0:def 3;
      then a in {(A\{x})\/{y} where A is Element of X\/Y: x in A} by A6;
      hence thesis by XBOOLE_0:def 3;
    end;
    suppose a in {A\/{x} where A is Element of Y : not x in A & A in Y};
      then consider A be Element of Y such that
A7:     a =A\/{x} & not x in A & A in Y;
      A in X\/Y by A7,XBOOLE_0:def 3;
      then a in {A\/{x} where A is Element of X\/Y: not x in A & A in X\/Y}
        by A7;
      hence thesis by XBOOLE_0:def 3;
    end;
  end;
  hence thesis by A3,XBOOLE_1:8;
end;
