:: Connectives and Subformulae of the First Order Language
:: by Grzegorz Bancerek
::
:: Copyright (c) 1990-2021 Association of Mizar Users

theorem Th1: :: QC_LANG2:1
for A being QC-alphabet
for p being Element of QC-WFF A holds the_argument_of () = p
proof end;

theorem Th2: :: QC_LANG2:2
for A being QC-alphabet
for p, q, p1, q1 being Element of QC-WFF A st p '&' q = p1 '&' q1 holds
( p = p1 & q = q1 )
proof end;

theorem Th3: :: QC_LANG2:3
for A being QC-alphabet
for p being Element of QC-WFF A st p is conjunctive holds
p = '&'
proof end;

theorem Th4: :: QC_LANG2:4
for A being QC-alphabet
for p, q being Element of QC-WFF A holds
( the_left_argument_of (p '&' q) = p & the_right_argument_of (p '&' q) = q )
proof end;

theorem Th5: :: QC_LANG2:5
for A being QC-alphabet
for x, y being bound_QC-variable of A
for p, q being Element of QC-WFF A st All (x,p) = All (y,q) holds
( x = y & p = q )
proof end;

theorem Th6: :: QC_LANG2:6
for A being QC-alphabet
for p being Element of QC-WFF A st p is universal holds
p = All ((),())
proof end;

theorem Th7: :: QC_LANG2:7
for A being QC-alphabet
for x being bound_QC-variable of A
for p being Element of QC-WFF A holds
( bound_in (All (x,p)) = x & the_scope_of (All (x,p)) = p )
proof end;

definition
let A be QC-alphabet ;
func FALSUM A -> QC-formula of A equals :: QC_LANG2:def 1
'not' ();
correctness
coherence
'not' () is QC-formula of A
;
;
let p, q be Element of QC-WFF A;
func p => q -> QC-formula of A equals :: QC_LANG2:def 2
'not' (p '&' ());
correctness
coherence
'not' (p '&' ()) is QC-formula of A
;
;
func p 'or' q -> QC-formula of A equals :: QC_LANG2:def 3
'not' (() '&' ());
correctness
coherence
'not' (() '&' ()) is QC-formula of A
;
;
end;

:: deftheorem defines FALSUM QC_LANG2:def 1 :
for A being QC-alphabet holds FALSUM A = 'not' ();

:: deftheorem defines => QC_LANG2:def 2 :
for A being QC-alphabet
for p, q being Element of QC-WFF A holds p => q = 'not' (p '&' ());

:: deftheorem defines 'or' QC_LANG2:def 3 :
for A being QC-alphabet
for p, q being Element of QC-WFF A holds p 'or' q = 'not' (() '&' ());

definition
let A be QC-alphabet ;
let p, q be Element of QC-WFF A;
func p <=> q -> QC-formula of A equals :: QC_LANG2:def 4
(p => q) '&' (q => p);
correctness
coherence
(p => q) '&' (q => p) is QC-formula of A
;
;
end;

:: deftheorem defines <=> QC_LANG2:def 4 :
for A being QC-alphabet
for p, q being Element of QC-WFF A holds p <=> q = (p => q) '&' (q => p);

definition
let A be QC-alphabet ;
let x be bound_QC-variable of A;
let p be Element of QC-WFF A;
func Ex (x,p) -> QC-formula of A equals :: QC_LANG2:def 5
'not' (All (x,()));
correctness
coherence
'not' (All (x,())) is QC-formula of A
;
;
end;

:: deftheorem defines Ex QC_LANG2:def 5 :
for A being QC-alphabet
for x being bound_QC-variable of A
for p being Element of QC-WFF A holds Ex (x,p) = 'not' (All (x,()));

theorem :: QC_LANG2:8
for A being QC-alphabet holds
( FALSUM A is negative & the_argument_of () = VERUM A ) by Th1;

theorem :: QC_LANG2:9
for A being QC-alphabet
for p, q being Element of QC-WFF A holds p 'or' q = () => q ;

theorem :: QC_LANG2:10
for A being QC-alphabet
for p, q, p1, q1 being Element of QC-WFF A st p 'or' q = p1 'or' q1 holds
( p = p1 & q = q1 )
proof end;

