| author | haftmann | 
| Wed, 24 Feb 2010 14:19:52 +0100 | |
| changeset 35366 | 6d474096698c | 
| parent 33026 | 8f35633c4922 | 
| child 37671 | fa53d267dab3 | 
| permissions | -rw-r--r-- | 
| 33026 | 1  | 
(* Title: HOL/Isar_Examples/Peirce.thy  | 
| 
6444
 
2ebe9e630cab
Miscellaneous Isabelle/Isar examples for Higher-Order Logic.
 
wenzelm 
parents:  
diff
changeset
 | 
2  | 
Author: Markus Wenzel, TU Muenchen  | 
| 
 
2ebe9e630cab
Miscellaneous Isabelle/Isar examples for Higher-Order Logic.
 
wenzelm 
parents:  
diff
changeset
 | 
3  | 
*)  | 
| 
 
2ebe9e630cab
Miscellaneous Isabelle/Isar examples for Higher-Order Logic.
 
wenzelm 
parents:  
diff
changeset
 | 
4  | 
|
| 10007 | 5  | 
header {* Peirce's Law *}
 | 
| 
6444
 
2ebe9e630cab
Miscellaneous Isabelle/Isar examples for Higher-Order Logic.
 
wenzelm 
parents:  
diff
changeset
 | 
6  | 
|
| 31758 | 7  | 
theory Peirce  | 
8  | 
imports Main  | 
|
9  | 
begin  | 
|
| 
6444
 
2ebe9e630cab
Miscellaneous Isabelle/Isar examples for Higher-Order Logic.
 
wenzelm 
parents:  
diff
changeset
 | 
10  | 
|
| 7860 | 11  | 
text {*
 | 
12  | 
We consider Peirce's Law: $((A \impl B) \impl A) \impl A$. This is  | 
|
13  | 
an inherently non-intuitionistic statement, so its proof will  | 
|
14  | 
certainly involve some form of classical contradiction.  | 
|
15  | 
||
16  | 
The first proof is again a well-balanced combination of plain  | 
|
| 7874 | 17  | 
backward and forward reasoning. The actual classical step is where  | 
18  | 
the negated goal may be introduced as additional assumption. This  | 
|
19  | 
 eventually leads to a contradiction.\footnote{The rule involved there
 | 
|
20  | 
is negation elimination; it holds in intuitionistic logic as well.}  | 
|
| 10007 | 21  | 
*}  | 
| 7860 | 22  | 
|
| 10007 | 23  | 
theorem "((A --> B) --> A) --> A"  | 
24  | 
proof  | 
|
| 23373 | 25  | 
assume "(A --> B) --> A"  | 
| 10007 | 26  | 
show A  | 
27  | 
proof (rule classical)  | 
|
28  | 
assume "~ A"  | 
|
29  | 
have "A --> B"  | 
|
30  | 
proof  | 
|
31  | 
assume A  | 
|
| 23373 | 32  | 
with `~ A` show B by contradiction  | 
| 10007 | 33  | 
qed  | 
| 23373 | 34  | 
with `(A --> B) --> A` show A ..  | 
| 10007 | 35  | 
qed  | 
36  | 
qed  | 
|
| 
6444
 
2ebe9e630cab
Miscellaneous Isabelle/Isar examples for Higher-Order Logic.
 
wenzelm 
parents:  
diff
changeset
 | 
37  | 
|
| 7860 | 38  | 
text {*
 | 
| 7874 | 39  | 
In the subsequent version the reasoning is rearranged by means of  | 
40  | 
 ``weak assumptions'' (as introduced by \isacommand{presume}).  Before
 | 
|
| 7860 | 41  | 
assuming the negated goal $\neg A$, its intended consequence $A \impl  | 
42  | 
B$ is put into place in order to solve the main problem.  | 
|
43  | 
Nevertheless, we do not get anything for free, but have to establish  | 
|
| 7874 | 44  | 
$A \impl B$ later on. The overall effect is that of a logical  | 
45  | 
 \emph{cut}.
 | 
|
| 7860 | 46  | 
|
47  | 
Technically speaking, whenever some goal is solved by  | 
|
48  | 
 \isacommand{show} in the context of weak assumptions then the latter
 | 
|
49  | 
give rise to new subgoals, which may be established separately. In  | 
|
50  | 
 contrast, strong assumptions (as introduced by \isacommand{assume})
 | 
|
51  | 
are solved immediately.  | 
|
| 10007 | 52  | 
*}  | 
| 7860 | 53  | 
|
| 10007 | 54  | 
theorem "((A --> B) --> A) --> A"  | 
55  | 
proof  | 
|
| 23373 | 56  | 
assume "(A --> B) --> A"  | 
| 10007 | 57  | 
show A  | 
58  | 
proof (rule classical)  | 
|
59  | 
presume "A --> B"  | 
|
| 23373 | 60  | 
with `(A --> B) --> A` show A ..  | 
| 10007 | 61  | 
next  | 
62  | 
assume "~ A"  | 
|
63  | 
show "A --> B"  | 
|
64  | 
proof  | 
|
65  | 
assume A  | 
|
| 23373 | 66  | 
with `~ A` show B by contradiction  | 
| 10007 | 67  | 
qed  | 
68  | 
qed  | 
|
69  | 
qed  | 
|
| 
6444
 
2ebe9e630cab
Miscellaneous Isabelle/Isar examples for Higher-Order Logic.
 
wenzelm 
parents:  
diff
changeset
 | 
70  | 
|
| 7860 | 71  | 
text {*
 | 
72  | 
Note that the goals stemming from weak assumptions may be even left  | 
|
73  | 
until qed time, where they get eventually solved ``by assumption'' as  | 
|
| 7874 | 74  | 
well. In that case there is really no fundamental difference between  | 
75  | 
the two kinds of assumptions, apart from the order of reducing the  | 
|
76  | 
individual parts of the proof configuration.  | 
|
| 7860 | 77  | 
|
78  | 
Nevertheless, the ``strong'' mode of plain assumptions is quite  | 
|
| 7982 | 79  | 
important in practice to achieve robustness of proof text  | 
| 7860 | 80  | 
 interpretation.  By forcing both the conclusion \emph{and} the
 | 
| 7869 | 81  | 
assumptions to unify with the pending goal to be solved, goal  | 
82  | 
selection becomes quite deterministic. For example, decomposition  | 
|
| 7982 | 83  | 
with rules of the ``case-analysis'' type usually gives rise to  | 
84  | 
several goals that only differ in there local contexts. With strong  | 
|
85  | 
assumptions these may be still solved in any order in a predictable  | 
|
86  | 
way, while weak ones would quickly lead to great confusion,  | 
|
87  | 
eventually demanding even some backtracking.  | 
|
| 10007 | 88  | 
*}  | 
| 7860 | 89  | 
|
| 10007 | 90  | 
end  |