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