theorem Th11: :: QC_LANG2:11
for A being QC-alphabet
for p, q, p1, q1 being Element of QC-WFF A st p => q = p1 => q1 holds
( p = p1 & q = q1 )
proof end;

theorem :: QC_LANG2:12
for A being QC-alphabet
for p, q, p1, q1 being Element of QC-WFF A st p <=> q = p1 <=> q1 holds
( p = p1 & q = q1 )
proof end;

theorem Th13: :: QC_LANG2:13
for A being QC-alphabet
for x, y being bound_QC-variable of A
for p, q being Element of QC-WFF A st Ex (x,p) = Ex (y,q) holds
( x = y & p = q )
proof end;

definition
let A be QC-alphabet ;
let x, y be bound_QC-variable of A;
let p be Element of QC-WFF A;
func All (x,y,p) -> QC-formula of A equals :: QC_LANG2:def 6
All (x,(All (y,p)));
correctness
coherence
All (x,(All (y,p))) is QC-formula of A
;
;
func Ex (x,y,p) -> QC-formula of A equals :: QC_LANG2:def 7
Ex (x,(Ex (y,p)));
correctness
coherence
Ex (x,(Ex (y,p))) is QC-formula of A
;
;
end;

:: deftheorem defines All QC_LANG2:def 6 :
for A being QC-alphabet
for x, y being bound_QC-variable of A
for p being Element of QC-WFF A holds All (x,y,p) = All (x,(All (y,p)));

:: deftheorem defines Ex QC_LANG2:def 7 :
for A being QC-alphabet
for x, y being bound_QC-variable of A
for p being Element of QC-WFF A holds Ex (x,y,p) = Ex (x,(Ex (y,p)));

theorem :: QC_LANG2:14
for A being QC-alphabet
for x, y being bound_QC-variable of A
for p being Element of QC-WFF A holds
( All (x,y,p) = All (x,(All (y,p))) & Ex (x,y,p) = Ex (x,(Ex (y,p))) ) ;

theorem Th15: :: QC_LANG2:15
for A being QC-alphabet
for p1, p2 being Element of QC-WFF A
for x1, x2, y1, y2 being bound_QC-variable of A st All (x1,y1,p1) = All (x2,y2,p2) holds
( x1 = x2 & y1 = y2 & p1 = p2 )
proof end;

theorem :: QC_LANG2:16
for A being QC-alphabet
for x, y, z being bound_QC-variable of A
for p, q being Element of QC-WFF A st All (x,y,p) = All (z,q) holds
( x = z & All (y,p) = q ) by Th5;

theorem Th17: :: QC_LANG2:17
for A being QC-alphabet
for p1, p2 being Element of QC-WFF A
for x1, x2, y1, y2 being bound_QC-variable of A st Ex (x1,y1,p1) = Ex (x2,y2,p2) holds
( x1 = x2 & y1 = y2 & p1 = p2 )
proof end;

theorem :: QC_LANG2:18
for A being QC-alphabet
for x, y, z being bound_QC-variable of A
for p, q being Element of QC-WFF A st Ex (x,y,p) = Ex (z,q) holds
( x = z & Ex (y,p) = q ) by Th13;

theorem :: QC_LANG2:19
for A being QC-alphabet
for x, y being bound_QC-variable of A
for p being Element of QC-WFF A holds
( All (x,y,p) is universal & bound_in (All (x,y,p)) = x & the_scope_of (All (x,y,p)) = All (y,p) ) by Th7;

definition
let A be QC-alphabet ;
let x, y, z be bound_QC-variable of A;
let p be Element of QC-WFF A;
func All (x,y,z,p) -> QC-formula of A equals :: QC_LANG2:def 8
All (x,(All (y,z,p)));
correctness
coherence
All (x,(All (y,z,p))) is QC-formula of A
;
;
func Ex (x,y,z,p) -> QC-formula of A equals :: QC_LANG2:def 9
Ex (x,(Ex (y,z,p)));
correctness
coherence
Ex (x,(Ex (y,z,p))) is QC-formula of A
;
;
end;

:: deftheorem defines All QC_LANG2:def 8 :
for A being QC-alphabet
for x, y, z being bound_QC-variable of A
for p being Element of QC-WFF A holds All (x,y,z,p) = All (x,(All (y,z,p)));

