
theorem Th3:
  for S be non void non empty ManySortedSign, MA be strict
  non-empty MSAlgebra over S for F be SubsetFamily of the Sorts of MA st F c=
  SubSort MA for B be MSSubset of MA st B = meet |:F:| holds B is opers_closed
proof
  let S be non void non empty ManySortedSign, MA be strict non-empty MSAlgebra
  over S;
  let F be SubsetFamily of the Sorts of MA such that
A1: F c= SubSort MA;
  let B be MSSubset of MA such that
A2: B = meet |:F:|;
  per cases;
  suppose
A3: F = {};
    set Q = the Sorts of MA;
    reconsider FF = |:F:| as MSSubsetFamily of the Sorts of MA;
    set I = the carrier of S;
    FF = EmptyMS I by A3;
    then
A4: Q = B by A2,MSSUBFAM:41;
    reconsider Q as MSSubset of MA by PBOOLE:def 18;
    for o be OperSymbol of S holds Q is_closed_on o
    proof
      let o be OperSymbol of S;
A5:   (the ResultSort of S).o = the_result_sort_of o & dom the ResultSort
      of S = the carrier' of S by FUNCT_2:def 1,MSUALG_1:def 2;
      Result(o,MA) = (Q * the ResultSort of S).o by MSUALG_1:def 5
        .= Q.(the_result_sort_of o) by A5,FUNCT_1:13;
      then
A6:   rng ((Den(o,MA))|((Q#.(the_arity_of o)))) c= Q.(the_result_sort_of
      o) by RELAT_1:def 19;
      (the Arity of S).o = the_arity_of o & dom the Arity of S = the
      carrier' of S by FUNCT_2:def 1,MSUALG_1:def 1;
      then
A7:   (Q# * (the Arity of S)).o = Q#.(the_arity_of o) by FUNCT_1:13;
      (Q * the ResultSort of S).o = Q.(the_result_sort_of o) by A5,FUNCT_1:13;
      hence thesis by A7,A6;
    end;
    hence thesis by A4;
  end;
  suppose
A8: F <> {};
    set SS = S;
    let o be OperSymbol of SS;
    set i = (the_result_sort_of o);
A9: (the ResultSort of SS).o = the_result_sort_of o by MSUALG_1:def 2;
A10: dom the ResultSort of SS = the carrier' of SS by FUNCT_2:def 1;
    (the Arity of SS).o = the_arity_of o & dom the Arity of SS = the
    carrier' of SS by FUNCT_2:def 1,MSUALG_1:def 1;
    then
A11: (B# * (the Arity of SS)).o = B#.(the_arity_of o) by FUNCT_1:13;
    Result(o,MA) = ((the Sorts of MA) * the ResultSort of SS).o by
MSUALG_1:def 5
      .= (the Sorts of MA).(the_result_sort_of o) by A9,A10,FUNCT_1:13;
    then
A12: rng ((Den(o,MA))|((B#.(the_arity_of o)))) c= (the Sorts of MA).(
    the_result_sort_of o) by RELAT_1:def 19;
A13: rng ((Den(o,MA))|((B#.(the_arity_of o)))) c= B.(the_result_sort_of o )
    proof
      consider Q be Subset-Family of ((the Sorts of MA).i) such that
A14:  Q = |:F:|.i and
A15:  B.i = Intersect Q by A2,MSSUBFAM:def 1;
      let v be object;
      assume
A16:  v in rng ((Den(o,MA))|((B#.(the_arity_of o))));
      then consider p be object such that
A17:  p in dom ((Den(o,MA))|(B#.(the_arity_of o))) and
A18:  v = ((Den(o,MA))|(B#.(the_arity_of o))).p by FUNCT_1:def 3;
      for Y being set st Y in Q holds v in Y
      proof
A19:    |:F:|.i = { xx.i where xx is Element of Bool the Sorts of MA : xx
        in F } by A8,CLOSURE2:14;
        let Y be set;
        assume Y in Q;
        then consider xx be Element of Bool the Sorts of MA such that
A20:    Y = xx.i and
A21:    xx in F by A14,A19;
        reconsider xx as MSSubset of MA;
        xx is opers_closed by A1,A21,MSUALG_2:14;
        then xx is_closed_on o;
        then
A22:    rng ((Den(o,MA))|((xx# * the Arity of SS).o)) c= (xx * the
        ResultSort of SS).o;
        B c= xx by A2,A21,CLOSURE2:21,MSSUBFAM:43;
        then
        (Den(o,MA))|((B# * the Arity of SS).o) c= (Den(o,MA))|((xx# * the
        Arity of SS).o) by MSUALG_2:2,RELAT_1:75;
        then
A23:    dom ((Den(o,MA))|((B# * the Arity of SS).o)) c= dom ((Den(o,MA))|
        ((xx# * the Arity of SS).o)) by RELAT_1:11;
A24:    v = (Den(o,MA)).p by A17,A18,FUNCT_1:47;
        then v = ((Den(o,MA))|((xx# * the Arity of SS).o)).p by A11,A17,A23,
FUNCT_1:47;
        then
        v in rng ((Den(o,MA))|((xx# * the Arity of SS).o)) by A11,A17,A23,
FUNCT_1:def 3;
        then (Den(o,MA)).p in (xx * the ResultSort of SS).o by A22,A24;
        then (Den(o,MA)).p in xx.((the ResultSort of SS).o) by A10,FUNCT_1:13;
        then (Den(o,MA)).p in xx.i by MSUALG_1:def 2;
        hence thesis by A17,A18,A20,FUNCT_1:47;
      end;
      hence thesis by A12,A16,A15,SETFAM_1:43;
    end;
    (B * the ResultSort of SS).o = B.(the_result_sort_of o) by A9,A10,
FUNCT_1:13;
    hence thesis by A11,A13;
  end;
end;
