src/HOL/ex/cla.ML
author paulson
Thu, 16 Jul 1998 10:35:31 +0200
changeset 5150 6e2e9b92c301
parent 4463 76769b48bd88
child 5278 a903b66822e2
permissions -rw-r--r--
Addition of "Theorem B" of Peter Andrews
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
5150
6e2e9b92c301 Addition of "Theorem B" of Peter Andrews
paulson
parents: 4463
diff changeset
    13
context HOL.thy; 
1912
947a34e00d1e Now starts with set_current_thy
paulson
parents: 1895
diff changeset
    14
5150
6e2e9b92c301 Addition of "Theorem B" of Peter Andrews
paulson
parents: 4463
diff changeset
    15
Goal "(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
5150
6e2e9b92c301 Addition of "Theorem B" of Peter Andrews
paulson
parents: 4463
diff changeset
    21
Goal "(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
5150
6e2e9b92c301 Addition of "Theorem B" of Peter Andrews
paulson
parents: 4463
diff changeset
    25
Goal "~ (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*)
5150
6e2e9b92c301 Addition of "Theorem B" of Peter Andrews
paulson
parents: 4463
diff changeset
    42
Goal "(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*)
5150
6e2e9b92c301 Addition of "Theorem B" of Peter Andrews
paulson
parents: 4463
diff changeset
    47
Goal "(~ ~ 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*)
5150
6e2e9b92c301 Addition of "Theorem B" of Peter Andrews
paulson
parents: 4463
diff changeset
    52
Goal "~(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*)
5150
6e2e9b92c301 Addition of "Theorem B" of Peter Andrews
paulson
parents: 4463
diff changeset
    57
Goal "(~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*)
5150
6e2e9b92c301 Addition of "Theorem B" of Peter Andrews
paulson
parents: 4463
diff changeset
    62
Goal "((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*)
5150
6e2e9b92c301 Addition of "Theorem B" of Peter Andrews
paulson
parents: 4463
diff changeset
    67
Goal "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*)
5150
6e2e9b92c301 Addition of "Theorem B" of Peter Andrews
paulson
parents: 4463
diff changeset
    72
Goal "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*)
5150
6e2e9b92c301 Addition of "Theorem B" of Peter Andrews
paulson
parents: 4463
diff changeset
    77
Goal "((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*)
5150
6e2e9b92c301 Addition of "Theorem B" of Peter Andrews
paulson
parents: 4463
diff changeset
    82
Goal "((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*)
5150
6e2e9b92c301 Addition of "Theorem B" of Peter Andrews
paulson
parents: 4463
diff changeset
    87
Goal "(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!!)  *)
5150
6e2e9b92c301 Addition of "Theorem B" of Peter Andrews
paulson
parents: 4463
diff changeset
    92
Goal "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"*)
5150
6e2e9b92c301 Addition of "Theorem B" of Peter Andrews
paulson
parents: 4463
diff changeset
    97
Goal "((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*)
5150
6e2e9b92c301 Addition of "Theorem B" of Peter Andrews
paulson
parents: 4463
diff changeset
   102
Goal "(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*)
5150
6e2e9b92c301 Addition of "Theorem B" of Peter Andrews
paulson
parents: 4463
diff changeset
   107
Goal "(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*)
5150
6e2e9b92c301 Addition of "Theorem B" of Peter Andrews
paulson
parents: 4463
diff changeset
   112
Goal "(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*)
5150
6e2e9b92c301 Addition of "Theorem B" of Peter Andrews
paulson
parents: 4463
diff changeset
   117
Goal "(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*)
5150
6e2e9b92c301 Addition of "Theorem B" of Peter Andrews
paulson
parents: 4463
diff changeset
   122
Goal "((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
5150
6e2e9b92c301 Addition of "Theorem B" of Peter Andrews
paulson
parents: 4463
diff changeset
   128
Goal "(! 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
5150
6e2e9b92c301 Addition of "Theorem B" of Peter Andrews
paulson
parents: 4463
diff changeset
   132
Goal "(? 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
5150
6e2e9b92c301 Addition of "Theorem B" of Peter Andrews
paulson
parents: 4463
diff changeset
   136
Goal "(? 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
5150
6e2e9b92c301 Addition of "Theorem B" of Peter Andrews
paulson
parents: 4463
diff changeset
   140
Goal "((! 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*)
5150
6e2e9b92c301 Addition of "Theorem B" of Peter Andrews
paulson
parents: 4463
diff changeset
   145
