src/FOLP/ex/Classical.thy
author wenzelm
Fri, 01 Jan 2016 10:49:00 +0100
changeset 62020 5d208fd2507d
parent 61337 4645502c3c64
child 69593 3dda49e08b9d
permissions -rw-r--r--
isabelle update_cartouches -c -t;
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
26322
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
     1
(*  Title:      FOLP/ex/Classical.thy
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
     2
    Author:     Lawrence C Paulson, Cambridge University Computer Laboratory
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
     3
    Copyright   1993  University of Cambridge
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
     4
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
     5
Classical First-Order Logic.
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
     6
*)
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
     7
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
     8
theory Classical
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
     9
imports FOLP
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
    10
begin
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
    11
61337
4645502c3c64 fewer aliases for toplevel theorem statements;
wenzelm
parents: 60770
diff changeset
    12
schematic_goal "?p : (P --> Q | R) --> (P-->Q) | (P-->R)"
58957
c9e744ea8a38 proper context for match_tac etc.;
wenzelm
parents: 58860
diff changeset
    13
  by (tactic "fast_tac @{context} FOLP_cs 1")
26322
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
    14
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
    15
(*If and only if*)
61337
4645502c3c64 fewer aliases for toplevel theorem statements;
wenzelm
parents: 60770
diff changeset
    16
schematic_goal "?p : (P<->Q) <-> (Q<->P)"
58957
c9e744ea8a38 proper context for match_tac etc.;
wenzelm
parents: 58860
diff changeset
    17
  by (tactic "fast_tac @{context} FOLP_cs 1")
26322
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
    18
61337
4645502c3c64 fewer aliases for toplevel theorem statements;
wenzelm
parents: 60770
diff changeset
    19
schematic_goal "?p : ~ (P <-> ~P)"
58957
c9e744ea8a38 proper context for match_tac etc.;
wenzelm
parents: 58860
diff changeset
    20
  by (tactic "fast_tac @{context} FOLP_cs 1")
26322
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
    21
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
    22
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
    23
(*Sample problems from 
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
    24
  F. J. Pelletier, 
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
    25
  Seventy-Five Problems for Testing Automatic Theorem Provers,
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
    26
  J. Automated Reasoning 2 (1986), 191-216.
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
    27
  Errata, JAR 4 (1988), 236-236.
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
    28
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
    29
The hardest problems -- judging by experience with several theorem provers,
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
    30
including matrix ones -- are 34 and 43.
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
    31
*)
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
    32
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
    33
text "Pelletier's examples"
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
    34
(*1*)
61337
4645502c3c64 fewer aliases for toplevel theorem statements;
wenzelm
parents: 60770
diff changeset
    35
schematic_goal "?p : (P-->Q)  <->  (~Q --> ~P)"
58957
c9e744ea8a38 proper context for match_tac etc.;
wenzelm
parents: 58860
diff changeset
    36
  by (tactic "fast_tac @{context} FOLP_cs 1")
26322
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
    37
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
    38
(*2*)
61337
4645502c3c64 fewer aliases for toplevel theorem statements;
wenzelm
parents: 60770
diff changeset
    39
schematic_goal "?p : ~ ~ P  <->  P"
58957
c9e744ea8a38 proper context for match_tac etc.;
wenzelm
parents: 58860
diff changeset
    40
  by (tactic "fast_tac @{context} FOLP_cs 1")
26322
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
    41
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
    42
(*3*)
61337
4645502c3c64 fewer aliases for toplevel theorem statements;
wenzelm
parents: 60770
diff changeset
    43
schematic_goal "?p : ~(P-->Q) --> (Q-->P)"
58957
c9e744ea8a38 proper context for match_tac etc.;
wenzelm
parents: 58860
diff changeset
    44
  by (tactic "fast_tac @{context} FOLP_cs 1")
26322
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
    45
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
    46
(*4*)
61337
4645502c3c64 fewer aliases for toplevel theorem statements;
wenzelm
parents: 60770
diff changeset
    47
