src/Sequents/LK/Hard_Quantifiers.thy
author wenzelm
Wed, 03 Nov 2010 21:53:56 +0100
changeset 40335 3e4bb6e7c3ca
parent 35762 af3ff2ba4c54
child 41959 b460124855b8
permissions -rw-r--r--
feeder: treat header as escaped utf8 to allow initial ML text to refer to non-ASCII file/directory names (e.g. "Documents/" on Chinese Ubuntu);
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
21426
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
     1
(*  Title:      LK/Hard_Quantifiers.thy
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
     2
    Author:     Lawrence C Paulson, Cambridge University Computer Laboratory
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
     3
    Copyright   1992  University of Cambridge
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
     4
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
     5
Hard examples with quantifiers.  Can be read to test the LK system.
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
     6
From  F. J. Pelletier,
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
     7
  Seventy-Five Problems for Testing Automatic Theorem Provers,
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
     8
  J. Automated Reasoning 2 (1986), 191-216.
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
     9
  Errata, JAR 4 (1988), 236-236.
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
    10
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
    11
Uses pc_tac rather than fast_tac when the former is significantly faster.
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
    12
*)
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
    13
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
    14
theory Hard_Quantifiers
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
    15
imports LK
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
    16
begin
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
    17
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
    18
lemma "|- (ALL x. P(x) & Q(x)) <-> (ALL x. P(x))  &  (ALL x. Q(x))"
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
    19
  by fast
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
    20
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
    21
lemma "|- (EX x. P-->Q(x))  <->  (P --> (EX x. Q(x)))"
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
    22
  by fast
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
    23
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
    24
lemma "|- (EX x. P(x)-->Q)  <->  (ALL x. P(x)) --> Q"
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
    25
  by fast
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
    26
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
    27
lemma "|- (ALL x. P(x)) | Q  <->  (ALL x. P(x) | Q)"
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
    28
  by fast
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
    29
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
    30
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
    31
text "Problems requiring quantifier duplication"
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
    32
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
    33
(*Not provable by fast: needs multiple instantiation of ALL*)
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
    34
lemma "|- (ALL x. P(x)-->P(f(x)))  &  P(d)-->P(f(f(f(d))))"
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
    35
  by best_dup
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
    36
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
    37
(*Needs double instantiation of the quantifier*)
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
    38
lemma "|- EX x. P(x) --> P(a) & P(b)"
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
    39
  by fast_dup
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
    40
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
    41
lemma "|- EX z. P(z) --> (ALL x. P(x))"
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
    42
  by best_dup
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
    43
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
    44
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
    45
text "Hard examples with quantifiers"
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
    46
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
    47
text "Problem 18"
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
    48
lemma "|- EX y. ALL x. P(y)-->P(x)"
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
    49
  by best_dup
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
    50
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
    51
text "Problem 19"
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
    52
lemma "|- EX x. ALL y z. (P(y)-->Q(z)) --> (P(x)-->Q(x))"
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
    53
  by best_dup
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
    54
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
    55
text "Problem 20"
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
    56
lemma "|- (ALL x y. EX z. ALL w. (P(x)&Q(y)-->R(z)&S(w)))      
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
    57
    --> (EX x y. P(x) & Q(y)) --> (EX z. R(z))"
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
    58
  by fast
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
    59
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
    60
text "Problem 21"
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
    61
lemma "|- (EX x. P-->Q(x)) & (EX x. Q(x)-->P) --> (EX x. P<->Q(x))"
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
    62
  by best_dup
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
    63
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
    64
text "Problem 22"
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
    65
lemma "|- (ALL x. P <-> Q(x))  -->  (P <-> (ALL x. Q(x)))"
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
    66
  by fast
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
    67
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
    68
text "Problem 23"
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
    69
lemma "|- (ALL x. P | Q(x))  <->  (P | (ALL x. Q(x)))"
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
    70
  by best
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
    71
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
    72
text "Problem 24"
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
    73
lemma "|- ~(EX x. S(x)&Q(x)) & (ALL x. P(x) --> Q(x)|R(x)) &   
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
    74
     ~(EX x. P(x)) --> (EX x. Q(x)) & (ALL x. Q(x)|R(x) --> S(x))   
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
    75
    --> (EX x. P(x)&R(x))"
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
    76
  by (tactic "pc_tac LK_pack 1")
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
    77
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
    78