Goal
969
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
5150
6e2e9b92c301 Addition of "Theorem B" of Peter Andrews
paulson
parents: 4463
diff changeset
   154
(*Theorem B of Peter Andrews, Theorem Proving via General Matings, 
6e2e9b92c301 Addition of "Theorem B" of Peter Andrews
paulson
parents: 4463
diff changeset
   155
  JACM 28 (1981).*)
6e2e9b92c301 Addition of "Theorem B" of Peter Andrews
paulson
parents: 4463
diff changeset
   156
Goal "(EX x. ALL y. P(x) = P(y)) --> ((EX x. P(x)) = (ALL y. P(y)))";
6e2e9b92c301 Addition of "Theorem B" of Peter Andrews
paulson
parents: 4463
diff changeset
   157
by (Blast_tac 1);
6e2e9b92c301 Addition of "Theorem B" of Peter Andrews
paulson
parents: 4463
diff changeset
   158
result();
6e2e9b92c301 Addition of "Theorem B" of Peter Andrews
paulson
parents: 4463
diff changeset
   159
969
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   160
(*Needs multiple instantiation of the quantifier.*)
5150
6e2e9b92c301 Addition of "Theorem B" of Peter Andrews
paulson
parents: 4463
diff changeset
   161
Goal "(! x. P(x)-->P(f(x)))  &  P(d)-->P(f(f(f(d))))";
2891
d8f254ad1ab9 Calls Blast_tac
paulson
parents: 2715
diff changeset
   162
by (Blast_tac 1);
969
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   163
result();
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   164
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   165
(*Needs double instantiation of the quantifier*)
5150
6e2e9b92c301 Addition of "Theorem B" of Peter Andrews
paulson
parents: 4463
diff changeset
   166
Goal "? x. P(x) --> P(a) & P(b)";
2891
d8f254ad1ab9 Calls Blast_tac
paulson
parents: 2715
diff changeset
   167
by (Blast_tac 1);
969
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   168
result();
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   169
5150
6e2e9b92c301 Addition of "Theorem B" of Peter Andrews
paulson
parents: 4463
diff changeset
   170
Goal "? z. P(z) --> (! x. P(x))";
2891
d8f254ad1ab9 Calls Blast_tac
paulson
parents: 2715
diff changeset
   171
by (Blast_tac 1);
969
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   172
result();
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   173
5150
6e2e9b92c301 Addition of "Theorem B" of Peter Andrews
paulson
parents: 4463
diff changeset
   174
Goal "? x. (? y. P(y)) --> P(x)";
2891
d8f254ad1ab9 Calls Blast_tac
paulson
parents: 2715
diff changeset
   175
by (Blast_tac 1);
969
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   176
result();
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   177
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   178
writeln"Hard examples with quantifiers";
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   179
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   180
writeln"Problem 18";
5150
6e2e9b92c301 Addition of "Theorem B" of Peter Andrews
paulson
parents: 4463
diff changeset
   181
Goal "? y. ! x. P(y)-->P(x)";
2891
d8f254ad1ab9 Calls Blast_tac
paulson
parents: 2715
diff changeset
   182
by (Blast_tac 1);
969
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   183
result(); 
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   184
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   185
writeln"Problem 19";
5150
6e2e9b92c301 Addition of "Theorem B" of Peter Andrews
paulson
parents: 4463
diff changeset
   186
Goal "? x. ! y z. (P(y)-->Q(z)) --> (P(x)-->Q(x))";
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 20";
5150
6e2e9b92c301 Addition of "Theorem B" of Peter Andrews
paulson
parents: 4463
diff changeset
   191
Goal "(! x y. ? z. ! w. (P(x)&Q(y)-->R(z)&S(w)))     \
969
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   192
\   --> (? x y. P(x) & Q(y)) --> (? z. R(z))";
2891
d8f254ad1ab9 Calls Blast_tac
paulson
parents: 2715
diff changeset
   193
by (Blast_tac 1); 
969
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   194
result();
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   195
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   196
writeln"Problem 21";
5150
6e2e9b92c301 Addition of "Theorem B" of Peter Andrews
paulson
parents: 4463
diff changeset
   197
Goal "(? x. P-->Q(x)) & (? x. Q(x)-->P) --> (? x. P=Q(x))";
2891
d8f254ad1ab9 Calls Blast_tac
paulson
parents: 2715
diff changeset
   198