schematic_goal "?p : (~P-->Q)  <->  (~Q --> P)"
58957
c9e744ea8a38 proper context for match_tac etc.;
wenzelm
parents: 58860
diff changeset
    48
  by (tactic "fast_tac @{context} FOLP_cs 1")
26322
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
    49
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
    50
(*5*)
61337
4645502c3c64 fewer aliases for toplevel theorem statements;
wenzelm
parents: 60770
diff changeset
    51
schematic_goal "?p : ((P|Q)-->(P|R)) --> (P|(Q-->R))"
58957
c9e744ea8a38 proper context for match_tac etc.;
wenzelm
parents: 58860
diff changeset
    52
  by (tactic "fast_tac @{context} FOLP_cs 1")
26322
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
    53
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
    54
(*6*)
61337
4645502c3c64 fewer aliases for toplevel theorem statements;
wenzelm
parents: 60770
diff changeset
    55
schematic_goal "?p : P | ~ P"
58957
c9e744ea8a38 proper context for match_tac etc.;
wenzelm
parents: 58860
diff changeset
    56
  by (tactic "fast_tac @{context} FOLP_cs 1")
26322
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
    57
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
    58
(*7*)
61337
4645502c3c64 fewer aliases for toplevel theorem statements;
wenzelm
parents: 60770
diff changeset
    59
schematic_goal "?p : P | ~ ~ ~ P"
58957
c9e744ea8a38 proper context for match_tac etc.;
wenzelm
parents: 58860
diff changeset
    60
  by (tactic "fast_tac @{context} FOLP_cs 1")
26322
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
    61
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
    62
