:: UNIALG_3 semantic presentation

definition
let c1 be Universal_Algebra;
mode SubAlgebra-Family of c1 -> set means :Def1: :: UNIALG_3:def 1
for b1 being set holds
( b1 in a2 implies b1 is SubAlgebra of a1 );
existence
ex b1 being set st
for b2 being set holds
( b2 in b1 implies b2 is SubAlgebra of c1 )
proof end;
end;

:: deftheorem Def1 defines SubAlgebra-Family UNIALG_3:def 1 :
for b1 being Universal_Algebra
for b2 being set holds
( b2 is SubAlgebra-Family of b1 iff for b3 being set holds
( b3 in b2 implies b3 is SubAlgebra of b1 ) );

registration
let c1 be Universal_Algebra;
cluster non empty SubAlgebra-Family of a1;
existence
not for b1 being SubAlgebra-Family of c1 holds b1 is empty
proof end;
end;

definition
let c1 be Universal_Algebra;
redefine func Sub as Sub c1 -> non empty SubAlgebra-Family of a1;
coherence
Sub c1 is non empty SubAlgebra-Family of c1
proof end;
let c2 be non empty SubAlgebra-Family of c1;
redefine mode Element as Element of c2 -> SubAlgebra of a1;
coherence
for b1 being Element of c2 holds
b1 is SubAlgebra of c1
by Def1;
end;

definition
let c1 be Universal_Algebra;
redefine func UniAlg_join as UniAlg_join c1 -> BinOp of Sub a1;
coherence
UniAlg_join c1 is BinOp of Sub c1
;
redefine func UniAlg_meet as UniAlg_meet c1 -> BinOp of Sub a1;
coherence
UniAlg_meet c1 is BinOp of Sub c1
;
end;

definition
let c1 be Universal_Algebra;
let c2 be Element of Sub c1;
func carr c2 -> Subset of a1 means :Def2: :: UNIALG_3:def 2
ex b1 being SubAlgebra of a1 st
( a2 = b1 & a3 = the carrier of b1 );
existence
ex b1 being Subset of c1ex b2 being SubAlgebra of c1 st
( c2 = b2 & b1 = the carrier of b2 )
proof end;
uniqueness
for b1, b2 being Subset of c1 holds
( ex b3 being SubAlgebra of c1 st
( c2 = b3 & b1 = the carrier of b3 ) & ex b3 being SubAlgebra of c1 st
( c2 = b3 & b2 = the carrier of b3 ) implies b1 = b2 )
;
end;

:: deftheorem Def2 defines carr UNIALG_3:def 2 :
for b1 being Universal_Algebra
for b2 being Element of Sub b1
for b3 being Subset of b1 holds
( b3 = carr b2 iff ex b4 being SubAlgebra of b1 st
( b2 = b4 & b3 = the carrier of b4 ) );

definition
let c1 be Universal_Algebra;
func Carr c1 -> Function of Sub a1, bool the carrier of a1 means :Def3: :: UNIALG_3:def 3
for b1 being Element of Sub a1 holds a2 . b1 = carr b1;
existence
ex b1 being Function of Sub c1, bool the carrier of c1 st
for b2 being Element of Sub c1 holds b1 . b2 = carr b2
proof end;
uniqueness
for b1, b2 being Function of Sub c1, bool the carrier of c1 holds
( ( for b3 being Element of Sub c1 holds b1 . b3 = carr b3 ) & ( for b3 being Element of Sub c1 holds b2 . b3 = carr b3 ) implies b1 = b2 )
proof end;
end;

:: deftheorem Def3 defines Carr UNIALG_3:def 3 :
for b1 being Universal_Algebra
for b2 being Function of Sub b1, bool the carrier of b1 holds
( b2 = Carr b1 iff for b3 being Element of Sub b1 holds b2 . b3 = carr b3 );

theorem Th1: :: UNIALG_3:1
for b1 being Universal_Algebra
for b2 being set holds
( b2 in Sub b1 iff ex b3 being strict SubAlgebra of b1 st b2 = b3 )
proof end;

theorem Th2: :: UNIALG_3:2
for b1 being Universal_Algebra
for b2 being non empty Subset of b1
for b3 being operation of b1 holds
( arity b3 = 0 implies ( b2 is_closed_on b3 iff b3 . {} in b2 ) )
proof end;

theorem Th3: :: UNIALG_3:3
for b1 being Universal_Algebra
for b2 being SubAlgebra of b1 holds the carrier of b2 c= the carrier of b1
proof end;

theorem Th4: :: UNIALG_3:4
for b1 being Universal_Algebra
for b2 being non empty Subset of b1
for b3 being operation of b1 holds
( b2 is_closed_on b3 & arity b3 = 0 implies b3 /. b2 = b3 )
proof end;

theorem Th5: :: UNIALG_3:5
for b1 being Universal_Algebra holds Constants b1 = { (b2 . {} ) where B is operation of b1 : arity b2 = 0 }
proof end;

