:: CQC_SIM1 semantic presentation

theorem Th1: :: CQC_SIM1:1
for b1, b2 being set
for b3 being Function holds (b3 +* ({b1} --> b2)) .: {b1} = {b2}
proof end;

theorem Th2: :: CQC_SIM1:2
for b1, b2, b3, b4 being set
for b5 being Function holds (b5 +* (b2 --> b4)) .: b1 c= (b5 .: b1) \/ {b4}
proof end;

theorem Th3: :: CQC_SIM1:3
for b1, b2 being set
for b3 being Function
for b4 being set holds (b3 +* ({b1} --> b2)) .: (b4 \ {b1}) = b3 .: (b4 \ {b1})
proof end;

theorem Th4: :: CQC_SIM1:4
for b1, b2 being set
for b3 being Function
for b4 being set st not b2 in b3 .: (b4 \ {b1}) holds
(b3 +* ({b1} --> b2)) .: (b4 \ {b1}) = ((b3 +* ({b1} --> b2)) .: b4) \ {b2}
proof end;

theorem Th5: :: CQC_SIM1:5
for b1 being Element of CQC-WFF st b1 is atomic holds
ex b2 being Element of NAT ex b3 being QC-pred_symbol of b2ex b4 being CQC-variable_list of b2 st b1 = b3 ! b4
proof end;

theorem Th6: :: CQC_SIM1:6
for b1 being Element of CQC-WFF st b1 is negative holds
ex b2 being Element of CQC-WFF st b1 = 'not' b2
proof end;

theorem Th7: :: CQC_SIM1:7
for b1 being Element of CQC-WFF st b1 is conjunctive holds
ex b2, b3 being Element of CQC-WFF st b1 = b2 '&' b3
proof end;

theorem Th8: :: CQC_SIM1:8
for b1 being Element of CQC-WFF st b1 is universal holds
ex b2 being Element of bound_QC-variables ex b3 being Element of CQC-WFF st b1 = All b2,b3
proof end;

theorem Th9: :: CQC_SIM1:9
for b1 being FinSequence holds rng b1 = { (b1 . b2) where B is Element of NAT : ( 1 <= b2 & b2 <= len b1 ) }
proof end;

scheme :: CQC_SIM1:sch 1
s1{ F1() -> non empty set , F2() -> Element of F1(), F3( set ) -> Element of F1(), F4( set , set ) -> Element of F1(), F5( set , set , set ) -> Element of F1(), F6( set , set ) -> Element of F1() } :
ex b1 being Function of QC-WFF ,F1() st
( b1 . VERUM = F2() & ( for b2 being Element of QC-WFF holds
( ( b2 is atomic implies b1 . b2 = F3(b2) ) & ( b2 is negative implies b1 . b2 = F4((b1 . (the_argument_of b2)),b2) ) & ( b2 is conjunctive implies b1 . b2 = F5((b1 . (the_left_argument_of b2)),(b1 . (the_right_argument_of b2)),b2) ) & ( b2 is universal implies b1 . b2 = F6((b1 . (the_scope_of b2)),b2) ) ) ) )
proof end;

scheme :: CQC_SIM1:sch 2
s2{ F1() -> non empty set , F2() -> non empty set , F3() -> Element of Funcs F1(),F2(), F4( set , set , set ) -> Element of Funcs F1(),F2(), F5( set , set ) -> Element of Funcs F1(),F2(), F6( set , set , set , set ) -> Element of Funcs F1(),F2(), F7( set , set , set ) -> Element of Funcs F1(),F2() } :
ex b1 being Function of CQC-WFF , Funcs F1(),F2() st
( b1 . VERUM = F3() & ( for b2 being Element of NAT
for b3 being CQC-variable_list of b2
for b4 being QC-pred_symbol of b2 holds b1 . (b4 ! b3) = F4(b2,b4,b3) ) & ( for b2, b3 being Element of CQC-WFF
for b4 being Element of bound_QC-variables holds
( b1 . ('not' b2) = F5((b1 . b2),b2) & b1 . (b2 '&' b3) = F6((b1 . b2),(b1 . b3),b2,b3) & b1 . (All b4,b2) = F7(b4,(b1 . b2),b2) ) ) )
proof end;

scheme :: CQC_SIM1:sch 3
s3{ F1() -> non empty set , F2() -> non empty set , F3() -> Function of CQC-WFF , Funcs F1(),F2(), F4() -> Function of CQC-WFF , Funcs F1(),F2(), F5() -> Function of F1(),F2(), F6( set , set , set ) -> Function of F1(),F2(), F7( set , set ) -> Function of F1(),F2(), F8( set , set , set , set ) -> Function of F1(),F2(), F9( set , set , set ) -> Function of F1(),F2() } :
F3() = F4()
provided
E7: F3() . VERUM = F5() and
E8: for b1 being Element of NAT
for b2 being CQC-variable_list of b1
for b3 being QC-pred_symbol of b1 holds F3() . (b3 ! b2) = F6(b1,b3,b2) and
E9: for b1, b2 being Element of CQC-WFF
for b3 being Element of bound_QC-variables holds
( F3() . ('not' b1) = F7((F3() . b1),b1) & F3() . (b1 '&' b2) = F8((F3() . b1),(F3() . b2),b1,b2) & F3() . (All b3,b1) = F9(b3,(F3() . b1),b1) ) and
E10: F4() . VERUM = F5() and
E11: for b1 being Element of NAT
for b2 being CQC-variable_list of b1
for b3 being QC-pred_symbol of b1 holds F4() . (b3 ! b2) = F6(b1,b3,b2) and
E12: for b1, b2 being Element of CQC-WFF
for b3 being Element of bound_QC-variables holds
( F4() . ('not' b1) = F7((F4() . b1),b1) & F4() . (b1 '&' b2) = F8((F4() . b1),(F4() . b2),b1,b2) & F4() . (All b3,b1) = F9(b3,(F4() . b1),b1) )
proof end;

theorem Th10: :: CQC_SIM1:10
for b1 being Element of CQC-WFF holds b1 is_subformula_of 'not' b1
proof end;

