reserve I for non empty set;
reserve M for ManySortedSet of I;
reserve Y,x,y,i for set;
reserve r,r1,r2 for Real;

theorem Th9:
  EqRelLatt M is complete
proof
  for X being Subset of EqRelLatt M ex a being Element of EqRelLatt M st a
is_less_than X & for b being Element of EqRelLatt M st b is_less_than X holds b
  [= a
  proof
    let X be Subset of EqRelLatt M;
    reconsider X1 = X as SubsetFamily of [|M,M|] by Th5;
    per cases;
    suppose
A1:   X is empty;
      take a = Top EqRelLatt M;
      for q be Element of EqRelLatt M st q in X holds a [= q by A1;
      hence a is_less_than X;
      let b be Element of EqRelLatt M;
      assume b is_less_than X;
      thus thesis by LATTICES:19;
    end;
    suppose
A2:   X is non empty;
      then reconsider a = meet |:X1:| as Equivalence_Relation of M by Th8;
      set a9 = a;
      reconsider a as Element of EqRelLatt M by MSUALG_5:def 5;
      take a;
      now
        let q be Element of EqRelLatt M;
        reconsider q9 = q as Equivalence_Relation of M by MSUALG_5:def 5;
        assume q in X;
        then a9 c= q9 by Th7;
        hence a [= q by Th6;
      end;
      hence a is_less_than X;
      now
        let b be Element of EqRelLatt M;
        reconsider b9 = b as Equivalence_Relation of M by MSUALG_5:def 5;
        assume
A3:     b is_less_than X;
        now
          reconsider X19 = X1 as non empty SubsetFamily of [|M,M|] by A2;
          let i be object;
          assume
A4:       i in I;
          then
A5:       ex Q be Subset-Family of ([|M,M|].i) st Q = |:X1:|.i & meet |:X1
          :|.i = Intersect Q by MSSUBFAM:def 1;
          |:X19:| is non-empty;
          then
A6:       |:X1:|.i <> {} by A4,PBOOLE:def 13;
          now
            let Z be set;
            assume
A7:         Z in |:X1:|.i;
            |:X19:|.i = { x.i where x is Element of Bool [|M,M|] : x in
            X1 } by A4,CLOSURE2:14;
            then consider z be Element of Bool [|M,M|] such that
A8:         Z = z.i and
A9:         z in X1 by A7;
            reconsider z9 = z as Element of EqRelLatt M by A9;
            reconsider z99 = z9 as Equivalence_Relation of M by MSUALG_5:def 5;
            b [= z9 by A3,A9;
            then b9 c= z99 by Th6;
            hence b9.i c= Z by A4,A8,PBOOLE:def 2;
          end;
          then b9.i c= meet (|:X1:|.i) by A6,SETFAM_1:5;
          hence b9.i c= meet |:X1:|.i by A6,A5,SETFAM_1:def 9;
        end;
        then b9 c= meet |:X1:| by PBOOLE:def 2;
        hence b [= a by Th6;
      end;
      hence thesis;
    end;
  end;
  hence thesis by VECTSP_8:def 6;
end;