by (Blast_tac 1); 
969
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   199
result();
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   200
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   201
writeln"Problem 22";
5150
6e2e9b92c301 Addition of "Theorem B" of Peter Andrews
paulson
parents: 4463
diff changeset
   202
Goal "(! x. P = Q(x))  -->  (P = (! x. Q(x)))";
2891
d8f254ad1ab9 Calls Blast_tac
paulson
parents: 2715
diff changeset
   203
by (Blast_tac 1); 
969
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   204
result();
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   205
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   206
writeln"Problem 23";
5150
6e2e9b92c301 Addition of "Theorem B" of Peter Andrews
paulson
parents: 4463
diff changeset
   207
Goal "(! x. P | Q(x))  =  (P | (! x. Q(x)))";
2891
d8f254ad1ab9 Calls Blast_tac
paulson
parents: 2715
diff changeset
   208
by (Blast_tac 1);  
969
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   209
result();
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   210
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   211
writeln"Problem 24";
5150
6e2e9b92c301 Addition of "Theorem B" of Peter Andrews
paulson
parents: 4463
diff changeset
   212
Goal "~(? x. S(x)&Q(x)) & (! x. P(x) --> Q(x)|R(x)) &  \
3842
b55686a7b22c fixed dots;
wenzelm
parents: 3347
diff changeset
   213
