src/HOL/ex/cla.ML
author paulson
Mon, 21 Apr 1997 10:14:31 +0200
changeset 2997 86aaab39ebb1
parent 2922 580647a879cf
child 3019 ca5a7bbbee6c
permissions -rw-r--r--
Without the type constraint, the inner equality was NOT a biconditional...
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))  =               \
5d7a7e439cec expanded tabs
clasohm
parents: 1404
diff changeset
   284
\                   ((? x. q(x)) = (! y. p(y))))   =    \
5d7a7e439cec expanded tabs
clasohm
parents: 1404
diff changeset
   285
\                  ((? x. ! y. q(x) = q(y))  =          \
969
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
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
(*slower with smaller bounds*)
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   289
result();
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   290
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   291
writeln"Problem 35";
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   292
goal HOL.thy "? x y. P x y -->  (! u v. P u v)";
2891
d8f254ad1ab9 Calls Blast_tac
paulson
parents: 2715
diff changeset
   293
by (Blast_tac 1);
969
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   294
result();
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   295
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   296
writeln"Problem 36";
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   297
goal HOL.thy "(! x. ? y. J x y) & \
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   298
\       (! x. ? y. G x y) & \
1465
5d7a7e439cec expanded tabs
clasohm
parents: 1404
diff changeset
   299
\       (! x y. J x y | G x y -->       \
969
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   300
\       (! z. J y z | G y z --> H x z))   \
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   301
\   --> (! x. ? y. H x y)";
2891
d8f254ad1ab9 Calls Blast_tac
paulson
parents: 2715
diff changeset
   302
by (Blast_tac 1);
969
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   303
result();
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   304
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   305
writeln"Problem 37";
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   306
goal HOL.thy "(! z. ? w. ! x. ? y. \
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   307
\          (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
   308
\       (! x z. ~(P x z) --> (? y. Q y z)) & \
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   309
\       ((? x y. Q x y) --> (! x. R x x))  \
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   310
\   --> (! x. ? y. R x y)";
2891
d8f254ad1ab9 Calls Blast_tac
paulson
parents: 2715
diff changeset
   311
by (Blast_tac 1);
969
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   312
result();
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   313
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   314
writeln"Problem 38";
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   315
goal HOL.thy
1465
5d7a7e439cec expanded tabs
clasohm
parents: 1404
diff changeset
   316
    "(! x. p(a) & (p(x) --> (? y. p(y) & r x y)) -->            \
5d7a7e439cec expanded tabs
clasohm
parents: 1404
diff changeset
   317
\          (? z. ? w. p(z) & r x w & r w z))  =                 \
5d7a7e439cec expanded tabs
clasohm
parents: 1404
diff changeset
   318
\    (! 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
   319
\          (~p(a) | ~(? y. p(y) & r x y) |                      \
969
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   320
\           (? z. ? w. p(z) & r x w & r w z)))";
2891
d8f254ad1ab9 Calls Blast_tac
paulson
parents: 2715
diff changeset
   321
by (Blast_tac 1);  (*beats fast_tac!*)
1716
8dbf9ca61ce5 Restored a proof of Pelletier #38 -- mysteriously deleted
paulson
parents: 1712
diff changeset
   322
result();
969
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   323
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   324
writeln"Problem 39";
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   325
goal HOL.thy "~ (? x. ! y. F y x = (~ F y y))";
2891
d8f254ad1ab9 Calls Blast_tac
paulson
parents: 2715
diff changeset
   326
by (Blast_tac 1);
969
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   327
result();
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   328
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   329
writeln"Problem 40.  AMENDED";
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   330
goal HOL.thy "(? y. ! x. F x y = F x x)  \
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   331
\       -->  ~ (! x. ? y. ! z. F z y = (~ F z x))";
2891
d8f254ad1ab9 Calls Blast_tac
paulson
parents: 2715
diff changeset
   332
by (Blast_tac 1);
969
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   333
result();
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   334
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   335
writeln"Problem 41";
1465
5d7a7e439cec expanded tabs
clasohm
parents: 1404
diff changeset
   336
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
   337
\              --> ~ (? z. ! x. f x z)";
2891
d8f254ad1ab9 Calls Blast_tac
paulson
parents: 2715
diff changeset
   338
by (Blast_tac 1);
969
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   339
result();
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   340
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   341
writeln"Problem 42";
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   342
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
   343
by (Blast_tac 1);
969
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   344
result();
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   345
2891
d8f254ad1ab9 Calls Blast_tac
paulson
parents: 2715
diff changeset
   346
writeln"Problem 43!!";
969
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   347
goal HOL.thy
1465
5d7a7e439cec expanded tabs
clasohm
parents: 1404
diff changeset
   348
    "(! 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
   349
\ --> (! x. (! y. q x y = (q y x::bool)))";
2891
d8f254ad1ab9 Calls Blast_tac
paulson
parents: 2715
diff changeset
   350
by (Blast_tac 1);
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
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   353
writeln"Problem 44";
1465
5d7a7e439cec expanded tabs
clasohm
parents: 1404
diff changeset
   354
goal HOL.thy "(! x. f(x) -->                                    \
969
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   355
\             (? y. g(y) & h x y & (? y. g(y) & ~ h x y)))  &   \
1465
5d7a7e439cec expanded tabs
clasohm
parents: 1404
diff changeset
   356
