77 "!!P. |- (EX x. x=t & P(x)) <-> P(t)" |
77 "!!P. |- (EX x. x=t & P(x)) <-> P(t)" |
78 "!!P. |- (EX x. t=x & P(x)) <-> P(t)" |
78 "!!P. |- (EX x. t=x & P(x)) <-> P(t)" |
79 by (fast add!: subst)+ |
79 by (fast add!: subst)+ |
80 |
80 |
81 |
81 |
82 subsection {* Miniscoping: pushing quantifiers in *} |
82 subsection \<open>Miniscoping: pushing quantifiers in\<close> |
83 |
83 |
84 text {* |
84 text \<open> |
85 We do NOT distribute of ALL over &, or dually that of EX over | |
85 We do NOT distribute of ALL over &, or dually that of EX over | |
86 Baaz and Leitsch, On Skolemization and Proof Complexity (1994) |
86 Baaz and Leitsch, On Skolemization and Proof Complexity (1994) |
87 show that this step can increase proof length! |
87 show that this step can increase proof length! |
88 *} |
88 \<close> |
89 |
89 |
90 text {*existential miniscoping*} |
90 text \<open>existential miniscoping\<close> |
91 lemma ex_simps: |
91 lemma ex_simps: |
92 "!!P Q. |- (EX x. P(x) & Q) <-> (EX x. P(x)) & Q" |
92 "!!P Q. |- (EX x. P(x) & Q) <-> (EX x. P(x)) & Q" |
93 "!!P Q. |- (EX x. P & Q(x)) <-> P & (EX x. Q(x))" |
93 "!!P Q. |- (EX x. P & Q(x)) <-> P & (EX x. Q(x))" |
94 "!!P Q. |- (EX x. P(x) | Q) <-> (EX x. P(x)) | Q" |
94 "!!P Q. |- (EX x. P(x) | Q) <-> (EX x. P(x)) | Q" |
95 "!!P Q. |- (EX x. P | Q(x)) <-> P | (EX x. Q(x))" |
95 "!!P Q. |- (EX x. P | Q(x)) <-> P | (EX x. Q(x))" |
96 "!!P Q. |- (EX x. P(x) --> Q) <-> (ALL x. P(x)) --> Q" |
96 "!!P Q. |- (EX x. P(x) --> Q) <-> (ALL x. P(x)) --> Q" |
97 "!!P Q. |- (EX x. P --> Q(x)) <-> P --> (EX x. Q(x))" |
97 "!!P Q. |- (EX x. P --> Q(x)) <-> P --> (EX x. Q(x))" |
98 by (fast add!: subst)+ |
98 by (fast add!: subst)+ |
99 |
99 |
100 text {*universal miniscoping*} |
100 text \<open>universal miniscoping\<close> |
101 lemma all_simps: |
101 lemma all_simps: |
102 "!!P Q. |- (ALL x. P(x) & Q) <-> (ALL x. P(x)) & Q" |
102 "!!P Q. |- (ALL x. P(x) & Q) <-> (ALL x. P(x)) & Q" |
103 "!!P Q. |- (ALL x. P & Q(x)) <-> P & (ALL x. Q(x))" |
103 "!!P Q. |- (ALL x. P & Q(x)) <-> P & (ALL x. Q(x))" |
104 "!!P Q. |- (ALL x. P(x) --> Q) <-> (EX x. P(x)) --> Q" |
104 "!!P Q. |- (ALL x. P(x) --> Q) <-> (EX x. P(x)) --> Q" |
105 "!!P Q. |- (ALL x. P --> Q(x)) <-> P --> (ALL x. Q(x))" |
105 "!!P Q. |- (ALL x. P --> Q(x)) <-> P --> (ALL x. Q(x))" |
106 "!!P Q. |- (ALL x. P(x) | Q) <-> (ALL x. P(x)) | Q" |
106 "!!P Q. |- (ALL x. P(x) | Q) <-> (ALL x. P(x)) | Q" |
107 "!!P Q. |- (ALL x. P | Q(x)) <-> P | (ALL x. Q(x))" |
107 "!!P Q. |- (ALL x. P | Q(x)) <-> P | (ALL x. Q(x))" |
108 by (fast add!: subst)+ |
108 by (fast add!: subst)+ |
109 |
109 |
110 text {*These are NOT supplied by default!*} |
110 text \<open>These are NOT supplied by default!\<close> |
111 lemma distrib_simps: |
111 lemma distrib_simps: |
112 "|- P & (Q | R) <-> P&Q | P&R" |
112 "|- P & (Q | R) <-> P&Q | P&R" |
113 "|- (Q | R) & P <-> Q&P | R&P" |
113 "|- (Q | R) & P <-> Q&P | R&P" |
114 "|- (P | Q --> R) <-> (P --> R) & (Q --> R)" |
114 "|- (P | Q --> R) <-> (P --> R) & (Q --> R)" |
115 by (fast add!: subst)+ |
115 by (fast add!: subst)+ |
136 "|- (~P --> P) <-> P" |
136 "|- (~P --> P) <-> P" |
137 "|- (~P <-> ~Q) <-> (P<->Q)" |
137 "|- (~P <-> ~Q) <-> (P<->Q)" |
138 by (fast add!: subst)+ |
138 by (fast add!: subst)+ |
139 |
139 |
140 |
140 |
141 subsection {* Named rewrite rules *} |
141 subsection \<open>Named rewrite rules\<close> |
142 |
142 |
143 lemma conj_commute: "|- P&Q <-> Q&P" |
143 lemma conj_commute: "|- P&Q <-> Q&P" |
144 and conj_left_commute: "|- P&(Q&R) <-> Q&(P&R)" |
144 and conj_left_commute: "|- P&(Q&R) <-> Q&(P&R)" |
145 by (fast add!: subst)+ |
145 by (fast add!: subst)+ |
146 |
146 |
175 assumes p1: "|- P <-> P'" |
175 assumes p1: "|- P <-> P'" |
176 and p2: "|- P' ==> |- Q <-> Q'" |
176 and p2: "|- P' ==> |- Q <-> Q'" |
177 shows "|- (P-->Q) <-> (P'-->Q')" |
177 shows "|- (P-->Q) <-> (P'-->Q')" |
178 apply (lem p1) |
178 apply (lem p1) |
179 apply safe |
179 apply safe |
180 apply (tactic {* |
180 apply (tactic \<open> |
181 REPEAT (resolve_tac @{context} @{thms cut} 1 THEN |
181 REPEAT (resolve_tac @{context} @{thms cut} 1 THEN |
182 DEPTH_SOLVE_1 |
182 DEPTH_SOLVE_1 |
183 (resolve_tac @{context} [@{thm thinL}, @{thm thinR}, @{thm p2} COMP @{thm monotonic}] 1) THEN |
183 (resolve_tac @{context} [@{thm thinL}, @{thm thinR}, @{thm p2} COMP @{thm monotonic}] 1) THEN |
184 Cla.safe_tac @{context} 1) *}) |
184 Cla.safe_tac @{context} 1)\<close>) |
185 done |
185 done |
186 |
186 |
187 lemma conj_cong: |
187 lemma conj_cong: |
188 assumes p1: "|- P <-> P'" |
188 assumes p1: "|- P <-> P'" |
189 and p2: "|- P' ==> |- Q <-> Q'" |
189 and p2: "|- P' ==> |- Q <-> Q'" |
190 shows "|- (P&Q) <-> (P'&Q')" |
190 shows "|- (P&Q) <-> (P'&Q')" |
191 apply (lem p1) |
191 apply (lem p1) |
192 apply safe |
192 apply safe |
193 apply (tactic {* |
193 apply (tactic \<open> |
194 REPEAT (resolve_tac @{context} @{thms cut} 1 THEN |
194 REPEAT (resolve_tac @{context} @{thms cut} 1 THEN |
195 DEPTH_SOLVE_1 |
195 DEPTH_SOLVE_1 |
196 (resolve_tac @{context} [@{thm thinL}, @{thm thinR}, @{thm p2} COMP @{thm monotonic}] 1) THEN |
196 (resolve_tac @{context} [@{thm thinL}, @{thm thinR}, @{thm p2} COMP @{thm monotonic}] 1) THEN |
197 Cla.safe_tac @{context} 1) *}) |
197 Cla.safe_tac @{context} 1)\<close>) |
198 done |
198 done |
199 |
199 |
200 lemma eq_sym_conv: "|- (x=y) <-> (y=x)" |
200 lemma eq_sym_conv: "|- (x=y) <-> (y=x)" |
201 by (fast add!: subst) |
201 by (fast add!: subst) |
202 |
202 |
203 ML_file "simpdata.ML" |
203 ML_file "simpdata.ML" |
204 setup {* map_theory_simpset (put_simpset LK_ss) *} |
204 setup \<open>map_theory_simpset (put_simpset LK_ss)\<close> |
205 setup {* Simplifier.method_setup [] *} |
205 setup \<open>Simplifier.method_setup []\<close> |
206 |
206 |
207 |
207 |
208 text {* To create substition rules *} |
208 text \<open>To create substition rules\<close> |
209 |
209 |
210 lemma eq_imp_subst: "|- a=b ==> $H, A(a), $G |- $E, A(b), $F" |
210 lemma eq_imp_subst: "|- a=b ==> $H, A(a), $G |- $E, A(b), $F" |
211 by simp |
211 by simp |
212 |
212 |
213 lemma split_if: "|- P(if Q then x else y) <-> ((Q --> P(x)) & (~Q --> P(y)))" |
213 lemma split_if: "|- P(if Q then x else y) <-> ((Q --> P(x)) & (~Q --> P(y)))" |