:: deftheorem defines Ex QC_LANG2:def 9 :
for A being QC-alphabet
for x, y, z being bound_QC-variable of A
for p being Element of QC-WFF A holds Ex (x,y,z,p) = Ex (x,(Ex (y,z,p)));

theorem :: QC_LANG2:20
for A being QC-alphabet
for x, y, z being bound_QC-variable of A
for p being Element of QC-WFF A holds
( All (x,y,z,p) = All (x,(All (y,z,p))) & Ex (x,y,z,p) = Ex (x,(Ex (y,z,p))) ) ;

theorem :: QC_LANG2:21
for A being QC-alphabet
for p1, p2 being Element of QC-WFF A
for x1, x2, y1, y2, z1, z2 being bound_QC-variable of A st All (x1,y1,z1,p1) = All (x2,y2,z2,p2) holds
( x1 = x2 & y1 = y2 & z1 = z2 & p1 = p2 )
proof end;

theorem :: QC_LANG2:22
for A being QC-alphabet
for x, y, z being bound_QC-variable of A
for p, q being Element of QC-WFF A
for t being bound_QC-variable of A st All (x,y,z,p) = All (t,q) holds
( x = t & All (y,z,p) = q ) by Th5;

theorem :: QC_LANG2:23
for A being QC-alphabet
for x, y, z being bound_QC-variable of A
for p, q being Element of QC-WFF A
for s, t being bound_QC-variable of A st All (x,y,z,p) = All (t,s,q) holds
( x = t & y = s & All (z,p) = q )
proof end;

theorem :: QC_LANG2:24
for A being QC-alphabet
for p1, p2 being Element of QC-WFF A
for x1, x2, y1, y2, z1, z2 being bound_QC-variable of A st Ex (x1,y1,z1,p1) = Ex (x2,y2,z2,p2) holds
( x1 = x2 & y1 = y2 & z1 = z2 & p1 = p2 )
proof end;

theorem :: QC_LANG2:25
for A being QC-alphabet
for x, y, z being bound_QC-variable of A
for p, q being Element of QC-WFF A
for t being bound_QC-variable of A st Ex (x,y,z,p) = Ex (t,q) holds
( x = t & Ex (y,z,p) = q ) by Th13;

theorem :: QC_LANG2:26
for A being QC-alphabet
for x, y, z being bound_QC-variable of A
for p, q being Element of QC-WFF A
for s, t being bound_QC-variable of A st Ex (x,y,z,p) = Ex (t,s,q) holds
( x = t & y = s & Ex (z,p) = q )
proof end;

theorem :: QC_LANG2:27
for A being QC-alphabet
for x, y, z being bound_QC-variable of A
for p being Element of QC-WFF A holds
( All (x,y,z,p) is universal & bound_in (All (x,y,z,p)) = x & the_scope_of (All (x,y,z,p)) = All (y,z,p) ) by Th7;

definition
let A be QC-alphabet ;
let H be Element of QC-WFF A;
attr H is disjunctive means :: QC_LANG2:def 10
ex p, q being Element of QC-WFF A st H = p 'or' q;
attr H is conditional means :: QC_LANG2:def 11
ex p, q being Element of QC-WFF A st H = p => q;
attr H is biconditional means :: QC_LANG2:def 12
ex p, q being Element of QC-WFF A st H = p <=> q;
attr H is existential means :: QC_LANG2:def 13
ex x being bound_QC-variable of A ex p being Element of QC-WFF A st H = Ex (x,p);
end;

:: deftheorem defines disjunctive QC_LANG2:def 10 :
for A being QC-alphabet
for H being Element of QC-WFF A holds
( H is disjunctive iff ex p, q being Element of QC-WFF A st H = p 'or' q );

:: deftheorem defines conditional QC_LANG2:def 11 :
for A being QC-alphabet
for H being Element of QC-WFF A holds
( H is conditional iff ex p, q being Element of QC-WFF A st H = p => q );

:: deftheorem defines biconditional QC_LANG2:def 12 :
for A being QC-alphabet
for H being Element of QC-WFF A holds
( H is biconditional iff ex p, q being Element of QC-WFF A st H = p <=> q );