text "Problem 25"
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
    79
lemma "|- (EX x. P(x)) &   
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
    80
        (ALL x. L(x) --> ~ (M(x) & R(x))) &   
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
    81
        (ALL x. P(x) --> (M(x) & L(x))) &    
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
    82
        ((ALL x. P(x)-->Q(x)) | (EX x. P(x)&R(x)))   
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
    83
    --> (EX x. Q(x)&P(x))"
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
    84
  by best
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
    85
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
    86
text "Problem 26"
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
    87
lemma "|- ((EX x. p(x)) <-> (EX x. q(x))) &        
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
    88
      (ALL x. ALL y. p(x) & q(y) --> (r(x) <-> s(y)))    
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
    89
  --> ((ALL x. p(x)-->r(x)) <-> (ALL x. q(x)-->s(x)))"
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
    90
  by (tactic "pc_tac LK_pack 1")
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
    91
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
    92
text "Problem 27"
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
    93
lemma "|- (EX x. P(x) & ~Q(x)) &    
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
    94
              (ALL x. P(x) --> R(x)) &    
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
    95
              (ALL x. M(x) & L(x) --> P(x)) &    
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
    96
              ((EX x. R(x) & ~ Q(x)) --> (ALL x. L(x) --> ~ R(x)))   
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
    97
          --> (ALL x. M(x) --> ~L(x))"
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
    98
  by (tactic "pc_tac LK_pack 1")
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
    99
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   100
text "Problem 28.  AMENDED"
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   101
lemma "|- (ALL x. P(x) --> (ALL x. Q(x))) &    
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   102
        ((ALL x. Q(x)|R(x)) --> (EX x. Q(x)&S(x))) &   
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   103
        ((EX x. S(x)) --> (ALL x. L(x) --> M(x)))   
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   104
    --> (ALL x. P(x) & L(x) --> M(x))"
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   105
  by (tactic "pc_tac LK_pack 1")
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   106
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   107
text "Problem 29.  Essentially the same as Principia Mathematica *11.71"
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   108
lemma "|- (EX x. P(x)) & (EX y. Q(y))   
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   109
    --> ((ALL x. P(x)-->R(x)) & (ALL y. Q(y)-->S(y))   <->      
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   110
         (ALL x y. P(x) & Q(y) --> R(x) & S(y)))"
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   111
  by (tactic "pc_tac LK_pack 1")
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   112
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   113
text "Problem 30"
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   114
lemma "|- (ALL x. P(x) | Q(x) --> ~ R(x)) &  
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   115
        (ALL x. (Q(x) --> ~ S(x)) --> P(x) & R(x))   
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   116
    --> (ALL x. S(x))"
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   117
  by fast
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   118
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   119
text "Problem 31"
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   120
lemma "|- ~(EX x. P(x) & (Q(x) | R(x))) &  
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   121
        (EX x. L(x) & P(x)) &  
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   122
        (ALL x. ~ R(x) --> M(x))   
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   123
    --> (EX x. L(x) & M(x))"
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   124
  by fast
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   125
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   126
text "Problem 32"
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   127
lemma "|- (ALL x. P(x) & (Q(x)|R(x))-->S(x)) &  
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   128
        (ALL x. S(x) & R(x) --> L(x)) &  
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   129
        (ALL x. M(x) --> R(x))   
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   130
    --> (ALL x. P(x) & M(x) --> L(x))"
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   131
  by best
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   132
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   133
text "Problem 33"
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   134
lemma "|- (ALL x. P(a) & (P(x)-->P(b))-->P(c))  <->     
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   135
     (ALL x. (~P(a) | P(x) | P(c)) & (~P(a) | ~P(b) | P(c)))"
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   136
  by fast
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   137
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   138
text "Problem 34  AMENDED (TWICE!!)"
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   139
(*Andrews's challenge*)
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   140
lemma "|- ((EX x. ALL y. p(x) <-> p(y))  <->               
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   141
               ((EX x. q(x)) <-> (ALL y. p(y))))     <->         
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   142
              ((EX x. ALL y. q(x) <-> q(y))  <->                 
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   143
               ((EX x. p(x)) <-> (ALL y. q(y))))"
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   144
  by best_dup
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   145
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   146
text "Problem 35"
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   147
lemma "|- EX x y. P(x,y) -->  (ALL u v. P(u,v))"
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   148
  by best_dup
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   149
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   150
text "Problem 36"
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   151
lemma "|- (ALL x. EX y. J(x,y)) &  
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   152
         (ALL x. EX y. G(x,y)) &  
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   153
         (ALL x y. J(x,y) | G(x,y) -->    
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   154
         (ALL z. J(y,z) | G(y,z) --> H(x,z)))    
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   155
         --> (ALL x. EX y. H(x,y))"
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   156
  by fast
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   157
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   158
text "Problem 37"
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   159
lemma "|- (ALL z. EX w. ALL x. EX y.  
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   160
           (P(x,z)-->P(y,w)) & P(y,z) & (P(y,w) --> (EX u. Q(u,w)))) &  
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   161
        (ALL x z. ~P(x,z) --> (EX y. Q(y,z))) &  
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   162
        ((EX x y. Q(x,y)) --> (ALL x. R(x,x)))   
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   163
    --> (ALL x. EX y. R(x,y))"
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   164
  by (tactic "pc_tac LK_pack 1")
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   165
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   166
text "Problem 38"
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   167
lemma "|- (ALL x. p(a) & (p(x) --> (EX y. p(y) & r(x,y))) -->         
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   168
                 (EX z. EX w. p(z) & r(x,w) & r(w,z)))  <->          
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   169
         (ALL x. (~p(a) | p(x) | (EX z. EX w. p(z) & r(x,w) & r(w,z))) &     
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   170
                 (~p(a) | ~(EX y. p(y) & r(x,y)) |                           
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   171
                 (EX z. EX w. p(z) & r(x,w) & r(w,z))))"
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   172
  by (tactic "pc_tac LK_pack 1")
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   173
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   174
text "Problem 39"
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   175
lemma "|- ~ (EX x. ALL y. F(y,x) <-> ~F(y,y))"
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   176
  by fast
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   177
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   178
text "Problem 40.  AMENDED"
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   179
lemma "|- (EX y. ALL x. F(x,y) <-> F(x,x)) -->   
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   180
         ~(ALL x. EX y. ALL z. F(z,y) <-> ~ F(z,x))"
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   181
  by fast
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   182
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   183
text "Problem 41"
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   184
lemma "|- (ALL z. EX y. ALL x. f(x,y) <-> f(x,z) & ~ f(x,x))       
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   185
         --> ~ (EX z. ALL x. f(x,z))"
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   186
  by fast
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   187
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   188
text "Problem 42"
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   189
lemma "|- ~ (EX y. ALL x. p(x,y) <-> ~ (EX z. p(x,z) & p(z,x)))"
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   190
  oops
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   191
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   192
text "Problem 43"
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   193
lemma "|- (ALL x. ALL y. q(x,y) <-> (ALL z. p(z,x) <-> p(z,y)))  
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   194
          --> (ALL x. (ALL y. q(x,y) <-> q(y,x)))"
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   195
  oops
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   196
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   197
text "Problem 44"
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   198
lemma "|- (ALL x. f(x) -->                                         
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   199
                 (EX y. g(y) & h(x,y) & (EX y. g(y) & ~ h(x,y))))  &        
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   200
         (EX x. j(x) & (ALL y. g(y) --> h(x,y)))                    
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   201
         --> (EX x. j(x) & ~f(x))"
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   202
  by fast
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   203
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   204
text "Problem 45"
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   205
lemma "|- (ALL x. f(x) & (ALL y. g(y) & h(x,y) --> j(x,y))         
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   206
                      --> (ALL y. g(y) & h(x,y) --> k(y))) &     
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   207
      ~ (EX y. l(y) & k(y)) &                                    
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   208
      (EX x. f(x) & (ALL y. h(x,y) --> l(y))                     
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   209
                   & (ALL y. g(y) & h(x,y) --> j(x,y)))          
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   210
      --> (EX x. f(x) & ~ (EX y. g(y) & h(x,y)))"
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   211
  by best
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   212
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   213
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   214
text "Problems (mainly) involving equality or functions"
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   215
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   216
text "Problem 48"
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   217
lemma "|- (a=b | c=d) & (a=c | b=d) --> a=d | b=c"
22896
1c2abcabea61 tuned ML setup;
wenzelm
parents: 21426
diff changeset
   218
  by (tactic {* fast_tac (LK_pack add_safes @{thms subst}) 1 *})
