317 EX!x,y such that P(x,y) (simultaneous) |
317 EX!x,y such that P(x,y) (simultaneous) |
318 do NOT mean the same thing. The parser treats EX!x y.P(x,y) as sequential. |
318 do NOT mean the same thing. The parser treats EX!x y.P(x,y) as sequential. |
319 ***) |
319 ***) |
320 |
320 |
321 lemma ex1I: |
321 lemma ex1I: |
322 assumes "P(a)" |
322 "P(a) \<Longrightarrow> (!!x. P(x) ==> x=a) \<Longrightarrow> EX! x. P(x)" |
323 and "!!x. P(x) ==> x=a" |
|
324 shows "EX! x. P(x)" |
|
325 apply (unfold ex1_def) |
323 apply (unfold ex1_def) |
326 apply (assumption | rule assms exI conjI allI impI)+ |
324 apply (assumption | rule exI conjI allI impI)+ |
327 done |
325 done |
328 |
326 |
329 (*Sometimes easier to use: the premises have no shared variables. Safe!*) |
327 (*Sometimes easier to use: the premises have no shared variables. Safe!*) |
330 lemma ex_ex1I: |
328 lemma ex_ex1I: |
331 assumes ex: "EX x. P(x)" |
329 "EX x. P(x) \<Longrightarrow> (!!x y. [| P(x); P(y) |] ==> x=y) \<Longrightarrow> EX! x. P(x)" |
332 and eq: "!!x y. [| P(x); P(y) |] ==> x=y" |
330 apply (erule exE) |
333 shows "EX! x. P(x)" |
331 apply (rule ex1I) |
334 apply (rule ex [THEN exE]) |
332 apply assumption |
335 apply (assumption | rule ex1I eq)+ |
333 apply assumption |
336 done |
334 done |
337 |
335 |
338 lemma ex1E: |
336 lemma ex1E: |
339 assumes ex1: "EX! x. P(x)" |
337 "EX! x. P(x) \<Longrightarrow> (!!x. [| P(x); ALL y. P(y) --> y=x |] ==> R) \<Longrightarrow> R" |
340 and r: "!!x. [| P(x); ALL y. P(y) --> y=x |] ==> R" |
338 apply (unfold ex1_def) |
341 shows R |
|
342 apply (insert ex1, unfold ex1_def) |
|
343 apply (assumption | erule exE conjE)+ |
339 apply (assumption | erule exE conjE)+ |
344 done |
340 done |
345 |
341 |
346 |
342 |
347 (*** <-> congruence rules for simplification ***) |
343 (*** <-> congruence rules for simplification ***) |
570 by (assumption | rule impI major [THEN mp] r1 r2)+ |
566 by (assumption | rule impI major [THEN mp] r1 r2)+ |
571 |
567 |
572 (*Simplifies the implication. Classical version is stronger. |
568 (*Simplifies the implication. Classical version is stronger. |
573 Still UNSAFE since ~P must be provable -- backtracking needed. *) |
569 Still UNSAFE since ~P must be provable -- backtracking needed. *) |
574 lemma not_impE: |
570 lemma not_impE: |
575 assumes major: "~P --> S" |
571 "~P --> S \<Longrightarrow> (P ==> False) \<Longrightarrow> (S ==> R) \<Longrightarrow> R" |
576 and r1: "P ==> False" |
572 apply (drule mp) |
577 and r2: "S ==> R" |
573 apply (rule notI) |
578 shows R |
574 apply assumption |
579 apply (assumption | rule notI impI major [THEN mp] r1 r2)+ |
575 apply assumption |
580 done |
576 done |
581 |
577 |
582 (*Simplifies the implication. UNSAFE. *) |
578 (*Simplifies the implication. UNSAFE. *) |
583 lemma iff_impE: |
579 lemma iff_impE: |
584 assumes major: "(P<->Q)-->S" |
580 assumes major: "(P<->Q)-->S" |