src/HOL/ex/cla.ML
author paulson
Thu, 14 Dec 1995 12:49:32 +0100
changeset 1404 57c3f6d2e692
parent 969 b051e2fc2e34
child 1465 5d7a7e439cec
permissions -rw-r--r--
Added Pelletier's problem 62, as corrected in AAR Newletter #31
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
969
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
     1
(*  Title: 	HOL/ex/cla
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
     2
    ID:         $Id$
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
     3
    Author: 	Lawrence C Paulson, Cambridge University Computer Laboratory
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
     4
    Copyright   1994  University of Cambridge
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
     5
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
     6
Higher-Order Logic: predicate calculus problems
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
     7
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
     8
Taken from FOL/cla.ML; beware of precedence of = vs <->
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
     9
*)
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
    10
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
    11
writeln"File HOL/ex/cla.";
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
    12
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
    13
goal HOL.thy "(P --> Q | R) --> (P-->Q) | (P-->R)";
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
    14
by (fast_tac HOL_cs 1);
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
    15
result();
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
    16
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
    17
(*If and only if*)
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
    18
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
    19
goal HOL.thy "(P=Q) = (Q=P::bool)";
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
    20
by (fast_tac HOL_cs 1);
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
    21
result();
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
    22
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
    23
goal HOL.thy "~ (P = (~P))";
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
    24
by (fast_tac HOL_cs 1);
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
    25
result();
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
    26
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
    27
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
    28
(*Sample problems from 
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
    29
  F. J. Pelletier, 
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
    30
  Seventy-Five Problems for Testing Automatic Theorem Provers,
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
    31
  J. Automated Reasoning 2 (1986), 191-216.
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
    32
  Errata, JAR 4 (1988), 236-236.
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
    33
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
    34
The hardest problems -- judging by experience with several theorem provers,
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
    35
including matrix ones -- are 34 and 43.
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
    36
*)
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
    37
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
    38
writeln"Pelletier's examples";
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
    39
(*1*)
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
    40
goal HOL.thy "(P-->Q)  =  (~Q --> ~P)";
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
    41
by (fast_tac HOL_cs 1);
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
    42
result();
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
    43
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
    44
(*2*)
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
    45
goal HOL.thy "(~ ~ P) =  P";
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
    46
by (fast_tac HOL_cs 1);
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
    47
result();
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
    48
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
    49
(*3*)
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
    50
goal HOL.thy "~(P-->Q) --> (Q-->P)";
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
    51
by (fast_tac HOL_cs 1);
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
    52
result();
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
    53
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
    54
(*4*)
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
    55
goal HOL.thy "(~P-->Q)  =  (~Q --> P)";
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
    56
by (fast_tac HOL_cs 1);
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
    57
result();
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
    58
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
    59
(*5*)
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
    60
goal HOL.thy "((P|Q)-->(P|R)) --> (P|(Q-->R))";
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
    61
by (fast_tac HOL_cs 1);
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
    62
result();
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
    63
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
    64
(*6*)
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
    65
goal HOL.thy "P | ~ P";
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
    66
by (fast_tac HOL_cs 1);
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
    67
result();
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
    68
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
    69
(*7*)
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
    70
goal HOL.thy "P | ~ ~ ~ P";
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
    71
by (fast_tac HOL_cs 1);
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
    72
result();
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
    73
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
    74