theorem Th11: :: CQC_SIM1:11
for b1, b2 being Element of CQC-WFF holds
( b1 is_subformula_of b1 '&' b2 & b2 is_subformula_of b1 '&' b2 )
proof end;

theorem Th12: :: CQC_SIM1:12
for b1 being Element of CQC-WFF
for b2 being Element of bound_QC-variables holds b1 is_subformula_of All b2,b1
proof end;

theorem Th13: :: CQC_SIM1:13
for b1 being Element of NAT
for b2 being CQC-variable_list of b1
for b3 being Element of NAT st 1 <= b3 & b3 <= len b2 holds
b2 . b3 in bound_QC-variables
proof end;

definition
let c1 be non empty set ;
let c2 be Function of c1, CQC-WFF ;
func NEGATIVE c2 -> Element of Funcs a1,CQC-WFF means :Def1: :: CQC_SIM1:def 1
for b1 being Element of a1
for b2 being Element of CQC-WFF st b2 = a2 . b1 holds
a3 . b1 = 'not' b2;
existence
ex b1 being Element of Funcs c1,CQC-WFF st
for b2 being Element of c1
for b3 being Element of CQC-WFF st b3 = c2 . b2 holds
b1 . b2 = 'not' b3
proof end;
uniqueness
for b1, b2 being Element of Funcs c1,CQC-WFF st ( for b3 being Element of c1
for b4 being Element of CQC-WFF st b4 = c2 . b3 holds
b1 . b3 = 'not' b4 ) & ( for b3 being Element of c1
for b4 being Element of CQC-WFF st b4 = c2 . b3 holds
b2 . b3 = 'not' b4 ) holds
b1 = b2
proof end;
end;

:: deftheorem Def1 defines NEGATIVE CQC_SIM1:def 1 :
for b1 being non empty set
for b2 being Function of b1, CQC-WFF
for b3 being Element of Funcs b1,CQC-WFF holds
( b3 = NEGATIVE b2 iff for b4 being Element of b1
for b5 being Element of CQC-WFF st b5 = b2 . b4 holds
b3 . b4 = 'not' b5 );

definition
let c1, c2 be Function of [:NAT ,(Funcs bound_QC-variables ,bound_QC-variables ):], CQC-WFF ;
let c3 be Nat;
func CON c1,c2,c3 -> Element of Funcs [:NAT ,(Funcs bound_QC-variables ,bound_QC-variables ):],CQC-WFF means :Def2: :: CQC_SIM1:def 2
for b1 being Element of NAT
for b2 being Element of Funcs bound_QC-variables ,bound_QC-variables
for b3, b4 being Element of CQC-WFF st b3 = a1 . [b1,b2] & b4 = a2 . [(b1 + a3),b2] holds
a4 . [b1,b2] = b3 '&' b4;
existence
ex b1 being Element of Funcs [:NAT ,(Funcs bound_QC-variables ,bound_QC-variables ):],CQC-WFF st
for b2 being Element of NAT
for b3 being Element of Funcs bound_QC-variables ,bound_QC-variables
for b4, b5 being Element of CQC-WFF st b4 = c1 . [b2,b3] & b5 = c2 . [(b2 + c3),b3] holds
b1 . [b2,b3] = b4 '&' b5
proof end;
uniqueness
for b1, b2 being Element of Funcs [:NAT ,(Funcs bound_QC-variables ,bound_QC-variables ):],CQC-WFF st ( for b3 being Element of NAT
for b4 being Element of Funcs bound_QC-variables ,bound_QC-variables
for b5, b6 being Element of CQC-WFF st b5 = c1 . [b3,b4] & b6 = c2 . [(b3 + c3),b4] holds
b1 . [b3,b4] = b5 '&' b6 ) & ( for b3 being Element of NAT
for b4 being Element of Funcs bound_QC-variables ,bound_QC-variables
for b5, b6 being Element of CQC-WFF st b5 = c1 . [b3,b4] & b6 = c2 . [(b3 + c3),b4] holds
b2 . [b3,b4] = b5 '&' b6 ) holds
b1 = b2
proof end;
end;

:: deftheorem Def2 defines CON CQC_SIM1:def 2 :
for b1, b2 being Function of [:NAT ,(Funcs bound_QC-variables ,bound_QC-variables ):], CQC-WFF
for b3 being Nat
for b4 being Element of Funcs [:NAT ,(Funcs bound_QC-variables ,bound_QC-variables ):],CQC-WFF holds
( b4 = CON b1,b2,b3 iff for b5 being Element of NAT
for b6 being Element of Funcs bound_QC-variables ,bound_QC-variables
for b7, b8 being Element of CQC-WFF st b7 = b1 . [b5,b6] & b8 = b2 . [(b5 + b3),b6] holds
b4 . [b5,b6] = b7 '&' b8 );

Lemma13: for b1 being Element of bound_QC-variables
for b2 being Element of NAT
for b3 being Element of Funcs bound_QC-variables ,bound_QC-variables holds b3 +* ({b1} --> (x. b2)) is Function of bound_QC-variables , bound_QC-variables
proof end;

definition
let c1 be Function of [:NAT ,(Funcs bound_QC-variables ,bound_QC-variables ):], CQC-WFF ;
let c2 be bound_QC-variable;
func UNIVERSAL c2,c1 -> Element of Funcs [:NAT ,(Funcs bound_QC-variables ,bound_QC-variables ):],CQC-WFF means :Def3: :: CQC_SIM1:def 3
for b1 being Element of NAT
for b2 being Element of Funcs bound_QC-variables ,bound_QC-variables
for b3 being Element of CQC-WFF st b3 = a1 . [(b1 + 1),(b2 +* ({a2} --> (x. b1)))] holds
a3 . [b1,b2] = All (x. b1),b3;
existence
ex b1 being Element of Funcs [:NAT ,(Funcs bound_QC-variables ,bound_QC-variables ):],CQC-WFF st
for b2 being Element of NAT
for b3 being Element of Funcs bound_QC-variables ,bound_QC-variables
for b4 being Element of CQC-WFF st b4 = c1 . [(b2 + 1),(b3 +* ({c2} --> (x. b2)))] holds
b1 . [b2,b3] = All (x. b2),b4
proof end;
uniqueness
for b1, b2 being Element of Funcs [:NAT ,(Funcs bound_QC-variables ,bound_QC-variables ):],CQC-WFF st ( for b3 being Element of NAT
for b4 being Element of Funcs bound_QC-variables ,bound_QC-variables
for b5 being Element of CQC-WFF st b5 = c1 . [(b3 + 1),(b4 +* ({c2} --> (x. b3)))] holds
b1 . [b3,b4] = All (x. b3),b5 ) & ( for b3 being Element of NAT
for b4 being Element of Funcs bound_QC-variables ,bound_QC-variables
for b5 being Element of CQC-WFF st b5 = c1 . [(b3 + 1),(b4 +* ({c2} --> (x. b3)))] holds
b2 . [b3,b4] = All (x. b3),b5 ) holds
b1 = b2
proof end;
end;

