:: LATTICE5 semantic presentation

scheme :: LATTICE5:sch 1
s1{ F1() -> set , P1[ set , set , set ] } :
ex b1 being Function st
( dom b1 = NAT & b1 . 0 = F1() & ( for b2 being Element of NAT holds P1[b2,b1 . b2,b1 . (b2 + 1)] ) )
provided
E1: for b1 being Nat
for b2 being set ex b3 being set st P1[b1,b2,b3]
proof end;

theorem Th1: :: LATTICE5:1
for b1 being Function
for b2 being Function-yielding Function st b1 = union (rng b2) holds
dom b1 = union (rng (doms b2))
proof end;

theorem Th2: :: LATTICE5:2
for b1, b2 being non empty set holds [:(union b1),(union b2):] = union { [:b3,b4:] where B is Element of b1, B is Element of b2 : ( b3 in b1 & b4 in b2 ) }
proof end;

theorem Th3: :: LATTICE5:3
for b1 being non empty set st b1 is c=-linear holds
[:(union b1),(union b1):] = union { [:b2,b2:] where B is Element of b1 : b2 in b1 }
proof end;

definition
let c1 be set ;
func EqRelLATT c1 -> Poset equals :: LATTICE5:def 1
LattPOSet (EqRelLatt a1);
correctness
coherence
LattPOSet (EqRelLatt c1) is Poset
;
;
end;

:: deftheorem Def1 defines EqRelLATT LATTICE5:def 1 :
for b1 being set holds EqRelLATT b1 = LattPOSet (EqRelLatt b1);

registration
let c1 be set ;
cluster EqRelLATT a1 -> with_suprema with_infima ;
coherence
( EqRelLATT c1 is with_infima & EqRelLATT c1 is with_suprema )
;
end;

theorem Th4: :: LATTICE5:4
for b1, b2 being set holds
( b2 in the carrier of (EqRelLATT b1) iff b2 is Equivalence_Relation of b1 )
proof end;

