let L be complete LATTICE; :: thesis: ( ( for x being Element of L holds x is compact ) iff for X being non empty Subset of L ex x being Element of L st
( x in X & ( for y being Element of L st y in X holds
not x < y ) ) )

hereby :: thesis: ( ( for X being non empty Subset of L ex x being Element of L st
( x in X & ( for y being Element of L st y in X holds
not x < y ) ) ) implies for x being Element of L holds x is compact )
assume A1: for x being Element of L holds x is compact ; :: thesis: for Y being non empty Subset of L ex x being Element of L st
( x in Y & ( for y being Element of L holds
( not y in Y or not x < y ) ) )

given Y being non empty Subset of L such that A2: for x being Element of L st x in Y holds
ex y being Element of L st
( y in Y & x < y ) ; :: thesis: contradiction
defpred S1[ set , set ] means ( [$1,$2] in the InternalRel of L & $1 <> $2 );
A3: now
let x be set ; :: thesis: ( x in Y implies ex u being set st
( u in Y & S1[x,u] ) )

assume A4: x in Y ; :: thesis: ex u being set st
( u in Y & S1[x,u] )

then reconsider y = x as Element of L ;
consider z being Element of L such that
A5: z in Y and
A6: y < z by A2, A4;
reconsider u = z as set ;
take u = u; :: thesis: ( u in Y & S1[x,u] )
y <= z by A6, ORDERS_2:def 10;
hence ( u in Y & S1[x,u] ) by A5, A6, ORDERS_2:def 9; :: thesis: verum
end;
consider f being Function such that
A7: ( dom f = Y & rng f c= Y & ( for x being set st x in Y holds
S1[x,f . x] ) ) from WELLORD2:sch 1(A3);
consider x being Element of Y;
set x1 = x;
set Z = { ((iter f,n) . x) where n is Element of NAT : verum } ;
f . x in rng f by A7, FUNCT_1:def 5;
then f . x in Y by A7;
then reconsider x = x, x9 = f . x as Element of L ;
A8: [x,(f . x)] in the InternalRel of L by A7;
A9: x <> f . x by A7;
A10: x9 = (iter f,1) . x by FUNCT_7:72;
A11: x <= x9 by A8, ORDERS_2:def 9;
A12: x9 in { ((iter f,n) . x) where n is Element of NAT : verum } by A10;
A13: x < x9 by A9, A11, ORDERS_2:def 10;
A14: { ((iter f,n) . x) where n is Element of NAT : verum } c= Y
proof
let a be set ; :: according to TARSKI:def 3 :: thesis: ( not a in { ((iter f,n) . x) where n is Element of NAT : verum } or a in Y )
assume a in { ((iter f,n) . x) where n is Element of NAT : verum } ; :: thesis: a in Y
then consider n being Element of NAT such that
A15: a = (iter f,n) . x ;
dom (iter f,n) = Y by A7, FUNCT_7:76;
then A16: a in rng (iter f,n) by A15, FUNCT_1:def 5;
rng (iter f,n) c= Y by A7, FUNCT_7:76;
hence a in Y by A16; :: thesis: verum
end;
then reconsider Z = { ((iter f,n) . x) where n is Element of NAT : verum } as Subset of L by XBOOLE_1:1;
A17: now
let i be Element of NAT ; :: thesis: for k being Element of NAT st i <= k holds
for z, y being Element of L st z = (iter f,i) . x & y = (iter f,k) . x holds
z <= y

defpred S2[ Element of NAT ] means ex z, y being Element of L st
( z = (iter f,i) . x & y = (iter f,(i + $1)) . x & z <= y );
(iter f,i) . x in Z ;
then A18: S2[ 0 ] ;
A19: for k being Element of NAT st S2[k] holds
S2[k + 1]
proof
let k be Element of NAT ; :: thesis: ( S2[k] implies S2[k + 1] )
given z, y being Element of L such that A20: z = (iter f,i) . x and
A21: y = (iter f,(i + k)) . x and
A22: z <= y ; :: thesis: S2[k + 1]
take z ; :: thesis: ex y being Element of L st
( z = (iter f,i) . x & y = (iter f,(i + (k + 1))) . x & z <= y )

