src/FOL/FOL.ML
author clasohm
Tue Dec 13 11:51:12 1994 +0100 (1994-12-13)
changeset 779 4ab9176b45b7
parent 677 dbb8431184f9
child 1280 909079af97b7
permissions -rw-r--r--
removed FOL_Lemmas and IFOL_Lemmas; added qed_goal
clasohm@0
     1
(*  Title: 	FOL/fol.ML
clasohm@0
     2
    ID:         $Id$
clasohm@0
     3
    Author: 	Lawrence C Paulson, Cambridge University Computer Laboratory
clasohm@0
     4
    Copyright   1991  University of Cambridge
clasohm@0
     5
clasohm@0
     6
Tactics and lemmas for fol.thy (classical First-Order Logic)
clasohm@0
     7
*)
clasohm@0
     8
clasohm@0
     9
open FOL;
clasohm@0
    10
clasohm@0
    11
clasohm@0
    12
(*** Classical introduction rules for | and EX ***)
clasohm@0
    13
clasohm@779
    14
qed_goal "disjCI" FOL.thy 
clasohm@0
    15
   "(~Q ==> P) ==> P|Q"
clasohm@0
    16
 (fn prems=>
clasohm@0
    17
  [ (resolve_tac [classical] 1),
clasohm@0
    18
    (REPEAT (ares_tac (prems@[disjI1,notI]) 1)),
clasohm@0
    19
    (REPEAT (ares_tac (prems@[disjI2,notE]) 1)) ]);
clasohm@0
    20
clasohm@0
    21
(*introduction rule involving only EX*)
clasohm@779
    22
qed_goal "ex_classical" FOL.thy 
clasohm@0
    23
   "( ~(EX x. P(x)) ==> P(a)) ==> EX x.P(x)"
clasohm@0
    24
 (fn prems=>
clasohm@0
    25
  [ (resolve_tac [classical] 1),
clasohm@0
    26
    (eresolve_tac (prems RL [exI]) 1) ]);
clasohm@0
    27
clasohm@0
    28
(*version of above, simplifying ~EX to ALL~ *)
clasohm@779
    29
qed_goal "exCI" FOL.thy 
clasohm@0
    30
   "(ALL x. ~P(x) ==> P(a)) ==> EX x.P(x)"
clasohm@0
    31
 (fn [prem]=>
clasohm@0
    32
  [ (resolve_tac [ex_classical] 1),
clasohm@0
    33
    (resolve_tac [notI RS allI RS prem] 1),
clasohm@0
    34
    (eresolve_tac [notE] 1),
clasohm@0
    35
    (eresolve_tac [exI] 1) ]);
clasohm@0
    36
clasohm@779
    37
qed_goal "excluded_middle" FOL.thy "~P | P"
clasohm@0
    38
 (fn _=> [ rtac disjCI 1, assume_tac 1 ]);
clasohm@0
    39
lcp@440
    40
(*For disjunctive case analysis*)
lcp@440
    41
fun excluded_middle_tac sP =
lcp@440
    42
    res_inst_tac [("Q",sP)] (excluded_middle RS disjE);
clasohm@0
    43
clasohm@0
    44
(*** Special elimination rules *)
clasohm@0
    45
clasohm@0
    46
clasohm@0
    47
(*Classical implies (-->) elimination. *)
clasohm@779
    48
qed_goal "impCE" FOL.thy 
clasohm@0
    49
    "[| P-->Q;  ~P ==> R;  Q ==> R |] ==> R"
clasohm@0
    50
 (fn major::prems=>
clasohm@0
    51
  [ (resolve_tac [excluded_middle RS disjE] 1),
clasohm@0
    52
    (DEPTH_SOLVE (ares_tac (prems@[major RS mp]) 1)) ]);
clasohm@0
    53
clasohm@0
    54
(*Double negation law*)
clasohm@779
    55
qed_goal "notnotD" FOL.thy "~~P ==> P"
clasohm@0
    56
 (fn [major]=>
clasohm@0
    57
  [ (resolve_tac [classical] 1), (eresolve_tac [major RS notE] 1) ]);
clasohm@0
    58
clasohm@0
    59
clasohm@0
    60
(*** Tactics for implication and contradiction ***)
clasohm@0
    61
clasohm@0
    62
(*Classical <-> elimination.  Proof substitutes P=Q in 
clasohm@0
    63
    ~P ==> ~Q    and    P ==> Q  *)
clasohm@779
    64
qed_goalw "iffCE" FOL.thy [iff_def]
clasohm@0
    65
    "[| P<->Q;  [| P; Q |] ==> R;  [| ~P; ~Q |] ==> R |] ==> R"
clasohm@0
    66
 (fn prems =>
clasohm@0
    67
  [ (resolve_tac [conjE] 1),
clasohm@0
    68
    (REPEAT (DEPTH_SOLVE_1 
clasohm@0
    69
	(etac impCE 1  ORELSE  mp_tac 1  ORELSE  ares_tac prems 1))) ]);