(*8.  Peirce's law*)
61337
4645502c3c64 fewer aliases for toplevel theorem statements;
wenzelm
parents: 60770
diff changeset
    63
schematic_goal "?p : ((P-->Q) --> P)  -->  P"
58957
c9e744ea8a38 proper context for match_tac etc.;
wenzelm
parents: 58860
diff changeset
    64
  by (tactic "fast_tac @{context} FOLP_cs 1")
26322
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
    65
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
    66
(*9*)
61337
4645502c3c64 fewer aliases for toplevel theorem statements;
wenzelm
parents: 60770
diff changeset
    67
schematic_goal "?p : ((P|Q) & (~P|Q) & (P| ~Q)) --> ~ (~P | ~Q)"
58957
c9e744ea8a38 proper context for match_tac etc.;
wenzelm
parents: 58860
diff changeset
    68
  by (tactic "fast_tac @{context} FOLP_cs 1")
26322
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
    69
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
    70
(*10*)
61337
4645502c3c64 fewer aliases for toplevel theorem statements;
wenzelm
parents: 60770
diff changeset
    71
schematic_goal "?p : (Q-->R) & (R-->P&Q) & (P-->Q|R) --> (P<->Q)"
58957
c9e744ea8a38 proper context for match_tac etc.;
wenzelm
parents: 58860
diff changeset
    72
  by (tactic "fast_tac @{context} FOLP_cs 1")
26322
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
    73
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
    74
(*11.  Proved in each direction (incorrectly, says Pelletier!!)  *)
61337
4645502c3c64 fewer aliases for toplevel theorem statements;
wenzelm
parents: 60770
diff changeset
    75
schematic_goal "?p : P<->P"
58957
c9e744ea8a38 proper context for match_tac etc.;
wenzelm
parents: 58860
diff changeset
    76
  by (tactic "fast_tac @{context} FOLP_cs 1")
26322
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
    77
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
    78
(*12.  "Dijkstra's law"*)
61337
4645502c3c64 fewer aliases for toplevel theorem statements;
wenzelm
parents: 60770
diff changeset
    79
schematic_goal "?p : ((P <-> Q) <-> R)  <->  (P <-> (Q <-> R))"
58957
c9e744ea8a38 proper context for match_tac etc.;
wenzelm
parents: 58860
diff changeset
    80
  by (tactic "fast_tac @{context} FOLP_cs 1")
26322
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
    81
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
    82
(*13.  Distributive law*)
61337
4645502c3c64 fewer aliases for toplevel theorem statements;
wenzelm
parents: 60770
diff changeset
    83
schematic_goal "?p : P | (Q & R)  <-> (P | Q) & (P | R)"
58957
c9e744ea8a38 proper context for match_tac etc.;
wenzelm
parents: 58860
diff changeset
    84
  by (tactic "fast_tac @{context} FOLP_cs 1")
26322
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
    85
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
    86
(*14*)
61337
4645502c3c64 fewer aliases for toplevel theorem statements;
wenzelm
parents: 60770
diff changeset
    87
schematic_goal "?p : (P <-> Q) <-> ((Q | ~P) & (~Q|P))"
58957
c9e744ea8a38 proper context for match_tac etc.;
wenzelm
parents: 58860
diff changeset
    88
  by (tactic "fast_tac @{context} FOLP_cs 1")
26322
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
    89
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
    90
(*15*)
61337
4645502c3c64 fewer aliases for toplevel theorem statements;
wenzelm
parents: 60770
diff changeset
    91
schematic_goal "?p : (P --> Q) <-> (~P | Q)"
58957
c9e744ea8a38 proper context for match_tac etc.;
wenzelm
parents: 58860
diff changeset
    92
  by (tactic "fast_tac @{context} FOLP_cs 1")
26322
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
    93
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
    94
(*16*)
61337
4645502c3c64 fewer aliases for toplevel theorem statements;
wenzelm
parents: 60770
diff changeset
    95
schematic_goal "?p : (P-->Q) | (Q-->P)"
58957
c9e744ea8a38 proper context for match_tac etc.;
wenzelm
parents: 58860
diff changeset
    96
  by (tactic "fast_tac @{context} FOLP_cs 1")
26322
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
    97
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
    98
(*17*)
61337
4645502c3c64 fewer aliases for toplevel theorem statements;
wenzelm
parents: 60770
diff changeset
    99
schematic_goal "?p : ((P & (Q-->R))-->S) <-> ((~P | Q | S) & (~P | ~R | S))"
58957
c9e744ea8a38 proper context for match_tac etc.;
wenzelm
parents: 58860
diff changeset
   100
  by (tactic "fast_tac @{context} FOLP_cs 1")
26322
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   101
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   102
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   103
text "Classical Logic: examples with quantifiers"
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   104
61337
4645502c3c64 fewer aliases for toplevel theorem statements;
wenzelm
parents: 60770
diff changeset
   105
schematic_goal "?p : (ALL x. P(x) & Q(x)) <-> (ALL x. P(x))  &  (ALL x. Q(x))"
58957
c9e744ea8a38 proper context for match_tac etc.;
wenzelm
parents: 58860
diff changeset
   106
  by (tactic "fast_tac @{context} FOLP_cs 1")
26322
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   107
61337
4645502c3c64 fewer aliases for toplevel theorem statements;
wenzelm
parents: 60770
diff changeset
   108
schematic_goal "?p : (EX x. P-->Q(x))  <->  (P --> (EX x. Q(x)))"
58957
c9e744ea8a38 proper context for match_tac etc.;
wenzelm
parents: 58860
diff changeset
   109
  by (tactic "fast_tac @{context} FOLP_cs 1")
26322
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   110
61337
4645502c3c64 fewer aliases for toplevel theorem statements;
wenzelm
parents: 60770
diff changeset
   111
schematic_goal "?p : (EX x. P(x)-->Q)  <->  (ALL x. P(x)) --> Q"
58957
c9e744ea8a38 proper context for match_tac etc.;
wenzelm
parents: 58860
diff changeset
   112
  by (tactic "fast_tac @{context} FOLP_cs 1")
26322
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   113
61337
4645502c3c64 fewer aliases for toplevel theorem statements;
wenzelm
parents: 60770
diff changeset
   114
schematic_goal "?p : (ALL x. P(x)) | Q  <->  (ALL x. P(x) | Q)"
58957
c9e744ea8a38 proper context for match_tac etc.;
wenzelm
parents: 58860
diff changeset
   115
  by (tactic "fast_tac @{context} FOLP_cs 1")
26322
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   116
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   117
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   118
text "Problems requiring quantifier duplication"
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   119
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   120
(*Needs multiple instantiation of ALL.*)
61337
4645502c3c64 fewer aliases for toplevel theorem statements;
wenzelm
parents: 60770
diff changeset
   121
schematic_goal "?p : (ALL x. P(x)-->P(f(x)))  &  P(d)-->P(f(f(f(d))))"
58957
c9e744ea8a38 proper context for match_tac etc.;
wenzelm
parents: 58860
diff changeset
   122
  by (tactic "best_tac @{context} FOLP_dup_cs 1")
26322
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   123
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   124
(*Needs double instantiation of the quantifier*)
61337
4645502c3c64 fewer aliases for toplevel theorem statements;
wenzelm
parents: 60770
diff changeset
   125
schematic_goal "?p : EX x. P(x) --> P(a) & P(b)"
58957
c9e744ea8a38 proper context for match_tac etc.;
wenzelm
parents: 58860
diff changeset
   126
  by (tactic "best_tac @{context} FOLP_dup_cs 1")
26322
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   127
61337
4645502c3c64 fewer aliases for toplevel theorem statements;
wenzelm
parents: 60770
diff changeset
   128
schematic_goal "?p : EX z. P(z) --> (ALL x. P(x))"
58957
c9e744ea8a38 proper context for match_tac etc.;
wenzelm
parents: 58860
diff changeset
   129
  by (tactic "best_tac @{context} FOLP_dup_cs 1")
26322
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   130
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   131
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   132
text "Hard examples with quantifiers"
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   133
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   134
text "Problem 18"
61337
4645502c3c64 fewer aliases for toplevel theorem statements;
wenzelm
parents: 60770
diff changeset
   135
schematic_goal "?p : EX y. ALL x. P(y)-->P(x)"
58957
c9e744ea8a38 proper context for match_tac etc.;
wenzelm
parents: 58860
diff changeset
   136
  by (tactic "best_tac @{context} FOLP_dup_cs 1")
26322
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   137
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   138
text "Problem 19"
61337
4645502c3c64 fewer aliases for toplevel theorem statements;
wenzelm
parents: 60770
diff changeset
   139
schematic_goal "?p : EX x. ALL y z. (P(y)-->Q(z)) --> (P(x)-->Q(x))"
58957
c9e744ea8a38 proper context for match_tac etc.;
wenzelm
parents: 58860
diff changeset
   140
  by (tactic "best_tac @{context} FOLP_dup_cs 1")
26322
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   141
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   142
text "Problem 20"
61337
4645502c3c64 fewer aliases for toplevel theorem statements;
wenzelm
parents: 60770
diff changeset
   143
schematic_goal "?p : (ALL x y. EX z. ALL w. (P(x)&Q(y)-->R(z)&S(w)))      
26322
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   144
    --> (EX x y. P(x) & Q(y)) --> (EX z. R(z))"
58957
c9e744ea8a38 proper context for match_tac etc.;
wenzelm
parents: 58860
diff changeset
   145
  by (tactic "fast_tac @{context} FOLP_cs 1")
26322
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   146
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   147
text "Problem 21"
61337
4645502c3c64 fewer aliases for toplevel theorem statements;
wenzelm
parents: 60770
diff changeset
   148
schematic_goal "?p : (EX x. P-->Q(x)) & (EX x. Q(x)-->P) --> (EX x. P<->Q(x))"
58957
c9e744ea8a38 proper context for match_tac etc.;
wenzelm
parents: 58860
diff changeset
   149
  by (tactic "best_tac @{context} FOLP_dup_cs 1")
26322
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   150
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   151
text "Problem 22"
61337
4645502c3c64 fewer aliases for toplevel theorem statements;
wenzelm
parents: 60770
diff changeset
   152
schematic_goal "?p : (ALL x. P <-> Q(x))  -->  (P <-> (ALL x. Q(x)))"
58957
c9e744ea8a38 proper context for match_tac etc.;
wenzelm
parents: 58860
diff changeset
   153
  by (tactic "fast_tac @{context} FOLP_cs 1")
26322
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   154
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   155
text "Problem 23"
61337
4645502c3c64 fewer aliases for toplevel theorem statements;
wenzelm
parents: 60770
diff changeset
   156
schematic_goal "?p : (ALL x. P | Q(x))  <->  (P | (ALL x. Q(x)))"
58957
c9e744ea8a38 proper context for match_tac etc.;
wenzelm
parents: 58860
diff changeset
   157
  by (tactic "best_tac @{context} FOLP_dup_cs 1")
26322
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   158
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   159
text "Problem 24"
61337
4645502c3c64 fewer aliases for toplevel theorem statements;
wenzelm
parents: 60770
diff changeset
   160
schematic_goal "?p : ~(EX x. S(x)&Q(x)) & (ALL x. P(x) --> Q(x)|R(x)) &   
26322
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   161
     (~(EX x. P(x)) --> (EX x. Q(x))) & (ALL x. Q(x)|R(x) --> S(x))   
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   162
    --> (EX x. P(x)&R(x))"
58957
c9e744ea8a38 proper context for match_tac etc.;
wenzelm
parents: 58860
diff changeset
   163
  by (tactic "fast_tac @{context} FOLP_cs 1")
26322
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   164
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   165
text "Problem 25"
61337
4645502c3c64 fewer aliases for toplevel theorem statements;
wenzelm
parents: 60770
diff changeset
   166
schematic_goal "?p : (EX x. P(x)) &  
26322
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   167
       (ALL x. L(x) --> ~ (M(x) & R(x))) &  
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   168
       (ALL x. P(x) --> (M(x) & L(x))) &   
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   169
       ((ALL x. P(x)-->Q(x)) | (EX x. P(x)&R(x)))  
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   170
   --> (EX x. Q(x)&P(x))"
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   171
  oops
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   172
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   173
text "Problem 26"
61337
4645502c3c64 fewer aliases for toplevel theorem statements;
wenzelm
parents: 60770
diff changeset
   174
schematic_goal "?u : ((EX x. p(x)) <-> (EX x. q(x))) &   
26322
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   175
     (ALL x. ALL y. p(x) & q(y) --> (r(x) <-> s(y)))   
58860
fee7cfa69c50 eliminated spurious semicolons;
wenzelm
parents: 36319
diff changeset
   176
  --> ((ALL x. p(x)-->r(x)) <-> (ALL x. q(x)-->s(x)))"
58957
c9e744ea8a38 proper context for match_tac etc.;
wenzelm
parents: 58860
diff changeset
   177
  by (tactic "fast_tac @{context} FOLP_cs 1")
26322
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   178
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   179
text "Problem 27"
61337
4645502c3c64 fewer aliases for toplevel theorem statements;
wenzelm
parents: 60770
diff changeset
   180
schematic_goal "?p : (EX x. P(x) & ~Q(x)) &    
26322
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   181
              (ALL x. P(x) --> R(x)) &    
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   182
              (ALL x. M(x) & L(x) --> P(x)) &    
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   183
              ((EX x. R(x) & ~ Q(x)) --> (ALL x. L(x) --> ~ R(x)))   
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   184
          --> (ALL x. M(x) --> ~L(x))"
58957
c9e744ea8a38 proper context for match_tac etc.;
wenzelm
parents: 58860
diff changeset
   185
  by (tactic "fast_tac @{context} FOLP_cs 1")
26322
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   186
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   187
text "Problem 28.  AMENDED"
61337
4645502c3c64 fewer aliases for toplevel theorem statements;
wenzelm
parents: 60770
diff changeset
   188
schematic_goal "?p : (ALL x. P(x) --> (ALL x. Q(x))) &    
26322
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   189
        ((ALL x. Q(x)|R(x)) --> (EX x. Q(x)&S(x))) &   
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   190
        ((EX x. S(x)) --> (ALL x. L(x) --> M(x)))   
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   191
    --> (ALL x. P(x) & L(x) --> M(x))"
58957
c9e744ea8a38 proper context for match_tac etc.;
wenzelm
parents: 58860
diff changeset
   192
  by (tactic "fast_tac @{context} FOLP_cs 1")
26322
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   193
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   194
text "Problem 29.  Essentially the same as Principia Mathematica *11.71"
61337
4645502c3c64 fewer aliases for toplevel theorem statements;
wenzelm
parents: 60770
diff changeset
   195
schematic_goal "?p : (EX x. P(x)) & (EX y. Q(y))   
26322
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   196
    --> ((ALL x. P(x)-->R(x)) & (ALL y. Q(y)-->S(y))   <->      
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   197
         (ALL x y. P(x) & Q(y) --> R(x) & S(y)))"
58957
c9e744ea8a38 proper context for match_tac etc.;
wenzelm
parents: 58860
diff changeset
   198
  by (tactic "fast_tac @{context} FOLP_cs 1")
26322
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   199
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   200
text "Problem 30"
61337
4645502c3c64 fewer aliases for toplevel theorem statements;
wenzelm
parents: 60770
diff changeset
   201
schematic_goal "?p : (ALL x. P(x) | Q(x) --> ~ R(x)) &  
26322
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   202
        (ALL x. (Q(x) --> ~ S(x)) --> P(x) & R(x))   
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   203
    --> (ALL x. S(x))"
58957
c9e744ea8a38 proper context for match_tac etc.;
wenzelm
parents: 58860
diff changeset
   204
  by (tactic "fast_tac @{context} FOLP_cs 1")
26322
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   205
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   206
text "Problem 31"
61337
4645502c3c64 fewer aliases for toplevel theorem statements;
wenzelm
parents: 60770
diff changeset
   207
schematic_goal "?p : ~(EX x. P(x) & (Q(x) | R(x))) &  
26322
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   208
        (EX x. L(x) & P(x)) &  
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   209
        (ALL x. ~ R(x) --> M(x))   
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   210
    --> (EX x. L(x) & M(x))"
58957
c9e744ea8a38 proper context for match_tac etc.;
wenzelm
parents: 58860
diff changeset
   211
  by (tactic "fast_tac @{context} FOLP_cs 1")
26322
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   212
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   213
text "Problem 32"
61337
4645502c3c64 fewer aliases for toplevel theorem statements;
wenzelm
parents: 60770
diff changeset
   214
schematic_goal "?p : (ALL x. P(x) & (Q(x)|R(x))-->S(x)) &  
26322
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   215
        (ALL x. S(x) & R(x) --> L(x)) &  
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   216
        (ALL x. M(x) --> R(x))   
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   217
    --> (ALL x. P(x) & M(x) --> L(x))"
58957
c9e744ea8a38 proper context for match_tac etc.;
wenzelm
parents: 58860
diff changeset
   218
  by (tactic "best_tac @{context} FOLP_dup_cs 1")
26322
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   219
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   220
text "Problem 33"
61337
4645502c3c64 fewer aliases for toplevel theorem statements;
wenzelm
parents: 60770
diff changeset
   221
schematic_goal "?p : (ALL x. P(a) & (P(x)-->P(b))-->P(c))  <->     
26322
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   222
     (ALL x. (~P(a) | P(x) | P(c)) & (~P(a) | ~P(b) | P(c)))"
58957
c9e744ea8a38 proper context for match_tac etc.;
wenzelm
parents: 58860
diff changeset
   223
  by (tactic "best_tac @{context} FOLP_dup_cs 1")
26322
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   224
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   225
text "Problem 35"
61337
4645502c3c64 fewer aliases for toplevel theorem statements;
wenzelm
parents: 60770
diff changeset
   226
schematic_goal "?p : EX x y. P(x,y) -->  (ALL u v. P(u,v))"
58957
c9e744ea8a38 proper context for match_tac etc.;
wenzelm
parents: 58860
diff changeset
   227
  by (tactic "best_tac @{context} FOLP_dup_cs 1")
26322
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   228
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   229
text "Problem 36"
61337
4645502c3c64 fewer aliases for toplevel theorem statements;
wenzelm
parents: 60770
diff changeset
   230
schematic_goal
26322
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   231
"?p : (ALL x. EX y. J(x,y)) &  
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   232
      (ALL x. EX y. G(x,y)) &  
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   233
      (ALL x y. J(x,y) | G(x,y) --> (ALL z. J(y,z) | G(y,z) --> H(x,z)))    
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   234
  --> (ALL x. EX y. H(x,y))"
58957
c9e744ea8a38 proper context for match_tac etc.;
wenzelm
parents: 58860
diff changeset
   235
  by (tactic "fast_tac @{context} FOLP_cs 1")
26322
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   236
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   237
text "Problem 37"
61337
4645502c3c64 fewer aliases for toplevel theorem statements;
wenzelm
parents: 60770
diff changeset
   238
schematic_goal "?p : (ALL z. EX w. ALL x. EX y.  
26322
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   239
           (P(x,z)-->P(y,w)) & P(y,z) & (P(y,w) --> (EX u. Q(u,w)))) &  
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   240
        (ALL x z. ~P(x,z) --> (EX y. Q(y,z))) &  
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   241
        ((EX x y. Q(x,y)) --> (ALL x. R(x,x)))   
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   242
    --> (ALL x. EX y. R(x,y))"