:: deftheorem Def3 defines UNIVERSAL CQC_SIM1:def 3 :
for b1 being Function of [:NAT ,(Funcs bound_QC-variables ,bound_QC-variables ):], CQC-WFF
for b2 being bound_QC-variable
for b3 being Element of Funcs [:NAT ,(Funcs bound_QC-variables ,bound_QC-variables ):],CQC-WFF holds
( b3 = UNIVERSAL b2,b1 iff for b4 being Element of NAT
for b5 being Element of Funcs bound_QC-variables ,bound_QC-variables
for b6 being Element of CQC-WFF st b6 = b1 . [(b4 + 1),(b5 +* ({b2} --> (x. b4)))] holds
b3 . [b4,b5] = All (x. b4),b6 );

Lemma15: for b1 being Element of NAT
for b2 being FinSequence of bound_QC-variables st len b2 = b1 holds
b2 is CQC-variable_list of b1
proof end;

Lemma16: for b1 being Element of NAT
for b2 being CQC-variable_list of b1 holds b2 is FinSequence of bound_QC-variables
proof end;

definition
let c1 be Element of NAT ;
let c2 be CQC-variable_list of c1;
let c3 be Element of Funcs bound_QC-variables ,bound_QC-variables ;
redefine func * as c3 * c2 -> CQC-variable_list of a1;
coherence
c2 * c3 is CQC-variable_list of c1
proof end;
end;

definition
let c1 be Element of NAT ;
let c2 be QC-pred_symbol of c1;
let c3 be CQC-variable_list of c1;
func ATOMIC c2,c3 -> Element of Funcs [:NAT ,(Funcs bound_QC-variables ,bound_QC-variables ):],CQC-WFF means :Def4: :: CQC_SIM1:def 4
for b1 being Element of NAT
for b2 being Element of Funcs bound_QC-variables ,bound_QC-variables holds a4 . [b1,b2] = a2 ! (b2 * a3);
existence
ex b1 being Element of Funcs [:NAT ,(Funcs bound_QC-variables ,bound_QC-variables ):],CQC-WFF st
for b2 being Element of NAT
for b3 being Element of Funcs bound_QC-variables ,bound_QC-variables holds b1 . [b2,b3] = c2 ! (b3 * c3)
proof end;
uniqueness
for b1, b2 being Element of Funcs [:NAT ,(Funcs bound_QC-variables ,bound_QC-variables ):],CQC-WFF st ( for b3 being Element of NAT
for b4 being Element of Funcs bound_QC-variables ,bound_QC-variables holds b1 . [b3,b4] = c2 ! (b4 * c3) ) & ( for b3 being Element of NAT
for b4 being Element of Funcs bound_QC-variables ,bound_QC-variables holds b2 . [b3,b4] = c2 ! (b4 * c3) ) holds
b1 = b2
proof end;
end;

:: deftheorem Def4 defines ATOMIC CQC_SIM1:def 4 :
for b1 being Element of NAT
for b2 being QC-pred_symbol of b1
for b3 being CQC-variable_list of b1
for b4 being Element of Funcs [:NAT ,(Funcs bound_QC-variables ,bound_QC-variables ):],CQC-WFF holds
( b4 = ATOMIC b2,b3 iff for b5 being Element of NAT
for b6 being Element of Funcs bound_QC-variables ,bound_QC-variables holds b4 . [b5,b6] = b2 ! (b6 * b3) );

deffunc H1( set , set , set ) -> Element of NAT = 0;

deffunc H2( Element of NAT ) -> Element of NAT = a1;

deffunc H3( Element of NAT , Element of NAT ) -> Element of NAT = a1 + a2;

deffunc H4( set , Element of NAT ) -> Element of NAT = a2 + 1;

definition
let c1 be Element of CQC-WFF ;
func QuantNbr c1 -> Element of NAT means :Def5: :: CQC_SIM1:def 5
ex b1 being Function of CQC-WFF , NAT st
( a2 = b1 . a1 & b1 . VERUM = 0 & ( for b2, b3 being Element of CQC-WFF
for b4 being Element of bound_QC-variables
for b5 being Element of NAT
for b6 being CQC-variable_list of b5
for b7 being QC-pred_symbol of b5 holds
( b1 . (b7 ! b6) = 0 & b1 . ('not' b2) = b1 . b2 & b1 . (b2 '&' b3) = (b1 . b2) + (b1 . b3) & b1 . (All b4,b2) = (b1 . b2) + 1 ) ) );
correctness
existence
ex b1 being Element of NAT ex b2 being Function of CQC-WFF , NAT st
( b1 = b2 . c1 & b2 . VERUM = 0 & ( for b3, b4 being Element of CQC-WFF
for b5 being Element of bound_QC-variables
for b6 being Element of NAT
for b7 being CQC-variable_list of b6
for b8 being QC-pred_symbol of b6 holds
( b2 . (b8 ! b7) = 0 & b2 . ('not' b3) = b2 . b3 & b2 . (b3 '&' b4) = (b2 . b3) + (b2 . b4) & b2 . (All b5,b3) = (b2 . b3) + 1 ) ) )
;
uniqueness
for b1, b2 being Element of NAT st ex b3 being Function of CQC-WFF , NAT st
( b1 = b3 . c1 & b3 . VERUM = 0 & ( for b4, b5 being Element of CQC-WFF
for b6 being Element of bound_QC-variables
for b7 being Element of NAT
for b8 being CQC-variable_list of b7
for b9 being QC-pred_symbol of b7 holds
( b3 . (b9 ! b8) = 0 & b3 . ('not' b4) = b3 . b4 & b3 . (b4 '&' b5) = (b3 . b4) + (b3 . b5) & b3 . (All b6,b4) = (b3 . b4) + 1 ) ) ) & ex b3 being Function of CQC-WFF , NAT st
( b2 = b3 . c1 & b3 . VERUM = 0 & ( for b4, b5 being Element of CQC-WFF
for b6 being Element of bound_QC-variables
for b7 being Element of NAT
for b8 being CQC-variable_list of b7
for b9 being QC-pred_symbol of b7 holds
( b3 . (b9 ! b8) = 0 & b3 . ('not' b4) = b3 . b4 & b3 . (b4 '&' b5) = (b3 . b4) + (b3 . b5) & b3 . (All b6,b4) = (b3 . b4) + 1 ) ) ) holds
b1 = b2
;
proof end;
end;