:: deftheorem defines existential QC_LANG2:def 13 :
for A being QC-alphabet
for H being Element of QC-WFF A holds
( H is existential iff ex x being bound_QC-variable of A ex p being Element of QC-WFF A st H = Ex (x,p) );

theorem :: QC_LANG2:28
for A being QC-alphabet
for x, y, z being bound_QC-variable of A
for p being Element of QC-WFF A holds
( Ex (x,y,p) is existential & Ex (x,y,z,p) is existential ) ;

definition
let A be QC-alphabet ;
let H be Element of QC-WFF A;
correctness
coherence ;
;
correctness
coherence ;
;
correctness
coherence ;
;
end;

:: deftheorem defines the_left_disjunct_of QC_LANG2:def 14 :
for A being QC-alphabet
for H being Element of QC-WFF A holds the_left_disjunct_of H = the_argument_of ;

:: deftheorem defines the_right_disjunct_of QC_LANG2:def 15 :
for A being QC-alphabet
for H being Element of QC-WFF A holds the_right_disjunct_of H = the_argument_of ;

:: deftheorem defines the_antecedent_of QC_LANG2:def 16 :
for A being QC-alphabet
for H being Element of QC-WFF A holds the_antecedent_of H = the_left_argument_of ();

notation
let A be QC-alphabet ;
let H be Element of QC-WFF A;
synonym the_consequent_of H for the_right_disjunct_of H;
end;

definition
let A be QC-alphabet ;
let H be Element of QC-WFF A;
correctness
coherence ;
;
correctness
coherence ;
;
end;

:: deftheorem defines the_left_side_of QC_LANG2:def 17 :
for A being QC-alphabet
for H being Element of QC-WFF A holds the_left_side_of H = the_antecedent_of ;

:: deftheorem defines the_right_side_of QC_LANG2:def 18 :
for A being QC-alphabet
for H being Element of QC-WFF A holds the_right_side_of H = the_consequent_of ;

theorem Th29: :: QC_LANG2:29
for A being QC-alphabet
for F, G being Element of QC-WFF A holds
( the_left_disjunct_of (F 'or' G) = F & the_right_disjunct_of (F 'or' G) = G & the_argument_of (F 'or' G) = () '&' () )
proof end;

theorem Th30: :: QC_LANG2:30
for A being QC-alphabet
for F, G being Element of QC-WFF A holds
( the_antecedent_of (F => G) = F & the_consequent_of (F => G) = G & the_argument_of (F => G) = F '&' () )
proof end;

theorem Th31: :: QC_LANG2:31
for A being QC-alphabet
for F, G being Element of QC-WFF A holds
( the_left_side_of (F <=> G) = F & the_right_side_of (F <=> G) = G & the_left_argument_of (F <=> G) = F => G & the_right_argument_of (F <=> G) = G => F )
proof end;

theorem :: QC_LANG2:32
for A being QC-alphabet
for x being bound_QC-variable of A
for H being Element of QC-WFF A holds the_argument_of (Ex (x,H)) = All (x,()) by Th1;

theorem :: QC_LANG2:33
for A being QC-alphabet
for H being Element of QC-WFF A st H is disjunctive holds
( H is conditional & H is negative & the_argument_of H is conjunctive & the_left_argument_of () is negative & the_right_argument_of () is negative )
proof end;

theorem :: QC_LANG2:34
for A being QC-alphabet
for H being Element of QC-WFF A st H is conditional holds
( H is negative & the_argument_of H is conjunctive & the_right_argument_of () is negative )
proof end;

theorem :: QC_LANG2:35
for A being QC-alphabet
for H being Element of QC-WFF A st H is biconditional holds
( H is conjunctive & the_left_argument_of H is conditional & the_right_argument_of H is conditional ) by Th4;

theorem :: QC_LANG2:36
for A being QC-alphabet
for H being Element of QC-WFF A st H is existential holds
( H is negative & the_argument_of H is universal & the_scope_of () is negative )
proof end;

theorem :: QC_LANG2:37
for A being QC-alphabet
for H being Element of QC-WFF A st H is disjunctive holds
H = 'or'
proof end;

theorem :: QC_LANG2:38
for A being QC-alphabet
for H being Element of QC-WFF A st H is conditional holds
H = =>
proof end;

theorem :: QC_LANG2:39
for A being QC-alphabet
for H being Element of QC-WFF A st H is biconditional holds
H = () <=>
proof end;

