
theorem Th44:
  for C being FormalContext holds ConceptLattice(C) is complete Lattice
proof
  let C be FormalContext;
  for X being Subset of ConceptLattice(C) ex a being Element of
ConceptLattice(C) st a is_less_than X & for b being Element of ConceptLattice(C
  ) st b is_less_than X holds b [= a
  proof
    let X be Subset of ConceptLattice(C);
    per cases;
    suppose
A1:   X = {};
A2:   for b being Element of ConceptLattice(C) st b is_less_than X holds b
      [= Top ConceptLattice(C)
      proof
        let b be Element of ConceptLattice(C);
        assume b is_less_than X;
        ex c being Element of ConceptLattice(C) st for a being Element of
        ConceptLattice(C) holds c"\/"a = c & a"\/"c = c
        proof
          reconsider CO = Concept-with-all-Objects(C) as Element of
          ConceptLattice(C) by Th31;
          for CP being Element of ConceptLattice(C) holds CO "\/" CP = CO
          & CP "\/" CO = CO
          proof
            let CP be Element of ConceptLattice(C);
            reconsider CP as strict FormalConcept of C by Th31;
            reconsider CO as strict FormalConcept of C;
            (B-join(C)).(CO,CP) = (B-join(C)).(CP,CO) by Th33
              .= CO by Th39;
            hence thesis by LATTICES:def 1;
          end;
          hence thesis;
        end;
        then ConceptLattice(C) is upper-bounded by LATTICES:def 14;
        then Top ConceptLattice(C) "\/" b = Top ConceptLattice(C);
        hence thesis by LATTICES:def 3;
      end;
      for q being Element of ConceptLattice(C) st q in X holds Top
      ConceptLattice(C) [= q by A1;
      then Top ConceptLattice(C) is_less_than X by LATTICE3:def 16;
      hence thesis by A2;
    end;
    suppose
      X <> {};
      then reconsider X as non empty Subset of ConceptLattice(C);
      set ExX = { the Extent of x where x is Element of B-carrier(C) : x in X
      };
A3:   for x being Element of X holds the Extent of x in ExX
      proof
        let x be Element of X;
        x in X;
        then reconsider x as Element of B-carrier(C);
        the Extent of x in ExX;
        hence thesis;
      end;
      then reconsider ExX as non empty set;
      set E1 = meet ExX;
A4:   for o being Object of C holds o in E1 iff for x being Element of X
      holds o in the Extent of x
      proof
        let o be Object of C;
A5:     (for x being Element of X holds o in the Extent of x) implies o in E1
        proof
          assume
A6:       for x being Element of X holds o in the Extent of x;
          for Y being set holds Y in ExX implies o in Y
          proof
            let Y be set;
            assume Y in ExX;
            then
            ex Y9 being Element of B-carrier(C) st Y = the Extent of Y9 &
            Y9 in X;
            hence thesis by A6;
          end;
          hence thesis by SETFAM_1:def 1;
        end;
        o in E1 implies for x being Element of X holds o in the Extent of x
        proof
          assume
A7:       o in E1;
          let x be Element of X;
          the Extent of x in ExX by A3;
          hence thesis by A7,SETFAM_1:def 1;
        end;
        hence thesis by A5;
      end;
      E1 c= the carrier of C
      proof
        set Y = the Element of ExX;
        let x be object;
        Y in ExX;
        then consider Y9 being Element of B-carrier(C) such that
A8:     Y = the Extent of Y9 and
        Y9 in X;
        assume x in E1;
        then x in the Extent of Y9 by A8,SETFAM_1:def 1;
        hence thesis;
      end;
      then consider O being Subset of the carrier of C such that
A9:   for o being Object of C holds o in O iff for x being Element of
      X holds o in the Extent of x by A4;
      set InX = { the Intent of x where x is Element of B-carrier(C) : x in X
      };
      set In = union InX;
A10:  for a being Attribute of C holds a in In iff ex x being Element of
      X st a in the Intent of x
      proof
        let a be Attribute of C;
A11:    (ex x being Element of X st a in the Intent of x) implies a in In
        proof
          assume
A12:      ex x being Element of X st a in the Intent of x;
          ex Y being set st a in Y & Y in InX
          proof
            consider x being Element of X such that
A13:        a in the Intent of x by A12;
            x in X;
            then the Intent of x in InX;
            hence thesis by A13;
          end;
          hence thesis by TARSKI:def 4;
        end;
        a in In implies ex x being Element of X st a in the Intent of x
        proof
          assume a in In;
          then consider Y being set such that
A14:      a in Y and
A15:      Y in InX by TARSKI:def 4;
          ex Y9 being Element of B-carrier(C) st Y = the Intent of Y9 & Y9
          in X by A15;
          hence thesis by A14;
        end;
        hence thesis by A11;
      end;
      In c= the carrier' of C
      proof
        let x be object;
        assume x in In;
        then consider Y being set such that
A16:    x in Y and
A17:    Y in InX by TARSKI:def 4;
        ex Y9 being Element of B-carrier(C) st Y = the Intent of Y9 & Y9
        in X by A17;
        hence thesis by A16;
      end;
      then consider A9 being Subset of the carrier' of C such that
A18:  for a being Attribute of C holds a in A9 iff ex x being Element
      of X st a in the Intent of x by A10;
A19:  for o being Object of C holds o in O iff for x being Element of X
      holds o in (AttributeDerivation(C)).(the Intent of x)
      proof
        let o be Object of C;
A20:    (for x being Element of X holds o in (AttributeDerivation(C)).(
        the Intent of x)) implies o in O
        proof
          assume
A21:      for x being Element of X holds o in (AttributeDerivation(C)
          ).(the Intent of x);
          for x being Element of X holds o in the Extent of x
          proof
            let x be Element of X;
            o in (AttributeDerivation(C)).(the Intent of x) by A21;
            hence thesis by Def9;
          end;
          hence thesis by A9;
        end;
        o in O implies for x being Element of X holds o in (
        AttributeDerivation(C)).(the Intent of x)
        proof
          assume
A22:      o in O;
          for x being Element of X holds o in (AttributeDerivation(C)).(
          the Intent of x)
          proof
            let x be Element of X;
            o in the Extent of x by A9,A22;
            hence thesis by Def9;
          end;
          hence thesis;
        end;
        hence thesis by A20;
      end;
A23:  for x being object holds x in (AttributeDerivation(C)).A9 implies x in O
      proof
        let x be object;
        assume x in (AttributeDerivation(C)).A9;
        then x in {o where o is Object of C : for a being Attribute of C st a
        in A9 holds o is-connected-with a} by Def3;
        then consider x9 being Object of C such that
A24:    x9 = x and
A25:    for a being Attribute of C st a in A9 holds x9 is-connected-with a;
        for x being Element of X holds x9 in (AttributeDerivation(C)).(
        the Intent of x)
        proof
          let x be Element of X;
          for a being Attribute of C st a in (the Intent of x) holds x9
          is-connected-with a by A18,A25;
          then x9 in {o where o is Object of C :
          for a being Attribute of C st
           a in (the Intent of x) holds o is-connected-with a};
          hence thesis by Def3;
        end;
        hence thesis by A19,A24;
      end;
      consider A being Subset of the carrier' of C such that
A26:  A = (ObjectDerivation(C)).((AttributeDerivation(C)).A9);
      set p = ConceptStr(#O,A#);
      for x being object
          holds x in O implies x in (AttributeDerivation(C)). A9
      proof
        let x9 be object;
        assume
A27:    x9 in O;
        then reconsider x9 as Object of C;
        for a being Attribute of C st a in A9 holds x9 is-connected-with a
        proof
          let a be Attribute of C;
          assume a in A9;
          then consider x being Element of X such that
A28:      a in the Intent of x by A18;
          x9 in (AttributeDerivation(C)).(the Intent of x) by A19,A27;
          then
          x9 in {o where o is Object of C : for a being Attribute of C st
          a in the Intent of x holds o is-connected-with a} by Def3;
          then
          ex y being Object of C st y = x9 & for a being Attribute of C st
          a in the Intent of x holds y is-connected-with a;
          hence thesis by A28;
        end;
        then
        x9 in {o where o is Object of C : for a being Attribute of C st a
        in A9 holds o is-connected-with a};
        hence thesis by Def3;
      end;
      then O = (AttributeDerivation(C)).A9 by A23,TARSKI:2;
      then p is FormalConcept of C by A26,Th21;
      then reconsider p as Element of ConceptLattice(C) by Th31;
A29:  for b being Element of ConceptLattice(C) st b is_less_than X holds b [= p
      proof
        let b be Element of ConceptLattice(C);
        assume
A30:    b is_less_than X;
        the Extent of b@ c= the Extent of p@
        proof
          let x9 be object;
          assume
A31:      x9 in the Extent of b@;
          then reconsider x9 as Object of C;
          for x being Element of X holds x9 in the Extent of x
          proof
            let x be Element of X;
            x in X;
            then reconsider x as Element of ConceptLattice(C);
            b [= x by A30,LATTICE3:def 16;
            then b@ is-SubConcept-of x@ by Th43;
            then the Extent of b@ c= the Extent of x@;
            hence thesis by A31;
          end;
          hence thesis by A9;
        end;
        then b@ is-SubConcept-of p@;
        hence thesis by Th43;
      end;
      for q being Element of ConceptLattice(C) st q in X holds p [= q
      proof
        let q be Element of ConceptLattice(C);
        assume
A32:    q in X;
        the Extent of p@ c= the Extent of q@
        by A9,A32;
        then p@ is-SubConcept-of q@;
        hence thesis by Th43;
      end;
      then p is_less_than X by LATTICE3:def 16;
      hence thesis by A29;
    end;
  end;
  hence thesis by VECTSP_8:def 6;
end;