theorem Th6: :: UNIALG_3:6
for b1 being with_const_op Universal_Algebra
for b2 being SubAlgebra of b1 holds Constants b1 = Constants b2
proof end;

registration
let c1 be with_const_op Universal_Algebra;
cluster -> with_const_op SubAlgebra of a1;
coherence
for b1 being SubAlgebra of c1 holds b1 is with_const_op
proof end;
end;

theorem Th7: :: UNIALG_3:7
for b1 being with_const_op Universal_Algebra
for b2, b3 being SubAlgebra of b1 holds Constants b2 = Constants b3
proof end;

definition
let c1 be Universal_Algebra;
redefine func Carr as Carr c1 -> Function of Sub a1, bool the carrier of a1 means :Def4: :: UNIALG_3:def 4
for b1 being Element of Sub a1
for b2 being SubAlgebra of a1 holds
( b1 = b2 implies a2 . b1 = the carrier of b2 );
coherence
Carr c1 is Function of Sub c1, bool the carrier of c1
;
compatibility
for b1 being Function of Sub c1, bool the carrier of c1 holds
( b1 = Carr c1 iff for b2 being Element of Sub c1
for b3 being SubAlgebra of c1 holds
( b2 = b3 implies b1 . b2 = the carrier of b3 ) )
proof end;
end;

:: deftheorem Def4 defines Carr UNIALG_3:def 4 :
for b1 being Universal_Algebra
for b2 being Function of Sub b1, bool the carrier of b1 holds
( b2 = Carr b1 iff for b3 being Element of Sub b1
for b4 being SubAlgebra of b1 holds
( b3 = b4 implies b2 . b3 = the carrier of b4 ) );

theorem Th8: :: UNIALG_3:8
for b1 being Universal_Algebra
for b2 being strict SubAlgebra of b1
for b3 being Element of b1 holds
( b3 in (Carr b1) . b2 iff b3 in b2 )
proof end;

theorem Th9: :: UNIALG_3:9
for b1 being Universal_Algebra
for b2 being non empty Subset of (Sub b1) holds
not (Carr b1) .: b2 is empty
proof end;

theorem Th10: :: UNIALG_3:10
for b1 being with_const_op Universal_Algebra
for b2 being strict SubAlgebra of b1 holds Constants b1 c= (Carr b1) . b2
proof end;

theorem Th11: :: UNIALG_3:11
for b1 being with_const_op Universal_Algebra
for b2 being SubAlgebra of b1
for b3 being set holds
( b3 is Element of Constants b1 implies b3 in the carrier of b2 )
proof end;

theorem Th12: :: UNIALG_3:12
for b1 being with_const_op Universal_Algebra
for b2 being non empty Subset of (Sub b1) holds
meet ((Carr b1) .: b2) is non empty Subset of b1
proof end;

theorem Th13: :: UNIALG_3:13
for b1 being with_const_op Universal_Algebra holds the carrier of (UnSubAlLattice b1) = Sub b1 ;

theorem Th14: :: UNIALG_3:14
for b1 being with_const_op Universal_Algebra
for b2 being non empty Subset of (Sub b1)
for b3 being non empty Subset of b1 holds
( b3 = meet ((Carr b1) .: b2) implies b3 is opers_closed )
proof end;

definition
let c1 be strict with_const_op Universal_Algebra;
let c2 be non empty Subset of (Sub c1);
func meet c2 -> strict SubAlgebra of a1 means :Def5: :: UNIALG_3:def 5
the carrier of a3 = meet ((Carr a1) .: a2);
existence
ex b1 being strict SubAlgebra of c1 st the carrier of b1 = meet ((Carr c1) .: c2)
proof end;
uniqueness
for b1, b2 being strict SubAlgebra of c1 holds
( the carrier of b1 = meet ((Carr c1) .: c2) & the carrier of b2 = meet ((Carr c1) .: c2) implies b1 = b2 )
by UNIALG_2:15;
end;

:: deftheorem Def5 defines meet UNIALG_3:def 5 :
for b1 being strict with_const_op Universal_Algebra
for b2 being non empty Subset of (Sub b1)
for b3 being strict SubAlgebra of b1 holds
( b3 = meet b2 iff the carrier of b3 = meet ((Carr b1) .: b2) );

theorem Th15: :: UNIALG_3:15
for b1 being with_const_op Universal_Algebra
for b2, b3 being Element of (UnSubAlLattice b1)
for b4, b5 being strict SubAlgebra of b1 holds
( b2 = b4 & b3 = b5 implies b2 "\/" b3 = b4 "\/" b5 ) by UNIALG_2:def 16;

