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