43 |
43 |
44 axiomatization where |
44 axiomatization where |
45 |
45 |
46 (*Structural rules: contraction, thinning, exchange [Soren Heilmann] *) |
46 (*Structural rules: contraction, thinning, exchange [Soren Heilmann] *) |
47 |
47 |
48 contRS: "$H |- $E, $S, $S, $F \<Longrightarrow> $H |- $E, $S, $F" and |
48 contRS: "$H \<turnstile> $E, $S, $S, $F \<Longrightarrow> $H \<turnstile> $E, $S, $F" and |
49 contLS: "$H, $S, $S, $G |- $E \<Longrightarrow> $H, $S, $G |- $E" and |
49 contLS: "$H, $S, $S, $G \<turnstile> $E \<Longrightarrow> $H, $S, $G \<turnstile> $E" and |
50 |
50 |
51 thinRS: "$H |- $E, $F \<Longrightarrow> $H |- $E, $S, $F" and |
51 thinRS: "$H \<turnstile> $E, $F \<Longrightarrow> $H \<turnstile> $E, $S, $F" and |
52 thinLS: "$H, $G |- $E \<Longrightarrow> $H, $S, $G |- $E" and |
52 thinLS: "$H, $G \<turnstile> $E \<Longrightarrow> $H, $S, $G \<turnstile> $E" and |
53 |
53 |
54 exchRS: "$H |- $E, $R, $S, $F \<Longrightarrow> $H |- $E, $S, $R, $F" and |
54 exchRS: "$H \<turnstile> $E, $R, $S, $F \<Longrightarrow> $H \<turnstile> $E, $S, $R, $F" and |
55 exchLS: "$H, $R, $S, $G |- $E \<Longrightarrow> $H, $S, $R, $G |- $E" and |
55 exchLS: "$H, $R, $S, $G \<turnstile> $E \<Longrightarrow> $H, $S, $R, $G \<turnstile> $E" and |
56 |
56 |
57 cut: "\<lbrakk>$H |- $E, P; $H, P |- $E\<rbrakk> \<Longrightarrow> $H |- $E" and |
57 cut: "\<lbrakk>$H \<turnstile> $E, P; $H, P \<turnstile> $E\<rbrakk> \<Longrightarrow> $H \<turnstile> $E" and |
58 |
58 |
59 (*Propositional rules*) |
59 (*Propositional rules*) |
60 |
60 |
61 basic: "$H, P, $G |- $E, P, $F" and |
61 basic: "$H, P, $G \<turnstile> $E, P, $F" and |
62 |
62 |
63 conjR: "\<lbrakk>$H|- $E, P, $F; $H|- $E, Q, $F\<rbrakk> \<Longrightarrow> $H|- $E, P \<and> Q, $F" and |
63 conjR: "\<lbrakk>$H\<turnstile> $E, P, $F; $H\<turnstile> $E, Q, $F\<rbrakk> \<Longrightarrow> $H\<turnstile> $E, P \<and> Q, $F" and |
64 conjL: "$H, P, Q, $G |- $E \<Longrightarrow> $H, P \<and> Q, $G |- $E" and |
64 conjL: "$H, P, Q, $G \<turnstile> $E \<Longrightarrow> $H, P \<and> Q, $G \<turnstile> $E" and |
65 |
65 |
66 disjR: "$H |- $E, P, Q, $F \<Longrightarrow> $H |- $E, P \<or> Q, $F" and |
66 disjR: "$H \<turnstile> $E, P, Q, $F \<Longrightarrow> $H \<turnstile> $E, P \<or> Q, $F" and |
67 disjL: "\<lbrakk>$H, P, $G |- $E; $H, Q, $G |- $E\<rbrakk> \<Longrightarrow> $H, P \<or> Q, $G |- $E" and |
67 disjL: "\<lbrakk>$H, P, $G \<turnstile> $E; $H, Q, $G \<turnstile> $E\<rbrakk> \<Longrightarrow> $H, P \<or> Q, $G \<turnstile> $E" and |
68 |
68 |
69 impR: "$H, P |- $E, Q, $F \<Longrightarrow> $H |- $E, P \<longrightarrow> Q, $F" and |
69 impR: "$H, P \<turnstile> $E, Q, $F \<Longrightarrow> $H \<turnstile> $E, P \<longrightarrow> Q, $F" and |
70 impL: "\<lbrakk>$H,$G |- $E,P; $H, Q, $G |- $E\<rbrakk> \<Longrightarrow> $H, P \<longrightarrow> Q, $G |- $E" and |
70 impL: "\<lbrakk>$H,$G \<turnstile> $E,P; $H, Q, $G \<turnstile> $E\<rbrakk> \<Longrightarrow> $H, P \<longrightarrow> Q, $G \<turnstile> $E" and |
71 |
71 |
72 notR: "$H, P |- $E, $F \<Longrightarrow> $H |- $E, \<not> P, $F" and |
72 notR: "$H, P \<turnstile> $E, $F \<Longrightarrow> $H \<turnstile> $E, \<not> P, $F" and |
73 notL: "$H, $G |- $E, P \<Longrightarrow> $H, \<not> P, $G |- $E" and |
73 notL: "$H, $G \<turnstile> $E, P \<Longrightarrow> $H, \<not> P, $G \<turnstile> $E" and |
74 |
74 |
75 FalseL: "$H, False, $G |- $E" and |
75 FalseL: "$H, False, $G \<turnstile> $E" and |
76 |
76 |
77 True_def: "True \<equiv> False \<longrightarrow> False" and |
77 True_def: "True \<equiv> False \<longrightarrow> False" and |
78 iff_def: "P \<longleftrightarrow> Q \<equiv> (P \<longrightarrow> Q) \<and> (Q \<longrightarrow> P)" |
78 iff_def: "P \<longleftrightarrow> Q \<equiv> (P \<longrightarrow> Q) \<and> (Q \<longrightarrow> P)" |
79 |
79 |
80 axiomatization where |
80 axiomatization where |
81 (*Quantifiers*) |
81 (*Quantifiers*) |
82 |
82 |
83 allR: "(\<And>x. $H |- $E, P(x), $F) \<Longrightarrow> $H |- $E, \<forall>x. P(x), $F" and |
83 allR: "(\<And>x. $H \<turnstile> $E, P(x), $F) \<Longrightarrow> $H \<turnstile> $E, \<forall>x. P(x), $F" and |
84 allL: "$H, P(x), $G, \<forall>x. P(x) |- $E \<Longrightarrow> $H, \<forall>x. P(x), $G |- $E" and |
84 allL: "$H, P(x), $G, \<forall>x. P(x) \<turnstile> $E \<Longrightarrow> $H, \<forall>x. P(x), $G \<turnstile> $E" and |
85 |
85 |
86 exR: "$H |- $E, P(x), $F, \<exists>x. P(x) \<Longrightarrow> $H |- $E, \<exists>x. P(x), $F" and |
86 exR: "$H \<turnstile> $E, P(x), $F, \<exists>x. P(x) \<Longrightarrow> $H \<turnstile> $E, \<exists>x. P(x), $F" and |
87 exL: "(\<And>x. $H, P(x), $G |- $E) \<Longrightarrow> $H, \<exists>x. P(x), $G |- $E" and |
87 exL: "(\<And>x. $H, P(x), $G \<turnstile> $E) \<Longrightarrow> $H, \<exists>x. P(x), $G \<turnstile> $E" and |
88 |
88 |
89 (*Equality*) |
89 (*Equality*) |
90 refl: "$H |- $E, a = a, $F" and |
90 refl: "$H \<turnstile> $E, a = a, $F" and |
91 subst: "\<And>G H E. $H(a), $G(a) |- $E(a) \<Longrightarrow> $H(b), a=b, $G(b) |- $E(b)" |
91 subst: "\<And>G H E. $H(a), $G(a) \<turnstile> $E(a) \<Longrightarrow> $H(b), a=b, $G(b) \<turnstile> $E(b)" |
92 |
92 |
93 (* Reflection *) |
93 (* Reflection *) |
94 |
94 |
95 axiomatization where |
95 axiomatization where |
96 eq_reflection: "|- x = y \<Longrightarrow> (x \<equiv> y)" and |
96 eq_reflection: "\<turnstile> x = y \<Longrightarrow> (x \<equiv> y)" and |
97 iff_reflection: "|- P \<longleftrightarrow> Q \<Longrightarrow> (P \<equiv> Q)" |
97 iff_reflection: "\<turnstile> P \<longleftrightarrow> Q \<Longrightarrow> (P \<equiv> Q)" |
98 |
98 |
99 (*Descriptions*) |
99 (*Descriptions*) |
100 |
100 |
101 axiomatization where |
101 axiomatization where |
102 The: "\<lbrakk>$H |- $E, P(a), $F; \<And>x.$H, P(x) |- $E, x=a, $F\<rbrakk> \<Longrightarrow> |
102 The: "\<lbrakk>$H \<turnstile> $E, P(a), $F; \<And>x.$H, P(x) \<turnstile> $E, x=a, $F\<rbrakk> \<Longrightarrow> |
103 $H |- $E, P(THE x. P(x)), $F" |
103 $H \<turnstile> $E, P(THE x. P(x)), $F" |
104 |
104 |
105 definition If :: "[o, 'a, 'a] \<Rightarrow> 'a" ("(if (_)/ then (_)/ else (_))" 10) |
105 definition If :: "[o, 'a, 'a] \<Rightarrow> 'a" ("(if (_)/ then (_)/ else (_))" 10) |
106 where "If(P,x,y) \<equiv> THE z::'a. (P \<longrightarrow> z = x) \<and> (\<not> P \<longrightarrow> z = y)" |
106 where "If(P,x,y) \<equiv> THE z::'a. (P \<longrightarrow> z = x) \<and> (\<not> P \<longrightarrow> z = y)" |
107 |
107 |
108 |
108 |
109 (** Structural Rules on formulas **) |
109 (** Structural Rules on formulas **) |
110 |
110 |
111 (*contraction*) |
111 (*contraction*) |
112 |
112 |
113 lemma contR: "$H |- $E, P, P, $F \<Longrightarrow> $H |- $E, P, $F" |
113 lemma contR: "$H \<turnstile> $E, P, P, $F \<Longrightarrow> $H \<turnstile> $E, P, $F" |
114 by (rule contRS) |
114 by (rule contRS) |
115 |
115 |
116 lemma contL: "$H, P, P, $G |- $E \<Longrightarrow> $H, P, $G |- $E" |
116 lemma contL: "$H, P, P, $G \<turnstile> $E \<Longrightarrow> $H, P, $G \<turnstile> $E" |
117 by (rule contLS) |
117 by (rule contLS) |
118 |
118 |
119 (*thinning*) |
119 (*thinning*) |
120 |
120 |
121 lemma thinR: "$H |- $E, $F \<Longrightarrow> $H |- $E, P, $F" |
121 lemma thinR: "$H \<turnstile> $E, $F \<Longrightarrow> $H \<turnstile> $E, P, $F" |
122 by (rule thinRS) |
122 by (rule thinRS) |
123 |
123 |
124 lemma thinL: "$H, $G |- $E \<Longrightarrow> $H, P, $G |- $E" |
124 lemma thinL: "$H, $G \<turnstile> $E \<Longrightarrow> $H, P, $G \<turnstile> $E" |
125 by (rule thinLS) |
125 by (rule thinLS) |
126 |
126 |
127 (*exchange*) |
127 (*exchange*) |
128 |
128 |
129 lemma exchR: "$H |- $E, Q, P, $F \<Longrightarrow> $H |- $E, P, Q, $F" |
129 lemma exchR: "$H \<turnstile> $E, Q, P, $F \<Longrightarrow> $H \<turnstile> $E, P, Q, $F" |
130 by (rule exchRS) |
130 by (rule exchRS) |
131 |
131 |
132 lemma exchL: "$H, Q, P, $G |- $E \<Longrightarrow> $H, P, Q, $G |- $E" |
132 lemma exchL: "$H, Q, P, $G \<turnstile> $E \<Longrightarrow> $H, P, Q, $G \<turnstile> $E" |
133 by (rule exchLS) |
133 by (rule exchLS) |
134 |
134 |
135 ML \<open> |
135 ML \<open> |
136 (*Cut and thin, replacing the right-side formula*) |
136 (*Cut and thin, replacing the right-side formula*) |
137 fun cutR_tac ctxt s i = |
137 fun cutR_tac ctxt s i = |
144 resolve_tac ctxt @{thms thinL} (i + 1) |
144 resolve_tac ctxt @{thms thinL} (i + 1) |
145 \<close> |
145 \<close> |
146 |
146 |
147 |
147 |
148 (** If-and-only-if rules **) |
148 (** If-and-only-if rules **) |
149 lemma iffR: "\<lbrakk>$H,P |- $E,Q,$F; $H,Q |- $E,P,$F\<rbrakk> \<Longrightarrow> $H |- $E, P \<longleftrightarrow> Q, $F" |
149 lemma iffR: "\<lbrakk>$H,P \<turnstile> $E,Q,$F; $H,Q \<turnstile> $E,P,$F\<rbrakk> \<Longrightarrow> $H \<turnstile> $E, P \<longleftrightarrow> Q, $F" |
150 apply (unfold iff_def) |
150 apply (unfold iff_def) |
151 apply (assumption | rule conjR impR)+ |
151 apply (assumption | rule conjR impR)+ |
152 done |
152 done |
153 |
153 |
154 lemma iffL: "\<lbrakk>$H,$G |- $E,P,Q; $H,Q,P,$G |- $E\<rbrakk> \<Longrightarrow> $H, P \<longleftrightarrow> Q, $G |- $E" |
154 lemma iffL: "\<lbrakk>$H,$G \<turnstile> $E,P,Q; $H,Q,P,$G \<turnstile> $E\<rbrakk> \<Longrightarrow> $H, P \<longleftrightarrow> Q, $G \<turnstile> $E" |
155 apply (unfold iff_def) |
155 apply (unfold iff_def) |
156 apply (assumption | rule conjL impL basic)+ |
156 apply (assumption | rule conjL impL basic)+ |
157 done |
157 done |
158 |
158 |
159 lemma iff_refl: "$H |- $E, (P \<longleftrightarrow> P), $F" |
159 lemma iff_refl: "$H \<turnstile> $E, (P \<longleftrightarrow> P), $F" |
160 apply (rule iffR basic)+ |
160 apply (rule iffR basic)+ |
161 done |
161 done |
162 |
162 |
163 lemma TrueR: "$H |- $E, True, $F" |
163 lemma TrueR: "$H \<turnstile> $E, True, $F" |
164 apply (unfold True_def) |
164 apply (unfold True_def) |
165 apply (rule impR) |
165 apply (rule impR) |
166 apply (rule basic) |
166 apply (rule basic) |
167 done |
167 done |
168 |
168 |
169 (*Descriptions*) |
169 (*Descriptions*) |
170 lemma the_equality: |
170 lemma the_equality: |
171 assumes p1: "$H |- $E, P(a), $F" |
171 assumes p1: "$H \<turnstile> $E, P(a), $F" |
172 and p2: "\<And>x. $H, P(x) |- $E, x=a, $F" |
172 and p2: "\<And>x. $H, P(x) \<turnstile> $E, x=a, $F" |
173 shows "$H |- $E, (THE x. P(x)) = a, $F" |
173 shows "$H \<turnstile> $E, (THE x. P(x)) = a, $F" |
174 apply (rule cut) |
174 apply (rule cut) |
175 apply (rule_tac [2] p2) |
175 apply (rule_tac [2] p2) |
176 apply (rule The, rule thinR, rule exchRS, rule p1) |
176 apply (rule The, rule thinR, rule exchRS, rule p1) |
177 apply (rule thinR, rule exchRS, rule p2) |
177 apply (rule thinR, rule exchRS, rule p2) |
178 done |
178 done |
179 |
179 |
180 |
180 |
181 (** Weakened quantifier rules. Incomplete, they let the search terminate.**) |
181 (** Weakened quantifier rules. Incomplete, they let the search terminate.**) |
182 |
182 |
183 lemma allL_thin: "$H, P(x), $G |- $E \<Longrightarrow> $H, \<forall>x. P(x), $G |- $E" |
183 lemma allL_thin: "$H, P(x), $G \<turnstile> $E \<Longrightarrow> $H, \<forall>x. P(x), $G \<turnstile> $E" |
184 apply (rule allL) |
184 apply (rule allL) |
185 apply (erule thinL) |
185 apply (erule thinL) |
186 done |
186 done |
187 |
187 |
188 lemma exR_thin: "$H |- $E, P(x), $F \<Longrightarrow> $H |- $E, \<exists>x. P(x), $F" |
188 lemma exR_thin: "$H \<turnstile> $E, P(x), $F \<Longrightarrow> $H \<turnstile> $E, \<exists>x. P(x), $F" |
189 apply (rule exR) |
189 apply (rule exR) |
190 apply (erule thinR) |
190 apply (erule thinR) |
191 done |
191 done |
192 |
192 |
193 (*The rules of LK*) |
193 (*The rules of LK*) |
231 resolve_tac ctxt [th] i)) |
231 resolve_tac ctxt [th] i)) |
232 \<close> |
232 \<close> |
233 |
233 |
234 |
234 |
235 lemma mp_R: |
235 lemma mp_R: |
236 assumes major: "$H |- $E, $F, P \<longrightarrow> Q" |
236 assumes major: "$H \<turnstile> $E, $F, P \<longrightarrow> Q" |
237 and minor: "$H |- $E, $F, P" |
237 and minor: "$H \<turnstile> $E, $F, P" |
238 shows "$H |- $E, Q, $F" |
238 shows "$H \<turnstile> $E, Q, $F" |
239 apply (rule thinRS [THEN cut], rule major) |
239 apply (rule thinRS [THEN cut], rule major) |
240 apply step |
240 apply step |
241 apply (rule thinR, rule minor) |
241 apply (rule thinR, rule minor) |
242 done |
242 done |
243 |
243 |
244 lemma mp_L: |
244 lemma mp_L: |
245 assumes major: "$H, $G |- $E, P \<longrightarrow> Q" |
245 assumes major: "$H, $G \<turnstile> $E, P \<longrightarrow> Q" |
246 and minor: "$H, $G, Q |- $E" |
246 and minor: "$H, $G, Q \<turnstile> $E" |
247 shows "$H, P, $G |- $E" |
247 shows "$H, P, $G \<turnstile> $E" |
248 apply (rule thinL [THEN cut], rule major) |
248 apply (rule thinL [THEN cut], rule major) |
249 apply step |
249 apply step |
250 apply (rule thinL, rule minor) |
250 apply (rule thinL, rule minor) |
251 done |
251 done |
252 |
252 |
253 |
253 |
254 (** Two rules to generate left- and right- rules from implications **) |
254 (** Two rules to generate left- and right- rules from implications **) |
255 |
255 |
256 lemma R_of_imp: |
256 lemma R_of_imp: |
257 assumes major: "|- P \<longrightarrow> Q" |
257 assumes major: "\<turnstile> P \<longrightarrow> Q" |
258 and minor: "$H |- $E, $F, P" |
258 and minor: "$H \<turnstile> $E, $F, P" |
259 shows "$H |- $E, Q, $F" |
259 shows "$H \<turnstile> $E, Q, $F" |
260 apply (rule mp_R) |
260 apply (rule mp_R) |
261 apply (rule_tac [2] minor) |
261 apply (rule_tac [2] minor) |
262 apply (rule thinRS, rule major [THEN thinLS]) |
262 apply (rule thinRS, rule major [THEN thinLS]) |
263 done |
263 done |
264 |
264 |
265 lemma L_of_imp: |
265 lemma L_of_imp: |
266 assumes major: "|- P \<longrightarrow> Q" |
266 assumes major: "\<turnstile> P \<longrightarrow> Q" |
267 and minor: "$H, $G, Q |- $E" |
267 and minor: "$H, $G, Q \<turnstile> $E" |
268 shows "$H, P, $G |- $E" |
268 shows "$H, P, $G \<turnstile> $E" |
269 apply (rule mp_L) |
269 apply (rule mp_L) |
270 apply (rule_tac [2] minor) |
270 apply (rule_tac [2] minor) |
271 apply (rule thinRS, rule major [THEN thinLS]) |
271 apply (rule thinRS, rule major [THEN thinLS]) |
272 done |
272 done |
273 |
273 |
274 (*Can be used to create implications in a subgoal*) |
274 (*Can be used to create implications in a subgoal*) |
275 lemma backwards_impR: |
275 lemma backwards_impR: |
276 assumes prem: "$H, $G |- $E, $F, P \<longrightarrow> Q" |
276 assumes prem: "$H, $G \<turnstile> $E, $F, P \<longrightarrow> Q" |
277 shows "$H, P, $G |- $E, Q, $F" |
277 shows "$H, P, $G \<turnstile> $E, Q, $F" |
278 apply (rule mp_L) |
278 apply (rule mp_L) |
279 apply (rule_tac [2] basic) |
279 apply (rule_tac [2] basic) |
280 apply (rule thinR, rule prem) |
280 apply (rule thinR, rule prem) |
281 done |
281 done |
282 |
282 |
283 lemma conjunct1: "|-P \<and> Q \<Longrightarrow> |-P" |
283 lemma conjunct1: "\<turnstile>P \<and> Q \<Longrightarrow> \<turnstile>P" |
284 apply (erule thinR [THEN cut]) |
284 apply (erule thinR [THEN cut]) |
285 apply fast |
285 apply fast |
286 done |
286 done |
287 |
287 |
288 lemma conjunct2: "|-P \<and> Q \<Longrightarrow> |-Q" |
288 lemma conjunct2: "\<turnstile>P \<and> Q \<Longrightarrow> \<turnstile>Q" |
289 apply (erule thinR [THEN cut]) |
289 apply (erule thinR [THEN cut]) |
290 apply fast |
290 apply fast |
291 done |
291 done |
292 |
292 |
293 lemma spec: "|- (\<forall>x. P(x)) \<Longrightarrow> |- P(x)" |
293 lemma spec: "\<turnstile> (\<forall>x. P(x)) \<Longrightarrow> \<turnstile> P(x)" |
294 apply (erule thinR [THEN cut]) |
294 apply (erule thinR [THEN cut]) |
295 apply fast |
295 apply fast |
296 done |
296 done |
297 |
297 |
298 |
298 |
299 (** Equality **) |
299 (** Equality **) |
300 |
300 |
301 lemma sym: "|- a = b \<longrightarrow> b = a" |
301 lemma sym: "\<turnstile> a = b \<longrightarrow> b = a" |
302 by (safe add!: subst) |
302 by (safe add!: subst) |
303 |
303 |
304 lemma trans: "|- a = b \<longrightarrow> b = c \<longrightarrow> a = c" |
304 lemma trans: "\<turnstile> a = b \<longrightarrow> b = c \<longrightarrow> a = c" |
305 by (safe add!: subst) |
305 by (safe add!: subst) |
306 |
306 |
307 (* Symmetry of equality in hypotheses *) |
307 (* Symmetry of equality in hypotheses *) |
308 lemmas symL = sym [THEN L_of_imp] |
308 lemmas symL = sym [THEN L_of_imp] |
309 |
309 |
310 (* Symmetry of equality in hypotheses *) |
310 (* Symmetry of equality in hypotheses *) |
311 lemmas symR = sym [THEN R_of_imp] |
311 lemmas symR = sym [THEN R_of_imp] |
312 |
312 |
313 lemma transR: "\<lbrakk>$H|- $E, $F, a = b; $H|- $E, $F, b=c\<rbrakk> \<Longrightarrow> $H|- $E, a = c, $F" |
313 lemma transR: "\<lbrakk>$H\<turnstile> $E, $F, a = b; $H\<turnstile> $E, $F, b=c\<rbrakk> \<Longrightarrow> $H\<turnstile> $E, a = c, $F" |
314 by (rule trans [THEN R_of_imp, THEN mp_R]) |
314 by (rule trans [THEN R_of_imp, THEN mp_R]) |
315 |
315 |
316 (* Two theorms for rewriting only one instance of a definition: |
316 (* Two theorms for rewriting only one instance of a definition: |
317 the first for definitions of formulae and the second for terms *) |
317 the first for definitions of formulae and the second for terms *) |
318 |
318 |
319 lemma def_imp_iff: "(A \<equiv> B) \<Longrightarrow> |- A \<longleftrightarrow> B" |
319 lemma def_imp_iff: "(A \<equiv> B) \<Longrightarrow> \<turnstile> A \<longleftrightarrow> B" |
320 apply unfold |
320 apply unfold |
321 apply (rule iff_refl) |
321 apply (rule iff_refl) |
322 done |
322 done |
323 |
323 |
324 lemma meta_eq_to_obj_eq: "(A \<equiv> B) \<Longrightarrow> |- A = B" |
324 lemma meta_eq_to_obj_eq: "(A \<equiv> B) \<Longrightarrow> \<turnstile> A = B" |
325 apply unfold |
325 apply unfold |
326 apply (rule refl) |
326 apply (rule refl) |
327 done |
327 done |
328 |
328 |
329 |
329 |
330 (** if-then-else rules **) |
330 (** if-then-else rules **) |
331 |
331 |
332 lemma if_True: "|- (if True then x else y) = x" |
332 lemma if_True: "\<turnstile> (if True then x else y) = x" |
333 unfolding If_def by fast |
333 unfolding If_def by fast |
334 |
334 |
335 lemma if_False: "|- (if False then x else y) = y" |
335 lemma if_False: "\<turnstile> (if False then x else y) = y" |
336 unfolding If_def by fast |
336 unfolding If_def by fast |
337 |
337 |
338 lemma if_P: "|- P \<Longrightarrow> |- (if P then x else y) = x" |
338 lemma if_P: "\<turnstile> P \<Longrightarrow> \<turnstile> (if P then x else y) = x" |
339 apply (unfold If_def) |
339 apply (unfold If_def) |
340 apply (erule thinR [THEN cut]) |
340 apply (erule thinR [THEN cut]) |
341 apply fast |
341 apply fast |
342 done |
342 done |
343 |
343 |
344 lemma if_not_P: "|- \<not> P \<Longrightarrow> |- (if P then x else y) = y" |
344 lemma if_not_P: "\<turnstile> \<not> P \<Longrightarrow> \<turnstile> (if P then x else y) = y" |
345 apply (unfold If_def) |
345 apply (unfold If_def) |
346 apply (erule thinR [THEN cut]) |
346 apply (erule thinR [THEN cut]) |
347 apply fast |
347 apply fast |
348 done |
348 done |
349 |
349 |