reserve i, x, I for set,
  A, M for ManySortedSet of I,
  f for Function,
  F for ManySortedFunction of I;
reserve P, R for MSSetOp of M,
  E, T for Element of bool M;
reserve S for 1-sorted;
reserve MS for many-sorted over S;

theorem Th32:
  for D being properly-upper-bound MSSubsetFamily of M for X being
  Element of bool M for SF being non-empty MSSubsetFamily of M st (for Y being
ManySortedSet of I holds Y in SF iff Y in D & X c= Y) holds for i being set, Di
being non empty set st i in I & Di = D.i holds SF.i = { z where z is Element of
Di: X.i c= z }
proof
  let D be properly-upper-bound MSSubsetFamily of M, X be Element of bool M,
  SF be non-empty MSSubsetFamily of M such that
A1: for Y being ManySortedSet of I holds Y in SF iff Y in D & X c= Y;
  let i be set, Di be non empty set such that
A2: i in I and
A3: Di = D.i;
  thus SF.i c= { z where z is Element of Di : X.i c= z }
  proof
    consider K be ManySortedSet of I such that
A4: K in SF by PBOOLE:134;
    let x be object such that
A5: x in SF.i;
    dom (K +* (i .--> x)) = I by A2,PZFMISC1:1;
    then reconsider L = K +* (i .--> x) as ManySortedSet of I by PARTFUN1:def 2
,RELAT_1:def 18;
A6: dom (i .--> x) = {i};
    i in {i} by TARSKI:def 1;
    then
A7: L.i = (i .--> x).i by A6,FUNCT_4:13
      .= x by FUNCOP_1:72;
A8: L in SF
    proof
      let s be object such that
A9:   s in I;
      per cases;
      suppose
        s = i;
        hence thesis by A5,A7;
      end;
      suppose
        s <> i;
        then not s in dom (i .--> x) by TARSKI:def 1;
        then L.s = K.s by FUNCT_4:11;
        hence thesis by A4,A9;
      end;
    end;
    then X c= L by A1;
    then
A10: X.i c= L.i by A2;
    L in D by A1,A8;
    then L.i in D.i by A2;
    hence thesis by A3,A7,A10;
  end;
  let x be object;
  assume x in { z where z is Element of Di : X.i c= z };
  then consider g be Element of Di such that
A11: g = x and
A12: X.i c= g;
  dom (M +* (i .--> g)) = I by A2,PZFMISC1:1;
  then reconsider L1 = M +* (i .--> g) as ManySortedSet of I by PARTFUN1:def 2
,RELAT_1:def 18;
A13: dom (i .--> g) = {i};
  i in {i} by TARSKI:def 1;
  then
A14: L1.i = (i .--> g).i by A13,FUNCT_4:13
    .= g by FUNCOP_1:72;
A15: X c= L1
  proof
    let s be object such that
A16: s in I;
    per cases;
    suppose
      s = i;
      hence thesis by A12,A14;
    end;
    suppose
A17:  s <> i;
      X in bool M by MSSUBFAM:12;
      then
A18:  X c= M by MBOOLEAN:18;
      not s in dom (i .--> g) by A17,TARSKI:def 1;
      then L1.s = M.s by FUNCT_4:11;
      hence thesis by A16,A18;
    end;
  end;
A19: M in D by MSSUBFAM:def 6;
  L1 in D
  proof
    let s be object such that
A20: s in I;
    per cases;
    suppose
      s = i;
      hence thesis by A3,A14;
    end;
    suppose
      s <> i;
      then not s in dom (i .--> g) by TARSKI:def 1;
      then L1.s = M.s by FUNCT_4:11;
      hence thesis by A19,A20;
    end;
  end;
  then L1 in SF by A1,A15;
  hence thesis by A2,A11,A14;
end;