theorem Th5: :: LATTICE5:5
for b1 being set
for b2, b3 being Element of (EqRelLatt b1) holds
( b2 [= b3 iff b2 c= b3 )
proof end;

theorem Th6: :: LATTICE5:6
for b1 being set
for b2, b3 being Element of (EqRelLATT b1) holds
( b2 <= b3 iff b2 c= b3 )
proof end;

theorem Th7: :: LATTICE5:7
for b1 being Lattice
for b2, b3 being Element of (LattPOSet b1) holds b2 "/\" b3 = (% b2) "/\" (% b3)
proof end;

theorem Th8: :: LATTICE5:8
for b1 being set
for b2, b3 being Element of (EqRelLATT b1) holds b2 "/\" b3 = b2 /\ b3
proof end;

theorem Th9: :: LATTICE5:9
for b1 being Lattice
for b2, b3 being Element of (LattPOSet b1) holds b2 "\/" b3 = (% b2) "\/" (% b3)
proof end;

theorem Th10: :: LATTICE5:10
for b1 being set
for b2, b3 being Element of (EqRelLATT b1)
for b4, b5 being Equivalence_Relation of b1 st b2 = b4 & b3 = b5 holds
b2 "\/" b3 = b4 "\/" b5
proof end;

definition
let c1 be non empty RelStr ;
redefine attr a1 is complete means :: LATTICE5:def 2
for b1 being Subset of a1 ex b2 being Element of a1 st
( b2 is_<=_than b1 & ( for b3 being Element of a1 st b3 is_<=_than b1 holds
b3 <= b2 ) );
compatibility
( c1 is complete iff for b1 being Subset of c1 ex b2 being Element of c1 st
( b2 is_<=_than b1 & ( for b3 being Element of c1 st b3 is_<=_than b1 holds
b3 <= b2 ) ) )
proof end;
end;

:: deftheorem Def2 defines complete LATTICE5:def 2 :
for b1 being non empty RelStr holds
( b1 is complete iff for b2 being Subset of b1 ex b3 being Element of b1 st
( b3 is_<=_than b2 & ( for b4 being Element of b1 st b4 is_<=_than b2 holds
b4 <= b3 ) ) );

registration
let c1 be set ;
cluster EqRelLATT a1 -> with_suprema with_infima complete ;
coherence
EqRelLATT c1 is complete
proof end;
end;

registration
let c1, c2 be LATTICE;
cluster meet-preserving join-preserving Relation of the carrier of a1,the carrier of a2;
existence
ex b1 being Function of c1,c2 st
( b1 is meet-preserving & b1 is join-preserving )
proof end;
end;

definition
let c1, c2 be LATTICE;
mode Homomorphism of a1,a2 is meet-preserving join-preserving Function of a1,a2;
end;

registration
let c1 be LATTICE;
cluster strict meet-inheriting join-inheriting SubRelStr of a1;
existence
ex b1 being SubRelStr of c1 st
( b1 is meet-inheriting & b1 is join-inheriting & b1 is strict )
proof end;
end;

definition
let c1 be non empty RelStr ;
mode Sublattice of a1 is meet-inheriting join-inheriting SubRelStr of a1;
end;

definition
let c1, c2 be LATTICE;
let c3 be Homomorphism of c1,c2;
redefine func Image as Image c3 -> strict full Sublattice of a2;
coherence
Image c3 is strict full Sublattice of c2
proof end;
end;

definition
let c1 be non empty set ;
let c2 be non empty FinSequence of c1;
let c3, c4 be set ;
let c5, c6 be Relation;
pred c3,c4 are_joint_by c2,c5,c6 means :Def3: :: LATTICE5:def 3
( a2 . 1 = a3 & a2 . (len a2) = a4 & ( for b1 being Nat st 1 <= b1 & b1 < len a2 holds
( ( not b1 is even implies [(a2 . b1),(a2 . (b1 + 1))] in a5 ) & ( b1 is even implies [(a2 . b1),(a2 . (b1 + 1))] in a6 ) ) ) );
end;

:: deftheorem Def3 defines are_joint_by LATTICE5:def 3 :
for b1 being non empty set
for b2 being non empty FinSequence of b1
for b3, b4 being set
for b5, b6 being Relation holds
( b3,b4 are_joint_by b2,b5,b6 iff ( b2 . 1 = b3 & b2 . (len b2) = b4 & ( for b7 being Nat st 1 <= b7 & b7 < len b2 holds
( ( not b7 is even implies [(b2 . b7),(b2 . (b7 + 1))] in b5 ) & ( b7 is even implies [(b2 . b7),(b2 . (b7 + 1))] in b6 ) ) ) ) );

theorem Th11: :: LATTICE5:11
canceled;

theorem Th12: :: LATTICE5:12
for b1 being non empty set
for b2 being set
for b3 being Nat
for b4, b5 being Relation
for b6 being non empty FinSequence of b1 st b4 is_reflexive_in b1 & b5 is_reflexive_in b1 & b6 = b3 |-> b2 holds
b2,b2 are_joint_by b6,b4,b5
proof end;

E13: now
let c1, c2, c3 be Nat;
assume ( 1 <= c1 & c1 < c2 + c3 ) ;
then ( ( 1 <= c1 & c1 < c2 ) or ( c2 = c1 & c1 < c2 + c3 ) or ( c2 < c1 & c1 < c2 + c3 ) ) by REAL_1:def 5;
hence ( ( 1 <= c1 & c1 < c2 ) or ( c2 = c1 & c1 < c2 + c3 ) or ( c2 + 1 <= c1 & c1 < c2 + c3 ) ) by NAT_1:38;
end;

theorem Th13: :: LATTICE5:13
canceled;

theorem Th14: :: LATTICE5:14
for b1 being non empty set
for b2, b3 being set
for b4, b5 being Relation
for b6, b7 being Nat st b6 <= b7 & b4 is_reflexive_in b1 & b5 is_reflexive_in b1 & ex b8 being non empty FinSequence of b1 st
( len b8 = b6 & b2,b3 are_joint_by b8,b4,b5 ) holds
ex b8 being non empty FinSequence of b1 st
( len b8 = b7 & b2,b3 are_joint_by b8,b4,b5 )
proof end;

definition
let c1 be non empty set ;
let c2 be Sublattice of EqRelLATT c1;
given c3 being Equivalence_Relation of c1 such that E15: c3 in the carrier of c2 and
E16: c3 <> id c1 ;
given c4 being Nat such that E17: for b1, b2 being Equivalence_Relation of c1
for b3, b4 being set st b1 in the carrier of c2 & b2 in the carrier of c2 & [b3,b4] in b1 "\/" b2 holds
ex b5 being non empty FinSequence of c1 st
( len b5 = c4 & b3,b4 are_joint_by b5,b1,b2 ) ;
func type_of c2 -> Nat means :Def4: :: LATTICE5:def 4
( ( for b1, b2 being Equivalence_Relation of a1
for b3, b4 being set st b1 in the carrier of a2 & b2 in the carrier of a2 & [b3,b4] in b1 "\/" b2 holds
ex b5 being non empty FinSequence of a1 st
( len b5 = a3 + 2 & b3,b4 are_joint_by b5,b1,b2 ) ) & ex b1, b2 being Equivalence_Relation of a1ex b3, b4 being set st
( b1 in the carrier of a2 & b2 in the carrier of a2 & [b3,b4] in b1 "\/" b2 & ( for b5 being non empty FinSequence of a1 holds
( not len b5 = a3 + 1 or not b3,b4 are_joint_by b5,b1,b2 ) ) ) );
existence
ex b1 being Nat st
( ( for b2, b3 being Equivalence_Relation of c1
for b4, b5 being set st b2 in the carrier of c2 & b3 in the carrier of c2 & [b4,b5] in b2 "\/" b3 holds
ex b6 being non empty FinSequence of c1 st
( len b6 = b1 + 2 & b4,b5 are_joint_by b6,b2,b3 ) ) & ex b2, b3 being Equivalence_Relation of c1ex b4, b5 being set st
( b2 in the carrier of c2 & b3 in the carrier of c2 & [b4,b5] in b2 "\/" b3 & ( for b6 being non empty FinSequence of c1 holds
( not len b6 = b1 + 1 or not b4,b5 are_joint_by b6,b2,b3 ) ) ) )
proof end;
uniqueness
for b1, b2 being Nat st ( for b3, b4 being Equivalence_Relation of c1
for b5, b6 being set st b3 in the carrier of c2 & b4 in the carrier of c2 & [b5,b6] in b3 "\/" b4 holds
ex b7 being non empty FinSequence of c1 st
( len b7 = b1 + 2 & b5,b6 are_joint_by b7,b3,b4 ) ) & ex b3, b4 being Equivalence_Relation of c1ex b5, b6 being set st
( b3 in the carrier of c2 & b4 in the carrier of c2 & [b5,b6] in b3 "\/" b4 & ( for b7 being non empty FinSequence of c1 holds
( not len b7 = b1 + 1 or not b5,b6 are_joint_by b7,b3,b4 ) ) ) & ( for b3, b4 being Equivalence_Relation of c1
for b5, b6 being set st b3 in the carrier of c2 & b4 in the carrier of c2 & [b5,b6] in b3 "\/" b4 holds
ex b7 being non empty FinSequence of c1 st
( len b7 = b2 + 2 & b5,b6 are_joint_by b7,b3,b4 ) ) & ex b3, b4 being Equivalence_Relation of c1ex b5, b6 being set st
( b3 in the carrier of c2 & b4 in the carrier of c2 & [b5,b6] in b3 "\/" b4 & ( for b7 being non empty FinSequence of c1 holds
( not len b7 = b2 + 1 or not b5,b6 are_joint_by b7,b3,b4 ) ) ) holds
b1 = b2
proof end;
end;

:: deftheorem Def4 defines type_of LATTICE5:def 4 :
for b1 being non empty set
for b2 being Sublattice of EqRelLATT b1 st ex b3 being Equivalence_Relation of b1 st
( b3 in the carrier of b2 & b3 <> id b1 ) & ex b3 being Nat st
for b4, b5 being Equivalence_Relation of b1
for b6, b7 being set st b4 in the carrier of b2 & b5 in the carrier of b2 & [b6,b7] in b4 "\/" b5 holds
ex b8 being non empty FinSequence of b1 st
( len b8 = b3 & b6,b7 are_joint_by b8,b4,b5 ) holds
for b3 being Nat holds
( b3 = type_of b2 iff ( ( for b4, b5 being Equivalence_Relation of b1
for b6, b7 being set st b4 in the carrier of b2 & b5 in the carrier of b2 & [b6,b7] in b4 "\/" b5 holds
ex b8 being non empty FinSequence of b1 st
( len b8 = b3 + 2 & b6,b7 are_joint_by b8,b4,b5 ) ) & ex b4, b5 being Equivalence_Relation of b1ex b6, b7 being set st
( b4 in the carrier of b2 & b5 in the carrier of b2 & [b6,b7] in b4 "\/" b5 & ( for b8 being non empty FinSequence of b1 holds
( not len b8 = b3 + 1 or not b6,b7 are_joint_by b8,b4,b5 ) ) ) ) );

theorem Th15: :: LATTICE5:15
for b1 being non empty set
for b2 being Sublattice of EqRelLATT b1
for b3 being Nat st ex b4 being Equivalence_Relation of b1 st
( b4 in the carrier of b2 & b4 <> id b1 ) & ( for b4, b5 being Equivalence_Relation of b1
for b6, b7 being set st b4 in the carrier of b2 & b5 in the carrier of b2 & [b6,b7] in b4 "\/" b5 holds
ex b8 being non empty FinSequence of b1 st
( len b8 = b3 + 2 & b6,b7 are_joint_by b8,b4,b5 ) ) holds
type_of b2 <= b3
proof end;

definition
let c1 be non empty set ;
let c2 be lower-bounded LATTICE;
mode BiFunction of a1,a2 is Function of [:a1,a1:],the carrier of a2;
end;

definition
let c1 be non empty set ;
let c2 be lower-bounded LATTICE;
let c3 be BiFunction of c1,c2;
let c4, c5 be Element of c1;
redefine func . as c3 . c4,c5 -> Element of a2;
coherence
c3 . c4,c5 is Element of c2
proof end;
end;

definition
let c1 be non empty set ;
let c2 be lower-bounded LATTICE;
let c3 be BiFunction of c1,c2;
canceled;
attr a3 is symmetric means :Def6: :: LATTICE5:def 6
for b1, b2 being Element of a1 holds a3 . b1,b2 = a3 . b2,b1;
attr a3 is zeroed means :Def7: :: LATTICE5:def 7
for b1 being Element of a1 holds a3 . b1,b1 = Bottom a2;
attr a3 is u.t.i. means :Def8: :: LATTICE5:def 8
for b1, b2, b3 being Element of a1 holds (a3 . b1,b2) "\/" (a3 . b2,b3) >= a3 . b1,b3;
end;

:: deftheorem Def5 LATTICE5:def 5 :
canceled;

:: deftheorem Def6 defines symmetric LATTICE5:def 6 :
for b1 being non empty set
for b2 being lower-bounded LATTICE
for b3 being BiFunction of b1,b2 holds
( b3 is symmetric iff for b4, b5 being Element of b1 holds b3 . b4,b5 = b3 . b5,b4 );

:: deftheorem Def7 defines zeroed LATTICE5:def 7 :
for b1 being non empty set
for b2 being lower-bounded LATTICE
for b3 being BiFunction of b1,b2 holds
( b3 is zeroed iff for b4 being Element of b1 holds b3 . b4,b4 = Bottom b2 );

:: deftheorem Def8 defines u.t.i. LATTICE5:def 8 :
for b1 being non empty set
for b2 being lower-bounded LATTICE
for b3 being BiFunction of b1,b2 holds
( b3 is u.t.i. iff for b4, b5, b6 being Element of b1 holds (b3 . b4,b5) "\/" (b3 . b5,b6) >= b3 . b4,b6 );

registration
let c1 be non empty set ;
let c2 be lower-bounded LATTICE;
cluster symmetric zeroed u.t.i. Relation of [:a1,a1:],the carrier of a2;
existence
ex b1 being BiFunction of c1,c2 st
( b1 is symmetric & b1 is zeroed & b1 is u.t.i. )
proof end;
end;

definition
let c1 be non empty set ;
let c2 be lower-bounded LATTICE;
mode distance_function of a1,a2 is symmetric zeroed u.t.i. BiFunction of a1,a2;
end;

definition
let c1 be non empty set ;
let c2 be lower-bounded LATTICE;
let c3 be distance_function of c1,c2;
func alpha c3 -> Function of a2,(EqRelLATT a1) means :Def9: :: LATTICE5:def 9
for b1 being Element of a2 ex b2 being Equivalence_Relation of a1 st
( b2 = a4 . b1 & ( for b3, b4 being Element of a1 holds
( [b3,b4] in b2 iff a3 . b3,b4 <= b1 ) ) );
existence
ex b1 being Function of c2,(EqRelLATT c1) st
for b2 being Element of c2 ex b3 being Equivalence_Relation of c1 st
( b3 = b1 . b2 & ( for b4, b5 being Element of c1 holds
( [b4,b5] in b3 iff c3 . b4,b5 <= b2 ) ) )
proof end;
uniqueness
for b1, b2 being Function of c2,(EqRelLATT c1) st ( for b3 being Element of c2 ex b4 being Equivalence_Relation of c1 st
( b4 = b1 . b3 & ( for b5, b6 being Element of c1 holds
( [b5,b6] in b4 iff c3 . b5,b6 <= b3 ) ) ) ) & ( for b3 being Element of c2 ex b4 being Equivalence_Relation of c1 st
( b4 = b2 . b3 & ( for b5, b6 being Element of c1 holds
( [b5,b6] in b4 iff c3 . b5,b6 <= b3 ) ) ) ) holds
b1 = b2
proof end;
end;

:: deftheorem Def9 defines alpha LATTICE5:def 9 :
for b1 being non empty set
for b2 being lower-bounded LATTICE
for b3 being distance_function of b1,b2
for b4 being Function of b2,(EqRelLATT b1) holds
( b4 = alpha b3 iff for b5 being Element of b2 ex b6 being Equivalence_Relation of b1 st
( b6 = b4 . b5 & ( for b7, b8 being Element of b1 holds
( [b7,b8] in b6 iff b3 . b7,b8 <= b5 ) ) ) );

theorem Th16: :: LATTICE5:16
for b1 being non empty set
for b2 being lower-bounded LATTICE
for b3 being distance_function of b1,b2 holds alpha b3 is meet-preserving
proof end;

theorem Th17: :: LATTICE5:17
for b1 being non empty set
for b2 being lower-bounded LATTICE
for b3 being distance_function of b1,b2 st b3 is onto holds
alpha b3 is one-to-one
proof end;

definition
let c1 be set ;
func new_set c1 -> set equals :: LATTICE5:def 10
a1 \/ {{a1},{{a1}},{{{a1}}}};
correctness
coherence
c1 \/ {{c1},{{c1}},{{{c1}}}} is set
;
;
end;

:: deftheorem Def10 defines new_set LATTICE5:def 10 :
for b1 being set holds new_set b1 = b1 \/ {{b1},{{b1}},{{{b1}}}};

registration
let c1 be set ;
cluster new_set a1 -> non empty ;
coherence
not new_set c1 is empty
proof end;
end;

definition
let c1 be non empty set ;
let c2 be lower-bounded LATTICE;
let c3 be BiFunction of c1,c2;
let c4 be Element of [:c1,c1,the carrier of c2,the carrier of c2:];
func new_bi_fun c3,c4 -> BiFunction of (new_set a1),a2 means :Def11: :: LATTICE5:def 11
( ( for b1, b2 being Element of a1 holds a5 . b1,b2 = a3 . b1,b2 ) & a5 . {a1},{a1} = Bottom a2 & a5 . {{a1}},{{a1}} = Bottom a2 & a5 . {{{a1}}},{{{a1}}} = Bottom a2 & a5 . {{a1}},{{{a1}}} = a4 `3 & a5 . {{{a1}}},{{a1}} = a4 `3 & a5 . {a1},{{a1}} = a4 `4 & a5 . {{a1}},{a1} = a4 `4 & a5 . {a1},{{{a1}}} = (a4 `3 ) "\/" (a4 `4 ) & a5 . {{{a1}}},{a1} = (a4 `3 ) "\/" (a4 `4 ) & ( for b1 being Element of a1 holds
( a5 . b1,{a1} = (a3 . b1,(a4 `1 )) "\/" (a4 `3 ) & a5 . {a1},b1 = (a3 . b1,(a4 `1 )) "\/" (a4 `3 ) & a5 . b1,{{a1}} = ((a3 . b1,(a4 `1 )) "\/" (a4 `3 )) "\/" (a4 `4 ) & a5 . {{a1}},b1 = ((a3 . b1,(a4 `1 )) "\/" (a4 `3 )) "\/" (a4 `4 ) & a5 . b1,{{{a1}}} = (a3 . b1,(a4 `2 )) "\/" (a4 `4 ) & a5 . {{{a1}}},b1 = (a3 . b1,(a4 `2 )) "\/" (a4 `4 ) ) ) );
existence
ex b1 being BiFunction of (new_set c1),c2 st
( ( for b2, b3 being Element of c1 holds b1 . b2,b3 = c3 . b2,b3 ) & b1 . {c1},{c1} = Bottom c2 & b1 . {{c1}},{{c1}} = Bottom c2 & b1 . {{{c1}}},{{{c1}}} = Bottom c2 & b1 . {{c1}},{{{c1}}} = c4 `3 & b1 . {{{c1}}},{{c1}} = c4 `3 & b1 . {c1},{{c1}} = c4 `4 & b1 . {{c1}},{c1} = c4 `4 & b1 . {c1},{{{c1}}} = (c4 `3 ) "\/" (c4 `4 ) & b1 . {{{c1}}},{c1} = (c4 `3 ) "\/" (c4 `4 ) & ( for b2 being Element of c1 holds
( b1 . b2,{c1} = (c3 . b2,(c4 `1 )) "\/" (c4 `3 ) & b1 . {c1},b2 = (c3 . b2,(c4 `1 )) "\/" (c4 `3 ) & b1 . b2,{{c1}} = ((c3 . b2,(c4 `1 )) "\/" (c4 `3 )) "\/" (c4 `4 ) & b1 . {{c1}},b2 = ((c3 . b2,(c4 `1 )) "\/" (c4 `3 )) "\/" (c4 `4 ) & b1 . b2,{{{c1}}} = (c3 . b2,(c4 `2 )) "\/" (c4 `4 ) & b1 . {{{c1}}},b2 = (c3 . b2,(c4 `2 )) "\/" (c4 `4 ) ) ) )
proof end;
uniqueness
for b1, b2 being BiFunction of (new_set c1),c2 st ( for b3, b4 being Element of c1 holds b1 . b3,b4 = c3 . b3,b4 ) & b1 . {c1},{c1} = Bottom c2 & b1 . {{c1}},{{c1}} = Bottom c2 & b1 . {{{c1}}},{{{c1}}} = Bottom c2 & b1 . {{c1}},{{{c1}}} = c4 `3 & b1 . {{{c1}}},{{c1}} = c4 `3 & b1 . {c1},{{c1}} = c4 `4 & b1 . {{c1}},{c1} = c4 `4 & b1 . {c1},{{{c1}}} = (c4 `3 ) "\/" (c4 `4 ) & b1 . {{{c1}}},{c1} = (c4 `3 ) "\/" (c4 `4 ) & ( for b3 being Element of c1 holds
( b1 . b3,{c1} = (c3 . b3,(c4 `1 )) "\/" (c4 `3 ) & b1 . {c1},b3 = (c3 . b3,(c4 `1 )) "\/" (c4 `3 ) & b1 . b3,{{c1}} = ((c3 . b3,(c4 `1 )) "\/" (c4 `3 )) "\/" (c4 `4 ) & b1 . {{c1}},b3 = ((c3 . b3,(c4 `1 )) "\/" (c4 `3 )) "\/" (c4 `4 ) & b1 . b3,{{{c1}}} = (c3 . b3,(c4 `2 )) "\/" (c4 `4 ) & b1 . {{{c1}}},b3 = (c3 . b3,(c4 `2 )) "\/" (c4 `4 ) ) ) & ( for b3, b4 being Element of c1 holds b2 . b3,b4 = c3 . b3,b4 ) & b2 . {c1},{c1} = Bottom c2 & b2 . {{c1}},{{c1}} = Bottom c2 & b2 . {{{c1}}},{{{c1}}} = Bottom c2 & b2 . {{c1}},{{{c1}}} = c4 `3 & b2 . {{{c1}}},{{c1}} = c4 `3 & b2 . {c1},{{c1}} = c4 `4 & b2 . {{c1}},{c1} = c4 `4 & b2 . {c1},{{{c1}}} = (c4 `3 ) "\/" (c4 `4 ) & b2 . {{{c1}}},{c1} = (c4 `3 ) "\/" (c4 `4 ) & ( for b3 being Element of c1 holds
( b2 . b3,{c1} = (c3 . b3,(c4 `1 )) "\/" (c4 `3 ) & b2 . {c1},b3 = (c3 . b3,(c4 `1 )) "\/" (c4 `3 ) & b2 . b3,{{c1}} = ((c3 . b3,(c4 `1 )) "\/" (c4 `3 )) "\/" (c4 `4 ) & b2 . {{c1}},b3 = ((c3 . b3,(c4 `1 )) "\/" (c4 `3 )) "\/" (c4 `4 ) & b2 . b3,{{{c1}}} = (c3 . b3,(c4 `2 )) "\/" (c4 `4 ) & b2 . {{{c1}}},b3 = (c3 . b3,(c4 `2 )) "\/" (c4 `4 ) ) ) holds
b1 = b2
proof end;
end;

:: deftheorem Def11 defines new_bi_fun LATTICE5:def 11 :
for b1 being non empty set
for b2 being lower-bounded LATTICE
for b3 being BiFunction of b1,b2
for b4 being Element of [:b1,b1,the carrier of b2,the carrier of b2:]
for b5 being BiFunction of (new_set b1),b2 holds
( b5 = new_bi_fun b3,b4 iff ( ( for b6, b7 being Element of b1 holds b5 . b6,b7 = b3 . b6,b7 ) & b5 . {b1},{b1} = Bottom b2 & b5 . {{b1}},{{b1}} = Bottom b2 & b5 . {{{b1}}},{{{b1}}} = Bottom b2 & b5 . {{b1}},{{{b1}}} = b4 `3 & b5 . {{{b1}}},{{b1}} = b4 `3 & b5 . {b1},{{b1}} = b4 `4 & b5 . {{b1}},{b1} = b4 `4 & b5 . {b1},{{{b1}}} = (b4 `3 ) "\/" (b4 `4 ) & b5 . {{{b1}}},{b1} = (b4 `3 ) "\/" (b4 `4 ) & ( for b6 being Element of b1 holds
( b5 . b6,{b1} = (b3 . b6,(b4 `1 )) "\/" (b4 `3 ) & b5 . {b1},b6 = (b3 . b6,(b4 `1 )) "\/" (b4 `3 ) & b5 . b6,{{b1}} = ((b3 . b6,(b4 `1 )) "\/" (b4 `3 )) "\/" (b4 `4 ) & b5 . {{b1}},b6 = ((b3 . b6,(b4 `1 )) "\/" (b4 `3 )) "\/" (b4 `4 ) & b5 . b6,{{{b1}}} = (b3 . b6,(b4 `2 )) "\/" (b4 `4 ) & b5 . {{{b1}}},b6 = (b3 . b6,(b4 `2 )) "\/" (b4 `4 ) ) ) ) );

theorem Th18: :: LATTICE5:18
for b1 being non empty set
for b2 being lower-bounded LATTICE
for b3 being BiFunction of b1,b2 st b3 is zeroed holds
for b4 being Element of [:b1,b1,the carrier of b2,the carrier of b2:] holds new_bi_fun b3,b4 is zeroed
proof end;

theorem Th19: :: LATTICE5:19
for b1 being non empty set
for b2 being lower-bounded LATTICE
for b3 being BiFunction of b1,b2 st b3 is symmetric holds
for b4 being Element of [:b1,b1,the carrier of b2,the carrier of b2:] holds new_bi_fun b3,b4 is symmetric
proof end;

theorem Th20: :: LATTICE5:20
for b1 being non empty set
for b2 being lower-bounded LATTICE
for b3 being BiFunction of b1,b2 st b3 is symmetric & b3 is u.t.i. holds
for b4 being Element of [:b1,b1,the carrier of b2,the carrier of b2:] st b3 . (b4 `1 ),(b4 `2 ) <= (b4 `3 ) "\/" (b4 `4 ) holds
new_bi_fun b3,b4 is u.t.i.
proof end;

theorem Th21: :: LATTICE5:21
for b1 being set holds b1 c= new_set b1 by XBOOLE_1:7;

theorem Th22: :: LATTICE5:22
for b1 being non empty set
for b2 being lower-bounded LATTICE
for b3 being BiFunction of b1,b2
for b4 being Element of [:b1,b1,the carrier of b2,the carrier of b2:] holds b3 c= new_bi_fun b3,b4
proof end;

definition
let c1 be non empty set ;
let c2 be lower-bounded LATTICE;
let c3 be BiFunction of c1,c2;
func DistEsti c3 -> Cardinal means :Def12: :: LATTICE5:def 12
a4,{ [b1,b2,b3,b4] where B is Element of a1, B is Element of a1, B is Element of a2, B is Element of a2 : a3 . b1,b2 <= b3 "\/" b4 } are_equipotent ;
existence
ex b1 being Cardinal st b1,{ [b2,b3,b4,b5] where B is Element of c1, B is Element of c1, B is Element of c2, B is Element of c2 : c3 . b2,b3 <= b4 "\/" b5 } are_equipotent
proof end;
uniqueness
for b1, b2 being Cardinal st b1,{ [b3,b4,b5,b6] where B is Element of c1, B is Element of c1, B is Element of c2, B is Element of c2 : c3 . b3,b4 <= b5 "\/" b6 } are_equipotent & b2,{ [b3,b4,b5,b6] where B is Element of c1, B is Element of c1, B is Element of c2, B is Element of c2 : c3 . b3,b4 <= b5 "\/" b6 } are_equipotent holds
b1 = b2
proof end;
end;

:: deftheorem Def12 defines DistEsti LATTICE5:def 12 :
for b1 being non empty set
for b2 being lower-bounded LATTICE
for b3 being BiFunction of b1,b2
for b4 being Cardinal holds
( b4 = DistEsti b3 iff b4,{ [b5,b6,b7,b8] where B is Element of b1, B is Element of b1, B is Element of b2, B is Element of b2 : b3 . b5,b6 <= b7 "\/" b8 } are_equipotent );

theorem Th23: :: LATTICE5:23
for b1 being non empty set
for b2 being lower-bounded LATTICE
for b3 being distance_function of b1,b2 holds DistEsti b3 <> {}
proof end;

definition
let c1 be non empty set ;
let c2 be Ordinal;
func ConsecutiveSet c1,c2 -> set means :Def13: :: LATTICE5:def 13
ex b1 being T-Sequence st
( a3 = last b1 & dom b1 = succ a2 & b1 . {} = a1 & ( for b2 being Ordinal st succ b2 in succ a2 holds
b1 . (succ b2) = new_set (b1 . b2) ) & ( for b2 being Ordinal st b2 in succ a2 & b2 <> {} & b2 is_limit_ordinal holds
b1 . b2 = union (rng (b1 | b2)) ) );
correctness
existence
ex b1 being set ex b2 being T-Sequence st
( b1 = last b2 & dom b2 = succ c2 & b2 . {} = c1 & ( for b3 being Ordinal st succ b3 in succ c2 holds
b2 . (succ b3) = new_set (b2 . b3) ) & ( for b3 being Ordinal st b3 in succ c2 & b3 <> {} & b3 is_limit_ordinal holds
b2 . b3 = union (rng (b2 | b3)) ) )
;
uniqueness
for b1, b2 being set st ex b3 being T-Sequence st
( b1 = last b3 & dom b3 = succ c2 & b3 . {} = c1 & ( for b4 being Ordinal st succ b4 in succ c2 holds
b3 . (succ b4) = new_set (b3 . b4) ) & ( for b4 being Ordinal st b4 in succ c2 & b4 <> {} & b4 is_limit_ordinal holds
b3 . b4 = union (rng (b3 | b4)) ) ) & ex b3 being T-Sequence st
( b2 = last b3 & dom b3 = succ c2 & b3 . {} = c1 & ( for b4 being Ordinal st succ b4 in succ c2 holds
b3 . (succ b4) = new_set (b3 . b4) ) & ( for b4 being Ordinal st b4 in succ c2 & b4 <> {} & b4 is_limit_ordinal holds
b3 . b4 = union (rng (b3 | b4)) ) ) holds
b1 = b2
;
proof end;
end;

:: deftheorem Def13 defines ConsecutiveSet LATTICE5:def 13 :
for b1 being non empty set
for b2 being Ordinal
for b3 being set holds
( b3 = ConsecutiveSet b1,b2 iff ex b4 being T-Sequence st
( b3 = last b4 & dom b4 = succ b2 & b4 . {} = b1 & ( for b5 being Ordinal st succ b5 in succ b2 holds
b4 . (succ b5) = new_set (b4 . b5) ) & ( for b5 being Ordinal st b5 in succ b2 & b5 <> {} & b5 is_limit_ordinal holds
b4 . b5 = union (rng (b4 | b5)) ) ) );

theorem Th24: :: LATTICE5:24
for b1 being non empty set holds ConsecutiveSet b1,{} = b1
proof end;

theorem Th25: :: LATTICE5:25
for b1 being non empty set
for b2 being Ordinal holds ConsecutiveSet b1,(succ b2) = new_set (ConsecutiveSet b1,b2)
proof end;

theorem Th26: :: LATTICE5:26
for b1 being non empty set
for b2 being T-Sequence
for b3 being Ordinal st b3 <> {} & b3 is_limit_ordinal & dom b2 = b3 & ( for b4 being Ordinal st b4 in b3 holds
b2 . b4 = ConsecutiveSet b1,b4 ) holds
ConsecutiveSet b1,b3 = union (rng b2)
proof end;

registration
let c1 be non empty set ;
let c2 be Ordinal;
cluster ConsecutiveSet a1,a2 -> non empty ;
coherence
not ConsecutiveSet c1,c2 is empty
proof end;
end;

theorem Th27: :: LATTICE5:27
for b1 being non empty set
for b2 being Ordinal holds b1 c= ConsecutiveSet b1,b2
proof end;

definition
let c1 be non empty set ;
let c2 be lower-bounded LATTICE;
let c3 be BiFunction of c1,c2;
mode QuadrSeq of c3 -> T-Sequence of [:a1,a1,the carrier of a2,the carrier of a2:] means :Def14: :: LATTICE5:def 14
( dom a4 is Cardinal & a4 is one-to-one & rng a4 = { [b1,b2,b3,b4] where B is Element of a1, B is Element of a1, B is Element of a2, B is Element of a2 : a3 . b1,b2 <= b3 "\/" b4 } );
existence
ex b1 being T-Sequence of [:c1,c1,the carrier of c2,the carrier of c2:] st
( dom b1 is Cardinal & b1 is one-to-one & rng b1 = { [b2,b3,b4,b5] where B is Element of c1, B is Element of c1, B is Element of c2, B is Element of c2 : c3 . b2,b3 <= b4 "\/" b5 } )
proof end;
end;

:: deftheorem Def14 defines QuadrSeq LATTICE5:def 14 :
for b1 being non empty set
for b2 being lower-bounded LATTICE
for b3 being BiFunction of b1,b2
for b4 being T-Sequence of [:b1,b1,the carrier of b2,the carrier of b2:] holds
( b4 is QuadrSeq of b3 iff ( dom b4 is Cardinal & b4 is one-to-one & rng b4 = { [b5,b6,b7,b8] where B is Element of b1, B is Element of b1, B is Element of b2, B is Element of b2 : b3 . b5,b6 <= b7 "\/" b8 } ) );

definition
let c1 be non empty set ;
let c2 be lower-bounded LATTICE;
let c3 be BiFunction of c1,c2;
let c4 be QuadrSeq of c3;
let c5 be Ordinal;
assume E37: c5 in dom c4 ;
func Quadr c4,c5 -> Element of [:(ConsecutiveSet a1,a5),(ConsecutiveSet a1,a5),the carrier of a2,the carrier of a2:] equals :Def15: :: LATTICE5:def 15
a4 . a5;
correctness
coherence
c4 . c5 is Element of [:(ConsecutiveSet c1,c5),(ConsecutiveSet c1,c5),the carrier of c2,the carrier of c2:]
;
proof end;
end;

:: deftheorem Def15 defines Quadr LATTICE5:def 15 :
for b1 being non empty set
for b2 being lower-bounded LATTICE
for b3 being BiFunction of b1,b2
for b4 being QuadrSeq of b3
for b5 being Ordinal st b5 in dom b4 holds
Quadr b4,b5 = b4 . b5;

theorem Th28: :: LATTICE5:28
for b1 being non empty set
for b2 being lower-bounded LATTICE
for b3 being Ordinal
for b4 being BiFunction of b1,b2
for b5 being QuadrSeq of b4 holds
( b3 in DistEsti b4 iff b3 in dom b5 )
proof end;

definition
let c1 be non empty set ;
let c2 be lower-bounded LATTICE;
let c3 be set ;
assume E39: c3 is BiFunction of c1,c2 ;
func BiFun c3,c1,c2 -> BiFunction of a1,a2 equals :Def16: :: LATTICE5:def 16
a3;
coherence
c3 is BiFunction of c1,c2
by E39;
end;

:: deftheorem Def16 defines BiFun LATTICE5:def 16 :
for b1 being non empty set
for b2 being lower-bounded LATTICE
for b3 being set st b3 is BiFunction of b1,b2 holds
BiFun b3,b1,b2 = b3;

definition
let c1 be non empty set ;
let c2 be lower-bounded LATTICE;
let c3 be BiFunction of c1,c2;
let c4 be QuadrSeq of c3;
let c5 be Ordinal;
func ConsecutiveDelta c4,c5 -> set means :Def17: :: LATTICE5:def 17
ex b1 being T-Sequence st
( a6 = last b1 & dom b1 = succ a5 & b1 . {} = a3 & ( for b2 being Ordinal st succ b2 in succ a5 holds
b1 . (succ b2) = new_bi_fun (BiFun (b1 . b2),(ConsecutiveSet a1,b2),a2),(Quadr a4,b2) ) & ( for b2 being Ordinal st b2 in succ a5 & b2 <> {} & b2 is_limit_ordinal holds
b1 . b2 = union (rng (b1 | b2)) ) );
correctness
existence
ex b1 being set ex b2 being T-Sequence st
( b1 = last b2 & dom b2 = succ c5 & b2 . {} = c3 & ( for b3 being Ordinal st succ b3 in succ c5 holds
b2 . (succ b3) = new_bi_fun (BiFun (b2 . b3),(ConsecutiveSet c1,b3),c2),(Quadr c4,b3) ) & ( for b3 being Ordinal st b3 in succ c5 & b3 <> {} & b3 is_limit_ordinal holds
b2 . b3 = union (rng (b2 | b3)) ) )
;
uniqueness
for b1, b2 being set st ex b3 being T-Sequence st
( b1 = last b3 & dom b3 = succ c5 & b3 . {} = c3 & ( for b4 being Ordinal st succ b4 in succ c5 holds
b3 . (succ b4) = new_bi_fun (BiFun (b3 . b4),(ConsecutiveSet c1,b4),c2),(Quadr c4,b4) ) & ( for b4 being Ordinal st b4 in succ c5 & b4 <> {} & b4 is_limit_ordinal holds
b3 . b4 = union (rng (b3 | b4)) ) ) & ex b3 being T-Sequence st
( b2 = last b3 & dom b3 = succ c5 & b3 . {} = c3 & ( for b4 being Ordinal st succ b4 in succ c5 holds
b3 . (succ b4) = new_bi_fun (BiFun (b3 . b4),(ConsecutiveSet c1,b4),c2),(Quadr c4,b4) ) & ( for b4 being Ordinal st b4 in succ c5 & b4 <> {} & b4 is_limit_ordinal holds
b3 . b4 = union (rng (b3 | b4)) ) ) holds
b1 = b2
;
proof end;
end;

:: deftheorem Def17 defines ConsecutiveDelta LATTICE5:def 17 :
for b1 being non empty set
for b2 being lower-bounded LATTICE
for b3 being BiFunction of b1,b2
for b4 being QuadrSeq of b3
for b5 being Ordinal
for b6 being set holds
( b6 = ConsecutiveDelta b4,b5 iff ex b7 being T-Sequence st
( b6 = last b7 & dom b7 = succ b5 & b7 . {} = b3 & ( for b8 being Ordinal st succ b8 in succ b5 holds
b7 . (succ b8) = new_bi_fun (BiFun (b7 . b8),(ConsecutiveSet b1,b8),b2),(Quadr b4,b8) ) & ( for b8 being Ordinal st b8 in succ b5 & b8 <> {} & b8 is_limit_ordinal holds
b7 . b8 = union (rng (b7 | b8)) ) ) );

theorem Th29: :: LATTICE5:29
for b1 being non empty set
for b2 being lower-bounded LATTICE
for b3 being BiFunction of b1,b2
for b4 being QuadrSeq of b3 holds ConsecutiveDelta b4,{} = b3
proof end;

theorem Th30: :: LATTICE5:30
for b1 being non empty set
for b2 being lower-bounded LATTICE
for b3 being Ordinal
for b4 being BiFunction of b1,b2
for b5 being QuadrSeq of b4 holds ConsecutiveDelta b5,(succ b3) = new_bi_fun (BiFun (ConsecutiveDelta b5,b3),(ConsecutiveSet b1,b3),b2),(Quadr b5,b3)
proof end;

theorem Th31: :: LATTICE5:31
for b1 being non empty set
for b2 being lower-bounded LATTICE
for b3 being T-Sequence
for b4 being Ordinal
for b5 being BiFunction of b1,b2
for b6 being QuadrSeq of b5 st b4 <> {} & b4 is_limit_ordinal & dom b3 = b4 & ( for b7 being Ordinal st b7 in b4 holds
b3 . b7 = ConsecutiveDelta b6,b7 ) holds
ConsecutiveDelta b6,b4 = union (rng b3)
proof end;

theorem Th32: :: LATTICE5:32
for b1 being non empty set
for b2, b3 being Ordinal st b2 c= b3 holds
ConsecutiveSet b1,b2 c= ConsecutiveSet b1,b3
proof end;

theorem Th33: :: LATTICE5:33
for b1 being non empty set
for b2 being lower-bounded LATTICE
for b3 being Ordinal
for b4 being BiFunction of b1,b2
for b5 being QuadrSeq of b4 holds ConsecutiveDelta b5,b3 is BiFunction of (ConsecutiveSet b1,b3),b2
proof end;

definition
let c1 be non empty set ;
let c2 be lower-bounded LATTICE;
let c3 be BiFunction of c1,c2;
let c4 be QuadrSeq of c3;
let c5 be Ordinal;
redefine func ConsecutiveDelta as ConsecutiveDelta c4,c5 -> BiFunction of (ConsecutiveSet a1,a5),a2;
coherence
ConsecutiveDelta c4,c5 is BiFunction of (ConsecutiveSet c1,c5),c2
by Th33;
end;

theorem Th34: :: LATTICE5:34
for b1 being non empty set
for b2 being lower-bounded LATTICE
for b3 being Ordinal
for b4 being BiFunction of b1,b2
for b5 being QuadrSeq of b4 holds b4 c= ConsecutiveDelta b5,b3
proof end;

theorem Th35: :: LATTICE5:35
for b1 being non empty set
for b2 being lower-bounded LATTICE
for b3, b4 being Ordinal
for b5 being BiFunction of b1,b2
for b6 being QuadrSeq of b5 st b3 c= b4 holds
ConsecutiveDelta b6,b3 c= ConsecutiveDelta b6,b4
proof end;

theorem Th36: :: LATTICE5:36
for b1 being non empty set
for b2 being lower-bounded LATTICE
for b3 being Ordinal
for b4 being BiFunction of b1,b2 st b4 is zeroed holds
for b5 being QuadrSeq of b4 holds ConsecutiveDelta b5,b3 is zeroed
proof end;

theorem Th37: :: LATTICE5:37
for b1 being non empty set
for b2 being lower-bounded LATTICE
for b3 being Ordinal
for b4 being BiFunction of b1,b2 st b4 is symmetric holds
for b5 being QuadrSeq of b4 holds ConsecutiveDelta b5,b3 is symmetric
proof end;

theorem Th38: :: LATTICE5:38
for b1 being non empty set
for b2 being lower-bounded LATTICE
for b3 being Ordinal
for b4 being BiFunction of b1,b2 st b4 is symmetric & b4 is u.t.i. holds
for b5 being QuadrSeq of b4 st b3 c= DistEsti b4 holds
ConsecutiveDelta b5,b3 is u.t.i.
proof end;

theorem Th39: :: LATTICE5:39
for b1 being non empty set
for b2 being lower-bounded LATTICE
for b3 being Ordinal
for b4 being distance_function of b1,b2
for b5 being QuadrSeq of b4 st b3 c= DistEsti b4 holds
ConsecutiveDelta b5,b3 is distance_function of (ConsecutiveSet b1,b3),b2 by Th36, Th37, Th38;

definition
let c1 be non empty set ;
let c2 be lower-bounded LATTICE;
let c3 be BiFunction of c1,c2;
func NextSet c3 -> set equals :: LATTICE5:def 18
ConsecutiveSet a1,(DistEsti a3);
correctness
coherence
ConsecutiveSet c1,(DistEsti c3) is set
;
;
end;

:: deftheorem Def18 defines NextSet LATTICE5:def 18 :
for b1 being non empty set
for b2 being lower-bounded LATTICE
for b3 being BiFunction of b1,b2 holds NextSet b3 = ConsecutiveSet b1,(DistEsti b3);

registration
let c1 be non empty set ;
let c2 be lower-bounded LATTICE;
let c3 be BiFunction of c1,c2;
cluster NextSet a3 -> non empty ;
coherence
not NextSet c3 is empty
;
end;

definition
let c1 be non empty set ;
let c2 be lower-bounded LATTICE;
let c3 be BiFunction of c1,c2;
let c4 be QuadrSeq of c3;
func NextDelta c4 -> set equals :: LATTICE5:def 19
ConsecutiveDelta a4,(DistEsti a3);
correctness
coherence
ConsecutiveDelta c4,(DistEsti c3) is set
;
;
end;

:: deftheorem Def19 defines NextDelta LATTICE5:def 19 :
for b1 being non empty set
for b2 being lower-bounded LATTICE
for b3 being BiFunction of b1,b2
for b4 being QuadrSeq of b3 holds NextDelta b4 = ConsecutiveDelta b4,(DistEsti b3);

definition
let c1 be non empty set ;
let c2 be lower-bounded LATTICE;
let c3 be distance_function of c1,c2;
let c4 be QuadrSeq of c3;
redefine func NextDelta as NextDelta c4 -> distance_function of (NextSet a3),a2;
coherence
NextDelta c4 is distance_function of (NextSet c3),c2
by Th36, Th37, Th38;
end;

definition
let c1 be non empty set ;
let c2 be lower-bounded LATTICE;
let c3 be distance_function of c1,c2;
let c4 be non empty set ;
let c5 be distance_function of c4,c2;
pred c4,c5 is_extension_of c1,c3 means :Def20: :: LATTICE5:def 20
ex b1 being QuadrSeq of a3 st
( a4 = NextSet a3 & a5 = NextDelta b1 );
end;

:: deftheorem Def20 defines is_extension_of LATTICE5:def 20 :
for b1 being non empty set
for b2 being lower-bounded LATTICE
for b3 being distance_function of b1,b2
for b4 being non empty set
for b5 being distance_function of b4,b2 holds
( b4,b5 is_extension_of b1,b3 iff ex b6 being QuadrSeq of b3 st
( b4 = NextSet b3 & b5 = NextDelta b6 ) );

theorem Th40: :: LATTICE5:40
for b1 being non empty set
for b2 being lower-bounded LATTICE
for b3 being distance_function of b1,b2
for b4 being non empty set
for b5 being distance_function of b4,b2 st b4,b5 is_extension_of b1,b3 holds
for b6, b7 being Element of b1
for b8, b9 being Element of b2 st b3 . b6,b7 <= b8 "\/" b9 holds
ex b10, b11, b12 being Element of b4 st
( b5 . b6,b10 = b8 & b5 . b11,b12 = b8 & b5 . b10,b11 = b9 & b5 . b12,b7 = b9 )
proof end;

definition
let c1 be non empty set ;
let c2 be lower-bounded LATTICE;
let c3 be distance_function of c1,c2;
mode ExtensionSeq of c1,c3 -> Function means :Def21: :: LATTICE5:def 21
( dom a4 = NAT & a4 . 0 = [a1,a3] & ( for b1 being Nat ex b2 being non empty set ex b3 being distance_function of b2,a2ex b4 being non empty set ex b5 being distance_function of b4,a2 st
( b4,b5 is_extension_of b2,b3 & a4 . b1 = [b2,b3] & a4 . (b1 + 1) = [b4,b5] ) ) );
existence
ex b1 being Function st
( dom b1 = NAT & b1 . 0 = [c1,c3] & ( for b2 being Nat ex b3 being non empty set ex b4 being distance_function of b3,c2ex b5 being non empty set ex b6 being distance_function of b5,c2 st
( b5,b6 is_extension_of b3,b4 & b1 . b2 = [b3,b4] & b1 . (b2 + 1) = [b5,b6] ) ) )
proof end;
end;

:: deftheorem Def21 defines ExtensionSeq LATTICE5:def 21 :
for b1 being non empty set
for b2 being lower-bounded LATTICE
for b3 being distance_function of b1,b2
for b4 being Function holds
( b4 is ExtensionSeq of b1,b3 iff ( dom b4 = NAT & b4 . 0 = [b1,b3] & ( for b5 being Nat ex b6 being non empty set ex b7 being distance_function of b6,b2ex b8 being non empty set ex b9 being distance_function of b8,b2 st
( b8,b9 is_extension_of b6,b7 & b4 . b5 = [b6,b7] & b4 . (b5 + 1) = [b8,b9] ) ) ) );

theorem Th41: :: LATTICE5:41
for b1 being non empty set
for b2 being lower-bounded LATTICE
for b3 being distance_function of b1,b2
for b4 being ExtensionSeq of b1,b3
for b5, b6 being Nat st b5 <= b6 holds
(b4 . b5) `1 c= (b4 . b6) `1
proof end;

theorem Th42: :: LATTICE5:42
for b1 being non empty set
for b2 being lower-bounded LATTICE
for b3 being distance_function of b1,b2
for b4 being ExtensionSeq of b1,b3
for b5, b6 being Nat st b5 <= b6 holds
(b4 . b5) `2 c= (b4 . b6) `2
proof end;

definition
let c1 be lower-bounded LATTICE;
func BasicDF c1 -> distance_function of the carrier of a1,a1 means :Def22: :: LATTICE5:def 22
for b1, b2 being Element of a1 holds
( ( b1 <> b2 implies a2 . b1,b2 = b1 "\/" b2 ) & ( b1 = b2 implies a2 . b1,b2 = Bottom a1 ) );
existence
ex b1 being distance_function of the carrier of c1,c1 st
for b2, b3 being Element of c1 holds
( ( b2 <> b3 implies b1 . b2,b3 = b2 "\/" b3 ) & ( b2 = b3 implies b1 . b2,b3 = Bottom c1 ) )
proof end;
uniqueness
for b1, b2 being distance_function of the carrier of c1,c1 st ( for b3, b4 being Element of c1 holds
( ( b3 <> b4 implies b1 . b3,b4 = b3 "\/" b4 ) & ( b3 = b4 implies b1 . b3,b4 = Bottom c1 ) ) ) & ( for b3, b4 being Element of c1 holds
( ( b3 <> b4 implies b2 . b3,b4 = b3 "\/" b4 ) & ( b3 = b4 implies b2 . b3,b4 = Bottom c1 ) ) ) holds
b1 = b2
proof end;
end;

:: deftheorem Def22 defines BasicDF LATTICE5:def 22 :
for b1 being lower-bounded LATTICE
for b2 being distance_function of the carrier of b1,b1 holds
( b2 = BasicDF b1 iff for b3, b4 being Element of b1 holds
( ( b3 <> b4 implies b2 . b3,b4 = b3 "\/" b4 ) & ( b3 = b4 implies b2 . b3,b4 = Bottom b1 ) ) );

theorem Th43: :: LATTICE5:43
for b1 being lower-bounded LATTICE holds BasicDF b1 is onto
proof end;

E58: now
let c1 be Nat;
assume E59: ( 1 <= c1 & c1 < 5 ) ;
then c1 < 4 + 1 ;
then c1 <= 4 by NAT_1:38;
then ( c1 = 0 or c1 = 1 or c1 = 2 or c1 = 3 or c1 = 4 ) by CQC_THE1:5;
hence ( c1 = 1 or c1 = 2 or c1 = 3 or c1 = 4 ) by E59;
end;

E59: now
let c1 be Nat;
assume E60: c1 in Seg 5 ;
then ( 1 <= c1 & c1 <= 5 ) by FINSEQ_1:3;
then ( c1 = 0 or c1 = 1 or c1 = 2 or c1 = 3 or c1 = 4 or c1 = 5 ) by CQC_THE1:6;
hence ( c1 = 1 or c1 = 2 or c1 = 3 or c1 = 4 or c1 = 5 ) by E60, FINSEQ_1:3;
end;

E60: now
let c1 be non empty set ;
let c2 be lower-bounded LATTICE;
let c3 be distance_function of c1,c2;
( succ {} c= DistEsti c3 or DistEsti c3 in succ {} ) by ORDINAL1:26;
then ( succ {} c= DistEsti c3 or DistEsti c3 c= {} ) by ORDINAL1:34;
then ( succ {} c= DistEsti c3 or DistEsti c3 = {} ) by XBOOLE_1:3;
hence succ {} c= DistEsti c3 by Th23;
end;

theorem Th44: :: LATTICE5:44
for b1 being lower-bounded LATTICE
for b2 being ExtensionSeq of the carrier of b1, BasicDF b1
for b3 being non empty set st b3 = union { ((b2 . b4) `1 ) where B is Nat : verum } holds
union { ((b2 . b4) `2 ) where B is Nat : verum } is distance_function of b3,b1
proof end;

theorem Th45: :: LATTICE5:45
for b1 being lower-bounded LATTICE
for b2 being ExtensionSeq of the carrier of b1, BasicDF b1
for b3 being non empty set
for b4 being distance_function of b3,b1
for b5, b6 being Element of b3
for b7, b8 being Element of b1 st b3 = union { ((b2 . b9) `1 ) where B is Nat : verum } & b4 = union { ((b2 . b9) `2 ) where B is Nat : verum } & b4 . b5,b6 <= b7 "\/" b8 holds
ex b9, b10, b11 being Element of b3 st
( b4 . b5,b9 = b7 & b4 . b10,b11 = b7 & b4 . b9,b10 = b8 & b4 . b11,b6 = b8 )
proof end;

theorem Th46: :: LATTICE5:46
for b1 being lower-bounded LATTICE
for b2 being ExtensionSeq of the carrier of b1, BasicDF b1
for b3 being non empty set
for b4 being distance_function of b3,b1
for b5 being Homomorphism of b1,(EqRelLATT b3)
for b6, b7 being Element of b3
for b8, b9 being Equivalence_Relation of b3
for b10, b11 being set st b5 = alpha b4 & b3 = union { ((b2 . b12) `1 ) where B is Nat : verum } & b4 = union { ((b2 . b12) `2 ) where B is Nat : verum } & b8 in the carrier of (Image b5) & b9 in the carrier of (Image b5) & [b10,b11] in b8 "\/" b9 holds
ex b12 being non empty FinSequence of b3 st
( len b12 = 3 + 2 & b10,b11 are_joint_by b12,b8,b9 )
proof end;

theorem Th47: :: LATTICE5:47
for b1 being lower-bounded LATTICE ex b2 being non empty set ex b3 being Homomorphism of b1,(EqRelLATT b2) st
( b3 is one-to-one & type_of (Image b3) <= 3 )
proof end;