(*8.  Peirce's law*)
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
    75
goal HOL.thy "((P-->Q) --> P)  -->  P";
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
    76
by (fast_tac HOL_cs 1);
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
    77
result();
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
    78
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
    79
(*9*)
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
    80
goal HOL.thy "((P|Q) & (~P|Q) & (P| ~Q)) --> ~ (~P | ~Q)";
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
    81
by (fast_tac HOL_cs 1);
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
    82
result();
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
    83
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
    84
(*10*)
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
    85
goal HOL.thy "(Q-->R) & (R-->P&Q) & (P-->Q|R) --> (P=Q)";
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
    86
by (fast_tac HOL_cs 1);
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
    87
result();
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
    88
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
    89
(*11.  Proved in each direction (incorrectly, says Pelletier!!)  *)
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
    90
goal HOL.thy "P=P::bool";
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
    91
by (fast_tac HOL_cs 1);
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
    92
result();
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
    93
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
    94
(*12.  "Dijkstra's law"*)
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
    95
goal HOL.thy "((P = Q) = R) = (P = (Q = R))";
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
    96
by (fast_tac HOL_cs 1);
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
    97
result();
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
    98
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
    99
(*13.  Distributive law*)
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   100
goal HOL.thy "(P | (Q & R)) = ((P | Q) & (P | R))";
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   101
by (fast_tac HOL_cs 1);
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   102
result();
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   103
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   104
(*14*)
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   105
goal HOL.thy "(P = Q) = ((Q | ~P) & (~Q|P))";
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   106
by (fast_tac HOL_cs 1);
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   107
result();
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   108
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   109
(*15*)
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   110
goal HOL.thy "(P --> Q) = (~P | Q)";
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   111
by (fast_tac HOL_cs 1);
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   112
result();
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   113
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   114
(*16*)
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   115
goal HOL.thy "(P-->Q) | (Q-->P)";
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   116
by (fast_tac HOL_cs 1);
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   117
result();
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   118
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   119
(*17*)
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   120
goal HOL.thy "((P & (Q-->R))-->S)  =  ((~P | Q | S) & (~P | ~R | S))";
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   121
by (fast_tac HOL_cs 1);
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   122
result();
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   123
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   124
writeln"Classical Logic: examples with quantifiers";
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   125
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   126
goal HOL.thy "(! x. P(x) & Q(x)) = ((! x. P(x)) & (! x. Q(x)))";
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   127
by (fast_tac HOL_cs 1);
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   128
result(); 
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   129
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   130
goal HOL.thy "(? x. P-->Q(x))  =  (P --> (? x.Q(x)))";
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   131
by (fast_tac HOL_cs 1);
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   132
result(); 
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   133
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   134
goal HOL.thy "(? x.P(x)-->Q) = ((! x.P(x)) --> Q)";
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   135
by (fast_tac HOL_cs 1);
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   136
result(); 
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   137
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   138
goal HOL.thy "((! x.P(x)) | Q)  =  (! x. P(x) | Q)";
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   139
by (fast_tac HOL_cs 1);
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   140
result(); 
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   141
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   142
(*From Wishnu Prasetya*)
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   143
goal HOL.thy
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   144
   "(!s. q(s) --> r(s)) & ~r(s) & (!s. ~r(s) & ~q(s) --> p(t) | q(t)) \
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   145
\   --> p(t) | r(t)";
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   146
by (fast_tac HOL_cs 1);
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   147
result(); 
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   148
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   149
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   150
writeln"Problems requiring quantifier duplication";
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   151
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   152
(*Needs multiple instantiation of the quantifier.*)
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   153
goal HOL.thy "(! x. P(x)-->P(f(x)))  &  P(d)-->P(f(f(f(d))))";
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   154
by (deepen_tac HOL_cs 1 1);
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   155
result();
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   156
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   157
(*Needs double instantiation of the quantifier*)
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   158
goal HOL.thy "? x. P(x) --> P(a) & P(b)";
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   159
by (deepen_tac HOL_cs 1 1);
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   160
result();
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   161
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   162
goal HOL.thy "? z. P(z) --> (! x. P(x))";
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   163
by (deepen_tac HOL_cs 1 1);
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   164
result();
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   165
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   166
goal HOL.thy "? x. (? y. P(y)) --> P(x)";
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   167
by (deepen_tac HOL_cs 1 1);
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   168
result();
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   169
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   170
writeln"Hard examples with quantifiers";
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   171
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   172
writeln"Problem 18";
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   173
goal HOL.thy "? y. ! x. P(y)-->P(x)";
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   174
by (deepen_tac HOL_cs 1 1);
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   175
result(); 
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   176
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   177
writeln"Problem 19";
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   178
goal HOL.thy "? x. ! y z. (P(y)-->Q(z)) --> (P(x)-->Q(x))";
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   179
by (deepen_tac HOL_cs 1 1);
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   180
result();
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   181
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   182
writeln"Problem 20";
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   183
goal HOL.thy "(! x y. ? z. ! w. (P(x)&Q(y)-->R(z)&S(w)))     \
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   184
\   --> (? x y. P(x) & Q(y)) --> (? z. R(z))";
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   185
by (fast_tac HOL_cs 1); 
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   186
result();
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   187
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   188
writeln"Problem 21";
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   189
goal HOL.thy "(? x. P-->Q(x)) & (? x. Q(x)-->P) --> (? x. P=Q(x))";
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   190
by (deepen_tac HOL_cs 1 1); 
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   191
result();
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   192
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   193
writeln"Problem 22";
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   194
goal HOL.thy "(! x. P = Q(x))  -->  (P = (! x. Q(x)))";
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   195
by (fast_tac HOL_cs 1); 
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   196
result();
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   197
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   198
writeln"Problem 23";
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   199
goal HOL.thy "(! x. P | Q(x))  =  (P | (! x. Q(x)))";
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   200
by (best_tac HOL_cs 1);  
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   201
result();
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   202
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   203
writeln"Problem 24";
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   204
goal HOL.thy "~(? x. S(x)&Q(x)) & (! x. P(x) --> Q(x)|R(x)) &  \
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   205
\    ~(? x.P(x)) --> (? x.Q(x)) & (! x. Q(x)|R(x) --> S(x))  \
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   206
\   --> (? x. P(x)&R(x))";
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   207
by (fast_tac HOL_cs 1); 
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   208
result();
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   209
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   210
writeln"Problem 25";
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   211
goal HOL.thy "(? x. P(x)) &  \
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   212
\       (! x. L(x) --> ~ (M(x) & R(x))) &  \
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   213
\       (! x. P(x) --> (M(x) & L(x))) &   \
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   214
\       ((! x. P(x)-->Q(x)) | (? x. P(x)&R(x)))  \
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   215
\   --> (? x. Q(x)&P(x))";
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   216
by (best_tac HOL_cs 1); 
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   217
result();
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   218
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   219
writeln"Problem 26";
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   220
goal HOL.thy "((? x. p(x)) = (? x. q(x))) &	\
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   221
\     (! x. ! y. p(x) & q(y) --> (r(x) = s(y)))	\
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   222
\ --> ((! x. p(x)-->r(x)) = (! x. q(x)-->s(x)))";
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   223
by (fast_tac HOL_cs 1);
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   224
result();
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   225
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   226
writeln"Problem 27";
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   227
goal HOL.thy "(? x. P(x) & ~Q(x)) &   \
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   228
\             (! x. P(x) --> R(x)) &   \
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   229
\             (! x. M(x) & L(x) --> P(x)) &   \
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   230
\             ((? x. R(x) & ~ Q(x)) --> (! x. L(x) --> ~ R(x)))  \
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   231
\         --> (! x. M(x) --> ~L(x))";
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   232
by (fast_tac HOL_cs 1); 
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   233
result();
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   234
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   235
writeln"Problem 28.  AMENDED";
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   236
goal HOL.thy "(! x. P(x) --> (! x. Q(x))) &   \
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   237
\       ((! x. Q(x)|R(x)) --> (? x. Q(x)&S(x))) &  \
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   238
\       ((? x.S(x)) --> (! x. L(x) --> M(x)))  \
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   239
\   --> (! x. P(x) & L(x) --> M(x))";
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   240
by (fast_tac HOL_cs 1);  
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   241
result();
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   242
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   243
writeln"Problem 29.  Essentially the same as Principia Mathematica *11.71";
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   244
goal HOL.thy "(? x. F(x)) & (? y. G(y))  \
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   245
\   --> ( ((! x. F(x)-->H(x)) & (! y. G(y)-->J(y)))  =   \
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   246
\         (! x y. F(x) & G(y) --> H(x) & J(y)))";
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   247
by (fast_tac HOL_cs 1); 
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   248
result();
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   249
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   250
writeln"Problem 30";
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   251
goal HOL.thy "(! x. P(x) | Q(x) --> ~ R(x)) & \
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   252
\       (! x. (Q(x) --> ~ S(x)) --> P(x) & R(x))  \
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   253
\   --> (! x. S(x))";
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   254
by (fast_tac HOL_cs 1);  
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   255
result();
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   256
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   257
writeln"Problem 31";
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   258
goal HOL.thy "~(? x.P(x) & (Q(x) | R(x))) & \
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   259
\       (? x. L(x) & P(x)) & \
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   260
\       (! x. ~ R(x) --> M(x))  \
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   261
\   --> (? x. L(x) & M(x))";
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   262
by (fast_tac HOL_cs 1);
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   263
result();
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   264
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   265
writeln"Problem 32";
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   266
goal HOL.thy "(! x. P(x) & (Q(x)|R(x))-->S(x)) & \
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   267
\       (! x. S(x) & R(x) --> L(x)) & \
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   268
\       (! x. M(x) --> R(x))  \
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   269
\   --> (! x. P(x) & M(x) --> L(x))";
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   270
by (best_tac HOL_cs 1);
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   271
result();
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   272
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   273
writeln"Problem 33";
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   274
goal HOL.thy "(! x. P(a) & (P(x)-->P(b))-->P(c))  =    \
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   275
\    (! x. (~P(a) | P(x) | P(c)) & (~P(a) | ~P(b) | P(c)))";
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   276
by (best_tac HOL_cs 1);
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   277
result();
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   278
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   279
writeln"Problem 34  AMENDED (TWICE!!)  NOT PROVED AUTOMATICALLY";
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   280
(*Andrews's challenge*)
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   281
goal HOL.thy "((? x. ! y. p(x) = p(y))  =		\
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   282
\                   ((? x. q(x)) = (! y. p(y))))   =	\
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   283
\                  ((? x. ! y. q(x) = q(y))  =		\
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   284
\                   ((? x. p(x)) = (! y. q(y))))";
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   285
by (deepen_tac HOL_cs 3 1);
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   286
(*slower with smaller bounds*)
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   287
result();
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   288
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   289
writeln"Problem 35";
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   290
goal HOL.thy "? x y. P x y -->  (! u v. P u v)";
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   291
by (deepen_tac HOL_cs 1 1);
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   292
result();
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   293
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   294
writeln"Problem 36";
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   295
goal HOL.thy "(! x. ? y. J x y) & \
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   296
\       (! x. ? y. G x y) & \
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   297
\       (! x y. J x y | G x y -->	\
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   298
\       (! z. J y z | G y z --> H x z))   \
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   299
\   --> (! x. ? y. H x y)";
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   300
by (fast_tac HOL_cs 1);
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   301
result();
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   302
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   303
writeln"Problem 37";
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   304
goal HOL.thy "(! z. ? w. ! x. ? y. \
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   305
\          (P x z -->P y w) & P y z & (P y w --> (? u.Q u w))) & \
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   306
\       (! x z. ~(P x z) --> (? y. Q y z)) & \
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   307
\       ((? x y. Q x y) --> (! x. R x x))  \
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   308
\   --> (! x. ? y. R x y)";
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   309
by (fast_tac HOL_cs 1);
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   310
result();
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   311
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   312
writeln"Problem 38";
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   313
goal HOL.thy
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   314
    "(! x. p(a) & (p(x) --> (? y. p(y) & r x y)) -->		\
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   315
\          (? z. ? w. p(z) & r x w & r w z))  =			\
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   316
\    (! x. (~p(a) | p(x) | (? z. ? w. p(z) & r x w & r w z)) &	\
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   317
\          (~p(a) | ~(? y. p(y) & r x y) |				\
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   318
\           (? z. ? w. p(z) & r x w & r w z)))";
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   319
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   320
writeln"Problem 39";
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   321
goal HOL.thy "~ (? x. ! y. F y x = (~ F y y))";
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   322
by (fast_tac HOL_cs 1);
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   323
result();
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   324
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   325
writeln"Problem 40.  AMENDED";
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   326
goal HOL.thy "(? y. ! x. F x y = F x x)  \
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   327
\       -->  ~ (! x. ? y. ! z. F z y = (~ F z x))";
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   328
by (fast_tac HOL_cs 1);
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   329
result();
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   330
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   331
writeln"Problem 41";
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   332
goal HOL.thy "(! z. ? y. ! x. f x y = (f x z & ~ f x x))	\
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   333
\              --> ~ (? z. ! x. f x z)";
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   334
by (best_tac HOL_cs 1);
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   335
result();
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   336
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   337
writeln"Problem 42";
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   338
goal HOL.thy "~ (? y. ! x. p x y = (~ (? z. p x z & p z x)))";
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   339
by (deepen_tac HOL_cs 3 1);
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   340
result();
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   341
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   342
writeln"Problem 43  NOT PROVED AUTOMATICALLY";
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   343
goal HOL.thy
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   344
    "(! x::'a. ! y::'a. q x y = (! z. p z x = (p z y::bool)))	\
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   345
\ --> (! x. (! y. q x y = (q y x::bool)))";
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   346
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   347
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   348
writeln"Problem 44";
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   349
goal HOL.thy "(! x. f(x) -->					\
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   350
\             (? y. g(y) & h x y & (? y. g(y) & ~ h x y)))  &   \
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   351
\             (? x. j(x) & (! y. g(y) --> h x y))		\
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   352
\             --> (? x. j(x) & ~f(x))";
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   353
by (fast_tac HOL_cs 1);
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   354
result();
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   355
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   356
writeln"Problem 45";
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   357
goal HOL.thy
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   358
    "(! x. f(x) & (! y. g(y) & h x y --> j x y)	\
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   359
\                     --> (! y. g(y) & h x y --> k(y))) &	\
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   360
\    ~ (? y. l(y) & k(y)) &					\
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   361
\    (? x. f(x) & (! y. h x y --> l(y))				\
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   362
\               & (! y. g(y) & h x y --> j x y))		\
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   363
\     --> (? x. f(x) & ~ (? y. g(y) & h x y))";
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   364
by (best_tac HOL_cs 1); 
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   365
result();
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   366
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   367
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   368
writeln"Problems (mainly) involving equality or functions";
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   369
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   370
writeln"Problem 48";
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   371
goal HOL.thy "(a=b | c=d) & (a=c | b=d) --> a=d | b=c";
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   372
by (fast_tac HOL_cs 1);
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   373
result();
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   374
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   375
writeln"Problem 49  NOT PROVED AUTOMATICALLY";
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   376
(*Hard because it involves substitution for Vars;
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   377
  the type constraint ensures that x,y,z have the same type as a,b,u. *)
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   378
goal HOL.thy "(? x y::'a. ! z. z=x | z=y) & P(a) & P(b) & (~a=b) \
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   379
\		--> (! u::'a.P(u))";
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   380
by (Classical.safe_tac HOL_cs);
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   381
by (res_inst_tac [("x","a")] allE 1);
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   382
by (assume_tac 1);
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   383
by (res_inst_tac [("x","b")] allE 1);
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   384
by (assume_tac 1);
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   385
by (fast_tac HOL_cs 1);
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   386
result();
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   387
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   388
writeln"Problem 50";  
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   389
(*What has this to do with equality?*)
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   390
goal HOL.thy "(! x. P a x | (! y.P x y)) --> (? x. ! y.P x y)";
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   391
by (deepen_tac HOL_cs 1 1);
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   392
result();
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   393
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   394
writeln"Problem 51";
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   395
goal HOL.thy
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   396
    "(? z w. ! x y. P x y = (x=z & y=w)) -->  \
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   397
\    (? z. ! x. ? w. (! y. P x y = (y=w)) = (x=z))";
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   398
by (best_tac HOL_cs 1);
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   399
result();
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   400
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   401
writeln"Problem 52";
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   402
(*Almost the same as 51. *)
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   403
goal HOL.thy
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   404
    "(? z w. ! x y. P x y = (x=z & y=w)) -->  \
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   405
\    (? w. ! y. ? z. (! x. P x y = (x=z)) = (y=w))";
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   406
by (best_tac HOL_cs 1);
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   407
result();
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   408
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   409
writeln"Problem 55";
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   410
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   411
(*Non-equational version, from Manthey and Bry, CADE-9 (Springer, 1988).
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   412
  fast_tac DISCOVERS who killed Agatha. *)
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   413
goal HOL.thy "lives(agatha) & lives(butler) & lives(charles) & \
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   414
\  (killed agatha agatha | killed butler agatha | killed charles agatha) & \
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   415
\  (!x y. killed x y --> hates x y & ~richer x y) & \
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   416
\  (!x. hates agatha x --> ~hates charles x) & \
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   417
\  (hates agatha agatha & hates agatha charles) & \
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   418
\  (!x. lives(x) & ~richer x agatha --> hates butler x) & \
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   419
\  (!x. hates agatha x --> hates butler x) & \
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   420
\  (!x. ~hates x agatha | ~hates x butler | ~hates x charles) --> \
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   421
\   killed ?who agatha";
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   422
by (fast_tac HOL_cs 1);
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   423
result();
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   424
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   425
writeln"Problem 56";
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   426
goal HOL.thy
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   427
    "(! x. (? y. P(y) & x=f(y)) --> P(x)) = (! x. P(x) --> P(f(x)))";
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   428
by (fast_tac HOL_cs 1);
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   429
result();
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   430
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   431
writeln"Problem 57";
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   432
goal HOL.thy
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   433
    "P (f a b) (f b c) & P (f b c) (f a c) & \
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   434
\    (! x y z. P x y & P y z --> P x z)    -->   P (f a b) (f a c)";
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   435
by (fast_tac HOL_cs 1);
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   436
result();
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   437
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   438
writeln"Problem 58  NOT PROVED AUTOMATICALLY";
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   439
goal HOL.thy "(! x y. f(x)=g(y)) --> (! x y. f(f(x))=f(g(y)))";
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   440
val f_cong = read_instantiate [("f","f")] arg_cong;
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   441
by (fast_tac (HOL_cs addIs [f_cong]) 1);
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   442
result();
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   443
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   444
writeln"Problem 59";
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   445
goal HOL.thy "(! x. P(x) = (~P(f(x)))) --> (? x. P(x) & ~P(f(x)))";
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   446
by (deepen_tac HOL_cs 1 1);
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   447
result();
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   448
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   449
writeln"Problem 60";
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   450
goal HOL.thy
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   451
    "! x. P x (f x) = (? y. (! z. P z y --> P z (f x)) & P x y)";
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   452
by (fast_tac HOL_cs 1);
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   453
result();
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   454
1404
57c3f6d2e692 Added Pelletier's problem 62, as corrected in AAR
paulson
parents: 969
diff changeset
   455
writeln"Problem 62 as corrected in AAR newletter #31";
57c3f6d2e692 Added Pelletier's problem 62, as corrected in AAR
paulson
parents: 969
diff changeset
   456
goal HOL.thy
57c3f6d2e692 Added Pelletier's problem 62, as corrected in AAR
paulson
parents: 969
diff changeset
   457
    "(ALL x. p a & (p x --> p(f x)) --> p(f(f x)))  =	\
57c3f6d2e692 Added Pelletier's problem 62, as corrected in AAR
paulson
parents: 969
diff changeset
   458
\    (ALL x. (~ p a | p x | p(f(f x))) &			\
57c3f6d2e692 Added Pelletier's problem 62, as corrected in AAR
paulson
parents: 969
diff changeset
   459
\            (~ p a | ~ p(f x) | p(f(f x))))";
57c3f6d2e692 Added Pelletier's problem 62, as corrected in AAR
paulson
parents: 969
diff changeset
   460
by (fast_tac HOL_cs 1);
57c3f6d2e692 Added Pelletier's problem 62, as corrected in AAR
paulson
parents: 969
diff changeset
   461
result();
57c3f6d2e692 Added Pelletier's problem 62, as corrected in AAR
paulson
parents: 969
diff changeset
   462
969
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   463
writeln"Reached end of file.";