src/FOLP/ex/Quantifiers_Cla.thy
author wenzelm
Sun Nov 09 17:04:14 2014 +0100 (2014-11-09)
changeset 58957 c9e744ea8a38
parent 36319 8feb2c4bef1a
child 60770 240563fbf41d
permissions -rw-r--r--
proper context for match_tac etc.;
     1 (*  Title:      FOLP/ex/Quantifiers_Cla.thy
     2     Author:     Lawrence C Paulson, Cambridge University Computer Laboratory
     3     Copyright   1991  University of Cambridge
     4 
     5 First-Order Logic: quantifier examples (intuitionistic and classical)
     6 Needs declarations of the theory "thy" and the tactic "tac".
     7 *)
     8 
     9 theory Quantifiers_Cla
    10 imports FOLP
    11 begin
    12 
    13 schematic_lemma "?p : (ALL x y. P(x,y))  -->  (ALL y x. P(x,y))"
    14   by (tactic {* Cla.fast_tac @{context} FOLP_cs 1 *})
    15 
    16 schematic_lemma "?p : (EX x y. P(x,y)) --> (EX y x. P(x,y))"
    17   by (tactic {* Cla.fast_tac @{context} FOLP_cs 1 *})
    18 
    19 
    20 (*Converse is false*)
    21 schematic_lemma "?p : (ALL x. P(x)) | (ALL x. Q(x)) --> (ALL x. P(x) | Q(x))"
    22   by (tactic {* Cla.fast_tac @{context} FOLP_cs 1 *})
    23 
    24 schematic_lemma "?p : (ALL x. P-->Q(x))  <->  (P--> (ALL x. Q(x)))"
    25   by (tactic {* Cla.fast_tac @{context} FOLP_cs 1 *})
    26 
    27 
    28 schematic_lemma "?p : (ALL x. P(x)-->Q)  <->  ((EX x. P(x)) --> Q)"
    29   by (tactic {* Cla.fast_tac @{context} FOLP_cs 1 *})
    30 
    31 
    32 text "Some harder ones"
    33 
    34 schematic_lemma "?p : (EX x. P(x) | Q(x)) <-> (EX x. P(x)) | (EX x. Q(x))"
    35   by (tactic {* Cla.fast_tac @{context} FOLP_cs 1 *})
    36 
    37 (*Converse is false*)
    38 schematic_lemma "?p : (EX x. P(x)&Q(x)) --> (EX x. P(x))  &  (EX x. Q(x))"
    39   by (tactic {* Cla.fast_tac @{context} FOLP_cs 1 *})
    40 
    41 
    42 text "Basic test of quantifier reasoning"
    43 (*TRUE*)
    44 schematic_lemma "?p : (EX y. ALL x. Q(x,y)) -->  (ALL x. EX y. Q(x,y))"
    45   by (tactic {* Cla.fast_tac @{context} FOLP_cs 1 *})
    46 
    47 schematic_lemma "?p : (ALL x. Q(x))  -->  (EX x. Q(x))"
    48   by (tactic {* Cla.fast_tac @{context} FOLP_cs 1 *})
    49 
    50 
    51 text "The following should fail, as they are false!"
    52 
    53 schematic_lemma "?p : (ALL x. EX y. Q(x,y))  -->  (EX y. ALL x. Q(x,y))"
    54   apply (tactic {* Cla.fast_tac @{context} FOLP_cs 1 *})?
    55   oops
    56 
    57 schematic_lemma "?p : (EX x. Q(x))  -->  (ALL x. Q(x))"
    58   apply (tactic {* Cla.fast_tac @{context} FOLP_cs 1 *})?
    59   oops
    60 
    61 schematic_lemma "?p : P(?a) --> (ALL x. P(x))"
    62   apply (tactic {* Cla.fast_tac @{context} FOLP_cs 1 *})?
    63   oops
    64 
    65 schematic_lemma "?p : (P(?a) --> (ALL x. Q(x))) --> (ALL x. P(x) --> Q(x))"
    66   apply (tactic {* Cla.fast_tac @{context} FOLP_cs 1 *})?
    67   oops
    68 
    69 
    70 text "Back to things that are provable..."
    71 
    72 schematic_lemma "?p : (ALL x. P(x)-->Q(x)) & (EX x. P(x)) --> (EX x. Q(x))"
    73   by (tactic {* Cla.fast_tac @{context} FOLP_cs 1 *})
    74 
    75 
    76 (*An example of why exI should be delayed as long as possible*)
    77 schematic_lemma "?p : (P --> (EX x. Q(x))) & P --> (EX x. Q(x))"
    78   by (tactic {* Cla.fast_tac @{context} FOLP_cs 1 *})
    79 
    80 schematic_lemma "?p : (ALL x. P(x)-->Q(f(x))) & (ALL x. Q(x)-->R(g(x))) & P(d) --> R(?a)"
    81   by (tactic {* Cla.fast_tac @{context} FOLP_cs 1 *})
    82 
    83 schematic_lemma "?p : (ALL x. Q(x))  -->  (EX x. Q(x))"
    84   by (tactic {* Cla.fast_tac @{context} FOLP_cs 1 *})
    85 
    86 
    87 text "Some slow ones"
    88 
    89 (*Principia Mathematica *11.53  *)
    90 schematic_lemma "?p : (ALL x y. P(x) --> Q(y)) <-> ((EX x. P(x)) --> (ALL y. Q(y)))"
    91   by (tactic {* Cla.fast_tac @{context} FOLP_cs 1 *})
    92 
    93 (*Principia Mathematica *11.55  *)
    94 schematic_lemma "?p : (EX x y. P(x) & Q(x,y)) <-> (EX x. P(x) & (EX y. Q(x,y)))"
    95   by (tactic {* Cla.fast_tac @{context} FOLP_cs 1 *})
    96 
    97 (*Principia Mathematica *11.61  *)
    98 schematic_lemma "?p : (EX y. ALL x. P(x) --> Q(x,y)) --> (ALL x. P(x) --> (EX y. Q(x,y)))"
    99   by (tactic {* Cla.fast_tac @{context} FOLP_cs 1 *})
   100 
   101 end