theorem Th16: :: UNIALG_3:16
for b1 being with_const_op Universal_Algebra
for b2, b3 being Element of (UnSubAlLattice b1)
for b4, b5 being strict SubAlgebra of b1 holds
( b2 = b4 & b3 = b5 implies b2 "/\" b3 = b4 /\ b5 ) by UNIALG_2:def 17;

theorem Th17: :: UNIALG_3:17
for b1 being with_const_op Universal_Algebra
for b2, b3 being Element of (UnSubAlLattice b1)
for b4, b5 being strict SubAlgebra of b1 holds
( b2 = b4 & b3 = b5 implies ( b2 [= b3 iff the carrier of b4 c= the carrier of b5 ) )
proof end;

theorem Th18: :: UNIALG_3:18
for b1 being with_const_op Universal_Algebra
for b2, b3 being Element of (UnSubAlLattice b1)
for b4, b5 being strict SubAlgebra of b1 holds
( b2 = b4 & b3 = b5 implies ( b2 [= b3 iff b4 is SubAlgebra of b5 ) )
proof end;

theorem Th19: :: UNIALG_3:19
for b1 being strict with_const_op Universal_Algebra holds UnSubAlLattice b1 is bounded
proof end;

registration
let c1 be strict with_const_op Universal_Algebra;
cluster UnSubAlLattice a1 -> bounded ;
coherence
UnSubAlLattice c1 is bounded
by Th19;
end;

theorem Th20: :: UNIALG_3:20
for b1 being strict with_const_op Universal_Algebra
for b2 being strict SubAlgebra of b1 holds (GenUnivAlg (Constants b1)) /\ b2 = GenUnivAlg (Constants b1)
proof end;

theorem Th21: :: UNIALG_3:21
for b1 being strict with_const_op Universal_Algebra holds Bottom (UnSubAlLattice b1) = GenUnivAlg (Constants b1)
proof end;

theorem Th22: :: UNIALG_3:22
for b1 being strict with_const_op Universal_Algebra
for b2 being SubAlgebra of b1
for b3 being Subset of b1 holds
( b3 = the carrier of b1 implies (GenUnivAlg b3) "\/" b2 = GenUnivAlg b3 )
proof end;

theorem Th23: :: UNIALG_3:23
for b1 being strict with_const_op Universal_Algebra
for b2 being Subset of b1 holds
( b2 = the carrier of b1 implies Top (UnSubAlLattice b1) = GenUnivAlg b2 )
proof end;

theorem Th24: :: UNIALG_3:24
for b1 being strict with_const_op Universal_Algebra holds Top (UnSubAlLattice b1) = b1
proof end;

theorem Th25: :: UNIALG_3:25
for b1 being strict with_const_op Universal_Algebra holds UnSubAlLattice b1 is complete
proof end;

definition
let c1, c2 be with_const_op Universal_Algebra;
let c3 be Function of the carrier of c1,the carrier of c2;
func FuncLatt c3 -> Function of the carrier of (UnSubAlLattice a1),the carrier of (UnSubAlLattice a2) means :Def6: :: UNIALG_3:def 6
for b1 being strict SubAlgebra of a1
for b2 being Subset of a2 holds
( b2 = a3 .: the carrier of b1 implies a4 . b1 = GenUnivAlg b2 );
existence
ex b1 being Function of the carrier of (UnSubAlLattice c1),the carrier of (UnSubAlLattice c2) st
for b2 being strict SubAlgebra of c1
for b3 being Subset of c2 holds
( b3 = c3 .: the carrier of b2 implies b1 . b2 = GenUnivAlg b3 )
proof end;
uniqueness
for b1, b2 being Function of the carrier of (UnSubAlLattice c1),the carrier of (UnSubAlLattice c2) holds
( ( for b3 being strict SubAlgebra of c1
for b4 being Subset of c2 holds
( b4 = c3 .: the carrier of b3 implies b1 . b3 = GenUnivAlg b4 ) ) & ( for b3 being strict SubAlgebra of c1
for b4 being Subset of c2 holds
( b4 = c3 .: the carrier of b3 implies b2 . b3 = GenUnivAlg b4 ) ) implies b1 = b2 )
proof end;
end;

:: deftheorem Def6 defines FuncLatt UNIALG_3:def 6 :
for b1, b2 being with_const_op Universal_Algebra
for b3 being Function of the carrier of b1,the carrier of b2
for b4 being Function of the carrier of (UnSubAlLattice b1),the carrier of (UnSubAlLattice b2) holds
( b4 = FuncLatt b3 iff for b5 being strict SubAlgebra of b1
for b6 being Subset of b2 holds
( b6 = b3 .: the carrier of b5 implies b4 . b5 = GenUnivAlg b6 ) );

theorem Th26: :: UNIALG_3:26
for b1 being strict with_const_op Universal_Algebra
for b2 being Function of the carrier of b1,the carrier of b1 holds
( b2 = id the carrier of b1 implies FuncLatt b2 = id the carrier of (UnSubAlLattice b1) )
proof end;