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