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