58957
c9e744ea8a38 proper context for match_tac etc.;
wenzelm
parents: 58860
diff changeset
   243
  by (tactic "fast_tac @{context} FOLP_cs 1")
26322
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   244
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   245
text "Problem 39"
61337
4645502c3c64 fewer aliases for toplevel theorem statements;
wenzelm
parents: 60770
diff changeset
   246
schematic_goal "?p : ~ (EX x. ALL y. F(y,x) <-> ~F(y,y))"
58957
c9e744ea8a38 proper context for match_tac etc.;
wenzelm
parents: 58860
diff changeset
   247
  by (tactic "fast_tac @{context} FOLP_cs 1")
26322
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   248
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   249
text "Problem 40.  AMENDED"
61337
4645502c3c64 fewer aliases for toplevel theorem statements;
wenzelm
parents: 60770
diff changeset
   250
schematic_goal "?p : (EX y. ALL x. F(x,y) <-> F(x,x)) -->   
26322
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   251
              ~(ALL x. EX y. ALL z. F(z,y) <-> ~ F(z,x))"
58957
c9e744ea8a38 proper context for match_tac etc.;
wenzelm
parents: 58860
diff changeset
   252
  by (tactic "fast_tac @{context} FOLP_cs 1")
26322
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   253
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   254
text "Problem 41"
61337
4645502c3c64 fewer aliases for toplevel theorem statements;
wenzelm
parents: 60770
diff changeset
   255