\    (~(? 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
   214
\   --> (? x. P(x)&R(x))";
2891
d8f254ad1ab9 Calls Blast_tac
paulson
parents: 2715
diff changeset
   215
by (Blast_tac 1); 
969
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   216
result();
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   217
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   218
writeln"Problem 25";
5150
6e2e9b92c301 Addition of "Theorem B" of Peter Andrews
paulson
parents: 4463
diff changeset
   219
Goal "(? x. P(x)) &  \
969
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   220
\       (! x. L(x) --> ~ (M(x) & R(x))) &  \
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   221
\       (! x. P(x) --> (M(x) & L(x))) &   \
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   222
\       ((! x. P(x)-->Q(x)) | (? x. P(x)&R(x)))  \
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   223
\   --> (? x. Q(x)&P(x))";
2891
d8f254ad1ab9 Calls Blast_tac
paulson
parents: 2715
diff changeset
   224
by (Blast_tac 1); 
969
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   225
result();
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   226
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   227
writeln"Problem 26";
5150
6e2e9b92c301 Addition of "Theorem B" of Peter Andrews
paulson
parents: 4463
diff changeset
   228
Goal "((? x. p(x)) = (? x. q(x))) &     \
1465
5d7a7e439cec expanded tabs
clasohm
parents: 1404
diff changeset
   229
\     (! x. ! y. p(x) & q(y) --> (r(x) = s(y))) \
969
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   230
\ --> ((! x. p(x)-->r(x)) = (! x. q(x)-->s(x)))";
2891
d8f254ad1ab9 Calls Blast_tac
paulson
parents: 2715
diff changeset
   231
by (Blast_tac 1);
969
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   232
result();
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   233
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   234
writeln"Problem 27";
5150
6e2e9b92c301 Addition of "Theorem B" of Peter Andrews
paulson
parents: 4463
diff changeset
   235
Goal "(? x. P(x) & ~Q(x)) &   \
969
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   236
\             (! x. P(x) --> R(x)) &   \
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   237
\             (! x. M(x) & L(x) --> P(x)) &   \
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   238
\             ((? x. R(x) & ~ Q(x)) --> (! x. L(x) --> ~ R(x)))  \
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   239
\         --> (! x. M(x) --> ~L(x))";
2891
d8f254ad1ab9 Calls Blast_tac
paulson
parents: 2715
diff changeset
   240
by (Blast_tac 1); 
969
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   241
result();
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   242
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   243
writeln"Problem 28.  AMENDED";
5150
6e2e9b92c301 Addition of "Theorem B" of Peter Andrews
paulson
parents: 4463
diff changeset
   244
Goal "(! x. P(x) --> (! x. Q(x))) &   \
969
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   245
\       ((! x. Q(x)|R(x)) --> (? x. Q(x)&S(x))) &  \
3842
b55686a7b22c fixed dots;
wenzelm
parents: 3347
diff changeset
   246
\       ((? x. S(x)) --> (! x. L(x) --> M(x)))  \
969
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   247
\   --> (! x. P(x) & L(x) --> M(x))";
2891
d8f254ad1ab9 Calls Blast_tac
paulson
parents: 2715
diff changeset
   248
by (Blast_tac 1);  
969
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   249
result();
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   250
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   251
writeln"Problem 29.  Essentially the same as Principia Mathematica *11.71";
5150
6e2e9b92c301 Addition of "Theorem B" of Peter Andrews
paulson
parents: 4463
diff changeset
   252
Goal "(? x. F(x)) & (? y. G(y))  \
969
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   253
\   --> ( ((! x. F(x)-->H(x)) & (! y. G(y)-->J(y)))  =   \
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   254
\         (! x y. F(x) & G(y) --> H(x) & J(y)))";
2891
d8f254ad1ab9 Calls Blast_tac
paulson
parents: 2715
diff changeset
   255
by (Blast_tac 1); 
969
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   256
result();
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   257
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   258
writeln"Problem 30";
5150
6e2e9b92c301 Addition of "Theorem B" of Peter Andrews
paulson
parents: 4463
diff changeset
   259
Goal "(! x. P(x) | Q(x) --> ~ R(x)) & \
969
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   260
\       (! x. (Q(x) --> ~ S(x)) --> P(x) & R(x))  \
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   261
\   --> (! x. S(x))";
2891
d8f254ad1ab9 Calls Blast_tac
paulson
parents: 2715
diff changeset
   262
by (Blast_tac 1);  
969
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   263
result();
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   264
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   265
writeln"Problem 31";
5150
6e2e9b92c301 Addition of "Theorem B" of Peter Andrews
paulson
parents: 4463
diff changeset
   266
Goal "~(? x. P(x) & (Q(x) | R(x))) & \
969
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   267
\       (? x. L(x) & P(x)) & \
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   268
\       (! x. ~ R(x) --> M(x))  \
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   269
\   --> (? x. L(x) & M(x))";
2891
d8f254ad1ab9 Calls Blast_tac
paulson
parents: 2715
diff changeset
   270
by (Blast_tac 1);
969
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   271
result();
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   272
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   273
writeln"Problem 32";
5150
6e2e9b92c301 Addition of "Theorem B" of Peter Andrews
paulson
parents: 4463
diff changeset
   274
Goal "(! x. P(x) & (Q(x)|R(x))-->S(x)) & \
969
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   275
\       (! x. S(x) & R(x) --> L(x)) & \
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   276
\       (! x. M(x) --> R(x))  \
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   277
\   --> (! x. P(x) & M(x) --> L(x))";
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
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   281
writeln"Problem 33";
5150
6e2e9b92c301 Addition of "Theorem B" of Peter Andrews
paulson
parents: 4463
diff changeset
   282
Goal "(! x. P(a) & (P(x)-->P(b))-->P(c))  =    \
969
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   283
\    (! x. (~P(a) | P(x) | P(c)) & (~P(a) | ~P(b) | P(c)))";
2891
d8f254ad1ab9 Calls Blast_tac
paulson
parents: 2715
diff changeset
   284
by (Blast_tac 1);
969
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   285
result();
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   286
1768
b5272bf9e1a4 Corrected a comment in #34
paulson
parents: 1716
diff changeset
   287
writeln"Problem 34  AMENDED (TWICE!!)";
969
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   288
(*Andrews's challenge*)
5150
6e2e9b92c301 Addition of "Theorem B" of Peter Andrews
paulson
parents: 4463
diff changeset
   289
Goal "((? x. ! y. p(x) = p(y))  =               \
3019
ca5a7bbbee6c Improved indentation of #34
paulson
parents: 2997
diff changeset
   290
\              ((? x. q(x)) = (! y. p(y))))   =    \
ca5a7bbbee6c Improved indentation of #34
paulson
parents: 2997
diff changeset
   291
\             ((? x. ! y. q(x) = q(y))  =          \
ca5a7bbbee6c Improved indentation of #34
paulson
parents: 2997
diff changeset
   292
\              ((? x. p(x)) = (! y. q(y))))";
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 35";
5150
6e2e9b92c301 Addition of "Theorem B" of Peter Andrews
paulson
parents: 4463
diff changeset
   297
Goal "? x y. P x y -->  (! u v. P u v)";
2891
d8f254ad1ab9 Calls Blast_tac
paulson
parents: 2715
diff changeset
   298
by (Blast_tac 1);
969
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   299
result();
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   300
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   301
writeln"Problem 36";
5150
6e2e9b92c301 Addition of "Theorem B" of Peter Andrews
paulson
parents: 4463
diff changeset
   302
Goal "(! x. ? y. J x y) & \
969
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   303
\       (! x. ? y. G x y) & \
1465
5d7a7e439cec expanded tabs
clasohm
parents: 1404
diff changeset
   304
\       (! x y. J x y | G x y -->       \
969
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   305
\       (! z. J y z | G y z --> H x z))   \
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   306
\   --> (! x. ? y. H x y)";
2891
d8f254ad1ab9 Calls Blast_tac
paulson
parents: 2715
diff changeset
   307
by (Blast_tac 1);
969
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   308
result();
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   309
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   310
writeln"Problem 37";
5150
6e2e9b92c301 Addition of "Theorem B" of Peter Andrews
paulson
parents: 4463
diff changeset
   311
Goal "(! z. ? w. ! x. ? y. \
3842
b55686a7b22c fixed dots;
wenzelm
parents: 3347
diff changeset
   312
\          (P x z -->P y w) & P y z & (P y w --> (? u. Q u w))) & \
969
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   313
\       (! x z. ~(P x z) --> (? y. Q y z)) & \
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   314
\       ((? x y. Q x y) --> (! x. R x x))  \
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   315
\   --> (! x. ? y. R x y)";
2891
d8f254ad1ab9 Calls Blast_tac
paulson
parents: 2715
diff changeset
   316
by (Blast_tac 1);
969
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   317
result();
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   318
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   319
writeln"Problem 38";
5150
6e2e9b92c301 Addition of "Theorem B" of Peter Andrews
paulson
parents: 4463
diff changeset
   320
Goal
1465
5d7a7e439cec expanded tabs
clasohm
parents: 1404
diff changeset
   321
    "(! x. p(a) & (p(x) --> (? y. p(y) & r x y)) -->            \
5d7a7e439cec expanded tabs
clasohm
parents: 1404
diff changeset
   322
\          (? z. ? w. p(z) & r x w & r w z))  =                 \
5d7a7e439cec expanded tabs
clasohm
parents: 1404
diff changeset
   323