theorem :: QC_LANG2:40
for A being QC-alphabet
for H being Element of QC-WFF A st H is existential holds
H = Ex ((),)
proof end;

::
:: Immediate constituents of QC-formulae
::
definition
let A be QC-alphabet ;
let G, H be Element of QC-WFF A;
pred G is_immediate_constituent_of H means :: QC_LANG2:def 19
( H = 'not' G or ex F being Element of QC-WFF A st
( H = G '&' F or H = F '&' G ) or ex x being bound_QC-variable of A st H = All (x,G) );
end;

:: deftheorem defines is_immediate_constituent_of QC_LANG2:def 19 :
for A being QC-alphabet
for G, H being Element of QC-WFF A holds
( G is_immediate_constituent_of H iff ( H = 'not' G or ex F being Element of QC-WFF A st
( H = G '&' F or H = F '&' G ) or ex x being bound_QC-variable of A st H = All (x,G) ) );

theorem Th41: :: QC_LANG2:41
for A being QC-alphabet
for H being Element of QC-WFF A holds not H is_immediate_constituent_of VERUM A
proof end;

theorem Th42: :: QC_LANG2:42
for A being QC-alphabet
for H being Element of QC-WFF A
for k being Nat
for P being QC-pred_symbol of k,A
for V being QC-variable_list of k,A holds not H is_immediate_constituent_of P ! V
proof end;

theorem Th43: :: QC_LANG2:43
for A being QC-alphabet
for F, H being Element of QC-WFF A holds
( F is_immediate_constituent_of 'not' H iff F = H )
proof end;

theorem :: QC_LANG2:44
for A being QC-alphabet
for H being Element of QC-WFF A holds
( H is_immediate_constituent_of FALSUM A iff H = VERUM A ) by Th43;

theorem Th45: :: QC_LANG2:45
for A being QC-alphabet
for F, G, H being Element of QC-WFF A holds
( F is_immediate_constituent_of G '&' H iff ( F = G or F = H ) )
proof end;

theorem Th46: :: QC_LANG2:46
for A being QC-alphabet
for F, H being Element of QC-WFF A
for x being bound_QC-variable of A holds
( F is_immediate_constituent_of All (x,H) iff F = H )
proof end;

theorem Th47: :: QC_LANG2:47
for A being QC-alphabet
for F, H being Element of QC-WFF A st H is atomic holds
not F is_immediate_constituent_of H by Th42;

theorem Th48: :: QC_LANG2:48
for A being QC-alphabet
for F, H being Element of QC-WFF A st H is negative holds
( F is_immediate_constituent_of H iff F = the_argument_of H )
proof end;

theorem Th49: :: QC_LANG2:49
for A being QC-alphabet
for F, H being Element of QC-WFF A st H is conjunctive holds
( F is_immediate_constituent_of H iff ( F = the_left_argument_of H or F = the_right_argument_of H ) )
proof end;

theorem Th50: :: QC_LANG2:50
for A being QC-alphabet
for F, H being Element of QC-WFF A st H is universal holds
( F is_immediate_constituent_of H iff F = the_scope_of H )
proof end;

definition
let A be QC-alphabet ;
let G, H be Element of QC-WFF A;
pred G is_subformula_of H means :: QC_LANG2:def 20
ex n being Nat ex L being FinSequence st
( 1 <= n & len L = n & L . 1 = G & L . n = H & ( for k being Nat st 1 <= k & k < n holds
ex G1, H1 being Element of QC-WFF A st
( L . k = G1 & L . (k + 1) = H1 & G1 is_immediate_constituent_of H1 ) ) );
reflexivity
for G being Element of QC-WFF A ex n being Nat ex L being FinSequence st
( 1 <= n & len L = n & L . 1 = G & L . n = G & ( for k being Nat st 1 <= k & k < n holds
ex G1, H1 being Element of QC-WFF A st
( L . k = G1 & L . (k + 1) = H1 & G1 is_immediate_constituent_of H1 ) ) )
proof end;
end;

