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

theorem :: LOPCLSET:31
  for A, X be ManySortedSet of I for B be non-empty ManySortedSet of I
holds (X c= union (A (\/) B) & for Y be ManySortedSet of I st Y in B
  holds Y (/\) X = EmptyMS I) implies X c= union A
proof
  let A, X be ManySortedSet of I, B be non-empty ManySortedSet of I;
  assume that
A1: X c= union (A (\/) B) and
A2: for Y be ManySortedSet of I st Y in B holds Y (/\) X = EmptyMS I;
  let i be object;
  assume
A3: i in I;
A4: for Y9 be set st Y9 in B.i holds Y9 misses X.i
  proof
    consider M be ManySortedSet of I such that
A5: M in B by PBOOLE:134;
    let Y9 be set such that
A6: Y9 in B.i;
    dom (M +* (i .--> Y9)) = I by A3,Lm1;
    then reconsider K = M +* (i .--> Y9) as ManySortedSet of I by
PARTFUN1:def 2,RELAT_1:def 18;
A7: dom (i .--> Y9) = {i};
    i in {i} by TARSKI:def 1;
    then
A8: K.i = (i .--> Y9).i by A7,FUNCT_4:13
      .= Y9 by FUNCOP_1:72;
    K in B
    proof
      let j be object such that
A9:   j in I;
      now
        per cases;
        case
          j = i;
          hence thesis by A6,A8;
        end;
        case
          j <> i;
          then not j in dom (i .--> Y9) by TARSKI:def 1;
          then K.j = M.j by FUNCT_4:11;
          hence thesis by A5,A9;
        end;
      end;
      hence thesis;
    end;
    then K (/\) X = EmptyMS I by A2;
    then (K (/\) X).i = {} by PBOOLE:5;
    then Y9 /\ X.i = {} by A3,A8,PBOOLE:def 5;
    hence thesis by XBOOLE_0:def 7;
  end;
  X.i c= (union (A (\/) B)).i by A1,A3;
  then X.i c= union (A.i \/ B.i) by A3,Lm6;
  then X.i c= union (A.i) by A4,SETFAM_1:42;
  hence thesis by A3,Def2;
end;