\    (! 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
   324
\          (~p(a) | ~(? y. p(y) & r x y) |                      \
969
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   325
\           (? z. ? w. p(z) & r x w & r w z)))";
2891
d8f254ad1ab9 Calls Blast_tac
paulson
parents: 2715
diff changeset
   326
by (Blast_tac 1);  (*beats fast_tac!*)
1716
8dbf9ca61ce5 Restored a proof of Pelletier #38 -- mysteriously deleted
paulson
parents: 1712
diff changeset
   327
result();
969
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 39";
5150
6e2e9b92c301 Addition of "Theorem B" of Peter Andrews
paulson
parents: 4463
diff changeset
   330
Goal "~ (? x. ! y. F y x = (~ F y y))";
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 40.  AMENDED";
5150
6e2e9b92c301 Addition of "Theorem B" of Peter Andrews
paulson
parents: 4463
diff changeset
   335
Goal "(? y. ! x. F x y = F x x)  \
969
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   336
\       -->  ~ (! x. ? y. ! z. F z y = (~ F z x))";
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 41";
5150
6e2e9b92c301 Addition of "Theorem B" of Peter Andrews
paulson
parents: 4463
diff changeset
   341
Goal "(! z. ? y. ! x. f x y = (f x z & ~ f x x))        \
969
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   342
\              --> ~ (? z. ! x. f x z)";
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
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   346
writeln"Problem 42";
5150
6e2e9b92c301 Addition of "Theorem B" of Peter Andrews
paulson
parents: 4463
diff changeset
   347
Goal "~ (? y. ! x. p x y = (~ (? z. p x z & p z x)))";
2891
d8f254ad1ab9 Calls Blast_tac
paulson
parents: 2715
diff changeset
   348
by (Blast_tac 1);
969
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   349
result();
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   350
2891
d8f254ad1ab9 Calls Blast_tac
paulson
parents: 2715
diff changeset
   351
writeln"Problem 43!!";
5150
6e2e9b92c301 Addition of "Theorem B" of Peter Andrews
paulson
parents: 4463
diff changeset
   352
Goal
1465
5d7a7e439cec expanded tabs
clasohm
parents: 1404
diff changeset
   353
    "(! 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
   354
