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