A23: rng (iter f,(i + k)) c= Y by A7, FUNCT_7:76;
A24: dom (iter f,(i + k)) = Y by A7, FUNCT_7:76;
then A25: y in rng (iter f,(i + k)) by A21, FUNCT_1:def 5;
then f . y in rng f by A7, A23, FUNCT_1:def 5;
then f . y in Y by A7;
then reconsider yy = f . y as Element of L ;
take yy ; :: thesis: ( z = (iter f,i) . x & yy = (iter f,(i + (k + 1))) . x & z <= yy )
thus z = (iter f,i) . x by A20; :: thesis: ( yy = (iter f,(i + (k + 1))) . x & z <= yy )
iter f,((k + i) + 1) = f * (iter f,(k + i)) by FUNCT_7:73;
hence yy = (iter f,(i + (k + 1))) . x by A21, A24, FUNCT_1:23; :: thesis: z <= yy
[y,yy] in the InternalRel of L by A7, A23, A25;
then y <= yy by ORDERS_2:def 9;
hence z <= yy by A22, ORDERS_2:26; :: thesis: verum
end;
A26: for k being Element of NAT holds S2[k] from NAT_1:sch 1(A18, A19);
let k be Element of NAT ; :: thesis: ( i <= k implies for z, y being Element of L st z = (iter f,i) . x & y = (iter f,k) . x holds
z <= y )

assume i <= k ; :: thesis: for z, y being Element of L st z = (iter f,i) . x & y = (iter f,k) . x holds
z <= y

