31974
|
1 |
(* Title: FOL/ex/Intuitionistic.thy
|
14239
|
2 |
Author: Lawrence C Paulson, Cambridge University Computer Laboratory
|
|
3 |
Copyright 1991 University of Cambridge
|
|
4 |
*)
|
|
5 |
|
60770
|
6 |
section \<open>Intuitionistic First-Order Logic\<close>
|
14239
|
7 |
|
31974
|
8 |
theory Intuitionistic
|
|
9 |
imports IFOL
|
|
10 |
begin
|
14239
|
11 |
|
|
12 |
(*
|
|
13 |
Single-step ML commands:
|
|
14 |
by (IntPr.step_tac 1)
|
|
15 |
by (biresolve_tac safe_brls 1);
|
|
16 |
by (biresolve_tac haz_brls 1);
|
|
17 |
by (assume_tac 1);
|
|
18 |
by (IntPr.safe_tac 1);
|
|
19 |
by (IntPr.mp_tac 1);
|
51798
|
20 |
by (IntPr.fast_tac @{context} 1);
|
14239
|
21 |
*)
|
|
22 |
|
|
23 |
|
60770
|
24 |
text\<open>Metatheorem (for \emph{propositional} formulae):
|
14239
|
25 |
$P$ is classically provable iff $\neg\neg P$ is intuitionistically provable.
|
|
26 |
Therefore $\neg P$ is classically provable iff it is intuitionistically
|
|
27 |
provable.
|
|
28 |
|
|
29 |
Proof: Let $Q$ be the conjuction of the propositions $A\vee\neg A$, one for
|
|
30 |
each atom $A$ in $P$. Now $\neg\neg Q$ is intuitionistically provable because
|
|
31 |
$\neg\neg(A\vee\neg A)$ is and because double-negation distributes over
|
|
32 |
conjunction. If $P$ is provable classically, then clearly $Q\rightarrow P$ is
|
|
33 |
provable intuitionistically, so $\neg\neg(Q\rightarrow P)$ is also provable
|
|
34 |
intuitionistically. The latter is intuitionistically equivalent to $\neg\neg
|
|
35 |
Q\rightarrow\neg\neg P$, hence to $\neg\neg P$, since $\neg\neg Q$ is
|
|
36 |
intuitionistically provable. Finally, if $P$ is a negation then $\neg\neg P$
|
60770
|
37 |
is intuitionstically equivalent to $P$. [Andy Pitts]\<close>
|
14239
|
38 |
|
61489
|
39 |
lemma "\<not> \<not> (P \<and> Q) \<longleftrightarrow> \<not> \<not> P \<and> \<not> \<not> Q"
|
|
40 |
by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
|
14239
|
41 |
|
61489
|
42 |
lemma "\<not> \<not> ((\<not> P \<longrightarrow> Q) \<longrightarrow> (\<not> P \<longrightarrow> \<not> Q) \<longrightarrow> P)"
|
|
43 |
by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
|
14239
|
44 |
|
61489
|
45 |
text \<open>Double-negation does NOT distribute over disjunction.\<close>
|
14239
|
46 |
|
61489
|
47 |
lemma "\<not> \<not> (P \<longrightarrow> Q) \<longleftrightarrow> (\<not> \<not> P \<longrightarrow> \<not> \<not> Q)"
|
|
48 |
by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
|
14239
|
49 |
|
61489
|
50 |
lemma "\<not> \<not> \<not> P \<longleftrightarrow> \<not> P"
|
|
51 |
by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
|
14239
|
52 |
|
61489
|
53 |
lemma "\<not> \<not> ((P \<longrightarrow> Q \<or> R) \<longrightarrow> (P \<longrightarrow> Q) \<or> (P \<longrightarrow> R))"
|
|
54 |
by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
|
14239
|
55 |
|
61489
|
56 |
lemma "(P \<longleftrightarrow> Q) \<longleftrightarrow> (Q \<longleftrightarrow> P)"
|
|
57 |
by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
|
14239
|
58 |
|
61489
|
59 |
lemma "((P \<longrightarrow> (Q \<or> (Q \<longrightarrow> R))) \<longrightarrow> R) \<longrightarrow> R"
|
|
60 |
by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
|
14239
|
61 |
|
61489
|
62 |
lemma
|
|
63 |
"(((G \<longrightarrow> A) \<longrightarrow> J) \<longrightarrow> D \<longrightarrow> E) \<longrightarrow> (((H \<longrightarrow> B) \<longrightarrow> I) \<longrightarrow> C \<longrightarrow> J)
|
|
64 |
\<longrightarrow> (A \<longrightarrow> H) \<longrightarrow> F \<longrightarrow> G \<longrightarrow> (((C \<longrightarrow> B) \<longrightarrow> I) \<longrightarrow> D) \<longrightarrow> (A \<longrightarrow> C)
|
|
65 |
\<longrightarrow> (((F \<longrightarrow> A) \<longrightarrow> B) \<longrightarrow> I) \<longrightarrow> E"
|
|
66 |
by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
|
14239
|
67 |
|
|
68 |
|
61489
|
69 |
subsection \<open>Lemmas for the propositional double-negation translation\<close>
|
14239
|
70 |
|
61489
|
71 |
lemma "P \<longrightarrow> \<not> \<not> P"
|
|
72 |
by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
|
14239
|
73 |
|
61489
|
74 |
lemma "\<not> \<not> (\<not> \<not> P \<longrightarrow> P)"
|
|
75 |
by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
|
14239
|
76 |
|
61489
|
77 |
lemma "\<not> \<not> P \<and> \<not> \<not> (P \<longrightarrow> Q) \<longrightarrow> \<not> \<not> Q"
|
|
78 |
by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
|
14239
|
79 |
|
|
80 |
|
61489
|
81 |
text \<open>The following are classically but not constructively valid.
|
|
82 |
The attempt to prove them terminates quickly!\<close>
|
|
83 |
lemma "((P \<longrightarrow> Q) \<longrightarrow> P) \<longrightarrow> P"
|
|
84 |
apply (tactic \<open>IntPr.fast_tac @{context} 1\<close>)?
|
62020
|
85 |
apply (rule asm_rl) \<comment>\<open>Checks that subgoals remain: proof failed.\<close>
|
14239
|
86 |
oops
|
|
87 |
|
61489
|
88 |
lemma "(P \<and> Q \<longrightarrow> R) \<longrightarrow> (P \<longrightarrow> R) \<or> (Q \<longrightarrow> R)"
|
|
89 |
apply (tactic \<open>IntPr.fast_tac @{context} 1\<close>)?
|
62020
|
90 |
apply (rule asm_rl) \<comment>\<open>Checks that subgoals remain: proof failed.\<close>
|
14239
|
91 |
oops
|
|
92 |
|
|
93 |
|
61489
|
94 |
subsection \<open>de Bruijn formulae\<close>
|
14239
|
95 |
|
61489
|
96 |
text \<open>de Bruijn formula with three predicates\<close>
|
|
97 |
lemma
|
|
98 |
"((P \<longleftrightarrow> Q) \<longrightarrow> P \<and> Q \<and> R) \<and>
|
|
99 |
((Q \<longleftrightarrow> R) \<longrightarrow> P \<and> Q \<and> R) \<and>
|
|
100 |
((R \<longleftrightarrow> P) \<longrightarrow> P \<and> Q \<and> R) \<longrightarrow> P \<and> Q \<and> R"
|
|
101 |
by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
|
14239
|
102 |
|
|
103 |
|
61489
|
104 |
text \<open>de Bruijn formula with five predicates\<close>
|
|
105 |
lemma
|
|
106 |
"((P \<longleftrightarrow> Q) \<longrightarrow> P \<and> Q \<and> R \<and> S \<and> T) \<and>
|
|
107 |
((Q \<longleftrightarrow> R) \<longrightarrow> P \<and> Q \<and> R \<and> S \<and> T) \<and>
|
|
108 |
((R \<longleftrightarrow> S) \<longrightarrow> P \<and> Q \<and> R \<and> S \<and> T) \<and>
|
|
109 |
((S \<longleftrightarrow> T) \<longrightarrow> P \<and> Q \<and> R \<and> S \<and> T) \<and>
|
|
110 |
((T \<longleftrightarrow> P) \<longrightarrow> P \<and> Q \<and> R \<and> S \<and> T) \<longrightarrow> P \<and> Q \<and> R \<and> S \<and> T"
|
|
111 |
by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
|
14239
|
112 |
|
|
113 |
|
61489
|
114 |
text \<open>
|
|
115 |
Problems from of Sahlin, Franzen and Haridi,
|
|
116 |
An Intuitionistic Predicate Logic Theorem Prover.
|
|
117 |
J. Logic and Comp. 2 (5), October 1992, 619-656.
|
|
118 |
\<close>
|
14239
|
119 |
|
60770
|
120 |
text\<open>Problem 1.1\<close>
|
61489
|
121 |
lemma
|
|
122 |
"(\<forall>x. \<exists>y. \<forall>z. p(x) \<and> q(y) \<and> r(z)) \<longleftrightarrow>
|
|
123 |
(\<forall>z. \<exists>y. \<forall>x. p(x) \<and> q(y) \<and> r(z))"
|
62020
|
124 |
by (tactic \<open>IntPr.best_dup_tac @{context} 1\<close>) \<comment>\<open>SLOW\<close>
|
14239
|
125 |
|
60770
|
126 |
text\<open>Problem 3.1\<close>
|
61489
|
127 |
lemma "\<not> (\<exists>x. \<forall>y. mem(y,x) \<longleftrightarrow> \<not> mem(x,x))"
|
|
128 |
by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
|
14239
|
129 |
|
60770
|
130 |
text\<open>Problem 4.1: hopeless!\<close>
|
61489
|
131 |
lemma
|
|
132 |
"(\<forall>x. p(x) \<longrightarrow> p(h(x)) \<or> p(g(x))) \<and> (\<exists>x. p(x)) \<and> (\<forall>x. \<not> p(h(x)))
|
|
133 |
\<longrightarrow> (\<exists>x. p(g(g(g(g(g(x)))))))"
|
|
134 |
oops
|
14239
|
135 |
|
|
136 |
|
61489
|
137 |
subsection \<open>Intuitionistic FOL: propositional problems based on Pelletier.\<close>
|
14239
|
138 |
|
62020
|
139 |
text\<open>\<open>\<not>\<not>\<close>1\<close>
|
61489
|
140 |
lemma "\<not> \<not> ((P \<longrightarrow> Q) \<longleftrightarrow> (\<not> Q \<longrightarrow> \<not> P))"
|
|
141 |
by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
|
14239
|
142 |
|
62020
|
143 |
text\<open>\<open>\<not>\<not>\<close>2\<close>
|
61489
|
144 |
lemma "\<not> \<not> (\<not> \<not> P \<longleftrightarrow> P)"
|
|
145 |
by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
|
14239
|
146 |
|
60770
|
147 |
text\<open>3\<close>
|
61489
|
148 |
lemma "\<not> (P \<longrightarrow> Q) \<longrightarrow> (Q \<longrightarrow> P)"
|
|
149 |
by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
|
14239
|
150 |
|
62020
|
151 |
text\<open>\<open>\<not>\<not>\<close>4\<close>
|
61489
|
152 |
lemma "\<not> \<not> ((\<not> P \<longrightarrow> Q) \<longleftrightarrow> (\<not> Q \<longrightarrow> P))"
|
|
153 |
by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
|
14239
|
154 |
|
62020
|
155 |
text\<open>\<open>\<not>\<not>\<close>5\<close>
|
61490
|
156 |
lemma "\<not> \<not> ((P \<or> Q \<longrightarrow> P \<or> R) \<longrightarrow> P \<or> (Q \<longrightarrow> R))"
|
61489
|
157 |
by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
|
14239
|
158 |
|
62020
|
159 |
text\<open>\<open>\<not>\<not>\<close>6\<close>
|
61489
|
160 |
lemma "\<not> \<not> (P \<or> \<not> P)"
|
|
161 |
by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
|
14239
|
162 |
|
62020
|
163 |
text\<open>\<open>\<not>\<not>\<close>7\<close>
|
61489
|
164 |
lemma "\<not> \<not> (P \<or> \<not> \<not> \<not> P)"
|
|
165 |
by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
|
14239
|
166 |
|
62020
|
167 |
text\<open>\<open>\<not>\<not>\<close>8. Peirce's law\<close>
|
61489
|
168 |
lemma "\<not> \<not> (((P \<longrightarrow> Q) \<longrightarrow> P) \<longrightarrow> P)"
|
|
169 |
by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
|
14239
|
170 |
|
60770
|
171 |
text\<open>9\<close>
|
61489
|
172 |
lemma "((P \<or> Q) \<and> (\<not> P \<or> Q) \<and> (P \<or> \<not> Q)) \<longrightarrow> \<not> (\<not> P \<or> \<not> Q)"
|
|
173 |
by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
|
14239
|
174 |
|
60770
|
175 |
text\<open>10\<close>
|
61489
|
176 |
lemma "(Q \<longrightarrow> R) \<longrightarrow> (R \<longrightarrow> P \<and> Q) \<longrightarrow> (P \<longrightarrow> (Q \<or> R)) \<longrightarrow> (P \<longleftrightarrow> Q)"
|
|
177 |
by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
|
14239
|
178 |
|
|
179 |
|
61489
|
180 |
subsection\<open>11. Proved in each direction (incorrectly, says Pelletier!!)\<close>
|
|
181 |
|
|
182 |
lemma "P \<longleftrightarrow> P"
|
|
183 |
by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
|
|
184 |
|
62020
|
185 |
text\<open>\<open>\<not>\<not>\<close>12. Dijkstra's law\<close>
|
61489
|
186 |
lemma "\<not> \<not> (((P \<longleftrightarrow> Q) \<longleftrightarrow> R) \<longleftrightarrow> (P \<longleftrightarrow> (Q \<longleftrightarrow> R)))"
|
|
187 |
by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
|
|
188 |
|
|
189 |
lemma "((P \<longleftrightarrow> Q) \<longleftrightarrow> R) \<longrightarrow> \<not> \<not> (P \<longleftrightarrow> (Q \<longleftrightarrow> R))"
|
|
190 |
by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
|
|
191 |
|
|
192 |
text\<open>13. Distributive law\<close>
|
|
193 |
lemma "P \<or> (Q \<and> R) \<longleftrightarrow> (P \<or> Q) \<and> (P \<or> R)"
|
|
194 |
by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
|
|
195 |
|
62020
|
196 |
text\<open>\<open>\<not>\<not>\<close>14\<close>
|
61489
|
197 |
lemma "\<not> \<not> ((P \<longleftrightarrow> Q) \<longleftrightarrow> ((Q \<or> \<not> P) \<and> (\<not> Q \<or> P)))"
|
|
198 |
by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
|
|
199 |
|
62020
|
200 |
text\<open>\<open>\<not>\<not>\<close>15\<close>
|
61489
|
201 |
lemma "\<not> \<not> ((P \<longrightarrow> Q) \<longleftrightarrow> (\<not> P \<or> Q))"
|
|
202 |
by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
|
|
203 |
|
62020
|
204 |
text\<open>\<open>\<not>\<not>\<close>16\<close>
|
61489
|
205 |
lemma "\<not> \<not> ((P \<longrightarrow> Q) \<or> (Q \<longrightarrow> P))"
|
|
206 |
by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
|
|
207 |
|
62020
|
208 |
text\<open>\<open>\<not>\<not>\<close>17\<close>
|
61489
|
209 |
lemma "\<not> \<not> (((P \<and> (Q \<longrightarrow> R)) \<longrightarrow> S) \<longleftrightarrow> ((\<not> P \<or> Q \<or> S) \<and> (\<not> P \<or> \<not> R \<or> S)))"
|
|
210 |
by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
|
|
211 |
|
|
212 |
text \<open>Dijkstra's ``Golden Rule''\<close>
|
|
213 |
lemma "(P \<and> Q) \<longleftrightarrow> P \<longleftrightarrow> Q \<longleftrightarrow> (P \<or> Q)"
|
|
214 |
by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
|
|
215 |
|
|
216 |
|
|
217 |
section \<open>Examples with quantifiers\<close>
|
|
218 |
|
|
219 |
subsection \<open>The converse is classical in the following implications \dots\<close>
|
|
220 |
|
|
221 |
lemma "(\<exists>x. P(x) \<longrightarrow> Q) \<longrightarrow> (\<forall>x. P(x)) \<longrightarrow> Q"
|
|
222 |
by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
|
|
223 |
|
|
224 |
lemma "((\<forall>x. P(x)) \<longrightarrow> Q) \<longrightarrow> \<not> (\<forall>x. P(x) \<and> \<not> Q)"
|
|
225 |
by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
|
|
226 |
|
|
227 |
lemma "((\<forall>x. \<not> P(x)) \<longrightarrow> Q) \<longrightarrow> \<not> (\<forall>x. \<not> (P(x) \<or> Q))"
|
|
228 |
by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
|
|
229 |
|
|
230 |
lemma "(\<forall>x. P(x)) \<or> Q \<longrightarrow> (\<forall>x. P(x) \<or> Q)"
|
|
231 |
by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
|
|
232 |
|
|
233 |
lemma "(\<exists>x. P \<longrightarrow> Q(x)) \<longrightarrow> (P \<longrightarrow> (\<exists>x. Q(x)))"
|
|
234 |
by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
|
14239
|
235 |
|
|
236 |
|
61489
|
237 |
subsection \<open>The following are not constructively valid!\<close>
|
|
238 |
text \<open>The attempt to prove them terminates quickly!\<close>
|
14239
|
239 |
|
61489
|
240 |
lemma "((\<forall>x. P(x)) \<longrightarrow> Q) \<longrightarrow> (\<exists>x. P(x) \<longrightarrow> Q)"
|
|
241 |
apply (tactic \<open>IntPr.fast_tac @{context} 1\<close>)?
|
62020
|
242 |
apply (rule asm_rl) \<comment>\<open>Checks that subgoals remain: proof failed.\<close>
|
61489
|
243 |
oops
|
14239
|
244 |
|
61489
|
245 |
lemma "(P \<longrightarrow> (\<exists>x. Q(x))) \<longrightarrow> (\<exists>x. P \<longrightarrow> Q(x))"
|
|
246 |
apply (tactic \<open>IntPr.fast_tac @{context} 1\<close>)?
|
62020
|
247 |
apply (rule asm_rl) \<comment>\<open>Checks that subgoals remain: proof failed.\<close>
|
61489
|
248 |
oops
|
14239
|
249 |
|
61489
|
250 |
lemma "(\<forall>x. P(x) \<or> Q) \<longrightarrow> ((\<forall>x. P(x)) \<or> Q)"
|
|
251 |
apply (tactic \<open>IntPr.fast_tac @{context} 1\<close>)?
|
62020
|
252 |
apply (rule asm_rl) \<comment>\<open>Checks that subgoals remain: proof failed.\<close>
|
61489
|
253 |
oops
|
14239
|
254 |
|
61489
|
255 |
lemma "(\<forall>x. \<not> \<not> P(x)) \<longrightarrow> \<not> \<not> (\<forall>x. P(x))"
|
|
256 |
apply (tactic \<open>IntPr.fast_tac @{context} 1\<close>)?
|
62020
|
257 |
apply (rule asm_rl) \<comment>\<open>Checks that subgoals remain: proof failed.\<close>
|
61489
|
258 |
oops
|
14239
|
259 |
|
61489
|
260 |
text \<open>Classically but not intuitionistically valid. Proved by a bug in 1986!\<close>
|
|
261 |
lemma "\<exists>x. Q(x) \<longrightarrow> (\<forall>x. Q(x))"
|
|
262 |
apply (tactic \<open>IntPr.fast_tac @{context} 1\<close>)?
|
62020
|
263 |
apply (rule asm_rl) \<comment>\<open>Checks that subgoals remain: proof failed.\<close>
|
61489
|
264 |
oops
|
14239
|
265 |
|
|
266 |
|
61489
|
267 |
subsection \<open>Hard examples with quantifiers\<close>
|
14239
|
268 |
|
61489
|
269 |
text \<open>
|
|
270 |
The ones that have not been proved are not known to be valid! Some will
|
|
271 |
require quantifier duplication -- not currently available.
|
|
272 |
\<close>
|
14239
|
273 |
|
62020
|
274 |
text\<open>\<open>\<not>\<not>\<close>18\<close>
|
61489
|
275 |
lemma "\<not> \<not> (\<exists>y. \<forall>x. P(y) \<longrightarrow> P(x))"
|
62020
|
276 |
oops \<comment> \<open>NOT PROVED\<close>
|
14239
|
277 |
|
62020
|
278 |
text\<open>\<open>\<not>\<not>\<close>19\<close>
|
61489
|
279 |
lemma "\<not> \<not> (\<exists>x. \<forall>y z. (P(y) \<longrightarrow> Q(z)) \<longrightarrow> (P(x) \<longrightarrow> Q(x)))"
|
62020
|
280 |
oops \<comment> \<open>NOT PROVED\<close>
|
14239
|
281 |
|
60770
|
282 |
text\<open>20\<close>
|
61489
|
283 |
lemma
|
|
284 |
"(\<forall>x y. \<exists>z. \<forall>w. (P(x) \<and> Q(y) \<longrightarrow> R(z) \<and> S(w)))
|
|
285 |
\<longrightarrow> (\<exists>x y. P(x) \<and> Q(y)) \<longrightarrow> (\<exists>z. R(z))"
|
|
286 |
by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
|
14239
|
287 |
|
60770
|
288 |
text\<open>21\<close>
|
61489
|
289 |
lemma "(\<exists>x. P \<longrightarrow> Q(x)) \<and> (\<exists>x. Q(x) \<longrightarrow> P) \<longrightarrow> \<not> \<not> (\<exists>x. P \<longleftrightarrow> Q(x))"
|
62020
|
290 |
oops \<comment> \<open>NOT PROVED; needs quantifier duplication\<close>
|
14239
|
291 |
|
60770
|
292 |
text\<open>22\<close>
|
61489
|
293 |
lemma "(\<forall>x. P \<longleftrightarrow> Q(x)) \<longrightarrow> (P \<longleftrightarrow> (\<forall>x. Q(x)))"
|
|
294 |
by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
|
14239
|
295 |
|
62020
|
296 |
text\<open>\<open>\<not>\<not>\<close>23\<close>
|
61489
|
297 |
lemma "\<not> \<not> ((\<forall>x. P \<or> Q(x)) \<longleftrightarrow> (P \<or> (\<forall>x. Q(x))))"
|
|
298 |
by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
|
14239
|
299 |
|
60770
|
300 |
text\<open>24\<close>
|
61489
|
301 |
lemma
|
|
302 |
"\<not> (\<exists>x. S(x) \<and> Q(x)) \<and> (\<forall>x. P(x) \<longrightarrow> Q(x) \<or> R(x)) \<and>
|
|
303 |
(\<not> (\<exists>x. P(x)) \<longrightarrow> (\<exists>x. Q(x))) \<and> (\<forall>x. Q(x) \<or> R(x) \<longrightarrow> S(x))
|
|
304 |
\<longrightarrow> \<not> \<not> (\<exists>x. P(x) \<and> R(x))"
|
|
305 |
text \<open>
|
62020
|
306 |
Not clear why \<open>fast_tac\<close>, \<open>best_tac\<close>, \<open>ASTAR\<close> and
|
|
307 |
\<open>ITER_DEEPEN\<close> all take forever.
|
61489
|
308 |
\<close>
|
|
309 |
apply (tactic \<open>IntPr.safe_tac @{context}\<close>)
|
|
310 |
apply (erule impE)
|
|
311 |
apply (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
|
|
312 |
apply (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
|
|
313 |
done
|
14239
|
314 |
|
60770
|
315 |
text\<open>25\<close>
|
61489
|
316 |
lemma
|
|
317 |
"(\<exists>x. P(x)) \<and>
|
|
318 |
(\<forall>x. L(x) \<longrightarrow> \<not> (M(x) \<and> R(x))) \<and>
|
|
319 |
(\<forall>x. P(x) \<longrightarrow> (M(x) \<and> L(x))) \<and>
|
|
320 |
((\<forall>x. P(x) \<longrightarrow> Q(x)) \<or> (\<exists>x. P(x) \<and> R(x)))
|
|
321 |
\<longrightarrow> (\<exists>x. Q(x) \<and> P(x))"
|
|
322 |
by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
|
14239
|
323 |
|
62020
|
324 |
text\<open>\<open>\<not>\<not>\<close>26\<close>
|
61489
|
325 |
lemma
|
|
326 |
"(\<not> \<not> (\<exists>x. p(x)) \<longleftrightarrow> \<not> \<not> (\<exists>x. q(x))) \<and>
|
|
327 |
(\<forall>x. \<forall>y. p(x) \<and> q(y) \<longrightarrow> (r(x) \<longleftrightarrow> s(y)))
|
|
328 |
\<longrightarrow> ((\<forall>x. p(x) \<longrightarrow> r(x)) \<longleftrightarrow> (\<forall>x. q(x) \<longrightarrow> s(x)))"
|
62020
|
329 |
oops \<comment>\<open>NOT PROVED\<close>
|
14239
|
330 |
|
60770
|
331 |
text\<open>27\<close>
|
61489
|
332 |
lemma
|
|
333 |
"(\<exists>x. P(x) \<and> \<not> Q(x)) \<and>
|
|
334 |
(\<forall>x. P(x) \<longrightarrow> R(x)) \<and>
|
|
335 |
(\<forall>x. M(x) \<and> L(x) \<longrightarrow> P(x)) \<and>
|
|
336 |
((\<exists>x. R(x) \<and> \<not> Q(x)) \<longrightarrow> (\<forall>x. L(x) \<longrightarrow> \<not> R(x)))
|
|
337 |
\<longrightarrow> (\<forall>x. M(x) \<longrightarrow> \<not> L(x))"
|
|
338 |
by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
|
14239
|
339 |
|
62020
|
340 |
text\<open>\<open>\<not>\<not>\<close>28. AMENDED\<close>
|
61489
|
341 |
lemma
|
|
342 |
"(\<forall>x. P(x) \<longrightarrow> (\<forall>x. Q(x))) \<and>
|
|
343 |
(\<not> \<not> (\<forall>x. Q(x) \<or> R(x)) \<longrightarrow> (\<exists>x. Q(x) \<and> S(x))) \<and>
|
|
344 |
(\<not> \<not> (\<exists>x. S(x)) \<longrightarrow> (\<forall>x. L(x) \<longrightarrow> M(x)))
|
|
345 |
\<longrightarrow> (\<forall>x. P(x) \<and> L(x) \<longrightarrow> M(x))"
|
|
346 |
by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
|
14239
|
347 |
|
61489
|
348 |
text\<open>29. Essentially the same as Principia Mathematica *11.71\<close>
|
|
349 |
lemma
|
|
350 |
"(\<exists>x. P(x)) \<and> (\<exists>y. Q(y))
|
|
351 |
\<longrightarrow> ((\<forall>x. P(x) \<longrightarrow> R(x)) \<and> (\<forall>y. Q(y) \<longrightarrow> S(y)) \<longleftrightarrow>
|
|
352 |
(\<forall>x y. P(x) \<and> Q(y) \<longrightarrow> R(x) \<and> S(y)))"
|
|
353 |
by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
|
14239
|
354 |
|
62020
|
355 |
text\<open>\<open>\<not>\<not>\<close>30\<close>
|
61489
|
356 |
lemma
|
|
357 |
"(\<forall>x. (P(x) \<or> Q(x)) \<longrightarrow> \<not> R(x)) \<and>
|
|
358 |
(\<forall>x. (Q(x) \<longrightarrow> \<not> S(x)) \<longrightarrow> P(x) \<and> R(x))
|
|
359 |
\<longrightarrow> (\<forall>x. \<not> \<not> S(x))"
|
|
360 |
by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
|
14239
|
361 |
|
60770
|
362 |
text\<open>31\<close>
|
61489
|
363 |
lemma
|
|
364 |
"\<not> (\<exists>x. P(x) \<and> (Q(x) \<or> R(x))) \<and>
|
|
365 |
(\<exists>x. L(x) \<and> P(x)) \<and>
|
|
366 |
(\<forall>x. \<not> R(x) \<longrightarrow> M(x))
|
|
367 |
\<longrightarrow> (\<exists>x. L(x) \<and> M(x))"
|
|
368 |
by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
|
14239
|
369 |
|
60770
|
370 |
text\<open>32\<close>
|
61489
|
371 |
lemma
|
|
372 |
"(\<forall>x. P(x) \<and> (Q(x) \<or> R(x)) \<longrightarrow> S(x)) \<and>
|
|
373 |
(\<forall>x. S(x) \<and> R(x) \<longrightarrow> L(x)) \<and>
|
|
374 |
(\<forall>x. M(x) \<longrightarrow> R(x))
|
|
375 |
\<longrightarrow> (\<forall>x. P(x) \<and> M(x) \<longrightarrow> L(x))"
|
|
376 |
by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
|
14239
|
377 |
|
62020
|
378 |
text\<open>\<open>\<not>\<not>\<close>33\<close>
|
61489
|
379 |
lemma
|
|
380 |
"(\<forall>x. \<not> \<not> (P(a) \<and> (P(x) \<longrightarrow> P(b)) \<longrightarrow> P(c))) \<longleftrightarrow>
|
|
381 |
(\<forall>x. \<not> \<not> ((\<not> P(a) \<or> P(x) \<or> P(c)) \<and> (\<not> P(a) \<or> \<not> P(b) \<or> P(c))))"
|
|
382 |
apply (tactic \<open>IntPr.best_tac @{context} 1\<close>)
|
|
383 |
done
|
14239
|
384 |
|
|
385 |
|
60770
|
386 |
text\<open>36\<close>
|
61489
|
387 |
lemma
|
|
388 |
"(\<forall>x. \<exists>y. J(x,y)) \<and>
|
|
389 |
(\<forall>x. \<exists>y. G(x,y)) \<and>
|
|
390 |
(\<forall>x y. J(x,y) \<or> G(x,y) \<longrightarrow> (\<forall>z. J(y,z) \<or> G(y,z) \<longrightarrow> H(x,z)))
|
|
391 |
\<longrightarrow> (\<forall>x. \<exists>y. H(x,y))"
|
|
392 |
by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
|
14239
|
393 |
|
60770
|
394 |
text\<open>37\<close>
|
61489
|
395 |
lemma
|
|
396 |
"(\<forall>z. \<exists>w. \<forall>x. \<exists>y.
|
|
397 |
\<not> \<not> (P(x,z) \<longrightarrow> P(y,w)) \<and> P(y,z) \<and> (P(y,w) \<longrightarrow> (\<exists>u. Q(u,w)))) \<and>
|
|
398 |
(\<forall>x z. \<not> P(x,z) \<longrightarrow> (\<exists>y. Q(y,z))) \<and>
|
|
399 |
(\<not> \<not> (\<exists>x y. Q(x,y)) \<longrightarrow> (\<forall>x. R(x,x)))
|
|
400 |
\<longrightarrow> \<not> \<not> (\<forall>x. \<exists>y. R(x,y))"
|
62020
|
401 |
oops \<comment>\<open>NOT PROVED\<close>
|
14239
|
402 |
|
60770
|
403 |
text\<open>39\<close>
|
61489
|
404 |
lemma "\<not> (\<exists>x. \<forall>y. F(y,x) \<longleftrightarrow> \<not> F(y,y))"
|
|
405 |
by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
|
14239
|
406 |
|
61489
|
407 |
text\<open>40. AMENDED\<close>
|
|
408 |
lemma
|
|
409 |
"(\<exists>y. \<forall>x. F(x,y) \<longleftrightarrow> F(x,x)) \<longrightarrow>
|
|
410 |
\<not> (\<forall>x. \<exists>y. \<forall>z. F(z,y) \<longleftrightarrow> \<not> F(z,x))"
|
|
411 |
by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
|
14239
|
412 |
|
60770
|
413 |
text\<open>44\<close>
|
61489
|
414 |
lemma
|
|
415 |
"(\<forall>x. f(x) \<longrightarrow>
|
|
416 |
(\<exists>y. g(y) \<and> h(x,y) \<and> (\<exists>y. g(y) \<and> \<not> h(x,y)))) \<and>
|
|
417 |
(\<exists>x. j(x) \<and> (\<forall>y. g(y) \<longrightarrow> h(x,y)))
|
|
418 |
\<longrightarrow> (\<exists>x. j(x) \<and> \<not> f(x))"
|
|
419 |
by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
|
14239
|
420 |
|
60770
|
421 |
text\<open>48\<close>
|
61489
|
422 |
lemma "(a = b \<or> c = d) \<and> (a = c \<or> b = d) \<longrightarrow> a = d \<or> b = c"
|
|
423 |
by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
|
14239
|
424 |
|
60770
|
425 |
text\<open>51\<close>
|
61489
|
426 |
lemma
|
|
427 |
"(\<exists>z w. \<forall>x y. P(x,y) \<longleftrightarrow> (x = z \<and> y = w)) \<longrightarrow>
|
|
428 |
(\<exists>z. \<forall>x. \<exists>w. (\<forall>y. P(x,y) \<longleftrightarrow> y = w) \<longleftrightarrow> x = z)"
|
|
429 |
by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
|
14239
|
430 |
|
60770
|
431 |
text\<open>52\<close>
|
61489
|
432 |
text \<open>Almost the same as 51.\<close>
|
|
433 |
lemma
|
|
434 |
"(\<exists>z w. \<forall>x y. P(x,y) \<longleftrightarrow> (x = z \<and> y = w)) \<longrightarrow>
|
|
435 |
(\<exists>w. \<forall>y. \<exists>z. (\<forall>x. P(x,y) \<longleftrightarrow> x = z) \<longleftrightarrow> y = w)"
|
|
436 |
by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
|
14239
|
437 |
|
60770
|
438 |
text\<open>56\<close>
|
61489
|
439 |
lemma "(\<forall>x. (\<exists>y. P(y) \<and> x = f(y)) \<longrightarrow> P(x)) \<longleftrightarrow> (\<forall>x. P(x) \<longrightarrow> P(f(x)))"
|
|
440 |
by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
|
14239
|
441 |
|
60770
|
442 |
text\<open>57\<close>
|
61489
|
443 |
lemma
|
|
444 |
"P(f(a,b), f(b,c)) \<and> P(f(b,c), f(a,c)) \<and>
|
|
445 |
(\<forall>x y z. P(x,y) \<and> P(y,z) \<longrightarrow> P(x,z)) \<longrightarrow> P(f(a,b), f(a,c))"
|
|
446 |
by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
|
14239
|
447 |
|
60770
|
448 |
text\<open>60\<close>
|
61489
|
449 |
lemma "\<forall>x. P(x,f(x)) \<longleftrightarrow> (\<exists>y. (\<forall>z. P(z,y) \<longrightarrow> P(z,f(x))) \<and> P(x,y))"
|
|
450 |
by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
|
14239
|
451 |
|
|
452 |
end
|