21426
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   219
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   220
text "Problem 50"
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   221
lemma "|- (ALL x. P(a,x) | (ALL y. P(x,y))) --> (EX x. ALL y. P(x,y))"
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   222
  by best_dup
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   223
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   224
text "Problem 51"
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   225
lemma "|- (EX z w. ALL x y. P(x,y) <->  (x=z & y=w)) -->   
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   226
         (EX z. ALL x. EX w. (ALL y. P(x,y) <-> y=w) <-> x=z)"
22896
1c2abcabea61 tuned ML setup;
wenzelm
parents: 21426
diff changeset
   227
  by (tactic {* fast_tac (LK_pack add_safes @{thms subst}) 1 *})
21426
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   228
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   229
text "Problem 52"  (*Almost the same as 51. *)
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   230
lemma "|- (EX z w. ALL x y. P(x,y) <->  (x=z & y=w)) -->
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   231
         (EX w. ALL y. EX z. (ALL x. P(x,y) <-> x=z) <-> y=w)"
22896
1c2abcabea61 tuned ML setup;
wenzelm
parents: 21426
diff changeset
   232
  by (tactic {* fast_tac (LK_pack add_safes @{thms subst}) 1 *})
21426
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   233
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   234
text "Problem 56"
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   235
lemma "|- (ALL x.(EX y. P(y) & x=f(y)) --> P(x)) <-> (ALL x. P(x) --> P(f(x)))"
22896
1c2abcabea61 tuned ML setup;
wenzelm
parents: 21426
diff changeset
   236
  by (tactic {* best_tac (LK_pack add_unsafes [@{thm symL}, @{thm subst}]) 1 *})