then consider n being Nat such that
A27: k = i + n by NAT_1:10;
reconsider n = n as Element of NAT by ORDINAL1:def 13;
A28: ex z, y being Element of L st
( z = (iter f,i) . x & y = (iter f,(i + n)) . x & z <= y ) by A26;
let z, y be Element of L; :: thesis: ( z = (iter f,i) . x & y = (iter f,k) . x implies z <= y )
assume that
A29: z = (iter f,i) . x and
A30: y = (iter f,k) . x ; :: thesis: z <= y
thus z <= y by A27, A28, A29, A30; :: thesis: verum
end;
A31: now
let z, y be Element of L; :: thesis: ( not z in Z or not y in Z or z <= y or z >= y )
assume z in Z ; :: thesis: ( not y in Z or z <= y or z >= y )
then consider k1 being Element of NAT such that
A32: z = (iter f,k1) . x ;
assume y in Z ; :: thesis: ( z <= y or z >= y )
then consider k2 being Element of NAT such that
A33: y = (iter f,k2) . x ;
( k1 <= k2 or k2 <= k1 ) ;
hence ( z <= y or z >= y ) by A17, A32, A33; :: thesis: verum
end;
sup Z is compact by A1;
then sup Z << sup Z by Def2;
then consider A being finite Subset of L such that
A34: A c= Z and
A35: sup Z <= sup A by Th18;
A36: now end;
A40: A is finite ;
defpred S2[ set ] means ( $1 <> {} implies "\/" $1,L in $1 );
A41: S2[ {} ] ;
A42: now
let x, B be set ; :: thesis: ( x in A & B c= A & S2[B] implies S2[B \/ {x}] )
assume that
A43: x in A and
A44: B c= A ; :: thesis: ( S2[B] implies S2[B \/ {x}] )
reconsider x9 = x as Element of L by A43;
assume A45: S2[B] ; :: thesis: S2[B \/ {x}]
thus S2[B \/ {x}] :: thesis: verum
proof
assume B \/ {x} <> {} ; :: thesis: "\/" (B \/ {x}),L in B \/ {x}
A46: ex_sup_of B,L by YELLOW_0:17;
A47: ex_sup_of {x},L by YELLOW_0:17;
ex_sup_of B \/ {x},L by YELLOW_0:17;
then A48: "\/" (B \/ {x}),L = ("\/" B,L) "\/" ("\/" {x},L) by A46, A47, YELLOW_0:36;
A49: sup {x9} = x by YELLOW_0:39;
per cases ( B = {} or B <> {} ) ;
suppose B = {} ; :: thesis: "\/" (B \/ {x}),L in B \/ {x}
hence "\/" (B \/ {x}),L in B \/ {x} by A49, TARSKI:def 1; :: thesis: verum
end;
suppose B <> {} ; :: thesis: "\/" (B \/ {x}),L in B \/ {x}
then "\/" B,L in A by A44, A45;
then ( x9 <= "\/" B,L or x9 >= "\/" B,L ) by A31, A34, A43;
then ( ("\/" B,L) "\/" x9 = "\/" B,L or ( ("\/" B,L) "\/" x9 = x9 "\/" ("\/" B,L) & x9 "\/" ("\/" B,L) = x9 ) ) by YELLOW_0:24;
then ( "\/" (B \/ {x}),L in B or "\/" (B \/ {x}),L in {x} ) by A45, A48, A49, TARSKI:def 1;
hence "\/" (B \/ {x}),L in B \/ {x} by XBOOLE_0:def 3; :: thesis: verum
end;
end;
end;
end;
S2[A] from FINSET_1:sch 2(A40, A41, A42);
then A50: sup A in Z by A34, A36;
then consider n being Element of NAT such that
A51: sup A = (iter f,n) . x ;
A52: [(sup A),(f . (sup A))] in the InternalRel of L by A7, A14, A50;
A53: sup A <> f . (sup A) by A7, A14, A50;
reconsider xSn = f . (sup A) as Element of L by A52, ZFMISC_1:106;
A54: iter f,(n + 1) = f * (iter f,n) by FUNCT_7:73;
A55: dom (iter f,n) = Y by A7, FUNCT_7:76;
A56: sup A <= xSn by A52, ORDERS_2:def 9;
A57: f . (sup A) = (iter f,(n + 1)) . x by A51, A54, A55, FUNCT_1:23;
A58: sup A < xSn by A53, A56, ORDERS_2:def 10;
A59: xSn in Z by A57;
Z is_<=_than sup Z by YELLOW_0:32;
then A60: xSn <= sup Z by A59, LATTICE3:def 9;
sup Z < xSn by A35, A58, ORDERS_2:32;
hence contradiction by A60, ORDERS_2:30; :: thesis: verum
end;
assume A61: for X being non empty Subset of L ex x being Element of L st
( x in X & ( for y being Element of L st y in X holds
not x < y ) ) ; :: thesis: for x being Element of L holds x is compact
let x be Element of L; :: thesis: x is compact
let D be non empty directed Subset of L; :: according to WAYBEL_3:def 1,WAYBEL_3:def 2 :: thesis: ( x <= sup D implies ex d being Element of L st
( d in D & x <= d ) )

consider y being Element of L such that
A62: y in D and
A63: for z being Element of L st z in D holds
not y < z by A61;
D is_<=_than y
proof
let a be Element of L; :: according to LATTICE3:def 9 :: thesis: ( not a in D or a <= y )
assume a in D ; :: thesis: a <= y
then consider b being Element of L such that
A64: b in D and
A65: a <= b and
A66: y <= b by A62, WAYBEL_0:def 1;
not y < b by A63, A64;
hence a <= y by A65, A66, ORDERS_2:def 10; :: thesis: verum
end;
then A67: sup D <= y by YELLOW_0:32;
sup D is_>=_than D by YELLOW_0:32;
then y <= sup D by A62, LATTICE3:def 9;
then sup D = y by A67, ORDERS_2:25;
hence ( x <= sup D implies ex d being Element of L st
( d in D & x <= d ) ) by A62; :: thesis: verum