:: deftheorem Def5 defines QuantNbr CQC_SIM1:def 5 :
for b1 being Element of CQC-WFF
for b2 being Element of NAT holds
( b2 = QuantNbr b1 iff ex b3 being Function of CQC-WFF , NAT st
( b2 = b3 . b1 & b3 . VERUM = 0 & ( for b4, b5 being Element of CQC-WFF
for b6 being Element of bound_QC-variables
for b7 being Element of NAT
for b8 being CQC-variable_list of b7
for b9 being QC-pred_symbol of b7 holds
( b3 . (b9 ! b8) = 0 & b3 . ('not' b4) = b3 . b4 & b3 . (b4 '&' b5) = (b3 . b4) + (b3 . b5) & b3 . (All b6,b4) = (b3 . b4) + 1 ) ) ) );

definition
let c1 be Function of CQC-WFF , Funcs [:NAT ,(Funcs bound_QC-variables ,bound_QC-variables ):],CQC-WFF ;
let c2 be Element of CQC-WFF ;
redefine func . as c1 . c2 -> Element of Funcs [:NAT ,(Funcs bound_QC-variables ,bound_QC-variables ):],CQC-WFF ;
coherence
c1 . c2 is Element of Funcs [:NAT ,(Funcs bound_QC-variables ,bound_QC-variables ):],CQC-WFF
proof end;
end;

definition
func SepFunc -> Function of CQC-WFF , Funcs [:NAT ,(Funcs bound_QC-variables ,bound_QC-variables ):],CQC-WFF means :Def6: :: CQC_SIM1:def 6
( a1 . VERUM = [:NAT ,(Funcs bound_QC-variables ,bound_QC-variables ):] --> VERUM & ( for b1 being Element of NAT
for b2 being CQC-variable_list of b1
for b3 being QC-pred_symbol of b1 holds a1 . (b3 ! b2) = ATOMIC b3,b2 ) & ( for b1, b2 being Element of CQC-WFF
for b3 being Element of bound_QC-variables holds
( a1 . ('not' b1) = NEGATIVE (a1 . b1) & a1 . (b1 '&' b2) = CON (a1 . b1),(a1 . b2),(QuantNbr b1) & a1 . (All b3,b1) = UNIVERSAL b3,(a1 . b1) ) ) );
existence
ex b1 being Function of CQC-WFF , Funcs [:NAT ,(Funcs bound_QC-variables ,bound_QC-variables ):],CQC-WFF st
( b1 . VERUM = [:NAT ,(Funcs bound_QC-variables ,bound_QC-variables ):] --> VERUM & ( for b2 being Element of NAT
for b3 being CQC-variable_list of b2
for b4 being QC-pred_symbol of b2 holds b1 . (b4 ! b3) = ATOMIC b4,b3 ) & ( for b2, b3 being Element of CQC-WFF
for b4 being Element of bound_QC-variables holds
( b1 . ('not' b2) = NEGATIVE (b1 . b2) & b1 . (b2 '&' b3) = CON (b1 . b2),(b1 . b3),(QuantNbr b2) & b1 . (All b4,b2) = UNIVERSAL b4,(b1 . b2) ) ) )
proof end;
uniqueness
for b1, b2 being Function of CQC-WFF , Funcs [:NAT ,(Funcs bound_QC-variables ,bound_QC-variables ):],CQC-WFF st b1 . VERUM = [:NAT ,(Funcs bound_QC-variables ,bound_QC-variables ):] --> VERUM & ( for b3 being Element of NAT
for b4 being CQC-variable_list of b3
for b5 being QC-pred_symbol of b3 holds b1 . (b5 ! b4) = ATOMIC b5,b4 ) & ( for b3, b4 being Element of CQC-WFF
for b5 being Element of bound_QC-variables holds
( b1 . ('not' b3) = NEGATIVE (b1 . b3) & b1 . (b3 '&' b4) = CON (b1 . b3),(b1 . b4),(QuantNbr b3) & b1 . (All b5,b3) = UNIVERSAL b5,(b1 . b3) ) ) & b2 . VERUM = [:NAT ,(Funcs bound_QC-variables ,bound_QC-variables ):] --> VERUM & ( for b3 being Element of NAT
for b4 being CQC-variable_list of b3
for b5 being QC-pred_symbol of b3 holds b2 . (b5 ! b4) = ATOMIC b5,b4 ) & ( for b3, b4 being Element of CQC-WFF
for b5 being Element of bound_QC-variables holds
( b2 . ('not' b3) = NEGATIVE (b2 . b3) & b2 . (b3 '&' b4) = CON (b2 . b3),(b2 . b4),(QuantNbr b3) & b2 . (All b5,b3) = UNIVERSAL b5,(b2 . b3) ) ) holds
b1 = b2
proof end;
end;

