:: HENMODEL semantic presentation

theorem Th1: :: HENMODEL:1
for b1 being Nat
for b2 being non empty finite Subset of NAT
for b3 being Function of b1,b2 st ex b4 being Nat st succ b4 = b1 & b3 is one-to-one & rng b3 = b2 & ( for b4, b5 being Nat st b5 in dom b3 & b4 in dom b3 & b4 < b5 holds
b3 . b4 in b3 . b5 ) holds
b3 . (union b1) = union (rng b3)
proof end;

theorem Th2: :: HENMODEL:2
for b1 being non empty finite Subset of NAT holds
( union b1 in b1 & ( for b2 being set holds
( not b2 in b1 or b2 in union b1 or b2 = union b1 ) ) )
proof end;

definition
let c1 be set ;
func min* c1 -> Nat means :Def1: :: HENMODEL:def 1
( a2 in a1 & ( for b1 being Nat st b1 in a1 holds
a2 <= b1 ) ) if a1 is non empty Subset of NAT
otherwise a2 = 0;
existence
( ( c1 is non empty Subset of NAT implies ex b1 being Nat st
( b1 in c1 & ( for b2 being Nat st b2 in c1 holds
b1 <= b2 ) ) ) & ( c1 is not non empty Subset of NAT implies ex b1 being Nat st b1 = 0 ) )
proof end;
uniqueness
for b1, b2 being Nat holds
( ( c1 is non empty Subset of NAT & b1 in c1 & ( for b3 being Nat st b3 in c1 holds
b1 <= b3 ) & b2 in c1 & ( for b3 being Nat st b3 in c1 holds
b2 <= b3 ) implies b1 = b2 ) & ( c1 is not non empty Subset of NAT & b1 = 0 & b2 = 0 implies b1 = b2 ) )
proof end;
consistency
for b1 being Nat holds verum
;
end;

:: deftheorem Def1 defines min* HENMODEL:def 1 :
for b1 being set
for b2 being Nat holds
( ( b1 is non empty Subset of NAT implies ( b2 = min* b1 iff ( b2 in b1 & ( for b3 being Nat st b3 in b1 holds
b2 <= b3 ) ) ) ) & ( b1 is not non empty Subset of NAT implies ( b2 = min* b1 iff b2 = 0 ) ) );

theorem Th3: :: HENMODEL:3
for b1 being non empty set
for b2 being Function of NAT ,b1
for b3 being finite set st ( for b4, b5 being Nat st b5 in dom b2 & b4 in dom b2 & b4 < b5 holds
b2 . b4 c= b2 . b5 ) & b3 c= union (rng b2) holds
ex b4 being Nat st b3 c= b2 . b4
proof end;

definition
let c1 be Subset of CQC-WFF ;
let c2 be Element of CQC-WFF ;
pred c1 |- c2 means :Def2: :: HENMODEL:def 2
ex b1 being FinSequence of CQC-WFF st
( rng b1 c= a1 & |- b1 ^ <*a2*> );
end;

:: deftheorem Def2 defines |- HENMODEL:def 2 :
for b1 being Subset of CQC-WFF
for b2 being Element of CQC-WFF holds
( b1 |- b2 iff ex b3 being FinSequence of CQC-WFF st
( rng b3 c= b1 & |- b3 ^ <*b2*> ) );

definition
let c1 be Subset of CQC-WFF ;
attr a1 is Consistent means :Def3: :: HENMODEL:def 3
for b1 being Element of CQC-WFF holds
( not a1 |- b1 or not a1 |- 'not' b1 );
end;

:: deftheorem Def3 defines Consistent HENMODEL:def 3 :
for b1 being Subset of CQC-WFF holds
( b1 is Consistent iff for b2 being Element of CQC-WFF holds
( not b1 |- b2 or not b1 |- 'not' b2 ) );

notation
let c1 be Subset of CQC-WFF ;
antonym Inconsistent c1 for Consistent c1;
end;

definition
let c1 be FinSequence of CQC-WFF ;
attr a1 is Consistent means :Def4: :: HENMODEL:def 4
for b1 being Element of CQC-WFF holds
( not |- a1 ^ <*b1*> or not |- a1 ^ <*('not' b1)*> );
end;

:: deftheorem Def4 defines Consistent HENMODEL:def 4 :
for b1 being FinSequence of CQC-WFF holds
( b1 is Consistent iff for b2 being Element of CQC-WFF holds
( not |- b1 ^ <*b2*> or not |- b1 ^ <*('not' b2)*> ) );

notation
let c1 be FinSequence of CQC-WFF ;
antonym Inconsistent c1 for Consistent c1;
end;

theorem Th4: :: HENMODEL:4
for b1 being Subset of CQC-WFF
for b2 being FinSequence of CQC-WFF st b1 is Consistent & rng b2 c= b1 holds
b2 is Consistent
proof end;

theorem Th5: :: HENMODEL:5
for b1 being Element of CQC-WFF
for b2, b3 being FinSequence of CQC-WFF st |- b2 ^ <*b1*> holds
|- (b2 ^ b3) ^ <*b1*>
proof end;

theorem Th6: :: HENMODEL:6
for b1 being Subset of CQC-WFF holds
( not b1 is Consistent iff for b2 being Element of CQC-WFF holds b1 |- b2 )
proof end;

