21426
|
1 |
(* Title: LK/Propositional.thy
|
|
2 |
ID: $Id$
|
|
3 |
Author: Lawrence C Paulson, Cambridge University Computer Laboratory
|
|
4 |
Copyright 1992 University of Cambridge
|
|
5 |
*)
|
|
6 |
|
|
7 |
header {* Classical sequent calculus: examples with propositional connectives *}
|
|
8 |
|
|
9 |
theory Propositional
|
|
10 |
imports LK
|
|
11 |
begin
|
|
12 |
|
|
13 |
text "absorptive laws of & and | "
|
|
14 |
|
|
15 |
lemma "|- P & P <-> P"
|
|
16 |
by fast_prop
|
|
17 |
|
|
18 |
lemma "|- P | P <-> P"
|
|
19 |
by fast_prop
|
|
20 |
|
|
21 |
|
|
22 |
text "commutative laws of & and | "
|
|
23 |
|
|
24 |
lemma "|- P & Q <-> Q & P"
|
|
25 |
by fast_prop
|
|
26 |
|
|
27 |
lemma "|- P | Q <-> Q | P"
|
|
28 |
by fast_prop
|
|
29 |
|
|
30 |
|
|
31 |
text "associative laws of & and | "
|
|
32 |
|
|
33 |
lemma "|- (P & Q) & R <-> P & (Q & R)"
|
|
34 |
by fast_prop
|
|
35 |
|
|
36 |
lemma "|- (P | Q) | R <-> P | (Q | R)"
|
|
37 |
by fast_prop
|
|
38 |
|
|
39 |
|
|
40 |
text "distributive laws of & and | "
|
|
41 |
|
|
42 |
lemma "|- (P & Q) | R <-> (P | R) & (Q | R)"
|
|
43 |
by fast_prop
|
|
44 |
|
|
45 |
lemma "|- (P | Q) & R <-> (P & R) | (Q & R)"
|
|
46 |
by fast_prop
|
|
47 |
|
|
48 |
|
|
49 |
text "Laws involving implication"
|
|
50 |
|
|
51 |
lemma "|- (P|Q --> R) <-> (P-->R) & (Q-->R)"
|
|
52 |
by fast_prop
|
|
53 |
|
|
54 |
lemma "|- (P & Q --> R) <-> (P--> (Q-->R))"
|
|
55 |
by fast_prop
|
|
56 |
|
|
57 |
lemma "|- (P --> Q & R) <-> (P-->Q) & (P-->R)"
|
|
58 |
by fast_prop
|
|
59 |
|
|
60 |
|
|
61 |
text "Classical theorems"
|
|
62 |
|
|
63 |
lemma "|- P|Q --> P| ~P&Q"
|
|
64 |
by fast_prop
|
|
65 |
|
|
66 |
lemma "|- (P-->Q)&(~P-->R) --> (P&Q | R)"
|
|
67 |
by fast_prop
|
|
68 |
|
|
69 |
lemma "|- P&Q | ~P&R <-> (P-->Q)&(~P-->R)"
|
|
70 |
by fast_prop
|
|
71 |
|
|
72 |
lemma "|- (P-->Q) | (P-->R) <-> (P --> Q | R)"
|
|
73 |
by fast_prop
|
|
74 |
|
|
75 |
|
|
76 |
(*If and only if*)
|
|
77 |
|
|
78 |
lemma "|- (P<->Q) <-> (Q<->P)"
|
|
79 |
by fast_prop
|
|
80 |
|
|
81 |
lemma "|- ~ (P <-> ~P)"
|
|
82 |
by fast_prop
|
|
83 |
|
|
84 |
|
|
85 |
(*Sample problems from
|
|
86 |
F. J. Pelletier,
|
|
87 |
Seventy-Five Problems for Testing Automatic Theorem Provers,
|
|
88 |
J. Automated Reasoning 2 (1986), 191-216.
|
|
89 |
Errata, JAR 4 (1988), 236-236.
|
|
90 |
*)
|
|
91 |
|
|
92 |
(*1*)
|
|
93 |
lemma "|- (P-->Q) <-> (~Q --> ~P)"
|
|
94 |
by fast_prop
|
|
95 |
|
|
96 |
(*2*)
|
|
97 |
lemma "|- ~ ~ P <-> P"
|
|
98 |
by fast_prop
|
|
99 |
|
|
100 |
(*3*)
|
|
101 |
lemma "|- ~(P-->Q) --> (Q-->P)"
|
|
102 |
by fast_prop
|
|
103 |
|
|
104 |
(*4*)
|
|
105 |
lemma "|- (~P-->Q) <-> (~Q --> P)"
|
|
106 |
by fast_prop
|
|
107 |
|
|
108 |
(*5*)
|
|
109 |
lemma "|- ((P|Q)-->(P|R)) --> (P|(Q-->R))"
|
|
110 |
by fast_prop
|
|
111 |
|
|
112 |
(*6*)
|
|
113 |
lemma "|- P | ~ P"
|
|
114 |
by fast_prop
|
|
115 |
|
|
116 |
(*7*)
|
|
117 |
lemma "|- P | ~ ~ ~ P"
|
|
118 |
by fast_prop
|
|
119 |
|
|
120 |
(*8. Peirce's law*)
|
|
121 |
lemma "|- ((P-->Q) --> P) --> P"
|
|
122 |
by fast_prop
|
|
123 |
|
|
124 |
(*9*)
|
|
125 |
lemma "|- ((P|Q) & (~P|Q) & (P| ~Q)) --> ~ (~P | ~Q)"
|
|
126 |
by fast_prop
|
|
127 |
|
|
128 |
(*10*)
|
|
129 |
lemma "Q-->R, R-->P&Q, P-->(Q|R) |- P<->Q"
|
|
130 |
by fast_prop
|
|
131 |
|
|
132 |
(*11. Proved in each direction (incorrectly, says Pelletier!!) *)
|
|
133 |
lemma "|- P<->P"
|
|
134 |
by fast_prop
|
|
135 |
|
|
136 |
(*12. "Dijkstra's law"*)
|
|
137 |
lemma "|- ((P <-> Q) <-> R) <-> (P <-> (Q <-> R))"
|
|
138 |
by fast_prop
|
|
139 |
|
|
140 |
(*13. Distributive law*)
|
|
141 |
lemma "|- P | (Q & R) <-> (P | Q) & (P | R)"
|
|
142 |
by fast_prop
|
|
143 |
|
|
144 |
(*14*)
|
|
145 |
lemma "|- (P <-> Q) <-> ((Q | ~P) & (~Q|P))"
|
|
146 |
by fast_prop
|
|
147 |
|
|
148 |
(*15*)
|
|
149 |
lemma "|- (P --> Q) <-> (~P | Q)"
|
|
150 |
by fast_prop
|
|
151 |
|
|
152 |
(*16*)
|
|
153 |
lemma "|- (P-->Q) | (Q-->P)"
|
|
154 |
by fast_prop
|
|
155 |
|
|
156 |
(*17*)
|
|
157 |
lemma "|- ((P & (Q-->R))-->S) <-> ((~P | Q | S) & (~P | ~R | S))"
|
|
158 |
by fast_prop
|
|
159 |
|
|
160 |
end
|