:: deftheorem defines is_subformula_of QC_LANG2:def 20 :
for A being QC-alphabet
for G, H being Element of QC-WFF A holds
( G is_subformula_of H iff ex n being Nat ex L being FinSequence st
( 1 <= n & len L = n & L . 1 = G & L . n = H & ( for k being Nat st 1 <= k & k < n holds
ex G1, H1 being Element of QC-WFF A st
( L . k = G1 & L . (k + 1) = H1 & G1 is_immediate_constituent_of H1 ) ) ) );

definition
let A be QC-alphabet ;
let H, F be Element of QC-WFF A;
pred H is_proper_subformula_of F means :Def21: :: QC_LANG2:def 21
( H is_subformula_of F & H <> F );
irreflexivity
for H being Element of QC-WFF A holds
( not H is_subformula_of H or not H <> H )
;
end;

:: deftheorem Def21 defines is_proper_subformula_of QC_LANG2:def 21 :
for A being QC-alphabet
for H, F being Element of QC-WFF A holds
( H is_proper_subformula_of F iff ( H is_subformula_of F & H <> F ) );

theorem Th51: :: QC_LANG2:51
for A being QC-alphabet
for F, H being Element of QC-WFF A st H is_immediate_constituent_of F holds
len (@ H) < len (@ F)
proof end;

theorem Th52: :: QC_LANG2:52
for A being QC-alphabet
for F, H being Element of QC-WFF A st H is_immediate_constituent_of F holds
H is_subformula_of F
proof end;

theorem Th53: :: QC_LANG2:53
for A being QC-alphabet
for F, H being Element of QC-WFF A st H is_immediate_constituent_of F holds
H is_proper_subformula_of F
proof end;

theorem Th54: :: QC_LANG2:54
for A being QC-alphabet
for F, H being Element of QC-WFF A st H is_proper_subformula_of F holds
len (@ H) < len (@ F)
proof end;

theorem Th55: :: QC_LANG2:55
for A being QC-alphabet
for F, H being Element of QC-WFF A st H is_proper_subformula_of F holds
ex G being Element of QC-WFF A st G is_immediate_constituent_of F
proof end;

theorem Th56: :: QC_LANG2:56
for A being QC-alphabet
for F, G, H being Element of QC-WFF A st F is_proper_subformula_of G & G is_proper_subformula_of H holds
F is_proper_subformula_of H
proof end;

theorem Th57: :: QC_LANG2:57
for A being QC-alphabet
for F, G, H being Element of QC-WFF A st F is_subformula_of G & G is_subformula_of H holds
F is_subformula_of H
proof end;

theorem Th58: :: QC_LANG2:58
for A being QC-alphabet
for G, H being Element of QC-WFF A st G is_subformula_of H & H is_subformula_of G holds
G = H
proof end;

theorem Th59: :: QC_LANG2:59
for A being QC-alphabet
for G, H being Element of QC-WFF A holds
( not G is_proper_subformula_of H or not H is_subformula_of G ) by Th58;

theorem :: QC_LANG2:60
for A being QC-alphabet
for G, H being Element of QC-WFF A holds
( not G is_proper_subformula_of H or not H is_proper_subformula_of G ) by Th59;

theorem Th61: :: QC_LANG2:61
for A being QC-alphabet
for G, H being Element of QC-WFF A holds
( not G is_subformula_of H or not H is_immediate_constituent_of G ) by ;

theorem :: QC_LANG2:62
for A being QC-alphabet
for G, H being Element of QC-WFF A holds
( not G is_proper_subformula_of H or not H is_immediate_constituent_of G ) by ;

theorem Th63: :: QC_LANG2:63
for A being QC-alphabet
for F, G, H being Element of QC-WFF A st ( ( F is_proper_subformula_of G & G is_subformula_of H ) or ( F is_subformula_of G & G is_proper_subformula_of H ) or ( F is_subformula_of G & G is_immediate_constituent_of H ) or ( F is_immediate_constituent_of G & G is_subformula_of H ) or ( F is_proper_subformula_of G & G is_immediate_constituent_of H ) or ( F is_immediate_constituent_of G & G is_proper_subformula_of H ) ) holds
F is_proper_subformula_of H
proof end;

theorem Th64: :: QC_LANG2:64
for A being QC-alphabet
for F being Element of QC-WFF A holds not F is_proper_subformula_of VERUM A
proof end;

