reserve A,B,C for Ordinal,
  X,X1,Y,Y1,Z for set,a,b,b1,b2,x,y,z for object,
  R for Relation,
  f,g,h for Function,
  k,m,n for Nat;
reserve M,N for Cardinal;
reserve S for Sequence;

theorem Th30:
  X misses X1 & Y misses Y1 & X,Y are_equipotent & X1,Y1
  are_equipotent implies X \/ X1,Y \/ Y1 are_equipotent
proof
  assume that
A1: X /\ X1 = {} and
A2: Y /\ Y1 = {};
  given f such that
A3: f is one-to-one and
A4: dom f = X and
A5: rng f = Y;
  given g such that
A6: g is one-to-one and
A7: dom g = X1 and
A8: rng g = Y1;
  defpred P[object,object] means $1 in X & $2 = f.$1 or $1 in X1 & $2 = g.$1;
A9: for x being object st x in X \/ X1 ex y being object st P[x,y]
  proof
    let x be object;
    assume x in X \/ X1;
    then x in X or x in X1 by XBOOLE_0:def 3;
    hence thesis;
  end;
A10: for x,y,z being object st x in X \/ X1 & P[x,y] & P[x,z] holds y = z
     by A1,XBOOLE_0:def 4;
  consider h such that
A11: dom h = X \/ X1 and
A12: for x being object st x in X \/ X1 holds P[x,h.x]
from FUNCT_1:sch 2(A10,A9);
  take h;
  thus h is one-to-one
  proof
    let x,y be object;
    assume that
A13: x in dom h and
A14: y in dom h and
A15: h.x = h.y;
A16: y in X & h.y = f.y or y in X1 & h.y = g.y by A11,A12,A14;
A17: x in X & h.x = f.x or x in X1 & h.x = g.x by A11,A12,A13;
A18: now
      assume
A19:  y in X & x in X1;
      then f.y in Y & g.x in Y1 by A4,A5,A7,A8,FUNCT_1:def 3;
      hence contradiction by A1,A2,A15,A17,A16,A19,XBOOLE_0:def 4;
    end;
    now
      assume
A20:  x in X & y in X1;
      then f.x in Y & g.y in Y1 by A4,A5,A7,A8,FUNCT_1:def 3;
      hence contradiction by A1,A2,A15,A17,A16,A20,XBOOLE_0:def 4;
    end;
    hence thesis by A3,A4,A6,A7,A15,A17,A16,A18;
  end;
  thus dom h = X \/ X1 by A11;
  thus rng h c= Y \/ Y1
  proof
    let x be object;
    assume x in rng h;
    then consider y being object such that
A21: y in dom h and
A22: x = h.y by FUNCT_1:def 3;
A23: y in X & x = f.y or y in X1 & x = g.y by A11,A12,A21,A22;
A24: now
      assume y in X1;
      then x in Y1 by A1,A7,A8,A23,FUNCT_1:def 3,XBOOLE_0:def 4;
      hence thesis by XBOOLE_0:def 3;
    end;
    now
      assume y in X;
      then x in Y by A1,A4,A5,A23,FUNCT_1:def 3,XBOOLE_0:def 4;
      hence thesis by XBOOLE_0:def 3;
    end;
    hence thesis by A11,A21,A24,XBOOLE_0:def 3;
  end;
  let x be object such that
A25: x in Y \/ Y1;
A26: now
    assume x in Y1;
    then consider y being object such that
A27: y in dom g and
A28: x = g.y by A8,FUNCT_1:def 3;
A29: y in X \/ X1 by A7,A27,XBOOLE_0:def 3;
    then P[y,h.y] by A12;
    hence thesis by A1,A7,A11,A27,A28,A29,FUNCT_1:def 3,XBOOLE_0:def 4;
  end;
  now
    assume x in Y;
    then consider y being object such that
A30: y in dom f and
A31: x = f.y by A5,FUNCT_1:def 3;
A32: y in X \/ X1 by A4,A30,XBOOLE_0:def 3;
    then P[y,h.y] by A12;
    hence thesis by A1,A4,A11,A30,A31,A32,FUNCT_1:def 3,XBOOLE_0:def 4;
  end;
  hence thesis by A25,A26,XBOOLE_0:def 3;
end;
