reserve x, y for object, I for set,
  A, B, X, Y for ManySortedSet of I;

theorem :: ZFMISC_1:101
  for A, B be ManySortedSet of I st A (\/) B is non-empty &
   for X, Y be ManySortedSet of I st X <> Y & X in A (\/) B & Y in A (\/) B
      holds X (/\) Y = EmptyMS I
   holds union(A (/\) B) = union A (/\) union B
proof
  let A, B be ManySortedSet of I such that
A1: A (\/) B is non-empty;
  assume
A2: for X, Y be ManySortedSet of I st X <> Y & X in A (\/) B & Y in A (\/) B
  holds X (/\) Y = EmptyMS I;
  now
    let i be object such that
A3: i in I;
    for X9, Y9 be set st X9 <> Y9 & X9 in A.i \/ B.i & Y9 in A.i \/ B.i
    holds X9 misses Y9
    proof
      consider M be ManySortedSet of I such that
A4:   M in A (\/) B by A1,PBOOLE:134;
A5:   i in {i} by TARSKI:def 1;
      let X9, Y9 be set such that
A6:   X9 <> Y9 and
A7:   X9 in A.i \/ B.i and
A8:   Y9 in A.i \/ B.i;
      dom (M +* (i .--> X9)) = I & dom (M +* (i .--> Y9)) = I by A3,Lm1;
      then reconsider
      Kx = M +* (i.-->X9), Ky = M +* (i.-->Y9) as ManySortedSet of
      I by PARTFUN1:def 2,RELAT_1:def 18;
   dom (i .--> Y9) = {i};
      then
A10:  Ky.i = (i .--> Y9).i by A5,FUNCT_4:13
        .= Y9 by FUNCOP_1:72;
A11:  Ky in A (\/) B
      proof
        let j be object such that
A12:    j in I;
        now
          per cases;
          suppose
            j = i;
            hence thesis by A8,A10,A12,PBOOLE:def 4;
          end;
          suppose
            j <> i;
            then not j in dom (i .--> Y9) by TARSKI:def 1;
            then Ky.j = M.j by FUNCT_4:11;
            hence thesis by A4,A12;
          end;
        end;
        hence thesis;
      end;
  dom (i .--> X9) = {i};
      then
A14:  Kx.i = (i .--> X9).i by A5,FUNCT_4:13
        .= X9 by FUNCOP_1:72;
      Kx in A (\/) B
      proof
        let j be object such that
A15:    j in I;
        now
          per cases;
          case
            j = i;
            hence thesis by A7,A14,A15,PBOOLE:def 4;
          end;
          case
            j <> i;
            then not j in dom (i .--> X9) by TARSKI:def 1;
            then Kx.j = M.j by FUNCT_4:11;
            hence thesis by A4,A15;
          end;
        end;
        hence thesis;
      end;
      then Kx (/\) Ky = EmptyMS I by A2,A6,A14,A10,A11;
      then (Kx (/\) Ky).i = {} by PBOOLE:5;
      then X9 /\ Y9 = {} by A3,A14,A10,PBOOLE:def 5;
      hence thesis by XBOOLE_0:def 7;
    end;
    then union(A.i /\ B.i) = union(A.i) /\ union(B.i) by ZFMISC_1:83;
    then union(A.i /\ B.i) = (union A).i /\ union(B.i) by A3,Def2;
    then union(A.i /\ B.i) = (union A).i /\ (union B).i by A3,Def2;
    then union(A.i /\ B.i) = (union A (/\) union B).i by A3,PBOOLE:def 5;
    hence (union(A (/\) B).i) = (union A (/\) union B).i by A3,Lm7;
  end;
  hence thesis;
end;
