author | wenzelm |
Sun, 27 Dec 2020 17:53:08 +0100 | |
changeset 73015 | 2d7060a3ea11 |
parent 71959 | ee2c7f0dd1be |
child 74342 | 5d411d85da8c |
permissions | -rw-r--r-- |
1268 | 1 |
(* Title: FOL/IFOL.thy |
11677 | 2 |
Author: Lawrence C Paulson and Markus Wenzel |
3 |
*) |
|
35 | 4 |
|
60770 | 5 |
section \<open>Intuitionistic first-order logic\<close> |
35 | 6 |
|
15481 | 7 |
theory IFOL |
71839 | 8 |
imports Pure |
73015 | 9 |
abbrevs "?<" = "\<exists>\<^sub>\<le>\<^sub>1" |
15481 | 10 |
begin |
7355
4c43090659ca
proper bootstrap of IFOL/FOL theories and packages;
wenzelm
parents:
6340
diff
changeset
|
11 |
|
69605 | 12 |
ML_file \<open>~~/src/Tools/misc_legacy.ML\<close> |
13 |
ML_file \<open>~~/src/Provers/splitter.ML\<close> |
|
14 |
ML_file \<open>~~/src/Provers/hypsubst.ML\<close> |
|
15 |
ML_file \<open>~~/src/Tools/IsaPlanner/zipper.ML\<close> |
|
16 |
ML_file \<open>~~/src/Tools/IsaPlanner/isand.ML\<close> |
|
17 |
ML_file \<open>~~/src/Tools/IsaPlanner/rw_inst.ML\<close> |
|
18 |
ML_file \<open>~~/src/Provers/quantifier1.ML\<close> |
|
19 |
ML_file \<open>~~/src/Tools/intuitionistic.ML\<close> |
|
20 |
ML_file \<open>~~/src/Tools/project_rule.ML\<close> |
|
21 |
ML_file \<open>~~/src/Tools/atomize_elim.ML\<close> |
|
48891 | 22 |
|
0 | 23 |
|
60770 | 24 |
subsection \<open>Syntax and axiomatic basis\<close> |
11677 | 25 |
|
39557
fe5722fce758
renamed structure PureThy to Pure_Thy and moved most content to Global_Theory, to emphasize that this is global-only;
wenzelm
parents:
39159
diff
changeset
|
26 |
setup Pure_Thy.old_appl_syntax_setup |
70880 | 27 |
setup \<open>Proofterm.set_preproc (Proof_Rewrite_Rules.standard_preproc [])\<close> |
26956
1309a6a0a29f
setup PureThy.old_appl_syntax_setup -- theory Pure provides regular application syntax by default;
wenzelm
parents:
26580
diff
changeset
|
28 |
|
55380
4de48353034e
prefer vacuous definitional type classes over axiomatic ones;
wenzelm
parents:
52241
diff
changeset
|
29 |
class "term" |
69590 | 30 |
default_sort \<open>term\<close> |
0 | 31 |
|
7355
4c43090659ca
proper bootstrap of IFOL/FOL theories and packages;
wenzelm
parents:
6340
diff
changeset
|
32 |
typedecl o |
79 | 33 |
|
11747 | 34 |
judgment |
69590 | 35 |
Trueprop :: \<open>o \<Rightarrow> prop\<close> (\<open>(_)\<close> 5) |
0 | 36 |
|
79 | 37 |
|
60770 | 38 |
subsubsection \<open>Equality\<close> |
35 | 39 |
|
46972 | 40 |
axiomatization |
69590 | 41 |
eq :: \<open>['a, 'a] \<Rightarrow> o\<close> (infixl \<open>=\<close> 50) |
46972 | 42 |
where |
69590 | 43 |
refl: \<open>a = a\<close> and |
44 |
subst: \<open>a = b \<Longrightarrow> P(a) \<Longrightarrow> P(b)\<close> |
|
79 | 45 |
|
0 | 46 |
|
60770 | 47 |
subsubsection \<open>Propositional logic\<close> |
46972 | 48 |
|
49 |
axiomatization |
|
69590 | 50 |
False :: \<open>o\<close> and |
51 |
conj :: \<open>[o, o] => o\<close> (infixr \<open>\<and>\<close> 35) and |
|
52 |
disj :: \<open>[o, o] => o\<close> (infixr \<open>\<or>\<close> 30) and |
|
53 |
imp :: \<open>[o, o] => o\<close> (infixr \<open>\<longrightarrow>\<close> 25) |
|
46972 | 54 |
where |
69590 | 55 |
conjI: \<open>\<lbrakk>P; Q\<rbrakk> \<Longrightarrow> P \<and> Q\<close> and |
56 |
conjunct1: \<open>P \<and> Q \<Longrightarrow> P\<close> and |
|
57 |
conjunct2: \<open>P \<and> Q \<Longrightarrow> Q\<close> and |
|
46972 | 58 |
|
69590 | 59 |
disjI1: \<open>P \<Longrightarrow> P \<or> Q\<close> and |
60 |
disjI2: \<open>Q \<Longrightarrow> P \<or> Q\<close> and |
|
61 |
disjE: \<open>\<lbrakk>P \<or> Q; P \<Longrightarrow> R; Q \<Longrightarrow> R\<rbrakk> \<Longrightarrow> R\<close> and |
|
46972 | 62 |
|
69590 | 63 |
impI: \<open>(P \<Longrightarrow> Q) \<Longrightarrow> P \<longrightarrow> Q\<close> and |
64 |
mp: \<open>\<lbrakk>P \<longrightarrow> Q; P\<rbrakk> \<Longrightarrow> Q\<close> and |
|
46972 | 65 |
|
69590 | 66 |
FalseE: \<open>False \<Longrightarrow> P\<close> |
46972 | 67 |
|
68 |
||
60770 | 69 |
subsubsection \<open>Quantifiers\<close> |
46972 | 70 |
|
71 |
axiomatization |
|
69590 | 72 |
All :: \<open>('a \<Rightarrow> o) \<Rightarrow> o\<close> (binder \<open>\<forall>\<close> 10) and |
73 |
Ex :: \<open>('a \<Rightarrow> o) \<Rightarrow> o\<close> (binder \<open>\<exists>\<close> 10) |
|
46972 | 74 |
where |
69590 | 75 |
allI: \<open>(\<And>x. P(x)) \<Longrightarrow> (\<forall>x. P(x))\<close> and |
76 |
spec: \<open>(\<forall>x. P(x)) \<Longrightarrow> P(x)\<close> and |
|
77 |
exI: \<open>P(x) \<Longrightarrow> (\<exists>x. P(x))\<close> and |
|
78 |
exE: \<open>\<lbrakk>\<exists>x. P(x); \<And>x. P(x) \<Longrightarrow> R\<rbrakk> \<Longrightarrow> R\<close> |
|
46972 | 79 |
|
80 |
||
60770 | 81 |
subsubsection \<open>Definitions\<close> |
46972 | 82 |
|
69590 | 83 |
definition \<open>True \<equiv> False \<longrightarrow> False\<close> |
61487
f8cb97e0fd0b
more symbols, with swapped defaults: old-style ASCII syntax uses "ASCII" print mode;
wenzelm
parents:
61378
diff
changeset
|
84 |
|
69587 | 85 |
definition Not (\<open>\<not> _\<close> [40] 40) |
69590 | 86 |
where not_def: \<open>\<not> P \<equiv> P \<longrightarrow> False\<close> |
46972 | 87 |
|
69587 | 88 |
definition iff (infixr \<open>\<longleftrightarrow>\<close> 25) |
69590 | 89 |
where \<open>P \<longleftrightarrow> Q \<equiv> (P \<longrightarrow> Q) \<and> (Q \<longrightarrow> P)\<close> |
61487
f8cb97e0fd0b
more symbols, with swapped defaults: old-style ASCII syntax uses "ASCII" print mode;
wenzelm
parents:
61378
diff
changeset
|
90 |
|
71839 | 91 |
definition Uniq :: "('a \<Rightarrow> o) \<Rightarrow> o" |
92 |
where \<open>Uniq(P) \<equiv> (\<forall>x y. P(x) \<longrightarrow> P(y) \<longrightarrow> y = x)\<close> |
|
93 |
||
69590 | 94 |
definition Ex1 :: \<open>('a \<Rightarrow> o) \<Rightarrow> o\<close> (binder \<open>\<exists>!\<close> 10) |
95 |
where ex1_def: \<open>\<exists>!x. P(x) \<equiv> \<exists>x. P(x) \<and> (\<forall>y. P(y) \<longrightarrow> y = x)\<close> |
|
46972 | 96 |
|
62020 | 97 |
axiomatization where \<comment> \<open>Reflection, admissible\<close> |
69590 | 98 |
eq_reflection: \<open>(x = y) \<Longrightarrow> (x \<equiv> y)\<close> and |
99 |
iff_reflection: \<open>(P \<longleftrightarrow> Q) \<Longrightarrow> (P \<equiv> Q)\<close> |
|
61487
f8cb97e0fd0b
more symbols, with swapped defaults: old-style ASCII syntax uses "ASCII" print mode;
wenzelm
parents:
61378
diff
changeset
|
100 |
|
69590 | 101 |
abbreviation not_equal :: \<open>['a, 'a] \<Rightarrow> o\<close> (infixl \<open>\<noteq>\<close> 50) |
102 |
where \<open>x \<noteq> y \<equiv> \<not> (x = y)\<close> |
|
46972 | 103 |
|
71839 | 104 |
syntax "_Uniq" :: "pttrn \<Rightarrow> o \<Rightarrow> o" ("(2\<exists>\<^sub>\<le>\<^sub>1 _./ _)" [0, 10] 10) |
105 |
translations "\<exists>\<^sub>\<le>\<^sub>1x. P" \<rightleftharpoons> "CONST Uniq (\<lambda>x. P)" |
|
106 |
||
107 |
print_translation \<open> |
|
108 |
[Syntax_Trans.preserve_binder_abs_tr' \<^const_syntax>\<open>Uniq\<close> \<^syntax_const>\<open>_Uniq\<close>] |
|
109 |
\<close> \<comment> \<open>to avoid eta-contraction of body\<close> |
|
110 |
||
46972 | 111 |
|
61487
f8cb97e0fd0b
more symbols, with swapped defaults: old-style ASCII syntax uses "ASCII" print mode;
wenzelm
parents:
61378
diff
changeset
|
112 |
subsubsection \<open>Old-style ASCII syntax\<close> |
79 | 113 |
|
61487
f8cb97e0fd0b
more symbols, with swapped defaults: old-style ASCII syntax uses "ASCII" print mode;
wenzelm
parents:
61378
diff
changeset
|
114 |
notation (ASCII) |
69587 | 115 |
not_equal (infixl \<open>~=\<close> 50) and |
116 |
Not (\<open>~ _\<close> [40] 40) and |
|
117 |
conj (infixr \<open>&\<close> 35) and |
|
118 |
disj (infixr \<open>|\<close> 30) and |
|
119 |
All (binder \<open>ALL \<close> 10) and |
|
120 |
Ex (binder \<open>EX \<close> 10) and |
|
121 |
Ex1 (binder \<open>EX! \<close> 10) and |
|
122 |
imp (infixr \<open>-->\<close> 25) and |
|
123 |
iff (infixr \<open><->\<close> 25) |
|
35 | 124 |
|
13779 | 125 |
|
60770 | 126 |
subsection \<open>Lemmas and proof tools\<close> |
11677 | 127 |
|
46972 | 128 |
lemmas strip = impI allI |
129 |
||
69590 | 130 |
lemma TrueI: \<open>True\<close> |
21539 | 131 |
unfolding True_def by (rule impI) |
132 |
||
133 |
||
62020 | 134 |
subsubsection \<open>Sequent-style elimination rules for \<open>\<and>\<close> \<open>\<longrightarrow>\<close> and \<open>\<forall>\<close>\<close> |
21539 | 135 |
|
136 |
lemma conjE: |
|
69590 | 137 |
assumes major: \<open>P \<and> Q\<close> |
138 |
and r: \<open>\<lbrakk>P; Q\<rbrakk> \<Longrightarrow> R\<close> |
|
139 |
shows \<open>R\<close> |
|
71839 | 140 |
proof (rule r) |
141 |
show "P" |
|
142 |
by (rule major [THEN conjunct1]) |
|
143 |
show "Q" |
|
144 |
by (rule major [THEN conjunct2]) |
|
145 |
qed |
|
21539 | 146 |
|
147 |
lemma impE: |
|
69590 | 148 |
assumes major: \<open>P \<longrightarrow> Q\<close> |
149 |
and \<open>P\<close> |
|
150 |
and r: \<open>Q \<Longrightarrow> R\<close> |
|
151 |
shows \<open>R\<close> |
|
71839 | 152 |
proof (rule r) |
153 |
show "Q" |
|
154 |
by (rule mp [OF major \<open>P\<close>]) |
|
155 |
qed |
|
21539 | 156 |
|
157 |
lemma allE: |
|
69590 | 158 |
assumes major: \<open>\<forall>x. P(x)\<close> |
159 |
and r: \<open>P(x) \<Longrightarrow> R\<close> |
|
160 |
shows \<open>R\<close> |
|
71839 | 161 |
proof (rule r) |
162 |
show "P(x)" |
|
163 |
by (rule major [THEN spec]) |
|
164 |
qed |
|
21539 | 165 |
|
69593 | 166 |
text \<open>Duplicates the quantifier; for use with \<^ML>\<open>eresolve_tac\<close>.\<close> |
21539 | 167 |
lemma all_dupE: |
69590 | 168 |
assumes major: \<open>\<forall>x. P(x)\<close> |
169 |
and r: \<open>\<lbrakk>P(x); \<forall>x. P(x)\<rbrakk> \<Longrightarrow> R\<close> |
|
170 |
shows \<open>R\<close> |
|
71839 | 171 |
proof (rule r) |
172 |
show "P(x)" |
|
173 |
by (rule major [THEN spec]) |
|
174 |
qed (rule major) |
|
175 |
||
21539 | 176 |
|
177 |
||
62020 | 178 |
subsubsection \<open>Negation rules, which translate between \<open>\<not> P\<close> and \<open>P \<longrightarrow> False\<close>\<close> |
21539 | 179 |
|
69590 | 180 |
lemma notI: \<open>(P \<Longrightarrow> False) \<Longrightarrow> \<not> P\<close> |
21539 | 181 |
unfolding not_def by (erule impI) |
182 |
||
69590 | 183 |
lemma notE: \<open>\<lbrakk>\<not> P; P\<rbrakk> \<Longrightarrow> R\<close> |
21539 | 184 |
unfolding not_def by (erule mp [THEN FalseE]) |
185 |
||
69590 | 186 |
lemma rev_notE: \<open>\<lbrakk>P; \<not> P\<rbrakk> \<Longrightarrow> R\<close> |
21539 | 187 |
by (erule notE) |
188 |
||
62020 | 189 |
text \<open>This is useful with the special implication rules for each kind of \<open>P\<close>.\<close> |
21539 | 190 |
lemma not_to_imp: |
69590 | 191 |
assumes \<open>\<not> P\<close> |
192 |
and r: \<open>P \<longrightarrow> False \<Longrightarrow> Q\<close> |
|
193 |
shows \<open>Q\<close> |
|
21539 | 194 |
apply (rule r) |
195 |
apply (rule impI) |
|
61487
f8cb97e0fd0b
more symbols, with swapped defaults: old-style ASCII syntax uses "ASCII" print mode;
wenzelm
parents:
61378
diff
changeset
|
196 |
apply (erule notE [OF \<open>\<not> P\<close>]) |
21539 | 197 |
done |
198 |
||
61487
f8cb97e0fd0b
more symbols, with swapped defaults: old-style ASCII syntax uses "ASCII" print mode;
wenzelm
parents:
61378
diff
changeset
|
199 |
text \<open> |
62020 | 200 |
For substitution into an assumption \<open>P\<close>, reduce \<open>Q\<close> to \<open>P \<longrightarrow> Q\<close>, substitute into this implication, then apply \<open>impI\<close> to |
201 |
move \<open>P\<close> back into the assumptions. |
|
61487
f8cb97e0fd0b
more symbols, with swapped defaults: old-style ASCII syntax uses "ASCII" print mode;
wenzelm
parents:
61378
diff
changeset
|
202 |
\<close> |
69590 | 203 |
lemma rev_mp: \<open>\<lbrakk>P; P \<longrightarrow> Q\<rbrakk> \<Longrightarrow> Q\<close> |
21539 | 204 |
by (erule mp) |
205 |
||
61487
f8cb97e0fd0b
more symbols, with swapped defaults: old-style ASCII syntax uses "ASCII" print mode;
wenzelm
parents:
61378
diff
changeset
|
206 |
text \<open>Contrapositive of an inference rule.\<close> |
21539 | 207 |
lemma contrapos: |
69590 | 208 |
assumes major: \<open>\<not> Q\<close> |
209 |
and minor: \<open>P \<Longrightarrow> Q\<close> |
|
210 |
shows \<open>\<not> P\<close> |
|
21539 | 211 |
apply (rule major [THEN notE, THEN notI]) |
212 |
apply (erule minor) |
|
213 |
done |
|
214 |
||
215 |
||
61487
f8cb97e0fd0b
more symbols, with swapped defaults: old-style ASCII syntax uses "ASCII" print mode;
wenzelm
parents:
61378
diff
changeset
|
216 |
subsubsection \<open>Modus Ponens Tactics\<close> |
21539 | 217 |
|
61487
f8cb97e0fd0b
more symbols, with swapped defaults: old-style ASCII syntax uses "ASCII" print mode;
wenzelm
parents:
61378
diff
changeset
|
218 |
text \<open> |
62020 | 219 |
Finds \<open>P \<longrightarrow> Q\<close> and P in the assumptions, replaces implication by |
220 |
\<open>Q\<close>. |
|
61487
f8cb97e0fd0b
more symbols, with swapped defaults: old-style ASCII syntax uses "ASCII" print mode;
wenzelm
parents:
61378
diff
changeset
|
221 |
\<close> |
60770 | 222 |
ML \<open> |
61487
f8cb97e0fd0b
more symbols, with swapped defaults: old-style ASCII syntax uses "ASCII" print mode;
wenzelm
parents:
61378
diff
changeset
|
223 |
fun mp_tac ctxt i = |
f8cb97e0fd0b
more symbols, with swapped defaults: old-style ASCII syntax uses "ASCII" print mode;
wenzelm
parents:
61378
diff
changeset
|
224 |
eresolve_tac ctxt @{thms notE impE} i THEN assume_tac ctxt i; |
f8cb97e0fd0b
more symbols, with swapped defaults: old-style ASCII syntax uses "ASCII" print mode;
wenzelm
parents:
61378
diff
changeset
|
225 |
fun eq_mp_tac ctxt i = |
f8cb97e0fd0b
more symbols, with swapped defaults: old-style ASCII syntax uses "ASCII" print mode;
wenzelm
parents:
61378
diff
changeset
|
226 |
eresolve_tac ctxt @{thms notE impE} i THEN eq_assume_tac i; |
60770 | 227 |
\<close> |
21539 | 228 |
|
229 |
||
61487
f8cb97e0fd0b
more symbols, with swapped defaults: old-style ASCII syntax uses "ASCII" print mode;
wenzelm
parents:
61378
diff
changeset
|
230 |
subsection \<open>If-and-only-if\<close> |
21539 | 231 |
|
69590 | 232 |
lemma iffI: \<open>\<lbrakk>P \<Longrightarrow> Q; Q \<Longrightarrow> P\<rbrakk> \<Longrightarrow> P \<longleftrightarrow> Q\<close> |
71839 | 233 |
unfolding iff_def |
234 |
by (rule conjI; erule impI) |
|
21539 | 235 |
|
236 |
lemma iffE: |
|
69590 | 237 |
assumes major: \<open>P \<longleftrightarrow> Q\<close> |
71839 | 238 |
and r: \<open>\<lbrakk>P \<longrightarrow> Q; Q \<longrightarrow> P\<rbrakk> \<Longrightarrow> R\<close> |
69590 | 239 |
shows \<open>R\<close> |
71839 | 240 |
using major |
241 |
unfolding iff_def |
|
242 |
apply (rule conjE) |
|
21539 | 243 |
apply (erule r) |
244 |
apply assumption |
|
245 |
done |
|
246 |
||
247 |
||
62020 | 248 |
subsubsection \<open>Destruct rules for \<open>\<longleftrightarrow>\<close> similar to Modus Ponens\<close> |
61487
f8cb97e0fd0b
more symbols, with swapped defaults: old-style ASCII syntax uses "ASCII" print mode;
wenzelm
parents:
61378
diff
changeset
|
249 |
|
69590 | 250 |
lemma iffD1: \<open>\<lbrakk>P \<longleftrightarrow> Q; P\<rbrakk> \<Longrightarrow> Q\<close> |
71839 | 251 |
unfolding iff_def |
21539 | 252 |
apply (erule conjunct1 [THEN mp]) |
253 |
apply assumption |
|
254 |
done |
|
255 |
||
69590 | 256 |
lemma iffD2: \<open>\<lbrakk>P \<longleftrightarrow> Q; Q\<rbrakk> \<Longrightarrow> P\<close> |
71839 | 257 |
unfolding iff_def |
21539 | 258 |
apply (erule conjunct2 [THEN mp]) |
259 |
apply assumption |
|
260 |
done |
|
261 |
||
69590 | 262 |
lemma rev_iffD1: \<open>\<lbrakk>P; P \<longleftrightarrow> Q\<rbrakk> \<Longrightarrow> Q\<close> |
21539 | 263 |
apply (erule iffD1) |
264 |
apply assumption |
|
265 |
done |
|
266 |
||
69590 | 267 |
lemma rev_iffD2: \<open>\<lbrakk>Q; P \<longleftrightarrow> Q\<rbrakk> \<Longrightarrow> P\<close> |
21539 | 268 |
apply (erule iffD2) |
269 |
apply assumption |
|
270 |
done |
|
271 |
||
69590 | 272 |
lemma iff_refl: \<open>P \<longleftrightarrow> P\<close> |
21539 | 273 |
by (rule iffI) |
274 |
||
69590 | 275 |
lemma iff_sym: \<open>Q \<longleftrightarrow> P \<Longrightarrow> P \<longleftrightarrow> Q\<close> |
21539 | 276 |
apply (erule iffE) |
277 |
apply (rule iffI) |
|
278 |
apply (assumption | erule mp)+ |
|
279 |
done |
|
280 |
||
69590 | 281 |
lemma iff_trans: \<open>\<lbrakk>P \<longleftrightarrow> Q; Q \<longleftrightarrow> R\<rbrakk> \<Longrightarrow> P \<longleftrightarrow> R\<close> |
21539 | 282 |
apply (rule iffI) |
283 |
apply (assumption | erule iffE | erule (1) notE impE)+ |
|
284 |
done |
|
285 |
||
286 |
||
61487
f8cb97e0fd0b
more symbols, with swapped defaults: old-style ASCII syntax uses "ASCII" print mode;
wenzelm
parents:
61378
diff
changeset
|
287 |
subsection \<open>Unique existence\<close> |
f8cb97e0fd0b
more symbols, with swapped defaults: old-style ASCII syntax uses "ASCII" print mode;
wenzelm
parents:
61378
diff
changeset
|
288 |
|
f8cb97e0fd0b
more symbols, with swapped defaults: old-style ASCII syntax uses "ASCII" print mode;
wenzelm
parents:
61378
diff
changeset
|
289 |
text \<open> |
f8cb97e0fd0b
more symbols, with swapped defaults: old-style ASCII syntax uses "ASCII" print mode;
wenzelm
parents:
61378
diff
changeset
|
290 |
NOTE THAT the following 2 quantifications: |
21539 | 291 |
|
63906
fa799a8e4adc
repair LaTeX dropout from f83ef97d8d7d
Lars Hupel <lars.hupel@mytum.de>
parents:
63901
diff
changeset
|
292 |
\<^item> \<open>\<exists>!x\<close> such that [\<open>\<exists>!y\<close> such that P(x,y)] (sequential) |
fa799a8e4adc
repair LaTeX dropout from f83ef97d8d7d
Lars Hupel <lars.hupel@mytum.de>
parents:
63901
diff
changeset
|
293 |
\<^item> \<open>\<exists>!x,y\<close> such that P(x,y) (simultaneous) |
61487
f8cb97e0fd0b
more symbols, with swapped defaults: old-style ASCII syntax uses "ASCII" print mode;
wenzelm
parents:
61378
diff
changeset
|
294 |
|
63906
fa799a8e4adc
repair LaTeX dropout from f83ef97d8d7d
Lars Hupel <lars.hupel@mytum.de>
parents:
63901
diff
changeset
|
295 |
do NOT mean the same thing. The parser treats \<open>\<exists>!x y.P(x,y)\<close> as sequential. |
61487
f8cb97e0fd0b
more symbols, with swapped defaults: old-style ASCII syntax uses "ASCII" print mode;
wenzelm
parents:
61378
diff
changeset
|
296 |
\<close> |
f8cb97e0fd0b
more symbols, with swapped defaults: old-style ASCII syntax uses "ASCII" print mode;
wenzelm
parents:
61378
diff
changeset
|
297 |
|
69590 | 298 |
lemma ex1I: \<open>P(a) \<Longrightarrow> (\<And>x. P(x) \<Longrightarrow> x = a) \<Longrightarrow> \<exists>!x. P(x)\<close> |
71839 | 299 |
unfolding ex1_def |
23393 | 300 |
apply (assumption | rule exI conjI allI impI)+ |
21539 | 301 |
done |
302 |
||
61487
f8cb97e0fd0b
more symbols, with swapped defaults: old-style ASCII syntax uses "ASCII" print mode;
wenzelm
parents:
61378
diff
changeset
|
303 |
text \<open>Sometimes easier to use: the premises have no shared variables. Safe!\<close> |
69590 | 304 |
lemma ex_ex1I: \<open>\<exists>x. P(x) \<Longrightarrow> (\<And>x y. \<lbrakk>P(x); P(y)\<rbrakk> \<Longrightarrow> x = y) \<Longrightarrow> \<exists>!x. P(x)\<close> |
23393 | 305 |
apply (erule exE) |
306 |
apply (rule ex1I) |
|
307 |
apply assumption |
|
308 |
apply assumption |
|
21539 | 309 |
done |
310 |
||
69590 | 311 |
lemma ex1E: \<open>\<exists>! x. P(x) \<Longrightarrow> (\<And>x. \<lbrakk>P(x); \<forall>y. P(y) \<longrightarrow> y = x\<rbrakk> \<Longrightarrow> R) \<Longrightarrow> R\<close> |
71839 | 312 |
unfolding ex1_def |
21539 | 313 |
apply (assumption | erule exE conjE)+ |
314 |
done |
|
315 |
||
316 |
||
62020 | 317 |
subsubsection \<open>\<open>\<longleftrightarrow>\<close> congruence rules for simplification\<close> |
21539 | 318 |
|
62020 | 319 |
text \<open>Use \<open>iffE\<close> on a premise. For \<open>conj_cong\<close>, \<open>imp_cong\<close>, \<open>all_cong\<close>, \<open>ex_cong\<close>.\<close> |
60770 | 320 |
ML \<open> |
59529 | 321 |
fun iff_tac ctxt prems i = |
322 |
resolve_tac ctxt (prems RL @{thms iffE}) i THEN |
|
61487
f8cb97e0fd0b
more symbols, with swapped defaults: old-style ASCII syntax uses "ASCII" print mode;
wenzelm
parents:
61378
diff
changeset
|
323 |
REPEAT1 (eresolve_tac ctxt @{thms asm_rl mp} i); |
60770 | 324 |
\<close> |
21539 | 325 |
|
59529 | 326 |
method_setup iff = |
61487
f8cb97e0fd0b
more symbols, with swapped defaults: old-style ASCII syntax uses "ASCII" print mode;
wenzelm
parents:
61378
diff
changeset
|
327 |
\<open>Attrib.thms >> |
f8cb97e0fd0b
more symbols, with swapped defaults: old-style ASCII syntax uses "ASCII" print mode;
wenzelm
parents:
61378
diff
changeset
|
328 |
(fn prems => fn ctxt => SIMPLE_METHOD' (iff_tac ctxt prems))\<close> |
59529 | 329 |
|
21539 | 330 |
lemma conj_cong: |
69590 | 331 |
assumes \<open>P \<longleftrightarrow> P'\<close> |
332 |
and \<open>P' \<Longrightarrow> Q \<longleftrightarrow> Q'\<close> |
|
333 |
shows \<open>(P \<and> Q) \<longleftrightarrow> (P' \<and> Q')\<close> |
|
21539 | 334 |
apply (insert assms) |
59529 | 335 |
apply (assumption | rule iffI conjI | erule iffE conjE mp | iff assms)+ |
21539 | 336 |
done |
337 |
||
61487
f8cb97e0fd0b
more symbols, with swapped defaults: old-style ASCII syntax uses "ASCII" print mode;
wenzelm
parents:
61378
diff
changeset
|
338 |
text \<open>Reversed congruence rule! Used in ZF/Order.\<close> |
21539 | 339 |
lemma conj_cong2: |
69590 | 340 |
assumes \<open>P \<longleftrightarrow> P'\<close> |
341 |
and \<open>P' \<Longrightarrow> Q \<longleftrightarrow> Q'\<close> |
|
342 |
shows \<open>(Q \<and> P) \<longleftrightarrow> (Q' \<and> P')\<close> |
|
21539 | 343 |
apply (insert assms) |
59529 | 344 |
apply (assumption | rule iffI conjI | erule iffE conjE mp | iff assms)+ |
21539 | 345 |
done |
346 |
||
347 |
lemma disj_cong: |
|
69590 | 348 |
assumes \<open>P \<longleftrightarrow> P'\<close> and \<open>Q \<longleftrightarrow> Q'\<close> |
349 |
shows \<open>(P \<or> Q) \<longleftrightarrow> (P' \<or> Q')\<close> |
|
21539 | 350 |
apply (insert assms) |
61487
f8cb97e0fd0b
more symbols, with swapped defaults: old-style ASCII syntax uses "ASCII" print mode;
wenzelm
parents:
61378
diff
changeset
|
351 |
apply (erule iffE disjE disjI1 disjI2 | |
f8cb97e0fd0b
more symbols, with swapped defaults: old-style ASCII syntax uses "ASCII" print mode;
wenzelm
parents:
61378
diff
changeset
|
352 |
assumption | rule iffI | erule (1) notE impE)+ |
21539 | 353 |
done |
354 |
||
355 |
lemma imp_cong: |
|
69590 | 356 |
assumes \<open>P \<longleftrightarrow> P'\<close> |
357 |
and \<open>P' \<Longrightarrow> Q \<longleftrightarrow> Q'\<close> |
|
358 |
shows \<open>(P \<longrightarrow> Q) \<longleftrightarrow> (P' \<longrightarrow> Q')\<close> |
|
21539 | 359 |
apply (insert assms) |
59529 | 360 |
apply (assumption | rule iffI impI | erule iffE | erule (1) notE impE | iff assms)+ |
21539 | 361 |
done |
362 |
||
69590 | 363 |
lemma iff_cong: \<open>\<lbrakk>P \<longleftrightarrow> P'; Q \<longleftrightarrow> Q'\<rbrakk> \<Longrightarrow> (P \<longleftrightarrow> Q) \<longleftrightarrow> (P' \<longleftrightarrow> Q')\<close> |
21539 | 364 |
apply (erule iffE | assumption | rule iffI | erule (1) notE impE)+ |
365 |
done |
|
366 |
||
69590 | 367 |
lemma not_cong: \<open>P \<longleftrightarrow> P' \<Longrightarrow> \<not> P \<longleftrightarrow> \<not> P'\<close> |
21539 | 368 |
apply (assumption | rule iffI notI | erule (1) notE impE | erule iffE notE)+ |
369 |
done |
|
370 |
||
371 |
lemma all_cong: |
|
69590 | 372 |
assumes \<open>\<And>x. P(x) \<longleftrightarrow> Q(x)\<close> |
373 |
shows \<open>(\<forall>x. P(x)) \<longleftrightarrow> (\<forall>x. Q(x))\<close> |
|
59529 | 374 |
apply (assumption | rule iffI allI | erule (1) notE impE | erule allE | iff assms)+ |
21539 | 375 |
done |
376 |
||
377 |
lemma ex_cong: |
|
69590 | 378 |
assumes \<open>\<And>x. P(x) \<longleftrightarrow> Q(x)\<close> |
379 |
shows \<open>(\<exists>x. P(x)) \<longleftrightarrow> (\<exists>x. Q(x))\<close> |
|
59529 | 380 |
apply (erule exE | assumption | rule iffI exI | erule (1) notE impE | iff assms)+ |
21539 | 381 |
done |
382 |
||
383 |
lemma ex1_cong: |
|
69590 | 384 |
assumes \<open>\<And>x. P(x) \<longleftrightarrow> Q(x)\<close> |
385 |
shows \<open>(\<exists>!x. P(x)) \<longleftrightarrow> (\<exists>!x. Q(x))\<close> |
|
59529 | 386 |
apply (erule ex1E spec [THEN mp] | assumption | rule iffI ex1I | erule (1) notE impE | iff assms)+ |
21539 | 387 |
done |
388 |
||
389 |
||
61487
f8cb97e0fd0b
more symbols, with swapped defaults: old-style ASCII syntax uses "ASCII" print mode;
wenzelm
parents:
61378
diff
changeset
|
390 |
subsection \<open>Equality rules\<close> |
f8cb97e0fd0b
more symbols, with swapped defaults: old-style ASCII syntax uses "ASCII" print mode;
wenzelm
parents:
61378
diff
changeset
|
391 |
|
69590 | 392 |
lemma sym: \<open>a = b \<Longrightarrow> b = a\<close> |
21539 | 393 |
apply (erule subst) |
394 |
apply (rule refl) |
|
395 |
done |
|
396 |
||
69590 | 397 |
lemma trans: \<open>\<lbrakk>a = b; b = c\<rbrakk> \<Longrightarrow> a = c\<close> |
21539 | 398 |
apply (erule subst, assumption) |
399 |
done |
|
400 |
||
69590 | 401 |
lemma not_sym: \<open>b \<noteq> a \<Longrightarrow> a \<noteq> b\<close> |
21539 | 402 |
apply (erule contrapos) |
403 |
apply (erule sym) |
|
404 |
done |
|
405 |
||
61487
f8cb97e0fd0b
more symbols, with swapped defaults: old-style ASCII syntax uses "ASCII" print mode;
wenzelm
parents:
61378
diff
changeset
|
406 |
text \<open> |
f8cb97e0fd0b
more symbols, with swapped defaults: old-style ASCII syntax uses "ASCII" print mode;
wenzelm
parents:
61378
diff
changeset
|
407 |
Two theorems for rewriting only one instance of a definition: |
f8cb97e0fd0b
more symbols, with swapped defaults: old-style ASCII syntax uses "ASCII" print mode;
wenzelm
parents:
61378
diff
changeset
|
408 |
the first for definitions of formulae and the second for terms. |
f8cb97e0fd0b
more symbols, with swapped defaults: old-style ASCII syntax uses "ASCII" print mode;
wenzelm
parents:
61378
diff
changeset
|
409 |
\<close> |
f8cb97e0fd0b
more symbols, with swapped defaults: old-style ASCII syntax uses "ASCII" print mode;
wenzelm
parents:
61378
diff
changeset
|
410 |
|
69590 | 411 |
lemma def_imp_iff: \<open>(A \<equiv> B) \<Longrightarrow> A \<longleftrightarrow> B\<close> |
21539 | 412 |
apply unfold |
413 |
apply (rule iff_refl) |
|
414 |
done |
|
415 |
||
69590 | 416 |
lemma meta_eq_to_obj_eq: \<open>(A \<equiv> B) \<Longrightarrow> A = B\<close> |
21539 | 417 |
apply unfold |
418 |
apply (rule refl) |
|
419 |
done |
|
420 |
||
69590 | 421 |
lemma meta_eq_to_iff: \<open>x \<equiv> y \<Longrightarrow> x \<longleftrightarrow> y\<close> |
21539 | 422 |
by unfold (rule iff_refl) |
423 |
||
61487
f8cb97e0fd0b
more symbols, with swapped defaults: old-style ASCII syntax uses "ASCII" print mode;
wenzelm
parents:
61378
diff
changeset
|
424 |
text \<open>Substitution.\<close> |
69590 | 425 |
lemma ssubst: \<open>\<lbrakk>b = a; P(a)\<rbrakk> \<Longrightarrow> P(b)\<close> |
21539 | 426 |
apply (drule sym) |
427 |
apply (erule (1) subst) |
|
428 |
done |
|
429 |
||
62020 | 430 |
text \<open>A special case of \<open>ex1E\<close> that would otherwise need quantifier |
61487
f8cb97e0fd0b
more symbols, with swapped defaults: old-style ASCII syntax uses "ASCII" print mode;
wenzelm
parents:
61378
diff
changeset
|
431 |
expansion.\<close> |
69590 | 432 |
lemma ex1_equalsE: \<open>\<lbrakk>\<exists>!x. P(x); P(a); P(b)\<rbrakk> \<Longrightarrow> a = b\<close> |
21539 | 433 |
apply (erule ex1E) |
434 |
apply (rule trans) |
|
435 |
apply (rule_tac [2] sym) |
|
436 |
apply (assumption | erule spec [THEN mp])+ |
|
437 |
done |
|
438 |
||
439 |
||
61487
f8cb97e0fd0b
more symbols, with swapped defaults: old-style ASCII syntax uses "ASCII" print mode;
wenzelm
parents:
61378
diff
changeset
|
440 |
subsection \<open>Simplifications of assumed implications\<close> |
f8cb97e0fd0b
more symbols, with swapped defaults: old-style ASCII syntax uses "ASCII" print mode;
wenzelm
parents:
61378
diff
changeset
|
441 |
|
f8cb97e0fd0b
more symbols, with swapped defaults: old-style ASCII syntax uses "ASCII" print mode;
wenzelm
parents:
61378
diff
changeset
|
442 |
text \<open> |
62020 | 443 |
Roy Dyckhoff has proved that \<open>conj_impE\<close>, \<open>disj_impE\<close>, and |
69593 | 444 |
\<open>imp_impE\<close> used with \<^ML>\<open>mp_tac\<close> (restricted to atomic formulae) is |
61487
f8cb97e0fd0b
more symbols, with swapped defaults: old-style ASCII syntax uses "ASCII" print mode;
wenzelm
parents:
61378
diff
changeset
|
445 |
COMPLETE for intuitionistic propositional logic. |
f8cb97e0fd0b
more symbols, with swapped defaults: old-style ASCII syntax uses "ASCII" print mode;
wenzelm
parents:
61378
diff
changeset
|
446 |
|
f8cb97e0fd0b
more symbols, with swapped defaults: old-style ASCII syntax uses "ASCII" print mode;
wenzelm
parents:
61378
diff
changeset
|
447 |
See R. Dyckhoff, Contraction-free sequent calculi for intuitionistic logic |
f8cb97e0fd0b
more symbols, with swapped defaults: old-style ASCII syntax uses "ASCII" print mode;
wenzelm
parents:
61378
diff
changeset
|
448 |
(preprint, University of St Andrews, 1991). |
f8cb97e0fd0b
more symbols, with swapped defaults: old-style ASCII syntax uses "ASCII" print mode;
wenzelm
parents:
61378
diff
changeset
|
449 |
\<close> |
21539 | 450 |
|
451 |
lemma conj_impE: |
|
69590 | 452 |
assumes major: \<open>(P \<and> Q) \<longrightarrow> S\<close> |
453 |
and r: \<open>P \<longrightarrow> (Q \<longrightarrow> S) \<Longrightarrow> R\<close> |
|
454 |
shows \<open>R\<close> |
|
21539 | 455 |
by (assumption | rule conjI impI major [THEN mp] r)+ |
456 |
||
457 |
lemma disj_impE: |
|
69590 | 458 |
assumes major: \<open>(P \<or> Q) \<longrightarrow> S\<close> |
459 |
and r: \<open>\<lbrakk>P \<longrightarrow> S; Q \<longrightarrow> S\<rbrakk> \<Longrightarrow> R\<close> |
|
460 |
shows \<open>R\<close> |
|
21539 | 461 |
by (assumption | rule disjI1 disjI2 impI major [THEN mp] r)+ |
462 |
||
61487
f8cb97e0fd0b
more symbols, with swapped defaults: old-style ASCII syntax uses "ASCII" print mode;
wenzelm
parents:
61378
diff
changeset
|
463 |
text \<open>Simplifies the implication. Classical version is stronger. |
f8cb97e0fd0b
more symbols, with swapped defaults: old-style ASCII syntax uses "ASCII" print mode;
wenzelm
parents:
61378
diff
changeset
|
464 |
Still UNSAFE since Q must be provable -- backtracking needed.\<close> |
21539 | 465 |
lemma imp_impE: |
69590 | 466 |
assumes major: \<open>(P \<longrightarrow> Q) \<longrightarrow> S\<close> |
467 |
and r1: \<open>\<lbrakk>P; Q \<longrightarrow> S\<rbrakk> \<Longrightarrow> Q\<close> |
|
468 |
and r2: \<open>S \<Longrightarrow> R\<close> |
|
469 |
shows \<open>R\<close> |
|
21539 | 470 |
by (assumption | rule impI major [THEN mp] r1 r2)+ |
471 |
||
61487
f8cb97e0fd0b
more symbols, with swapped defaults: old-style ASCII syntax uses "ASCII" print mode;
wenzelm
parents:
61378
diff
changeset
|
472 |
text \<open>Simplifies the implication. Classical version is stronger. |
f8cb97e0fd0b
more symbols, with swapped defaults: old-style ASCII syntax uses "ASCII" print mode;
wenzelm
parents:
61378
diff
changeset
|
473 |
Still UNSAFE since ~P must be provable -- backtracking needed.\<close> |
69590 | 474 |
lemma not_impE: \<open>\<not> P \<longrightarrow> S \<Longrightarrow> (P \<Longrightarrow> False) \<Longrightarrow> (S \<Longrightarrow> R) \<Longrightarrow> R\<close> |
23393 | 475 |
apply (drule mp) |
71839 | 476 |
apply (rule notI | assumption)+ |
21539 | 477 |
done |
478 |
||
61487
f8cb97e0fd0b
more symbols, with swapped defaults: old-style ASCII syntax uses "ASCII" print mode;
wenzelm
parents:
61378
diff
changeset
|
479 |
text \<open>Simplifies the implication. UNSAFE.\<close> |
21539 | 480 |
lemma iff_impE: |
69590 | 481 |
assumes major: \<open>(P \<longleftrightarrow> Q) \<longrightarrow> S\<close> |
482 |
and r1: \<open>\<lbrakk>P; Q \<longrightarrow> S\<rbrakk> \<Longrightarrow> Q\<close> |
|
483 |
and r2: \<open>\<lbrakk>Q; P \<longrightarrow> S\<rbrakk> \<Longrightarrow> P\<close> |
|
484 |
and r3: \<open>S \<Longrightarrow> R\<close> |
|
485 |
shows \<open>R\<close> |
|
71839 | 486 |
by (assumption | rule iffI impI major [THEN mp] r1 r2 r3)+ |
21539 | 487 |
|
62020 | 488 |
text \<open>What if \<open>(\<forall>x. \<not> \<not> P(x)) \<longrightarrow> \<not> \<not> (\<forall>x. P(x))\<close> is an assumption? |
61487
f8cb97e0fd0b
more symbols, with swapped defaults: old-style ASCII syntax uses "ASCII" print mode;
wenzelm
parents:
61378
diff
changeset
|
489 |
UNSAFE.\<close> |
21539 | 490 |
lemma all_impE: |
69590 | 491 |
assumes major: \<open>(\<forall>x. P(x)) \<longrightarrow> S\<close> |
492 |
and r1: \<open>\<And>x. P(x)\<close> |
|
493 |
and r2: \<open>S \<Longrightarrow> R\<close> |
|
494 |
shows \<open>R\<close> |
|
71839 | 495 |
by (rule allI impI major [THEN mp] r1 r2)+ |
21539 | 496 |
|
61487
f8cb97e0fd0b
more symbols, with swapped defaults: old-style ASCII syntax uses "ASCII" print mode;
wenzelm
parents:
61378
diff
changeset
|
497 |
text \<open> |
62020 | 498 |
Unsafe: \<open>\<exists>x. P(x)) \<longrightarrow> S\<close> is equivalent |
499 |
to \<open>\<forall>x. P(x) \<longrightarrow> S\<close>.\<close> |
|
21539 | 500 |
lemma ex_impE: |
69590 | 501 |
assumes major: \<open>(\<exists>x. P(x)) \<longrightarrow> S\<close> |
502 |
and r: \<open>P(x) \<longrightarrow> S \<Longrightarrow> R\<close> |
|
503 |
shows \<open>R\<close> |
|
71839 | 504 |
by (assumption | rule exI impI major [THEN mp] r)+ |
21539 | 505 |
|
61487
f8cb97e0fd0b
more symbols, with swapped defaults: old-style ASCII syntax uses "ASCII" print mode;
wenzelm
parents:
61378
diff
changeset
|
506 |
text \<open>Courtesy of Krzysztof Grabczewski.\<close> |
69590 | 507 |
lemma disj_imp_disj: \<open>P \<or> Q \<Longrightarrow> (P \<Longrightarrow> R) \<Longrightarrow> (Q \<Longrightarrow> S) \<Longrightarrow> R \<or> S\<close> |
23393 | 508 |
apply (erule disjE) |
21539 | 509 |
apply (rule disjI1) apply assumption |
510 |
apply (rule disjI2) apply assumption |
|
511 |
done |
|
11734 | 512 |
|
60770 | 513 |
ML \<open> |
32172 | 514 |
structure Project_Rule = Project_Rule |
515 |
( |
|
22139 | 516 |
val conjunct1 = @{thm conjunct1} |
517 |
val conjunct2 = @{thm conjunct2} |
|
518 |
val mp = @{thm mp} |
|
32172 | 519 |
) |
60770 | 520 |
\<close> |
18481 | 521 |
|
69605 | 522 |
ML_file \<open>fologic.ML\<close> |
21539 | 523 |
|
69590 | 524 |
lemma thin_refl: \<open>\<lbrakk>x = x; PROP W\<rbrakk> \<Longrightarrow> PROP W\<close> . |
21539 | 525 |
|
60770 | 526 |
ML \<open> |
42799 | 527 |
structure Hypsubst = Hypsubst |
528 |
( |
|
529 |
val dest_eq = FOLogic.dest_eq |
|
530 |
val dest_Trueprop = FOLogic.dest_Trueprop |
|
531 |
val dest_imp = FOLogic.dest_imp |
|
532 |
val eq_reflection = @{thm eq_reflection} |
|
533 |
val rev_eq_reflection = @{thm meta_eq_to_obj_eq} |
|
534 |
val imp_intr = @{thm impI} |
|
535 |
val rev_mp = @{thm rev_mp} |
|
536 |
val subst = @{thm subst} |
|
537 |
val sym = @{thm sym} |
|
538 |
val thin_refl = @{thm thin_refl} |
|
539 |
); |
|
540 |
open Hypsubst; |
|
60770 | 541 |
\<close> |
42799 | 542 |
|
69605 | 543 |
ML_file \<open>intprover.ML\<close> |
7355
4c43090659ca
proper bootstrap of IFOL/FOL theories and packages;
wenzelm
parents:
6340
diff
changeset
|
544 |
|
4092 | 545 |
|
60770 | 546 |
subsection \<open>Intuitionistic Reasoning\<close> |
12368 | 547 |
|
69593 | 548 |
setup \<open>Intuitionistic.method_setup \<^binding>\<open>iprover\<close>\<close> |
30165
6ee87f67d9cd
moved generic intuitionistic prover to src/Tools/intuitionistic.ML;
wenzelm
parents:
30160
diff
changeset
|
549 |
|
12349 | 550 |
lemma impE': |
69590 | 551 |
assumes 1: \<open>P \<longrightarrow> Q\<close> |
552 |
and 2: \<open>Q \<Longrightarrow> R\<close> |
|
553 |
and 3: \<open>P \<longrightarrow> Q \<Longrightarrow> P\<close> |
|
554 |
shows \<open>R\<close> |
|
12349 | 555 |
proof - |
69590 | 556 |
from 3 and 1 have \<open>P\<close> . |
557 |
with 1 have \<open>Q\<close> by (rule impE) |
|
558 |
with 2 show \<open>R\<close> . |
|
12349 | 559 |
qed |
560 |
||
561 |
lemma allE': |
|
69590 | 562 |
assumes 1: \<open>\<forall>x. P(x)\<close> |
563 |
and 2: \<open>P(x) \<Longrightarrow> \<forall>x. P(x) \<Longrightarrow> Q\<close> |
|
564 |
shows \<open>Q\<close> |
|
12349 | 565 |
proof - |
69590 | 566 |
from 1 have \<open>P(x)\<close> by (rule spec) |
567 |
from this and 1 show \<open>Q\<close> by (rule 2) |
|
12349 | 568 |
qed |
569 |
||
12937
0c4fd7529467
clarified syntax of ``long'' statements: fixes/assumes/shows;
wenzelm
parents:
12875
diff
changeset
|
570 |
lemma notE': |
69590 | 571 |
assumes 1: \<open>\<not> P\<close> |
572 |
and 2: \<open>\<not> P \<Longrightarrow> P\<close> |
|
573 |
shows \<open>R\<close> |
|
12349 | 574 |
proof - |
69590 | 575 |
from 2 and 1 have \<open>P\<close> . |
576 |
with 1 show \<open>R\<close> by (rule notE) |
|
12349 | 577 |
qed |
578 |
||
579 |
lemmas [Pure.elim!] = disjE iffE FalseE conjE exE |
|
580 |
and [Pure.intro!] = iffI conjI impI TrueI notI allI refl |
|
581 |
and [Pure.elim 2] = allE notE' impE' |
|
582 |
and [Pure.intro] = exI disjI2 disjI1 |
|
583 |
||
61487
f8cb97e0fd0b
more symbols, with swapped defaults: old-style ASCII syntax uses "ASCII" print mode;
wenzelm
parents:
61378
diff
changeset
|
584 |
setup \<open> |
f8cb97e0fd0b
more symbols, with swapped defaults: old-style ASCII syntax uses "ASCII" print mode;
wenzelm
parents:
61378
diff
changeset
|
585 |
Context_Rules.addSWrapper |
f8cb97e0fd0b
more symbols, with swapped defaults: old-style ASCII syntax uses "ASCII" print mode;
wenzelm
parents:
61378
diff
changeset
|
586 |
(fn ctxt => fn tac => hyp_subst_tac ctxt ORELSE' tac) |
f8cb97e0fd0b
more symbols, with swapped defaults: old-style ASCII syntax uses "ASCII" print mode;
wenzelm
parents:
61378
diff
changeset
|
587 |
\<close> |
12349 | 588 |
|
589 |
||
69590 | 590 |
lemma iff_not_sym: \<open>\<not> (Q \<longleftrightarrow> P) \<Longrightarrow> \<not> (P \<longleftrightarrow> Q)\<close> |
17591 | 591 |
by iprover |
12368 | 592 |
|
593 |
lemmas [sym] = sym iff_sym not_sym iff_not_sym |
|
594 |
and [Pure.elim?] = iffD1 iffD2 impE |
|
595 |
||
596 |
||
69590 | 597 |
lemma eq_commute: \<open>a = b \<longleftrightarrow> b = a\<close> |
71839 | 598 |
by iprover |
599 |
||
600 |
||
601 |
subsection \<open>Polymorphic congruence rules\<close> |
|
602 |
||
603 |
lemma subst_context: \<open>a = b \<Longrightarrow> t(a) = t(b)\<close> |
|
604 |
by iprover |
|
605 |
||
606 |
lemma subst_context2: \<open>\<lbrakk>a = b; c = d\<rbrakk> \<Longrightarrow> t(a,c) = t(b,d)\<close> |
|
607 |
by iprover |
|
608 |
||
609 |
lemma subst_context3: \<open>\<lbrakk>a = b; c = d; e = f\<rbrakk> \<Longrightarrow> t(a,c,e) = t(b,d,f)\<close> |
|
610 |
by iprover |
|
611 |
||
612 |
text \<open> |
|
613 |
Useful with \<^ML>\<open>eresolve_tac\<close> for proving equalities from known |
|
614 |
equalities. |
|
615 |
||
616 |
a = b |
|
617 |
| | |
|
618 |
c = d |
|
619 |
\<close> |
|
620 |
lemma box_equals: \<open>\<lbrakk>a = b; a = c; b = d\<rbrakk> \<Longrightarrow> c = d\<close> |
|
621 |
by iprover |
|
622 |
||
623 |
text \<open>Dual of \<open>box_equals\<close>: for proving equalities backwards.\<close> |
|
624 |
lemma simp_equals: \<open>\<lbrakk>a = c; b = d; c = d\<rbrakk> \<Longrightarrow> a = b\<close> |
|
625 |
by iprover |
|
626 |
||
627 |
||
628 |
subsubsection \<open>Congruence rules for predicate letters\<close> |
|
629 |
||
630 |
lemma pred1_cong: \<open>a = a' \<Longrightarrow> P(a) \<longleftrightarrow> P(a')\<close> |
|
631 |
by iprover |
|
632 |
||
633 |
lemma pred2_cong: \<open>\<lbrakk>a = a'; b = b'\<rbrakk> \<Longrightarrow> P(a,b) \<longleftrightarrow> P(a',b')\<close> |
|
634 |
by iprover |
|
635 |
||
636 |
lemma pred3_cong: \<open>\<lbrakk>a = a'; b = b'; c = c'\<rbrakk> \<Longrightarrow> P(a,b,c) \<longleftrightarrow> P(a',b',c')\<close> |
|
637 |
by iprover |
|
638 |
||
639 |
text \<open>Special case for the equality predicate!\<close> |
|
640 |
lemma eq_cong: \<open>\<lbrakk>a = a'; b = b'\<rbrakk> \<Longrightarrow> a = b \<longleftrightarrow> a' = b'\<close> |
|
641 |
by iprover |
|
13435 | 642 |
|
643 |
||
60770 | 644 |
subsection \<open>Atomizing meta-level rules\<close> |
11677 | 645 |
|
69590 | 646 |
lemma atomize_all [atomize]: \<open>(\<And>x. P(x)) \<equiv> Trueprop (\<forall>x. P(x))\<close> |
11976 | 647 |
proof |
69590 | 648 |
assume \<open>\<And>x. P(x)\<close> |
649 |
then show \<open>\<forall>x. P(x)\<close> .. |
|
11677 | 650 |
next |
69590 | 651 |
assume \<open>\<forall>x. P(x)\<close> |
652 |
then show \<open>\<And>x. P(x)\<close> .. |
|
11677 | 653 |
qed |
654 |
||
69590 | 655 |
lemma atomize_imp [atomize]: \<open>(A \<Longrightarrow> B) \<equiv> Trueprop (A \<longrightarrow> B)\<close> |
11976 | 656 |
proof |
69590 | 657 |
assume \<open>A \<Longrightarrow> B\<close> |
658 |
then show \<open>A \<longrightarrow> B\<close> .. |
|
11677 | 659 |
next |
69590 | 660 |
assume \<open>A \<longrightarrow> B\<close> and \<open>A\<close> |
661 |
then show \<open>B\<close> by (rule mp) |
|
11677 | 662 |
qed |
663 |
||
69590 | 664 |
lemma atomize_eq [atomize]: \<open>(x \<equiv> y) \<equiv> Trueprop (x = y)\<close> |
11976 | 665 |
proof |
69590 | 666 |
assume \<open>x \<equiv> y\<close> |
667 |
show \<open>x = y\<close> unfolding \<open>x \<equiv> y\<close> by (rule refl) |
|
11677 | 668 |
next |
69590 | 669 |
assume \<open>x = y\<close> |
670 |
then show \<open>x \<equiv> y\<close> by (rule eq_reflection) |
|
11677 | 671 |
qed |
672 |
||
69590 | 673 |
lemma atomize_iff [atomize]: \<open>(A \<equiv> B) \<equiv> Trueprop (A \<longleftrightarrow> B)\<close> |
18813 | 674 |
proof |
69590 | 675 |
assume \<open>A \<equiv> B\<close> |
676 |
show \<open>A \<longleftrightarrow> B\<close> unfolding \<open>A \<equiv> B\<close> by (rule iff_refl) |
|
18813 | 677 |
next |
69590 | 678 |
assume \<open>A \<longleftrightarrow> B\<close> |
679 |
then show \<open>A \<equiv> B\<close> by (rule iff_reflection) |
|
18813 | 680 |
qed |
681 |
||
69590 | 682 |
lemma atomize_conj [atomize]: \<open>(A &&& B) \<equiv> Trueprop (A \<and> B)\<close> |
11976 | 683 |
proof |
69590 | 684 |
assume conj: \<open>A &&& B\<close> |
685 |
show \<open>A \<and> B\<close> |
|
19120
353d349740de
not_equal: replaced syntax translation by abbreviation;
wenzelm
parents:
18861
diff
changeset
|
686 |
proof (rule conjI) |
69590 | 687 |
from conj show \<open>A\<close> by (rule conjunctionD1) |
688 |
from conj show \<open>B\<close> by (rule conjunctionD2) |
|
19120
353d349740de
not_equal: replaced syntax translation by abbreviation;
wenzelm
parents:
18861
diff
changeset
|
689 |
qed |
11953 | 690 |
next |
69590 | 691 |
assume conj: \<open>A \<and> B\<close> |
692 |
show \<open>A &&& B\<close> |
|
19120
353d349740de
not_equal: replaced syntax translation by abbreviation;
wenzelm
parents:
18861
diff
changeset
|
693 |
proof - |
69590 | 694 |
from conj show \<open>A\<close> .. |
695 |
from conj show \<open>B\<close> .. |
|
11953 | 696 |
qed |
697 |
qed |
|
698 |
||
12368 | 699 |
lemmas [symmetric, rulify] = atomize_all atomize_imp |
18861 | 700 |
and [symmetric, defn] = atomize_all atomize_imp atomize_eq atomize_iff |
11771 | 701 |
|
11848 | 702 |
|
60770 | 703 |
subsection \<open>Atomizing elimination rules\<close> |
26580
c3e597a476fd
Generic conversion and tactic "atomize_elim" to convert elimination rules
krauss
parents:
26286
diff
changeset
|
704 |
|
69590 | 705 |
lemma atomize_exL[atomize_elim]: \<open>(\<And>x. P(x) \<Longrightarrow> Q) \<equiv> ((\<exists>x. P(x)) \<Longrightarrow> Q)\<close> |
57948 | 706 |
by rule iprover+ |
26580
c3e597a476fd
Generic conversion and tactic "atomize_elim" to convert elimination rules
krauss
parents:
26286
diff
changeset
|
707 |
|
69590 | 708 |
lemma atomize_conjL[atomize_elim]: \<open>(A \<Longrightarrow> B \<Longrightarrow> C) \<equiv> (A \<and> B \<Longrightarrow> C)\<close> |
57948 | 709 |
by rule iprover+ |
26580
c3e597a476fd
Generic conversion and tactic "atomize_elim" to convert elimination rules
krauss
parents:
26286
diff
changeset
|
710 |
|
69590 | 711 |
lemma atomize_disjL[atomize_elim]: \<open>((A \<Longrightarrow> C) \<Longrightarrow> (B \<Longrightarrow> C) \<Longrightarrow> C) \<equiv> ((A \<or> B \<Longrightarrow> C) \<Longrightarrow> C)\<close> |
57948 | 712 |
by rule iprover+ |
26580
c3e597a476fd
Generic conversion and tactic "atomize_elim" to convert elimination rules
krauss
parents:
26286
diff
changeset
|
713 |
|
69590 | 714 |
lemma atomize_elimL[atomize_elim]: \<open>(\<And>B. (A \<Longrightarrow> B) \<Longrightarrow> B) \<equiv> Trueprop(A)\<close> .. |
26580
c3e597a476fd
Generic conversion and tactic "atomize_elim" to convert elimination rules
krauss
parents:
26286
diff
changeset
|
715 |
|
c3e597a476fd
Generic conversion and tactic "atomize_elim" to convert elimination rules
krauss
parents:
26286
diff
changeset
|
716 |
|
60770 | 717 |
subsection \<open>Calculational rules\<close> |
11848 | 718 |
|
69590 | 719 |
lemma forw_subst: \<open>a = b \<Longrightarrow> P(b) \<Longrightarrow> P(a)\<close> |
11848 | 720 |
by (rule ssubst) |
721 |
||
69590 | 722 |
lemma back_subst: \<open>P(a) \<Longrightarrow> a = b \<Longrightarrow> P(b)\<close> |
11848 | 723 |
by (rule subst) |
724 |
||
60770 | 725 |
text \<open> |
11848 | 726 |
Note that this list of rules is in reverse order of priorities. |
60770 | 727 |
\<close> |
11848 | 728 |
|
12019 | 729 |
lemmas basic_trans_rules [trans] = |
11848 | 730 |
forw_subst |
731 |
back_subst |
|
732 |
rev_mp |
|
733 |
mp |
|
734 |
trans |
|
735 |
||
61487
f8cb97e0fd0b
more symbols, with swapped defaults: old-style ASCII syntax uses "ASCII" print mode;
wenzelm
parents:
61378
diff
changeset
|
736 |
|
60770 | 737 |
subsection \<open>``Let'' declarations\<close> |
13779 | 738 |
|
41229
d797baa3d57c
replaced command 'nonterminals' by slightly modernized version 'nonterminal';
wenzelm
parents:
39557
diff
changeset
|
739 |
nonterminal letbinds and letbind |
13779 | 740 |
|
69590 | 741 |
definition Let :: \<open>['a::{}, 'a => 'b] \<Rightarrow> ('b::{})\<close> |
742 |
where \<open>Let(s, f) \<equiv> f(s)\<close> |
|
13779 | 743 |
|
744 |
syntax |
|
69590 | 745 |
"_bind" :: \<open>[pttrn, 'a] => letbind\<close> (\<open>(2_ =/ _)\<close> 10) |
746 |
"" :: \<open>letbind => letbinds\<close> (\<open>_\<close>) |
|
747 |
"_binds" :: \<open>[letbind, letbinds] => letbinds\<close> (\<open>_;/ _\<close>) |
|
748 |
"_Let" :: \<open>[letbinds, 'a] => 'a\<close> (\<open>(let (_)/ in (_))\<close> 10) |
|
13779 | 749 |
|
750 |
translations |
|
751 |
"_Let(_binds(b, bs), e)" == "_Let(b, _Let(bs, e))" |
|
61487
f8cb97e0fd0b
more symbols, with swapped defaults: old-style ASCII syntax uses "ASCII" print mode;
wenzelm
parents:
61378
diff
changeset
|
752 |
"let x = a in e" == "CONST Let(a, \<lambda>x. e)" |
13779 | 753 |
|
61487
f8cb97e0fd0b
more symbols, with swapped defaults: old-style ASCII syntax uses "ASCII" print mode;
wenzelm
parents:
61378
diff
changeset
|
754 |
lemma LetI: |
69590 | 755 |
assumes \<open>\<And>x. x = t \<Longrightarrow> P(u(x))\<close> |
756 |
shows \<open>P(let x = t in u(x))\<close> |
|
71839 | 757 |
unfolding Let_def |
21539 | 758 |
apply (rule refl [THEN assms]) |
759 |
done |
|
760 |
||
761 |
||
60770 | 762 |
subsection \<open>Intuitionistic simplification rules\<close> |
26286 | 763 |
|
764 |
lemma conj_simps: |
|
69590 | 765 |
\<open>P \<and> True \<longleftrightarrow> P\<close> |
766 |
\<open>True \<and> P \<longleftrightarrow> P\<close> |
|
767 |
\<open>P \<and> False \<longleftrightarrow> False\<close> |
|
768 |
\<open>False \<and> P \<longleftrightarrow> False\<close> |
|
769 |
\<open>P \<and> P \<longleftrightarrow> P\<close> |
|
770 |
\<open>P \<and> P \<and> Q \<longleftrightarrow> P \<and> Q\<close> |
|
771 |
\<open>P \<and> \<not> P \<longleftrightarrow> False\<close> |
|
772 |
\<open>\<not> P \<and> P \<longleftrightarrow> False\<close> |
|
773 |
\<open>(P \<and> Q) \<and> R \<longleftrightarrow> P \<and> (Q \<and> R)\<close> |
|
26286 | 774 |
by iprover+ |
775 |
||
776 |
lemma disj_simps: |
|
69590 | 777 |
\<open>P \<or> True \<longleftrightarrow> True\<close> |
778 |
\<open>True \<or> P \<longleftrightarrow> True\<close> |
|
779 |
\<open>P \<or> False \<longleftrightarrow> P\<close> |
|
780 |
\<open>False \<or> P \<longleftrightarrow> P\<close> |
|
781 |
\<open>P \<or> P \<longleftrightarrow> P\<close> |
|
782 |
\<open>P \<or> P \<or> Q \<longleftrightarrow> P \<or> Q\<close> |
|
783 |
\<open>(P \<or> Q) \<or> R \<longleftrightarrow> P \<or> (Q \<or> R)\<close> |
|
26286 | 784 |
by iprover+ |
785 |
||
786 |
lemma not_simps: |
|
69590 | 787 |
\<open>\<not> (P \<or> Q) \<longleftrightarrow> \<not> P \<and> \<not> Q\<close> |
788 |
\<open>\<not> False \<longleftrightarrow> True\<close> |
|
789 |
\<open>\<not> True \<longleftrightarrow> False\<close> |
|
26286 | 790 |
by iprover+ |
791 |
||
792 |
lemma imp_simps: |
|
69590 | 793 |
\<open>(P \<longrightarrow> False) \<longleftrightarrow> \<not> P\<close> |
794 |
\<open>(P \<longrightarrow> True) \<longleftrightarrow> True\<close> |
|
795 |
\<open>(False \<longrightarrow> P) \<longleftrightarrow> True\<close> |
|
796 |
\<open>(True \<longrightarrow> P) \<longleftrightarrow> P\<close> |
|
797 |
\<open>(P \<longrightarrow> P) \<longleftrightarrow> True\<close> |
|
798 |
\<open>(P \<longrightarrow> \<not> P) \<longleftrightarrow> \<not> P\<close> |
|
26286 | 799 |
by iprover+ |
800 |
||
801 |
lemma iff_simps: |
|
69590 | 802 |
\<open>(True \<longleftrightarrow> P) \<longleftrightarrow> P\<close> |
803 |
\<open>(P \<longleftrightarrow> True) \<longleftrightarrow> P\<close> |
|
804 |
\<open>(P \<longleftrightarrow> P) \<longleftrightarrow> True\<close> |
|
805 |
\<open>(False \<longleftrightarrow> P) \<longleftrightarrow> \<not> P\<close> |
|
806 |
\<open>(P \<longleftrightarrow> False) \<longleftrightarrow> \<not> P\<close> |
|
26286 | 807 |
by iprover+ |
808 |
||
62020 | 809 |
text \<open>The \<open>x = t\<close> versions are needed for the simplification |
61487
f8cb97e0fd0b
more symbols, with swapped defaults: old-style ASCII syntax uses "ASCII" print mode;
wenzelm
parents:
61378
diff
changeset
|
810 |
procedures.\<close> |
26286 | 811 |
lemma quant_simps: |
69590 | 812 |
\<open>\<And>P. (\<forall>x. P) \<longleftrightarrow> P\<close> |
813 |
\<open>(\<forall>x. x = t \<longrightarrow> P(x)) \<longleftrightarrow> P(t)\<close> |
|
814 |
\<open>(\<forall>x. t = x \<longrightarrow> P(x)) \<longleftrightarrow> P(t)\<close> |
|
815 |
\<open>\<And>P. (\<exists>x. P) \<longleftrightarrow> P\<close> |
|
816 |
\<open>\<exists>x. x = t\<close> |
|
817 |
\<open>\<exists>x. t = x\<close> |
|
818 |
\<open>(\<exists>x. x = t \<and> P(x)) \<longleftrightarrow> P(t)\<close> |
|
819 |
\<open>(\<exists>x. t = x \<and> P(x)) \<longleftrightarrow> P(t)\<close> |
|
26286 | 820 |
by iprover+ |
821 |
||
61487
f8cb97e0fd0b
more symbols, with swapped defaults: old-style ASCII syntax uses "ASCII" print mode;
wenzelm
parents:
61378
diff
changeset
|
822 |
text \<open>These are NOT supplied by default!\<close> |
26286 | 823 |
lemma distrib_simps: |
69590 | 824 |
\<open>P \<and> (Q \<or> R) \<longleftrightarrow> P \<and> Q \<or> P \<and> R\<close> |
825 |
\<open>(Q \<or> R) \<and> P \<longleftrightarrow> Q \<and> P \<or> R \<and> P\<close> |
|
826 |
\<open>(P \<or> Q \<longrightarrow> R) \<longleftrightarrow> (P \<longrightarrow> R) \<and> (Q \<longrightarrow> R)\<close> |
|
26286 | 827 |
by iprover+ |
828 |
||
71919 | 829 |
lemma subst_all: |
830 |
\<open>(\<And>x. x = a \<Longrightarrow> PROP P(x)) \<equiv> PROP P(a)\<close> |
|
831 |
\<open>(\<And>x. a = x \<Longrightarrow> PROP P(x)) \<equiv> PROP P(a)\<close> |
|
71959 | 832 |
proof - |
833 |
show \<open>(\<And>x. x = a \<Longrightarrow> PROP P(x)) \<equiv> PROP P(a)\<close> |
|
834 |
proof (rule equal_intr_rule) |
|
835 |
assume *: \<open>\<And>x. x = a \<Longrightarrow> PROP P(x)\<close> |
|
836 |
show \<open>PROP P(a)\<close> |
|
837 |
by (rule *) (rule refl) |
|
838 |
next |
|
839 |
fix x |
|
840 |
assume \<open>PROP P(a)\<close> and \<open>x = a\<close> |
|
841 |
from \<open>x = a\<close> have \<open>x \<equiv> a\<close> |
|
842 |
by (rule eq_reflection) |
|
843 |
with \<open>PROP P(a)\<close> show \<open>PROP P(x)\<close> |
|
844 |
by simp |
|
845 |
qed |
|
846 |
show \<open>(\<And>x. a = x \<Longrightarrow> PROP P(x)) \<equiv> PROP P(a)\<close> |
|
847 |
proof (rule equal_intr_rule) |
|
848 |
assume *: \<open>\<And>x. a = x \<Longrightarrow> PROP P(x)\<close> |
|
849 |
show \<open>PROP P(a)\<close> |
|
850 |
by (rule *) (rule refl) |
|
851 |
next |
|
852 |
fix x |
|
853 |
assume \<open>PROP P(a)\<close> and \<open>a = x\<close> |
|
854 |
from \<open>a = x\<close> have \<open>a \<equiv> x\<close> |
|
855 |
by (rule eq_reflection) |
|
856 |
with \<open>PROP P(a)\<close> show \<open>PROP P(x)\<close> |
|
857 |
by simp |
|
858 |
qed |
|
71919 | 859 |
qed |
860 |
||
26286 | 861 |
|
61487
f8cb97e0fd0b
more symbols, with swapped defaults: old-style ASCII syntax uses "ASCII" print mode;
wenzelm
parents:
61378
diff
changeset
|
862 |
subsubsection \<open>Conversion into rewrite rules\<close> |
26286 | 863 |
|
69590 | 864 |
lemma P_iff_F: \<open>\<not> P \<Longrightarrow> (P \<longleftrightarrow> False)\<close> |
61487
f8cb97e0fd0b
more symbols, with swapped defaults: old-style ASCII syntax uses "ASCII" print mode;
wenzelm
parents:
61378
diff
changeset
|
865 |
by iprover |
69590 | 866 |
lemma iff_reflection_F: \<open>\<not> P \<Longrightarrow> (P \<equiv> False)\<close> |
61487
f8cb97e0fd0b
more symbols, with swapped defaults: old-style ASCII syntax uses "ASCII" print mode;
wenzelm
parents:
61378
diff
changeset
|
867 |
by (rule P_iff_F [THEN iff_reflection]) |
26286 | 868 |
|
69590 | 869 |
lemma P_iff_T: \<open>P \<Longrightarrow> (P \<longleftrightarrow> True)\<close> |
61487
f8cb97e0fd0b
more symbols, with swapped defaults: old-style ASCII syntax uses "ASCII" print mode;
wenzelm
parents:
61378
diff
changeset
|
870 |
by iprover |
69590 | 871 |
lemma iff_reflection_T: \<open>P \<Longrightarrow> (P \<equiv> True)\<close> |
61487
f8cb97e0fd0b
more symbols, with swapped defaults: old-style ASCII syntax uses "ASCII" print mode;
wenzelm
parents:
61378
diff
changeset
|
872 |
by (rule P_iff_T [THEN iff_reflection]) |
26286 | 873 |
|
874 |
||
61487
f8cb97e0fd0b
more symbols, with swapped defaults: old-style ASCII syntax uses "ASCII" print mode;
wenzelm
parents:
61378
diff
changeset
|
875 |
subsubsection \<open>More rewrite rules\<close> |
26286 | 876 |
|
69590 | 877 |
lemma conj_commute: \<open>P \<and> Q \<longleftrightarrow> Q \<and> P\<close> by iprover |
878 |
lemma conj_left_commute: \<open>P \<and> (Q \<and> R) \<longleftrightarrow> Q \<and> (P \<and> R)\<close> by iprover |
|
26286 | 879 |
lemmas conj_comms = conj_commute conj_left_commute |
880 |
||
69590 | 881 |
lemma disj_commute: \<open>P \<or> Q \<longleftrightarrow> Q \<or> P\<close> by iprover |
882 |
lemma disj_left_commute: \<open>P \<or> (Q \<or> R) \<longleftrightarrow> Q \<or> (P \<or> R)\<close> by iprover |
|
26286 | 883 |
lemmas disj_comms = disj_commute disj_left_commute |
884 |
||
69590 | 885 |
lemma conj_disj_distribL: \<open>P \<and> (Q \<or> R) \<longleftrightarrow> (P \<and> Q \<or> P \<and> R)\<close> by iprover |
886 |
lemma conj_disj_distribR: \<open>(P \<or> Q) \<and> R \<longleftrightarrow> (P \<and> R \<or> Q \<and> R)\<close> by iprover |
|
26286 | 887 |
|
69590 | 888 |
lemma disj_conj_distribL: \<open>P \<or> (Q \<and> R) \<longleftrightarrow> (P \<or> Q) \<and> (P \<or> R)\<close> by iprover |
889 |
lemma disj_conj_distribR: \<open>(P \<and> Q) \<or> R \<longleftrightarrow> (P \<or> R) \<and> (Q \<or> R)\<close> by iprover |
|
26286 | 890 |
|
69590 | 891 |
lemma imp_conj_distrib: \<open>(P \<longrightarrow> (Q \<and> R)) \<longleftrightarrow> (P \<longrightarrow> Q) \<and> (P \<longrightarrow> R)\<close> by iprover |
892 |
lemma imp_conj: \<open>((P \<and> Q) \<longrightarrow> R) \<longleftrightarrow> (P \<longrightarrow> (Q \<longrightarrow> R))\<close> by iprover |
|
893 |
lemma imp_disj: \<open>(P \<or> Q \<longrightarrow> R) \<longleftrightarrow> (P \<longrightarrow> R) \<and> (Q \<longrightarrow> R)\<close> by iprover |
|
26286 | 894 |
|
69590 | 895 |
lemma de_Morgan_disj: \<open>(\<not> (P \<or> Q)) \<longleftrightarrow> (\<not> P \<and> \<not> Q)\<close> by iprover |
26286 | 896 |
|
69590 | 897 |
lemma not_ex: \<open>(\<not> (\<exists>x. P(x))) \<longleftrightarrow> (\<forall>x. \<not> P(x))\<close> by iprover |
898 |
lemma imp_ex: \<open>((\<exists>x. P(x)) \<longrightarrow> Q) \<longleftrightarrow> (\<forall>x. P(x) \<longrightarrow> Q)\<close> by iprover |
|
26286 | 899 |
|
69590 | 900 |
lemma ex_disj_distrib: \<open>(\<exists>x. P(x) \<or> Q(x)) \<longleftrightarrow> ((\<exists>x. P(x)) \<or> (\<exists>x. Q(x)))\<close> |
61487
f8cb97e0fd0b
more symbols, with swapped defaults: old-style ASCII syntax uses "ASCII" print mode;
wenzelm
parents:
61378
diff
changeset
|
901 |
by iprover |
26286 | 902 |
|
69590 | 903 |
lemma all_conj_distrib: \<open>(\<forall>x. P(x) \<and> Q(x)) \<longleftrightarrow> ((\<forall>x. P(x)) \<and> (\<forall>x. Q(x)))\<close> |
61487
f8cb97e0fd0b
more symbols, with swapped defaults: old-style ASCII syntax uses "ASCII" print mode;
wenzelm
parents:
61378
diff
changeset
|
904 |
by iprover |
26286 | 905 |
|
4854 | 906 |
end |