\ --> (! x. (! y. q x y = (q y x::bool)))";
2891
d8f254ad1ab9 Calls Blast_tac
paulson
parents: 2715
diff changeset
   355
by (Blast_tac 1);
3347
4e7dfe8ae41b Added a missing "result();" after problem 43.
paulson
parents: 3019
diff changeset
   356
result();
969
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   357
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   358
writeln"Problem 44";
5150
6e2e9b92c301 Addition of "Theorem B" of Peter Andrews
paulson
parents: 4463
diff changeset
   359
Goal "(! x. f(x) -->                                    \
969
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   360
\             (? y. g(y) & h x y & (? y. g(y) & ~ h x y)))  &   \
1465
5d7a7e439cec expanded tabs
clasohm
parents: 1404
diff changeset
   361
\             (? x. j(x) & (! y. g(y) --> h x y))               \
969
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   362
\             --> (? x. j(x) & ~f(x))";
2891
d8f254ad1ab9 Calls Blast_tac
paulson
parents: 2715
diff changeset
   363
by (Blast_tac 1);
969
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   364
result();
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   365
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   366
writeln"Problem 45";
5150
6e2e9b92c301 Addition of "Theorem B" of Peter Andrews
paulson
parents: 4463
diff changeset
   367
Goal
1465
5d7a7e439cec expanded tabs
clasohm
parents: 1404
diff changeset
   368
    "(! x. f(x) & (! y. g(y) & h x y --> j x y) \
5d7a7e439cec expanded tabs
clasohm
parents: 1404
diff changeset
   369
\                     --> (! y. g(y) & h x y --> k(y))) &       \
5d7a7e439cec expanded tabs
clasohm
parents: 1404
diff changeset
   370
\    ~ (? y. l(y) & k(y)) &                                     \
5d7a7e439cec expanded tabs
clasohm
parents: 1404
diff changeset
   371
\    (? x. f(x) & (! y. h x y --> l(y))                         \
5d7a7e439cec expanded tabs
clasohm
parents: 1404
diff changeset
   372
\               & (! y. g(y) & h x y --> j x y))                \
969
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   373
\     --> (? x. f(x) & ~ (? y. g(y) & h x y))";
2891
d8f254ad1ab9 Calls Blast_tac
paulson
parents: 2715
diff changeset
   374
by (Blast_tac 1); 
969
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   375
result();
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   376
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   377
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   378
writeln"Problems (mainly) involving equality or functions";
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 48";
5150
6e2e9b92c301 Addition of "Theorem B" of Peter Andrews
paulson
parents: 4463
diff changeset
   381
Goal "(a=b | c=d) & (a=c | b=d) --> a=d | b=c";
2891
d8f254ad1ab9 Calls Blast_tac
paulson
parents: 2715
diff changeset
   382
by (Blast_tac 1);
969
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   383
result();
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   384
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   385
writeln"Problem 49  NOT PROVED AUTOMATICALLY";
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   386
(*Hard because it involves substitution for Vars;
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   387
  the type constraint ensures that x,y,z have the same type as a,b,u. *)
5150
6e2e9b92c301 Addition of "Theorem B" of Peter Andrews
paulson
parents: 4463
diff changeset
   388
Goal "(? x y::'a. ! z. z=x | z=y) & P(a) & P(b) & (~a=b) \
3842
b55686a7b22c fixed dots;
wenzelm
parents: 3347
diff changeset
   389