theorem Th7: :: HENMODEL:7
for b1 being Subset of CQC-WFF st not b1 is Consistent holds
ex b2 being Subset of CQC-WFF st
( b2 c= b1 & b2 is finite & not b2 is Consistent )
proof end;

Lemma12: for b1, b2 being FinSequence holds Seg (len (b1 ^ b2)) = (Seg (len b1)) \/ (seq (len b1),(len b2))
by CALCUL_2:9;

Lemma13: for b1, b2 being Nat holds Seg b1 misses seq b1,b2
by CALCUL_2:8;

theorem Th8: :: HENMODEL:8
for b1 being Subset of CQC-WFF
for b2, b3 being Element of CQC-WFF st b1 \/ {b2} |- b3 holds
ex b4 being FinSequence of CQC-WFF st
( rng b4 c= b1 & |- (b4 ^ <*b2*>) ^ <*b3*> )
proof end;

theorem Th9: :: HENMODEL:9
for b1 being Subset of CQC-WFF
for b2 being Element of CQC-WFF holds
( b1 |- b2 iff not b1 \/ {('not' b2)} is Consistent )
proof end;

theorem Th10: :: HENMODEL:10
for b1 being Subset of CQC-WFF
for b2 being Element of CQC-WFF holds
( b1 |- 'not' b2 iff not b1 \/ {b2} is Consistent )
proof end;

theorem Th11: :: HENMODEL:11
for b1 being Function of NAT , bool CQC-WFF st ( for b2, b3 being Nat st b3 in dom b1 & b2 in dom b1 & b2 < b3 holds
( b1 . b2 is Consistent & b1 . b2 c= b1 . b3 ) ) holds
union (rng b1) is Consistent
proof end;

theorem Th12: :: HENMODEL:12
for b1 being Subset of CQC-WFF
for b2 being non empty set st not b1 is Consistent holds
for b3 being interpretation of b2
for b4 being Element of Valuations_in b2 holds not b3,b4 |= b1
proof end;

theorem Th13: :: HENMODEL:13
{VERUM } is Consistent
proof end;

registration
cluster Consistent Element of bool CQC-WFF ;
existence
ex b1 being Subset of CQC-WFF st b1 is Consistent
by Th13;
end;

definition
func HCar -> non empty set equals :: HENMODEL:def 5
bound_QC-variables ;
coherence
bound_QC-variables is non empty set
;
end;

:: deftheorem Def5 defines HCar HENMODEL:def 5 :
HCar = bound_QC-variables ;

definition
let c1 be Element of QC-pred_symbols ;
let c2 be CQC-variable_list of the_arity_of c1;
redefine func ! as c1 ! c2 -> Element of CQC-WFF ;
coherence
c1 ! c2 is Element of CQC-WFF
proof end;
end;

definition
let c1 be Consistent Subset of CQC-WFF ;
mode Henkin_interpretation of c1 -> interpretation of HCar means :Def6: :: HENMODEL:def 6
for b1 being Element of QC-pred_symbols
for b2 being Element of relations_on HCar st a2 . b1 = b2 holds
for b3 being set holds
( b3 in b2 iff ex b4 being CQC-variable_list of the_arity_of b1 st
( b3 = b4 & a1 |- b1 ! b4 ) );
existence
ex b1 being interpretation of HCar st
for b2 being Element of QC-pred_symbols
for b3 being Element of relations_on HCar st b1 . b2 = b3 holds
for b4 being set holds
( b4 in b3 iff ex b5 being CQC-variable_list of the_arity_of b2 st
( b4 = b5 & c1 |- b2 ! b5 ) )
proof end;
end;

:: deftheorem Def6 defines Henkin_interpretation HENMODEL:def 6 :
for b1 being Consistent Subset of CQC-WFF
for b2 being interpretation of HCar holds
( b2 is Henkin_interpretation of b1 iff for b3 being Element of QC-pred_symbols
for b4 being Element of relations_on HCar st b2 . b3 = b4 holds
for b5 being set holds
( b5 in b4 iff ex b6 being CQC-variable_list of the_arity_of b3 st
( b5 = b6 & b1 |- b3 ! b6 ) ) );

definition
func valH -> Element of Valuations_in HCar equals :: HENMODEL:def 7
id bound_QC-variables ;
coherence
id bound_QC-variables is Element of Valuations_in HCar
by VALUAT_1:def 1;
end;

:: deftheorem Def7 defines valH HENMODEL:def 7 :
valH = id bound_QC-variables ;

theorem Th14: :: HENMODEL:14
for b1 being Nat
for b2 being CQC-variable_list of b1 holds valH *' b2 = b2
proof end;

theorem Th15: :: HENMODEL:15
for b1 being FinSequence of CQC-WFF holds |- b1 ^ <*VERUM *>
proof end;

theorem Th16: :: HENMODEL:16
for b1 being Consistent Subset of CQC-WFF
for b2 being Henkin_interpretation of b1 holds
( b2, valH |= VERUM iff b1 |- VERUM )
proof end;

theorem Th17: :: HENMODEL:17
for b1 being Nat
for b2 being QC-pred_symbol of b1
for b3 being CQC-variable_list of b1
for b4 being Consistent Subset of CQC-WFF
for b5 being Henkin_interpretation of b4 holds
( b5, valH |= b2 ! b3 iff b4 |- b2 ! b3 )
proof end;