:: deftheorem Def6 defines SepFunc CQC_SIM1:def 6 :
for b1 being Function of CQC-WFF , Funcs [:NAT ,(Funcs bound_QC-variables ,bound_QC-variables ):],CQC-WFF holds
( b1 = SepFunc iff ( b1 . VERUM = [:NAT ,(Funcs bound_QC-variables ,bound_QC-variables ):] --> VERUM & ( for b2 being Element of NAT
for b3 being CQC-variable_list of b2
for b4 being QC-pred_symbol of b2 holds b1 . (b4 ! b3) = ATOMIC b4,b3 ) & ( for b2, b3 being Element of CQC-WFF
for b4 being Element of bound_QC-variables holds
( b1 . ('not' b2) = NEGATIVE (b1 . b2) & b1 . (b2 '&' b3) = CON (b1 . b2),(b1 . b3),(QuantNbr b2) & b1 . (All b4,b2) = UNIVERSAL b4,(b1 . b2) ) ) ) );

definition
let c1 be Element of CQC-WFF ;
let c2 be Element of NAT ;
let c3 be Element of Funcs bound_QC-variables ,bound_QC-variables ;
func SepFunc c1,c2,c3 -> Element of CQC-WFF equals :: CQC_SIM1:def 7
(SepFunc . a1) . [a2,a3];
correctness
coherence
(SepFunc . c1) . [c2,c3] is Element of CQC-WFF
;
;
end;

:: deftheorem Def7 defines SepFunc CQC_SIM1:def 7 :
for b1 being Element of CQC-WFF
for b2 being Element of NAT
for b3 being Element of Funcs bound_QC-variables ,bound_QC-variables holds SepFunc b1,b2,b3 = (SepFunc . b1) . [b2,b3];

deffunc H5( Element of CQC-WFF ) -> Element of NAT = QuantNbr a1;

theorem Th14: :: CQC_SIM1:14
QuantNbr VERUM = 0
proof end;

theorem Th15: :: CQC_SIM1:15
for b1 being Element of NAT
for b2 being CQC-variable_list of b1
for b3 being QC-pred_symbol of b1 holds QuantNbr (b3 ! b2) = 0
proof end;

theorem Th16: :: CQC_SIM1:16
for b1 being Element of CQC-WFF holds QuantNbr ('not' b1) = QuantNbr b1
proof end;

theorem Th17: :: CQC_SIM1:17
for b1, b2 being Element of CQC-WFF holds QuantNbr (b1 '&' b2) = (QuantNbr b1) + (QuantNbr b2)
proof end;

theorem Th18: :: CQC_SIM1:18
for b1 being Element of CQC-WFF
for b2 being Element of bound_QC-variables holds QuantNbr (All b2,b1) = (QuantNbr b1) + 1
proof end;

definition
let c1 be non empty Subset of NAT ;
func min c1 -> Nat means :Def8: :: CQC_SIM1:def 8
( a2 in a1 & ( for b1 being Element of NAT st b1 in a1 holds
a2 <= b1 ) );
existence
ex b1 being Nat st
( b1 in c1 & ( for b2 being Element of NAT st b2 in c1 holds
b1 <= b2 ) )
proof end;
uniqueness
for b1, b2 being Nat st b1 in c1 & ( for b3 being Element of NAT st b3 in c1 holds
b1 <= b3 ) & b2 in c1 & ( for b3 being Element of NAT st b3 in c1 holds
b2 <= b3 ) holds
b1 = b2
proof end;
end;

:: deftheorem Def8 defines min CQC_SIM1:def 8 :
for b1 being non empty Subset of NAT
for b2 being Nat holds
( b2 = min b1 iff ( b2 in b1 & ( for b3 being Element of NAT st b3 in b1 holds
b2 <= b3 ) ) );

theorem Th19: :: CQC_SIM1:19
for b1, b2 being non empty Subset of NAT st b1 c= b2 holds
min b2 <= min b1
proof end;

theorem Th20: :: CQC_SIM1:20
for b1 being Element of QC-WFF holds still_not-bound_in b1 is finite
proof end;

scheme :: CQC_SIM1:sch 4
s4{ F1() -> non empty set , F2() -> set , P1[ set , set ] } :
ex b1 being Element of F1() st
( b1 in F2() & ( for b2 being Element of F1() st b2 in F2() holds
P1[b1,b2] ) )
provided
E23: ( F2() is finite & F2() <> {} & F2() c= F1() ) and
E24: for b1, b2 being Element of F1() holds
( P1[b1,b2] or P1[b2,b1] ) and
E25: for b1, b2, b3 being Element of F1() st P1[b1,b2] & P1[b2,b3] holds
P1[b1,b3]
proof end;

definition
let c1 be Element of CQC-WFF ;
func NBI c1 -> Subset of NAT equals :: CQC_SIM1:def 9
{ b1 where B is Element of NAT : for b1 being Element of NAT st b1 <= b2 holds
not x. b2 in still_not-bound_in a1
}
;
coherence
{ b1 where B is Element of NAT : for b1 being Element of NAT st b1 <= b2 holds
not x. b2 in still_not-bound_in c1
}
is Subset of NAT
proof end;
end;

:: deftheorem Def9 defines NBI CQC_SIM1:def 9 :
for b1 being Element of CQC-WFF holds NBI b1 = { b2 where B is Element of NAT : for b1 being Element of NAT st b2 <= b3 holds
not x. b3 in still_not-bound_in b1
}
;

registration
let c1 be Element of CQC-WFF ;
cluster NBI a1 -> non empty ;
coherence
not NBI c1 is empty
proof end;
end;

definition
let c1 be Element of CQC-WFF ;
func index c1 -> Nat equals :: CQC_SIM1:def 10
min (NBI a1);
coherence
min (NBI c1) is Nat
;
end;

:: deftheorem Def10 defines index CQC_SIM1:def 10 :
for b1 being Element of CQC-WFF holds index b1 = min (NBI b1);

theorem Th21: :: CQC_SIM1:21
for b1 being Element of CQC-WFF holds
( index b1 = 0 iff b1 is closed )
proof end;

theorem Th22: :: CQC_SIM1:22
for b1 being Element of CQC-WFF
for b2 being Element of NAT st x. b2 in still_not-bound_in b1 holds
b2 < index b1
proof end;

