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