\               --> (! u::'a. P(u))";
4153
e534c4c32d54 Ran expandshort, especially to introduce Safe_tac
paulson
parents: 4089
diff changeset
   390
by (Classical.Safe_tac);
969
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   391
by (res_inst_tac [("x","a")] allE 1);
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   392
by (assume_tac 1);
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   393
by (res_inst_tac [("x","b")] allE 1);
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   394
by (assume_tac 1);
4353
d565d2197a5f updated for latest Blast_tac, which treats equality differently
paulson
parents: 4153
diff changeset
   395
by (Fast_tac 1);    (*Blast_tac's treatment of equality can't do it*)
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 50";  
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   399
(*What has this to do with equality?*)
5150
6e2e9b92c301 Addition of "Theorem B" of Peter Andrews
paulson
parents: 4463
diff changeset
   400
Goal "(! x. P a x | (! y. P x y)) --> (? x. ! y. P x y)";
2891
d8f254ad1ab9 Calls Blast_tac
paulson
parents: 2715
diff changeset
   401
by (Blast_tac 1);
969
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   402
result();
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   403
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   404
writeln"Problem 51";
5150
6e2e9b92c301 Addition of "Theorem B" of Peter Andrews
paulson
parents: 4463
diff changeset
   405
Goal
969
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   406
    "(? z w. ! x y. P x y = (x=z & y=w)) -->  \
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   407
\    (? z. ! x. ? w. (! y. P x y = (y=w)) = (x=z))";
2891
d8f254ad1ab9 Calls Blast_tac
paulson
parents: 2715
diff changeset
   408
by (Blast_tac 1);
969
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   409
result();
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   410
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   411
writeln"Problem 52";
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   412
(*Almost the same as 51. *)
5150
6e2e9b92c301 Addition of "Theorem B" of Peter Andrews
paulson
parents: 4463
diff changeset
   413
Goal
969
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   414
    "(? z w. ! x y. P x y = (x=z & y=w)) -->  \
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   415
\    (? w. ! y. ? z. (! x. P x y = (x=z)) = (y=w))";
2891
d8f254ad1ab9 Calls Blast_tac
paulson
parents: 2715
diff changeset
   416
by (Blast_tac 1);
969
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   417
result();
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   418
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   419
writeln"Problem 55";
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   420
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   421
(*Non-equational version, from Manthey and Bry, CADE-9 (Springer, 1988).
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   422
  fast_tac DISCOVERS who killed Agatha. *)
5150
6e2e9b92c301 Addition of "Theorem B" of Peter Andrews
paulson
parents: 4463
diff changeset
   423
Goal "lives(agatha) & lives(butler) & lives(charles) & \
969
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   424
\  (killed agatha agatha | killed butler agatha | killed charles agatha) & \
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   425
\  (!x y. killed x y --> hates x y & ~richer x y) & \
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   426
\  (!x. hates agatha x --> ~hates charles x) & \
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   427
\  (hates agatha agatha & hates agatha charles) & \
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   428
\  (!x. lives(x) & ~richer x agatha --> hates butler x) & \
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   429
\  (!x. hates agatha x --> hates butler x) & \
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   430
\  (!x. ~hates x agatha | ~hates x butler | ~hates x charles) --> \
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   431
\   killed ?who agatha";
2922
580647a879cf Using Blast_tac
paulson
parents: 2891
diff changeset
   432
by (Fast_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 56";
5150
6e2e9b92c301 Addition of "Theorem B" of Peter Andrews
paulson
parents: 4463
diff changeset
   436
Goal
969
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   437
    "(! 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
   438
by (Blast_tac 1);
969
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   439
result();
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   440
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   441
writeln"Problem 57";
5150
6e2e9b92c301 Addition of "Theorem B" of Peter Andrews
paulson
parents: 4463
diff changeset
   442
Goal
969
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   443
    "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
   444
\    (! 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
   445
by (Blast_tac 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 58  NOT PROVED AUTOMATICALLY";
5150
6e2e9b92c301 Addition of "Theorem B" of Peter Andrews
paulson
parents: 4463
diff changeset
   449
Goal "(! x y. f(x)=g(y)) --> (! x y. f(f(x))=f(g(y)))";
969
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   450
val f_cong = read_instantiate [("f","f")] arg_cong;
4089
96fba19bcbe2 isatool fixclasimp;
wenzelm
parents: 4061
diff changeset
   451
by (fast_tac (claset() addIs [f_cong]) 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 59";
5150
6e2e9b92c301 Addition of "Theorem B" of Peter Andrews
paulson
parents: 4463
diff changeset
   455
Goal "(! x. P(x) = (~P(f(x)))) --> (? x. P(x) & ~P(f(x)))";
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
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   459
writeln"Problem 60";
5150
6e2e9b92c301 Addition of "Theorem B" of Peter Andrews
paulson
parents: 4463
diff changeset
   460
Goal
969
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   461
    "! 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
   462
by (Blast_tac 1);
969
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   463
result();
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   464
2715
79c35a051196 Updated reference to Pelletier erratum
paulson
parents: 2575
diff changeset
   465
writeln"Problem 62 as corrected in JAR 18 (1997), page 135";
5150
6e2e9b92c301 Addition of "Theorem B" of Peter Andrews
paulson
parents: 4463
diff changeset
   466
Goal "(ALL x. p a & (p x --> p(f x)) --> p(f(f x)))  =   \
6e2e9b92c301 Addition of "Theorem B" of Peter Andrews
paulson
parents: 4463
diff changeset
   467
\     (ALL x. (~ p a | p x | p(f(f x))) &                        \
6e2e9b92c301 Addition of "Theorem B" of Peter Andrews
paulson
parents: 4463
diff changeset
   468
\             (~ p a | ~ p(f x) | p(f(f x))))";
2891
d8f254ad1ab9 Calls Blast_tac
paulson
parents: 2715
diff changeset
   469
by (Blast_tac 1);
1404
57c3f6d2e692 Added Pelletier's problem 62, as corrected in AAR
paulson
parents: 969
diff changeset
   470
result();
57c3f6d2e692 Added Pelletier's problem 62, as corrected in AAR
paulson
parents: 969
diff changeset
   471
4463
76769b48bd88 New example
paulson
parents: 4353
diff changeset
   472
(*From Davis, Obvious Logical Inferences, IJCAI-81, 530-531
76769b48bd88 New example
paulson
parents: 4353
diff changeset
   473
  Fast_tac indeed copes!*)
76769b48bd88 New example
paulson
parents: 4353
diff changeset
   474
goal Prod.thy "(ALL x. F(x) & ~G(x) --> (EX y. H(x,y) & J(y))) & \
76769b48bd88 New example
paulson
parents: 4353
diff changeset
   475
\             (EX x. K(x) & F(x) & (ALL y. H(x,y) --> K(y))) &   \
76769b48bd88 New example
paulson
parents: 4353
diff changeset
   476
\             (ALL x. K(x) --> ~G(x))  -->  (EX x. K(x) & J(x))";
76769b48bd88 New example
paulson
parents: 4353
diff changeset
   477
by (Fast_tac 1);
76769b48bd88 New example
paulson
parents: 4353
diff changeset
   478
result();
76769b48bd88 New example
paulson
parents: 4353
diff changeset
   479
1712
c064cae981d6 Two new "obvious" examples
paulson
parents: 1465
diff changeset
   480
(*From Rudnicki, Obvious Inferences, JAR 3 (1987), 383-393.  
c064cae981d6 Two new "obvious" examples
paulson
parents: 1465
diff changeset
   481
  It does seem obvious!*)
c064cae981d6 Two new "obvious" examples
paulson
parents: 1465
diff changeset
   482
goal Prod.thy
c064cae981d6 Two new "obvious" examples
paulson
parents: 1465
diff changeset
   483
    "(ALL x. F(x) & ~G(x) --> (EX y. H(x,y) & J(y))) &        \
c064cae981d6 Two new "obvious" examples
paulson
parents: 1465
diff changeset
   484
\    (EX x. K(x) & F(x) & (ALL y. H(x,y) --> K(y)))  &        \
c064cae981d6 Two new "obvious" examples
paulson
parents: 1465
diff changeset
   485
\    (ALL x. K(x) --> ~G(x))   -->   (EX x. K(x) --> ~G(x))";
4463
76769b48bd88 New example
paulson
parents: 4353
diff changeset
   486
by (Fast_tac 1);
1712
c064cae981d6 Two new "obvious" examples
paulson
parents: 1465
diff changeset
   487
result();
c064cae981d6 Two new "obvious" examples
paulson
parents: 1465
diff changeset
   488
c064cae981d6 Two new "obvious" examples
paulson
parents: 1465
diff changeset
   489
goal Prod.thy
c064cae981d6 Two new "obvious" examples
paulson
parents: 1465
diff changeset
   490
    "(ALL x y. R(x,y) | R(y,x)) &                \
c064cae981d6 Two new "obvious" examples
paulson
parents: 1465
diff changeset
   491
\    (ALL x y. S(x,y) & S(y,x) --> x=y) &        \
c064cae981d6 Two new "obvious" examples
paulson
parents: 1465
diff changeset
   492
\    (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
   493
by (Blast_tac 1);
1712
c064cae981d6 Two new "obvious" examples
paulson
parents: 1465
diff changeset
   494
result();
c064cae981d6 Two new "obvious" examples
paulson
parents: 1465
diff changeset
   495
c064cae981d6 Two new "obvious" examples
paulson
parents: 1465
diff changeset
   496
c064cae981d6 Two new "obvious" examples
paulson
parents: 1465
diff changeset
   497
969
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   498
writeln"Reached end of file.";