theorem Th23: :: CQC_SIM1:23
index VERUM = 0 by Th21, QC_LANG3:24;

theorem Th24: :: CQC_SIM1:24
for b1 being Element of CQC-WFF holds index ('not' b1) = index b1
proof end;

theorem Th25: :: CQC_SIM1:25
for b1, b2 being Element of CQC-WFF holds
( index b1 <= index (b1 '&' b2) & index b2 <= index (b1 '&' b2) )
proof end;

definition
let c1 be non empty set ;
redefine func id as id c1 -> Element of Funcs a1,a1;
coherence
id c1 is Element of Funcs c1,c1
proof end;
end;

definition
let c1 be Element of CQC-WFF ;
func SepVar c1 -> Element of CQC-WFF equals :: CQC_SIM1:def 11
SepFunc a1,(index a1),(id bound_QC-variables );
coherence
SepFunc c1,(index c1),(id bound_QC-variables ) is Element of CQC-WFF
;
end;

:: deftheorem Def11 defines SepVar CQC_SIM1:def 11 :
for b1 being Element of CQC-WFF holds SepVar b1 = SepFunc b1,(index b1),(id bound_QC-variables );

theorem Th26: :: CQC_SIM1:26
SepVar VERUM = VERUM
proof end;

scheme :: CQC_SIM1:sch 5
s5{ P1[ set ] } :
for b1 being Element of CQC-WFF holds P1[b1]
provided
E27: P1[ VERUM ] and
E28: for b1 being Element of NAT
for b2 being CQC-variable_list of b1
for b3 being QC-pred_symbol of b1 holds P1[b3 ! b2] and
E29: for b1 being Element of CQC-WFF st P1[b1] holds
P1[ 'not' b1] and
E30: for b1, b2 being Element of CQC-WFF st P1[b1] & P1[b2] holds
P1[b1 '&' b2] and
E31: for b1 being Element of CQC-WFF
for b2 being Element of bound_QC-variables st P1[b1] holds
P1[ All b2,b1]
proof end;

theorem Th27: :: CQC_SIM1:27
for b1 being Element of NAT
for b2 being CQC-variable_list of b1
for b3 being QC-pred_symbol of b1 holds SepVar (b3 ! b2) = b3 ! b2
proof end;

theorem Th28: :: CQC_SIM1:28
for b1 being Element of CQC-WFF st b1 is atomic holds
SepVar b1 = b1
proof end;

theorem Th29: :: CQC_SIM1:29
for b1 being Element of CQC-WFF holds SepVar ('not' b1) = 'not' (SepVar b1)
proof end;

theorem Th30: :: CQC_SIM1:30
for b1, b2 being Element of CQC-WFF st b1 is negative & b2 = the_argument_of b1 holds
SepVar b1 = 'not' (SepVar b2)
proof end;

definition
let c1 be Element of CQC-WFF ;
let c2 be Subset of [:CQC-WFF ,NAT ,(Fin bound_QC-variables ),(Funcs bound_QC-variables ,bound_QC-variables ):];
pred c2 is_Sep-closed_on c1 means :Def12: :: CQC_SIM1:def 12
( [a1,(index a1),({}. bound_QC-variables ),(id bound_QC-variables )] in a2 & ( for b1 being Element of CQC-WFF
for b2 being Element of NAT
for b3 being Finite_Subset of bound_QC-variables
for b4 being Element of Funcs bound_QC-variables ,bound_QC-variables st [('not' b1),b2,b3,b4] in a2 holds
[b1,b2,b3,b4] in a2 ) & ( for b1, b2 being Element of CQC-WFF
for b3 being Element of NAT
for b4 being Finite_Subset of bound_QC-variables
for b5 being Element of Funcs bound_QC-variables ,bound_QC-variables st [(b1 '&' b2),b3,b4,b5] in a2 holds
( [b1,b3,b4,b5] in a2 & [b2,(b3 + (QuantNbr b1)),b4,b5] in a2 ) ) & ( for b1 being Element of CQC-WFF
for b2 being Element of bound_QC-variables
for b3 being Element of NAT
for b4 being Finite_Subset of bound_QC-variables
for b5 being Element of Funcs bound_QC-variables ,bound_QC-variables st [(All b2,b1),b3,b4,b5] in a2 holds
[b1,(b3 + 1),(b4 \/ {b2}),(b5 +* ({b2} --> (x. b3)))] in a2 ) );
end;

:: deftheorem Def12 defines is_Sep-closed_on CQC_SIM1:def 12 :
for b1 being Element of CQC-WFF
for b2 being Subset of [:CQC-WFF ,NAT ,(Fin bound_QC-variables ),(Funcs bound_QC-variables ,bound_QC-variables ):] holds
( b2 is_Sep-closed_on b1 iff ( [b1,(index b1),({}. bound_QC-variables ),(id bound_QC-variables )] in b2 & ( for b3 being Element of CQC-WFF
for b4 being Element of NAT
for b5 being Finite_Subset of bound_QC-variables
for b6 being Element of Funcs bound_QC-variables ,bound_QC-variables st [('not' b3),b4,b5,b6] in b2 holds
[b3,b4,b5,b6] in b2 ) & ( for b3, b4 being Element of CQC-WFF
for b5 being Element of NAT
for b6 being Finite_Subset of bound_QC-variables
for b7 being Element of Funcs bound_QC-variables ,bound_QC-variables st [(b3 '&' b4),b5,b6,b7] in b2 holds
( [b3,b5,b6,b7] in b2 & [b4,(b5 + (QuantNbr b3)),b6,b7] in b2 ) ) & ( for b3 being Element of CQC-WFF
for b4 being Element of bound_QC-variables
for b5 being Element of NAT
for b6 being Finite_Subset of bound_QC-variables
for b7 being Element of Funcs bound_QC-variables ,bound_QC-variables st [(All b4,b3),b5,b6,b7] in b2 holds
[b3,(b5 + 1),(b6 \/ {b4}),(b7 +* ({b4} --> (x. b5)))] in b2 ) ) );