\             (? x. j(x) & (! y. g(y) --> h x y))               \
969
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   357
\             --> (? x. j(x) & ~f(x))";
2891
d8f254ad1ab9 Calls Blast_tac
paulson
parents: 2715
diff changeset
   358
by (Blast_tac 1);
969
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   359
result();
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   360
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   361
writeln"Problem 45";
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   362
goal HOL.thy
1465
5d7a7e439cec expanded tabs
clasohm
parents: 1404
diff changeset
   363
    "(! x. f(x) & (! y. g(y) & h x y --> j x y) \
5d7a7e439cec expanded tabs
clasohm
parents: 1404
diff changeset
   364
\                     --> (! y. g(y) & h x y --> k(y))) &       \
5d7a7e439cec expanded tabs
clasohm
parents: 1404
diff changeset
   365
\    ~ (? y. l(y) & k(y)) &                                     \
5d7a7e439cec expanded tabs
clasohm
parents: 1404
diff changeset
   366
\    (? x. f(x) & (! y. h x y --> l(y))                         \
5d7a7e439cec expanded tabs
clasohm
parents: 1404
diff changeset
   367
\               & (! y. g(y) & h x y --> j x y))                \
969
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   368
\     --> (? x. f(x) & ~ (? y. g(y) & h x y))";
2891
d8f254ad1ab9 Calls Blast_tac
paulson
parents: 2715
diff changeset
   369
by (Blast_tac 1); 
969
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   370
result();
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   371
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   372
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   373
writeln"Problems (mainly) involving equality or functions";
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 48";
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   376
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
   377