schematic_goal "?p : (ALL z. EX y. ALL x. f(x,y) <-> f(x,z) & ~ f(x,x))   
26322
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   256
          --> ~ (EX z. ALL x. f(x,z))"
58957
c9e744ea8a38 proper context for match_tac etc.;
wenzelm
parents: 58860
diff changeset
   257
  by (tactic "best_tac @{context} FOLP_dup_cs 1")
26322
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   258
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   259
text "Problem 44"
61337
4645502c3c64 fewer aliases for toplevel theorem statements;
wenzelm
parents: 60770
diff changeset
   260
schematic_goal "?p : (ALL x. f(x) -->                                     
26322
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   261
              (EX y. g(y) & h(x,y) & (EX y. g(y) & ~ h(x,y))))  &        
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   262
              (EX x. j(x) & (ALL y. g(y) --> h(x,y)))                    
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   263
              --> (EX x. j(x) & ~f(x))"
58957
c9e744ea8a38 proper context for match_tac etc.;
wenzelm
parents: 58860
diff changeset
   264
  by (tactic "fast_tac @{context} FOLP_cs 1")
26322
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   265
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   266
text "Problems (mainly) involving equality or functions"
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   267
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   268
text "Problem 48"
61337
4645502c3c64 fewer aliases for toplevel theorem statements;
wenzelm
parents: 60770
diff changeset
   269