21426
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   237
  (*requires tricker to orient the equality properly*)
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   238
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   239
text "Problem 57"
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   240
lemma "|- P(f(a,b), f(b,c)) & P(f(b,c), f(a,c)) &  
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   241
         (ALL x y z. P(x,y) & P(y,z) --> P(x,z))    -->   P(f(a,b), f(a,c))"
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   242
  by fast
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   243
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   244
text "Problem 58!"
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   245
lemma "|- (ALL x y. f(x)=g(y)) --> (ALL x y. f(f(x))=f(g(y)))"
22896
1c2abcabea61 tuned ML setup;
wenzelm
parents: 21426
diff changeset
   246
  by (tactic {* fast_tac (LK_pack add_safes @{thms subst}) 1 *})
21426
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   247
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   248
text "Problem 59"
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   249
(*Unification works poorly here -- the abstraction %sobj prevents efficient
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   250
  operation of the occurs check*)
24178
4ff1dc2aa18d turned Unify flags into configuration options (global only);
wenzelm
parents: 22896
diff changeset
   251
21426
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   252
lemma "|- (ALL x. P(x) <-> ~P(f(x))) --> (EX x. P(x) & ~P(f(x)))"
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   253
  by best_dup
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   254
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   255
text "Problem 60"
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   256
lemma "|- ALL x. P(x,f(x)) <-> (EX y. (ALL z. P(z,y) --> P(z,f(x))) & P(x,y))"
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   257
  by fast
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   258
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   259
text "Problem 62 as corrected in JAR 18 (1997), page 135"
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   260
lemma "|- (ALL x. p(a) & (p(x) --> p(f(x))) --> p(f(f(x))))  <->
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   261
      (ALL x. (~p(a) | p(x) | p(f(f(x)))) &                       
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   262
              (~p(a) | ~p(f(x)) | p(f(f(x)))))"
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   263
  by fast
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   264
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   265
(*18 June 92: loaded in 372 secs*)
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   266
(*19 June 92: loaded in 166 secs except #34, using repeat_goal_tac*)
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   267
(*29 June 92: loaded in 370 secs*)
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   268
(*18 September 2005: loaded in 1.809 secs*)
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   269
87ac12bed1ab converted legacy ML scripts;
wenzelm
parents:
diff changeset
   270
end