theorem Th65: :: QC_LANG2:65
for A being QC-alphabet
for F being Element of QC-WFF A
for k being Nat
for P being QC-pred_symbol of k,A
for V being QC-variable_list of k,A holds not F is_proper_subformula_of P ! V
proof end;

theorem Th66: :: QC_LANG2:66
for A being QC-alphabet
for F, H being Element of QC-WFF A holds
( F is_subformula_of H iff F is_proper_subformula_of 'not' H )
proof end;

theorem :: QC_LANG2:67
for A being QC-alphabet
for F, H being Element of QC-WFF A st 'not' F is_subformula_of H holds
F is_proper_subformula_of H
proof end;

theorem :: QC_LANG2:68
for A being QC-alphabet
for F being Element of QC-WFF A holds
( F is_proper_subformula_of FALSUM A iff F is_subformula_of VERUM A ) by Th66;

theorem Th69: :: QC_LANG2:69
for A being QC-alphabet
for F, G, H being Element of QC-WFF A holds
( ( F is_subformula_of G or F is_subformula_of H ) iff F is_proper_subformula_of G '&' H )
proof end;

theorem :: QC_LANG2:70
for A being QC-alphabet
for F, G, H being Element of QC-WFF A st F '&' G is_subformula_of H holds
( F is_proper_subformula_of H & G is_proper_subformula_of H )
proof end;

theorem Th71: :: QC_LANG2:71
for A being QC-alphabet
for F, H being Element of QC-WFF A
for x being bound_QC-variable of A holds
( F is_subformula_of H iff F is_proper_subformula_of All (x,H) )
proof end;

theorem :: QC_LANG2:72
for A being QC-alphabet
for F, H being Element of QC-WFF A
for x being bound_QC-variable of A st All (x,H) is_subformula_of F holds
H is_proper_subformula_of F
proof end;

theorem :: QC_LANG2:73
for A being QC-alphabet
for F, G being Element of QC-WFF A holds
( F '&' () is_proper_subformula_of F => G & F is_proper_subformula_of F => G & 'not' G is_proper_subformula_of F => G & G is_proper_subformula_of F => G )
proof end;

theorem :: QC_LANG2:74
for A being QC-alphabet
for F, G being Element of QC-WFF A holds
( () '&' () is_proper_subformula_of F 'or' G & 'not' F is_proper_subformula_of F 'or' G & 'not' G is_proper_subformula_of F 'or' G & F is_proper_subformula_of F 'or' G & G is_proper_subformula_of F 'or' G )
proof end;

theorem :: QC_LANG2:75
for A being QC-alphabet
for F, H being Element of QC-WFF A st H is atomic holds
not F is_proper_subformula_of H by Th65;

theorem :: QC_LANG2:76
for A being QC-alphabet
for H being Element of QC-WFF A st H is negative holds
the_argument_of H is_proper_subformula_of H
proof end;

theorem :: QC_LANG2:77
for A being QC-alphabet
for H being Element of QC-WFF A st H is conjunctive holds
( the_left_argument_of H is_proper_subformula_of H & the_right_argument_of H is_proper_subformula_of H )
proof end;

theorem :: QC_LANG2:78
for A being QC-alphabet
for H being Element of QC-WFF A st H is universal holds
the_scope_of H is_proper_subformula_of H
proof end;

theorem Th79: :: QC_LANG2:79
for A being QC-alphabet
for H being Element of QC-WFF A holds
( H is_subformula_of VERUM A iff H = VERUM A ) by ;

theorem Th80: :: QC_LANG2:80
for A being QC-alphabet
for H being Element of QC-WFF A
for k being Nat
for P being QC-pred_symbol of k,A
for V being QC-variable_list of k,A holds
( H is_subformula_of P ! V iff H = P ! V )
proof end;

theorem Th81: :: QC_LANG2:81
for A being QC-alphabet
for H being Element of QC-WFF A holds
( H is_subformula_of FALSUM A iff ( H = FALSUM A or H = VERUM A ) )
proof end;