schematic_goal "?p : (a=b | c=d) & (a=c | b=d) --> a=d | b=c"
58957
c9e744ea8a38 proper context for match_tac etc.;
wenzelm
parents: 58860
diff changeset
   270
  by (tactic "fast_tac @{context} FOLP_cs 1")
26322
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   271
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   272
text "Problem 50"
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   273
(*What has this to do with equality?*)
61337
4645502c3c64 fewer aliases for toplevel theorem statements;
wenzelm
parents: 60770
diff changeset
   274
schematic_goal "?p : (ALL x. P(a,x) | (ALL y. P(x,y))) --> (EX x. ALL y. P(x,y))"
58957
c9e744ea8a38 proper context for match_tac etc.;
wenzelm
parents: 58860
diff changeset
   275
  by (tactic "best_tac @{context} FOLP_dup_cs 1")
26322
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   276
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   277
text "Problem 56"
61337
4645502c3c64 fewer aliases for toplevel theorem statements;
wenzelm
parents: 60770
diff changeset
   278
schematic_goal
26322
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   279
 "?p : (ALL x. (EX y. P(y) & x=f(y)) --> P(x)) <-> (ALL x. P(x) --> P(f(x)))"
58957
c9e744ea8a38 proper context for match_tac etc.;
wenzelm
parents: 58860
diff changeset
   280
  by (tactic "fast_tac @{context} FOLP_cs 1")