by (Blast_tac 1);
969
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   378
result();
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   379
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   380
writeln"Problem 49  NOT PROVED AUTOMATICALLY";
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   381
(*Hard because it involves substitution for Vars;
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   382
  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
   383
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
   384
\               --> (! u::'a.P(u))";
1820
e381e1c51689 Classical tactics now use default claset.
berghofe
parents: 1768
diff changeset
   385
by (Classical.safe_tac (!claset));
969
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   386
by (res_inst_tac [("x","a")] allE 1);
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   387
by (assume_tac 1);
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   388
by (res_inst_tac [("x","b")] allE 1);
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   389
by (assume_tac 1);
2891
d8f254ad1ab9 Calls Blast_tac
paulson
parents: 2715
diff changeset
   390
by (Blast_tac 1);
969
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   391
result();
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   392
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   393
writeln"Problem 50";  
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   394
(*What has this to do with equality?*)
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   395
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
   396
by (Blast_tac 1);
969
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   397
result();
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   398
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   399
writeln"Problem 51";
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   400
goal HOL.thy
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   401
    "(? z w. ! x y. P x y = (x=z & y=w)) -->  \
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   402
\    (? z. ! x. ? w. (! y. P x y = (y=w)) = (x=z))";
2891
d8f254ad1ab9 Calls Blast_tac
paulson
parents: 2715
diff changeset
   403
by (Blast_tac 1);
969
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   404
result();
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   405
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   406
writeln"Problem 52";
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   407
(*Almost the same as 51. *)
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   408
goal HOL.thy
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   409
    "(? z w. ! x y. P x y = (x=z & y=w)) -->  \
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   410
\    (? w. ! y. ? z. (! x. P x y = (x=z)) = (y=w))";
2891
d8f254ad1ab9 Calls Blast_tac
paulson
parents: 2715
diff changeset
   411
by (Blast_tac 1);
969
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   412
result();
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   413
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   414
writeln"Problem 55";
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   415
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   416
(*Non-equational version, from Manthey and Bry, CADE-9 (Springer, 1988).
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   417
  fast_tac DISCOVERS who killed Agatha. *)
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   418
goal HOL.thy "lives(agatha) & lives(butler) & lives(charles) & \
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   419
\  (killed agatha agatha | killed butler agatha | killed charles agatha) & \
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   420
\  (!x y. killed x y --> hates x y & ~richer x y) & \
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   421
\  (!x. hates agatha x --> ~hates charles x) & \
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   422
\  (hates agatha agatha & hates agatha charles) & \
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   423
\  (!x. lives(x) & ~richer x agatha --> hates butler x) & \
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   424
\  (!x. hates agatha x --> hates butler x) & \
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   425
\  (!x. ~hates x agatha | ~hates x butler | ~hates x charles) --> \
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   426
\   killed ?who agatha";
2922
580647a879cf Using Blast_tac
paulson
parents: 2891
diff changeset
   427
by (Fast_tac 1);
969
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   428
result();
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   429
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   430
writeln"Problem 56";
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   431
goal HOL.thy
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   432
    "(! 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
   433
by (Blast_tac 1);
969
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   434
result();
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   435
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   436
writeln"Problem 57";
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   437
goal HOL.thy
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   438
    "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
   439
\    (! 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
   440
by (Blast_tac 1);
969
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   441
result();
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   442
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   443
writeln"Problem 58  NOT PROVED AUTOMATICALLY";
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   444
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
   445
val f_cong = read_instantiate [("f","f")] arg_cong;
1820
e381e1c51689 Classical tactics now use default claset.
berghofe
parents: 1768
diff changeset
   446
by (fast_tac (!claset addIs [f_cong]) 1);
969
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 59";
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   450
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
   451
by (Blast_tac 1);
969
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   452
result();
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   453
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   454
writeln"Problem 60";
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   455
goal HOL.thy
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   456
    "! 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
   457
by (Blast_tac 1);
969
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   458
result();
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   459
2715
79c35a051196 Updated reference to Pelletier erratum
paulson
parents: 2575
diff changeset
   460
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
   461
goal HOL.thy
1465
5d7a7e439cec expanded tabs
clasohm
parents: 1404
diff changeset
   462
    "(ALL x. p a & (p x --> p(f x)) --> p(f(f x)))  =   \
5d7a7e439cec expanded tabs
clasohm
parents: 1404
diff changeset
   463
\    (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
   464
\            (~ p a | ~ p(f x) | p(f(f x))))";
2891
d8f254ad1ab9 Calls Blast_tac
paulson
parents: 2715
diff changeset
   465
by (Blast_tac 1);
1404
57c3f6d2e692 Added Pelletier's problem 62, as corrected in AAR
paulson
parents: 969
diff changeset
   466
result();
57c3f6d2e692 Added Pelletier's problem 62, as corrected in AAR
paulson
parents: 969
diff changeset
   467
1712
c064cae981d6 Two new "obvious" examples
paulson
parents: 1465
diff changeset
   468
(*From Rudnicki, Obvious Inferences, JAR 3 (1987), 383-393.  
c064cae981d6 Two new "obvious" examples
paulson
parents: 1465
diff changeset
   469
  It does seem obvious!*)
c064cae981d6 Two new "obvious" examples
paulson
parents: 1465
diff changeset
   470
goal Prod.thy
c064cae981d6 Two new "obvious" examples
paulson
parents: 1465
diff changeset
   471
    "(ALL x. F(x) & ~G(x) --> (EX y. H(x,y) & J(y))) &        \
c064cae981d6 Two new "obvious" examples
paulson
parents: 1465
diff changeset
   472
\    (EX x. K(x) & F(x) & (ALL y. H(x,y) --> K(y)))  &        \
c064cae981d6 Two new "obvious" examples
paulson
parents: 1465
diff changeset
   473
\    (ALL x. K(x) --> ~G(x))   -->   (EX x. K(x) --> ~G(x))";
2891
d8f254ad1ab9 Calls Blast_tac
paulson
parents: 2715
diff changeset
   474
by (Blast_tac 1);
1712
c064cae981d6 Two new "obvious" examples
paulson
parents: 1465
diff changeset
   475
result();
c064cae981d6 Two new "obvious" examples
paulson
parents: 1465
diff changeset
   476
c064cae981d6 Two new "obvious" examples
paulson
parents: 1465
diff changeset
   477
goal Prod.thy
c064cae981d6 Two new "obvious" examples
paulson
parents: 1465
diff changeset
   478
    "(ALL x y. R(x,y) | R(y,x)) &                \
c064cae981d6 Two new "obvious" examples
paulson
parents: 1465
diff changeset
   479
\    (ALL x y. S(x,y) & S(y,x) --> x=y) &        \
c064cae981d6 Two new "obvious" examples
paulson
parents: 1465
diff changeset
   480
\    (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
   481
by (Blast_tac 1);
1712
c064cae981d6 Two new "obvious" examples
paulson
parents: 1465
diff changeset
   482
result();
c064cae981d6 Two new "obvious" examples
paulson
parents: 1465
diff changeset
   483
c064cae981d6 Two new "obvious" examples
paulson
parents: 1465
diff changeset
   484
c064cae981d6 Two new "obvious" examples
paulson
parents: 1465
diff changeset
   485
969
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   486
writeln"Reached end of file.";