::
:: Set of subformulae of QC-formulae
::
definition
let A be QC-alphabet ;
let H be Element of QC-WFF A;
func Subformulae H -> set means :Def22: :: QC_LANG2:def 22
for a being object holds
( a in it iff ex F being Element of QC-WFF A st
( F = a & F is_subformula_of H ) );
existence
ex b1 being set st
for a being object holds
( a in b1 iff ex F being Element of QC-WFF A st
( F = a & F is_subformula_of H ) )
proof end;
uniqueness
for b1, b2 being set st ( for a being object holds
( a in b1 iff ex F being Element of QC-WFF A st
( F = a & F is_subformula_of H ) ) ) & ( for a being object holds
( a in b2 iff ex F being Element of QC-WFF A st
( F = a & F is_subformula_of H ) ) ) holds
b1 = b2
proof end;
end;

:: deftheorem Def22 defines Subformulae QC_LANG2:def 22 :
for A being QC-alphabet
for H being Element of QC-WFF A
for b3 being set holds
( b3 = Subformulae H iff for a being object holds
( a in b3 iff ex F being Element of QC-WFF A st
( F = a & F is_subformula_of H ) ) );

theorem Th82: :: QC_LANG2:82
for A being QC-alphabet
for G, H being Element of QC-WFF A st G in Subformulae H holds
G is_subformula_of H
proof end;

theorem Th83: :: QC_LANG2:83
for A being QC-alphabet
for F, H being Element of QC-WFF A st F is_subformula_of H holds
Subformulae F c= Subformulae H
proof end;

theorem :: QC_LANG2:84
for A being QC-alphabet
for G, H being Element of QC-WFF A st G in Subformulae H holds
Subformulae G c= Subformulae H by ;

theorem Th85: :: QC_LANG2:85
for A being QC-alphabet holds Subformulae () = {()}
proof end;

theorem Th86: :: QC_LANG2:86
for A being QC-alphabet
for k being Nat
for P being QC-pred_symbol of k,A
for V being QC-variable_list of k,A holds Subformulae (P ! V) = {(P ! V)}
proof end;

theorem :: QC_LANG2:87
for A being QC-alphabet holds Subformulae () = {(),()}
proof end;

theorem Th88: :: QC_LANG2:88
for A being QC-alphabet
for H being Element of QC-WFF A holds Subformulae () = () \/ {()}
proof end;

theorem Th89: :: QC_LANG2:89
for A being QC-alphabet
for F, H being Element of QC-WFF A holds Subformulae (H '&' F) = (() \/ ()) \/ {(H '&' F)}
proof end;

theorem Th90: :: QC_LANG2:90
for A being QC-alphabet
for H being Element of QC-WFF A
for x being bound_QC-variable of A holds Subformulae (All (x,H)) = () \/ {(All (x,H))}
proof end;

theorem Th91: :: QC_LANG2:91
for A being QC-alphabet
for F, G being Element of QC-WFF A holds Subformulae (F => G) = (() \/ ()) \/ {(),(F '&' ()),(F => G)}
proof end;

theorem :: QC_LANG2:92
for A being QC-alphabet
for F, G being Element of QC-WFF A holds Subformulae (F 'or' G) = (() \/ ()) \/ {(),(),(() '&' ()),(F 'or' G)}
proof end;

theorem :: QC_LANG2:93
for A being QC-alphabet
for F, G being Element of QC-WFF A holds Subformulae (F <=> G) = (() \/ ()) \/ {(),(F '&' ()),(F => G),(),(G '&' ()),(G => F),(F <=> G)}
proof end;

theorem :: QC_LANG2:94
for A being QC-alphabet
for H being Element of QC-WFF A holds
( ( H = VERUM A or H is atomic ) iff Subformulae H = {H} )
proof end;

theorem :: QC_LANG2:95
for A being QC-alphabet
for H being Element of QC-WFF A st H is negative holds
Subformulae H = () \/ {H}
proof end;

theorem :: QC_LANG2:96
for A being QC-alphabet
for H being Element of QC-WFF A st H is conjunctive holds
Subformulae H = () \/ {H}
proof end;

theorem :: QC_LANG2:97
for A being QC-alphabet
for H being Element of QC-WFF A st H is universal holds
Subformulae H = () \/ {H}
proof end;

theorem :: QC_LANG2:98
for A being QC-alphabet
for F, G, H being Element of QC-WFF A st ( H is_immediate_constituent_of G or H is_proper_subformula_of G or H is_subformula_of G ) & G in Subformulae F holds
H in Subformulae F
proof end;