definition
let c1 be non empty set ;
let c2 be Element of c1;
redefine func { as {c2} -> Element of Fin a1;
coherence
{c2} is Element of Fin c1
proof end;
end;

definition
let c1 be Element of CQC-WFF ;
func SepQuadruples c1 -> Subset of [:CQC-WFF ,NAT ,(Fin bound_QC-variables ),(Funcs bound_QC-variables ,bound_QC-variables ):] means :Def13: :: CQC_SIM1:def 13
( a2 is_Sep-closed_on a1 & ( for b1 being Subset of [:CQC-WFF ,NAT ,(Fin bound_QC-variables ),(Funcs bound_QC-variables ,bound_QC-variables ):] st b1 is_Sep-closed_on a1 holds
a2 c= b1 ) );
existence
ex b1 being Subset of [:CQC-WFF ,NAT ,(Fin bound_QC-variables ),(Funcs bound_QC-variables ,bound_QC-variables ):] st
( b1 is_Sep-closed_on c1 & ( for b2 being Subset of [:CQC-WFF ,NAT ,(Fin bound_QC-variables ),(Funcs bound_QC-variables ,bound_QC-variables ):] st b2 is_Sep-closed_on c1 holds
b1 c= b2 ) )
proof end;
uniqueness
for b1, b2 being Subset of [:CQC-WFF ,NAT ,(Fin bound_QC-variables ),(Funcs bound_QC-variables ,bound_QC-variables ):] st b1 is_Sep-closed_on c1 & ( for b3 being Subset of [:CQC-WFF ,NAT ,(Fin bound_QC-variables ),(Funcs bound_QC-variables ,bound_QC-variables ):] st b3 is_Sep-closed_on c1 holds
b1 c= b3 ) & b2 is_Sep-closed_on c1 & ( for b3 being Subset of [:CQC-WFF ,NAT ,(Fin bound_QC-variables ),(Funcs bound_QC-variables ,bound_QC-variables ):] st b3 is_Sep-closed_on c1 holds
b2 c= b3 ) holds
b1 = b2
proof end;
end;

:: deftheorem Def13 defines SepQuadruples CQC_SIM1:def 13 :
for b1 being Element of CQC-WFF
for b2 being Subset of [:CQC-WFF ,NAT ,(Fin bound_QC-variables ),(Funcs bound_QC-variables ,bound_QC-variables ):] holds
( b2 = SepQuadruples b1 iff ( b2 is_Sep-closed_on b1 & ( for b3 being Subset of [:CQC-WFF ,NAT ,(Fin bound_QC-variables ),(Funcs bound_QC-variables ,bound_QC-variables ):] st b3 is_Sep-closed_on b1 holds
b2 c= b3 ) ) );

theorem Th31: :: CQC_SIM1:31
for b1 being Element of CQC-WFF holds [b1,(index b1),({}. bound_QC-variables ),(id bound_QC-variables )] in SepQuadruples b1
proof end;

theorem Th32: :: CQC_SIM1:32
for b1, b2 being Element of CQC-WFF
for b3 being Element of NAT
for b4 being Finite_Subset of bound_QC-variables
for b5 being Element of Funcs bound_QC-variables ,bound_QC-variables st [('not' b2),b3,b4,b5] in SepQuadruples b1 holds
[b2,b3,b4,b5] in SepQuadruples b1
proof end;

theorem Th33: :: CQC_SIM1:33
for b1, b2, b3 being Element of CQC-WFF
for b4 being Element of NAT
for b5 being Finite_Subset of bound_QC-variables
for b6 being Element of Funcs bound_QC-variables ,bound_QC-variables st [(b2 '&' b3),b4,b5,b6] in SepQuadruples b1 holds
( [b2,b4,b5,b6] in SepQuadruples b1 & [b3,(b4 + (QuantNbr b2)),b5,b6] in SepQuadruples b1 )
proof end;

theorem Th34: :: CQC_SIM1:34
for b1, b2 being Element of CQC-WFF
for b3 being Element of bound_QC-variables
for b4 being Element of NAT
for b5 being Finite_Subset of bound_QC-variables
for b6 being Element of Funcs bound_QC-variables ,bound_QC-variables st [(All b3,b2),b4,b5,b6] in SepQuadruples b1 holds
[b2,(b4 + 1),(b5 \/ {b3}),(b6 +* ({b3} --> (x. b4)))] in SepQuadruples b1
proof end;

theorem Th35: :: CQC_SIM1:35
for b1, b2 being Element of CQC-WFF
for b3 being Element of NAT
for b4 being Element of Funcs bound_QC-variables ,bound_QC-variables
for b5 being Finite_Subset of bound_QC-variables holds
( not [b1,b3,b5,b4] in SepQuadruples b2 or [b1,b3,b5,b4] = [b2,(index b2),({}. bound_QC-variables ),(id bound_QC-variables )] or [('not' b1),b3,b5,b4] in SepQuadruples b2 or ex b6 being Element of CQC-WFF st [(b1 '&' b6),b3,b5,b4] in SepQuadruples b2 or ex b6 being Element of CQC-WFF ex b7 being Element of NAT st
( b3 = b7 + (QuantNbr b6) & [(b6 '&' b1),b7,b5,b4] in SepQuadruples b2 ) or ex b6 being Element of bound_QC-variables ex b7 being Element of NAT ex b8 being Element of Funcs bound_QC-variables ,bound_QC-variables st
( b7 + 1 = b3 & b8 +* ({b6} --> (x. b7)) = b4 & ( [(All b6,b1),b7,b5,b8] in SepQuadruples b2 or [(All b6,b1),b7,(b5 \ {b6}),b8] in SepQuadruples b2 ) ) )
proof end;

scheme :: CQC_SIM1:sch 6
s6{ F1() -> Element of CQC-WFF , P1[ set , set , set , set ] } :
for b1 being Element of CQC-WFF
for b2 being Element of NAT
for b3 being Finite_Subset of bound_QC-variables
for b4 being Element of Funcs bound_QC-variables ,bound_QC-variables st [b1,b2,b3,b4] in SepQuadruples F1() holds
P1[b1,b2,b3,b4]
provided
E36: P1[F1(), index F1(), {}. bound_QC-variables , id bound_QC-variables ] and
E37: for b1 being Element of CQC-WFF
for b2 being Element of NAT
for b3 being Finite_Subset of bound_QC-variables
for b4 being Element of Funcs bound_QC-variables ,bound_QC-variables st [('not' b1),b2,b3,b4] in SepQuadruples F1() & P1[ 'not' b1,b2,b3,b4] holds
P1[b1,b2,b3,b4] and
E38: for b1, b2 being Element of CQC-WFF
for b3 being Element of NAT
for b4 being Finite_Subset of bound_QC-variables
for b5 being Element of Funcs bound_QC-variables ,bound_QC-variables st [(b1 '&' b2),b3,b4,b5] in SepQuadruples F1() & P1[b1 '&' b2,b3,b4,b5] holds
( P1[b1,b3,b4,b5] & P1[b2,b3 + (QuantNbr b1),b4,b5] ) and
E39: for b1 being Element of CQC-WFF
for b2 being Element of bound_QC-variables
for b3 being Element of NAT
for b4 being Finite_Subset of bound_QC-variables
for b5 being Element of Funcs bound_QC-variables ,bound_QC-variables st [(All b2,b1),b3,b4,b5] in SepQuadruples F1() & P1[ All b2,b1,b3,b4,b5] holds
P1[b1,b3 + 1,b4 \/ {b2},b5 +* ({b2} --> (x. b3))]
proof end;

theorem Th36: :: CQC_SIM1:36
for b1, b2 being Element of CQC-WFF
for b3 being Element of NAT
for b4 being Finite_Subset of bound_QC-variables
for b5 being Element of Funcs bound_QC-variables ,bound_QC-variables st [b2,b3,b4,b5] in SepQuadruples b1 holds
b2 is_subformula_of b1
proof end;

theorem Th37: :: CQC_SIM1:37
SepQuadruples VERUM = {[VERUM ,0,({}. bound_QC-variables ),(id bound_QC-variables )]}
proof end;

theorem Th38: :: CQC_SIM1:38
for b1 being Element of NAT
for b2 being CQC-variable_list of b1
for b3 being QC-pred_symbol of b1 holds SepQuadruples (b3 ! b2) = {[(b3 ! b2),(index (b3 ! b2)),({}. bound_QC-variables ),(id bound_QC-variables )]}
proof end;

theorem Th39: :: CQC_SIM1:39
for b1, b2 being Element of CQC-WFF
for b3 being Element of NAT
for b4 being Finite_Subset of bound_QC-variables
for b5 being Element of Funcs bound_QC-variables ,bound_QC-variables st [b2,b3,b4,b5] in SepQuadruples b1 holds
still_not-bound_in b2 c= (still_not-bound_in b1) \/ b4
proof end;

theorem Th40: :: CQC_SIM1:40
for b1, b2 being Element of CQC-WFF
for b3, b4 being Element of NAT
for b5 being Element of Funcs bound_QC-variables ,bound_QC-variables
for b6 being Finite_Subset of bound_QC-variables st [b1,b3,b6,b5] in SepQuadruples b2 & x. b4 in b5 .: b6 holds
b4 < b3
proof end;

theorem Th41: :: CQC_SIM1:41
for b1, b2 being Element of CQC-WFF
for b3 being Element of NAT
for b4 being Element of Funcs bound_QC-variables ,bound_QC-variables
for b5 being Finite_Subset of bound_QC-variables st [b1,b3,b5,b4] in SepQuadruples b2 holds
not x. b3 in b4 .: b5 by Th40;

theorem Th42: :: CQC_SIM1:42
for b1, b2 being Element of CQC-WFF
for b3, b4 being Element of NAT
for b5 being Element of Funcs bound_QC-variables ,bound_QC-variables
for b6 being Finite_Subset of bound_QC-variables st [b1,b3,b6,b5] in SepQuadruples b2 & x. b4 in b5 .: (still_not-bound_in b2) holds
b4 < b3
proof end;

theorem Th43: :: CQC_SIM1:43
for b1, b2 being Element of CQC-WFF
for b3, b4 being Element of NAT
for b5 being Element of Funcs bound_QC-variables ,bound_QC-variables
for b6 being Finite_Subset of bound_QC-variables st [b1,b3,b6,b5] in SepQuadruples b2 & x. b4 in b5 .: (still_not-bound_in b1) holds
b4 < b3
proof end;

theorem Th44: :: CQC_SIM1:44
for b1, b2 being Element of CQC-WFF
for b3 being Element of NAT
for b4 being Element of Funcs bound_QC-variables ,bound_QC-variables
for b5 being Finite_Subset of bound_QC-variables st [b1,b3,b5,b4] in SepQuadruples b2 holds
not x. b3 in b4 .: (still_not-bound_in b1) by Th43;

theorem Th45: :: CQC_SIM1:45
for b1 being Element of CQC-WFF holds still_not-bound_in b1 = still_not-bound_in (SepVar b1)
proof end;

theorem Th46: :: CQC_SIM1:46
for b1 being Element of CQC-WFF holds index b1 = index (SepVar b1)
proof end;

definition
let c1, c2 be Element of CQC-WFF ;
pred c1,c2 are_similar means :Def14: :: CQC_SIM1:def 14
SepVar a1 = SepVar a2;
reflexivity
for b1 being Element of CQC-WFF holds SepVar b1 = SepVar b1
;
symmetry
for b1, b2 being Element of CQC-WFF st SepVar b1 = SepVar b2 holds
SepVar b2 = SepVar b1
;
end;

:: deftheorem Def14 defines are_similar CQC_SIM1:def 14 :
for b1, b2 being Element of CQC-WFF holds
( b1,b2 are_similar iff SepVar b1 = SepVar b2 );

theorem Th47: :: CQC_SIM1:47
canceled;

theorem Th48: :: CQC_SIM1:48
canceled;

theorem Th49: :: CQC_SIM1:49
for b1, b2, b3 being Element of CQC-WFF st b1,b2 are_similar & b2,b3 are_similar holds
b1,b3 are_similar
proof end;