
theorem
  for C being FormalContext holds [phi(C),psi(C)] is co-Galois
proof
  let C be FormalContext;
A1: LattPOSet BooleLatt the carrier' of C = RelStr (#the carrier of
BooleLatt the carrier' of C, LattRel BooleLatt the carrier' of C#) by
LATTICE3:def 2;
A2: LattPOSet BooleLatt the carrier of C = RelStr (#the carrier of BooleLatt
    the carrier of C, LattRel BooleLatt the carrier of C#) by LATTICE3:def 2;
A3: for x being Element of BoolePoset the carrier of C, y being Element of
  BoolePoset the carrier' of C st y <= (phi(C)).x holds x <= (psi(C)).y
  proof
    let x be Element of BoolePoset the carrier of C, y be Element of
    BoolePoset the carrier' of C;
    assume y <= (phi(C)).x;
    then [y,(phi(C)).x] in the InternalRel of (BoolePoset the carrier' of C)
    by ORDERS_2:def 5;
    then
A4: [y,(phi(C)).x] in LattRel (BooleLatt the carrier' of C) by A1,
YELLOW_1:def 2;
    reconsider x9 = (phi(C)).x as Element of (BooleLatt the carrier' of C) by
A1,YELLOW_1:def 2;
    reconsider x as Element of BooleLatt the carrier of C by A2,YELLOW_1:def 2;
    reconsider x as Subset of the carrier of C by LATTICE3:def 1;
    reconsider y as Element of (BooleLatt the carrier' of C) by A1,
YELLOW_1:def 2;
    y [= x9 by A4,FILTER_1:31;
    then
A5: y "\/" x9 = x9 by LATTICES:def 3;
    reconsider x9 as Subset of the carrier' of C by LATTICE3:def 1;
    reconsider y as Subset of the carrier' of C by LATTICE3:def 1;
    for z being object holds z in y implies z in x9 by A5,XBOOLE_0:def 3;
    then y c= x9;
    then
A6: (AttributeDerivation(C)).x9 c= (AttributeDerivation(C)).y by Th4;
    reconsider y as Element of BoolePoset the carrier' of C;
    reconsider y9 = (psi(C)).y as Element of (BooleLatt the carrier of C) by A2
,YELLOW_1:def 2;
    reconsider y9 as Subset of the carrier of C by LATTICE3:def 1;
    reconsider y9 as Element of (BooleLatt the carrier of C);
A7: x c= (AttributeDerivation(C)).((ObjectDerivation(C)).x) by Th5;
    reconsider x as Subset of the carrier of C;
    reconsider x as Element of (BooleLatt the carrier of C);
    x "\/" y9 = y9 by A6,A7,XBOOLE_1:1,12;
    then x [= y9 by LATTICES:def 3;
    then [x,(psi(C)).y] in LattRel (BooleLatt the carrier of C) by FILTER_1:31;
    then
    [x,(psi(C)).y] in the InternalRel of (BoolePoset the carrier of C) by A2,
YELLOW_1:def 2;
    hence thesis by ORDERS_2:def 5;
  end;
  for x being Element of BoolePoset the carrier of C, y being Element of
  BoolePoset the carrier' of C st x <= (psi(C)).y holds y <= (phi(C)).x
  proof
    let x be Element of BoolePoset the carrier of C, y be Element of
    BoolePoset the carrier' of C;
    assume x <= (psi(C)).y;
    then
    [x,(psi(C)).y] in the InternalRel of (BoolePoset the carrier of C) by
ORDERS_2:def 5;
    then
A8: [x,(psi(C)).y] in LattRel (BooleLatt the carrier of C) by A2,YELLOW_1:def 2
;
    reconsider y9 = (psi(C)).y as Element of (BooleLatt the carrier of C) by A2
,YELLOW_1:def 2;
    reconsider y as Element of (BooleLatt the carrier' of C) by A1,
YELLOW_1:def 2;
    reconsider y as Subset of the carrier' of C by LATTICE3:def 1;
    reconsider x as Element of (BooleLatt the carrier of C) by A2,
YELLOW_1:def 2;
    x [= y9 by A8,FILTER_1:31;
    then
A9: x "\/" y9 = y9 by LATTICES:def 3;
    reconsider y9 as Subset of the carrier of C by LATTICE3:def 1;
    reconsider x as Subset of the carrier of C by LATTICE3:def 1;
    for z being object holds z in x implies z in y9 by A9,XBOOLE_0:def 3;
    then
A10: x c= y9;
    reconsider x,y9 as Subset of the carrier of C;
A11: (ObjectDerivation(C)).y9 c= (ObjectDerivation(C)).x by A10,Th3;
    reconsider x as Element of BoolePoset the carrier of C;
    reconsider x9 = (phi(C)).x as Element of (BooleLatt the carrier' of C) by
A1,YELLOW_1:def 2;
    reconsider x9 as Subset of the carrier' of C by LATTICE3:def 1;
    reconsider x9 as Element of (BooleLatt the carrier' of C);
A12: y c= (ObjectDerivation(C)).((AttributeDerivation(C)).y) by Th6;
    reconsider y as Element of (BooleLatt the carrier' of C);
    y "\/" x9 = x9 by A11,A12,XBOOLE_1:1,12;
    then y [= x9 by LATTICES:def 3;
    then [y,(phi(C)).x] in LattRel (BooleLatt the carrier' of C) by FILTER_1:31
;
    then [y,(phi(C)).x] in the InternalRel of (BoolePoset the carrier' of C)
    by A1,YELLOW_1:def 2;
    hence thesis by ORDERS_2:def 5;
  end;
  hence thesis by A3,Th12;
end;