26322
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   281
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   282
text "Problem 57"
61337
4645502c3c64 fewer aliases for toplevel theorem statements;
wenzelm
parents: 60770
diff changeset
   283
schematic_goal
26322
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   284
"?p : P(f(a,b), f(b,c)) & P(f(b,c), f(a,c)) &  
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   285
      (ALL x y z. P(x,y) & P(y,z) --> P(x,z))    -->   P(f(a,b), f(a,c))"
58957
c9e744ea8a38 proper context for match_tac etc.;
wenzelm
parents: 58860
diff changeset
   286
  by (tactic "fast_tac @{context} FOLP_cs 1")
26322
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   287
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   288
text "Problem 58  NOT PROVED AUTOMATICALLY"
61337
4645502c3c64 fewer aliases for toplevel theorem statements;
wenzelm
parents: 60770
diff changeset
   289
schematic_goal "?p : (ALL x y. f(x)=g(y)) --> (ALL x y. f(f(x))=f(g(y)))"
60375
wenzelm
parents: 58957
diff changeset
   290
  supply f_cong = subst_context [where t = f]
60770
240563fbf41d isabelle update_cartouches;
wenzelm
parents: 60375
diff changeset
   291
  by (tactic \<open>fast_tac @{context} (FOLP_cs addSIs [@{thm f_cong}]) 1\<close>)
26322
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   292
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   293
text "Problem 59"
61337
4645502c3c64 fewer aliases for toplevel theorem statements;
wenzelm
parents: 60770
diff changeset
   294
schematic_goal "?p : (ALL x. P(x) <-> ~P(f(x))) --> (EX x. P(x) & ~P(f(x)))"
58957
c9e744ea8a38 proper context for match_tac etc.;
wenzelm
parents: 58860
diff changeset
   295
  by (tactic "best_tac @{context} FOLP_dup_cs 1")
26322
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   296
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   297
text "Problem 60"
61337
4645502c3c64 fewer aliases for toplevel theorem statements;
wenzelm
parents: 60770
diff changeset
   298
schematic_goal "?p : ALL x. P(x,f(x)) <-> (EX y. (ALL z. P(z,y) --> P(z,f(x))) & P(x,y))"
58957
c9e744ea8a38 proper context for match_tac etc.;
wenzelm
parents: 58860
diff changeset
   299
  by (tactic "fast_tac @{context} FOLP_cs 1")
26322
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   300
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   301
end