src/HOL/ex/cla.ML
author oheimb
Thu, 01 Feb 2001 20:51:48 +0100
changeset 11025 a70b796d9af8
parent 10212 33fe2d701ddd
permissions -rw-r--r--
converted to Isar therory, adding attributes complete_split and split_format
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*)
5278
a903b66822e2 even more tidying of Goal commands
paulson
parents: 5150
diff changeset
   145
Goal "(!s. q(s) --> r(s)) & ~r(s) & (!s. ~r(s) & ~q(s) --> p(t) | q(t)) \
969
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   146
\   --> p(t) | r(t)";
2891
d8f254ad1ab9 Calls Blast_tac
paulson
parents: 2715
diff changeset
   147
by (Blast_tac 1);
969
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   148
result(); 
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   149
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   150
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   151
writeln"Problems requiring quantifier duplication";
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   152
5150
6e2e9b92c301 Addition of "Theorem B" of Peter Andrews
paulson
parents: 4463
diff changeset
   153
(*Theorem B of Peter Andrews, Theorem Proving via General Matings, 
6e2e9b92c301 Addition of "Theorem B" of Peter Andrews
paulson
parents: 4463
diff changeset
   154
  JACM 28 (1981).*)
6e2e9b92c301 Addition of "Theorem B" of Peter Andrews
paulson
parents: 4463
diff changeset
   155
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
   156
by (Blast_tac 1);
6e2e9b92c301 Addition of "Theorem B" of Peter Andrews
paulson
parents: 4463
diff changeset
   157
result();
6e2e9b92c301 Addition of "Theorem B" of Peter Andrews
paulson
parents: 4463
diff changeset
   158
969
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   159
(*Needs multiple instantiation of the quantifier.*)
5150
6e2e9b92c301 Addition of "Theorem B" of Peter Andrews
paulson
parents: 4463
diff changeset
   160
Goal "(! x. P(x)-->P(f(x)))  &  P(d)-->P(f(f(f(d))))";
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
(*Needs double instantiation of the quantifier*)
5150
6e2e9b92c301 Addition of "Theorem B" of Peter Andrews
paulson
parents: 4463
diff changeset
   165
Goal "? x. P(x) --> P(a) & P(b)";
2891
d8f254ad1ab9 Calls Blast_tac
paulson
parents: 2715
diff changeset
   166
by (Blast_tac 1);
969
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   167
result();
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   168
5150
6e2e9b92c301 Addition of "Theorem B" of Peter Andrews
paulson
parents: 4463
diff changeset
   169
Goal "? z. P(z) --> (! x. P(x))";
2891
d8f254ad1ab9 Calls Blast_tac
paulson
parents: 2715
diff changeset
   170
by (Blast_tac 1);
969
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   171
result();
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   172
5150
6e2e9b92c301 Addition of "Theorem B" of Peter Andrews
paulson
parents: 4463
diff changeset
   173
Goal "? x. (? y. P(y)) --> P(x)";
2891
d8f254ad1ab9 Calls Blast_tac
paulson
parents: 2715
diff changeset
   174
by (Blast_tac 1);
969
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   175
result();
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   176
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   177
writeln"Hard examples with quantifiers";
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 18";
5150
6e2e9b92c301 Addition of "Theorem B" of Peter Andrews
paulson
parents: 4463
diff changeset
   180
Goal "? y. ! x. P(y)-->P(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 19";
5150
6e2e9b92c301 Addition of "Theorem B" of Peter Andrews
paulson
parents: 4463
diff changeset
   185
Goal "? x. ! y z. (P(y)-->Q(z)) --> (P(x)-->Q(x))";
2891
d8f254ad1ab9 Calls Blast_tac
paulson
parents: 2715
diff changeset
   186
by (Blast_tac 1);
969
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   187
result();
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   188
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   189
writeln"Problem 20";
5150
6e2e9b92c301 Addition of "Theorem B" of Peter Andrews
paulson
parents: 4463
diff changeset
   190
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
   191
\   --> (? x y. P(x) & Q(y)) --> (? z. R(z))";
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 21";
5150
6e2e9b92c301 Addition of "Theorem B" of Peter Andrews
paulson
parents: 4463
diff changeset
   196
Goal "(? x. P-->Q(x)) & (? x. Q(x)-->P) --> (? x. P=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 22";
5150
6e2e9b92c301 Addition of "Theorem B" of Peter Andrews
paulson
parents: 4463
diff changeset
   201
Goal "(! 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 23";
5150
6e2e9b92c301 Addition of "Theorem B" of Peter Andrews
paulson
parents: 4463
diff changeset
   206
Goal "(! x. P | Q(x))  =  (P | (! x. Q(x)))";
2891
d8f254ad1ab9 Calls Blast_tac
paulson
parents: 2715
diff changeset
   207
by (Blast_tac 1);  
969
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   208
result();
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   209
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   210
writeln"Problem 24";
5150
6e2e9b92c301 Addition of "Theorem B" of Peter Andrews
paulson
parents: 4463
diff changeset
   211
Goal "~(? x. S(x)&Q(x)) & (! x. P(x) --> Q(x)|R(x)) &  \
3842
b55686a7b22c fixed dots;
wenzelm
parents: 3347
diff changeset
   212
\    (~(? 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
   213
\   --> (? x. P(x)&R(x))";
2891
d8f254ad1ab9 Calls Blast_tac
paulson
parents: 2715
diff changeset
   214
by (Blast_tac 1); 
969
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   215
result();
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   216
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   217
writeln"Problem 25";
5150
6e2e9b92c301 Addition of "Theorem B" of Peter Andrews
paulson
parents: 4463
diff changeset
   218
Goal "(? x. P(x)) &  \
969
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   219
\       (! x. L(x) --> ~ (M(x) & R(x))) &  \
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   220
\       (! x. P(x) --> (M(x) & L(x))) &   \
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   221
\       ((! x. P(x)-->Q(x)) | (? x. P(x)&R(x)))  \
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   222
\   --> (? x. Q(x)&P(x))";
2891
d8f254ad1ab9 Calls Blast_tac
paulson
parents: 2715
diff changeset
   223
by (Blast_tac 1); 
969
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   224
result();
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   225
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   226
writeln"Problem 26";
5150
6e2e9b92c301 Addition of "Theorem B" of Peter Andrews
paulson
parents: 4463
diff changeset
   227
Goal "((? x. p(x)) = (? x. q(x))) &     \
1465
5d7a7e439cec expanded tabs
clasohm
parents: 1404
diff changeset
   228
\     (! x. ! y. p(x) & q(y) --> (r(x) = s(y))) \
969
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   229
\ --> ((! x. p(x)-->r(x)) = (! x. q(x)-->s(x)))";
2891
d8f254ad1ab9 Calls Blast_tac
paulson
parents: 2715
diff changeset
   230
by (Blast_tac 1);
969
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   231
result();
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   232
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   233
writeln"Problem 27";
5150
6e2e9b92c301 Addition of "Theorem B" of Peter Andrews
paulson
parents: 4463
diff changeset
   234
Goal "(? x. P(x) & ~Q(x)) &   \
969
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   235
\             (! x. P(x) --> R(x)) &   \
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   236
\             (! x. M(x) & L(x) --> P(x)) &   \
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   237
\             ((? x. R(x) & ~ Q(x)) --> (! x. L(x) --> ~ R(x)))  \
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   238
\         --> (! x. M(x) --> ~L(x))";
2891
d8f254ad1ab9 Calls Blast_tac
paulson
parents: 2715
diff changeset
   239
by (Blast_tac 1); 
969
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   240
result();
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   241
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   242
writeln"Problem 28.  AMENDED";
5150
6e2e9b92c301 Addition of "Theorem B" of Peter Andrews
paulson
parents: 4463
diff changeset
   243
Goal "(! x. P(x) --> (! x. Q(x))) &   \
969
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   244
\       ((! x. Q(x)|R(x)) --> (? x. Q(x)&S(x))) &  \
3842
b55686a7b22c fixed dots;
wenzelm
parents: 3347
diff changeset
   245
\       ((? x. S(x)) --> (! x. L(x) --> M(x)))  \
969
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   246
\   --> (! x. P(x) & L(x) --> M(x))";
2891
d8f254ad1ab9 Calls Blast_tac
paulson
parents: 2715
diff changeset
   247
by (Blast_tac 1);  
969
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   248
result();
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   249
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   250
writeln"Problem 29.  Essentially the same as Principia Mathematica *11.71";
5150
6e2e9b92c301 Addition of "Theorem B" of Peter Andrews
paulson
parents: 4463
diff changeset
   251
Goal "(? x. F(x)) & (? y. G(y))  \
969
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   252
\   --> ( ((! x. F(x)-->H(x)) & (! y. G(y)-->J(y)))  =   \
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   253
\         (! x y. F(x) & G(y) --> H(x) & J(y)))";
2891
d8f254ad1ab9 Calls Blast_tac
paulson
parents: 2715
diff changeset
   254
by (Blast_tac 1); 
969
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   255
result();
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   256
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   257
writeln"Problem 30";
5150
6e2e9b92c301 Addition of "Theorem B" of Peter Andrews
paulson
parents: 4463
diff changeset
   258
Goal "(! x. P(x) | Q(x) --> ~ R(x)) & \
969
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   259
\       (! x. (Q(x) --> ~ S(x)) --> P(x) & R(x))  \
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   260
\   --> (! x. S(x))";
2891
d8f254ad1ab9 Calls Blast_tac
paulson
parents: 2715
diff changeset
   261
by (Blast_tac 1);  
969
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   262
result();
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   263
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   264
writeln"Problem 31";
5150
6e2e9b92c301 Addition of "Theorem B" of Peter Andrews
paulson
parents: 4463
diff changeset
   265
Goal "~(? x. P(x) & (Q(x) | R(x))) & \
969
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   266
\       (? x. L(x) & P(x)) & \
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   267
\       (! x. ~ R(x) --> M(x))  \
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   268
\   --> (? x. L(x) & M(x))";
2891
d8f254ad1ab9 Calls Blast_tac
paulson
parents: 2715
diff changeset
   269
by (Blast_tac 1);
969
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   270
result();
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   271
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   272
writeln"Problem 32";
5150
6e2e9b92c301 Addition of "Theorem B" of Peter Andrews
paulson
parents: 4463
diff changeset
   273
Goal "(! x. P(x) & (Q(x)|R(x))-->S(x)) & \
969
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   274
\       (! x. S(x) & R(x) --> L(x)) & \
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   275
\       (! x. M(x) --> R(x))  \
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   276
\   --> (! x. P(x) & M(x) --> L(x))";
2891
d8f254ad1ab9 Calls Blast_tac
paulson
parents: 2715
diff changeset
   277
by (Blast_tac 1);
969
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   278
result();
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   279
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   280
writeln"Problem 33";
5150
6e2e9b92c301 Addition of "Theorem B" of Peter Andrews
paulson
parents: 4463
diff changeset
   281
Goal "(! x. P(a) & (P(x)-->P(b))-->P(c))  =    \
969
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   282
\    (! x. (~P(a) | P(x) | P(c)) & (~P(a) | ~P(b) | P(c)))";
2891
d8f254ad1ab9 Calls Blast_tac
paulson
parents: 2715
diff changeset
   283
by (Blast_tac 1);
969
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   284
result();
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   285
1768
b5272bf9e1a4 Corrected a comment in #34
paulson
parents: 1716
diff changeset
   286
writeln"Problem 34  AMENDED (TWICE!!)";
969
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   287
(*Andrews's challenge*)
5150
6e2e9b92c301 Addition of "Theorem B" of Peter Andrews
paulson
parents: 4463
diff changeset
   288
Goal "((? x. ! y. p(x) = p(y))  =               \
3019
ca5a7bbbee6c Improved indentation of #34
paulson
parents: 2997
diff changeset
   289
\              ((? x. q(x)) = (! y. p(y))))   =    \
ca5a7bbbee6c Improved indentation of #34
paulson
parents: 2997
diff changeset
   290
\             ((? x. ! y. q(x) = q(y))  =          \
ca5a7bbbee6c Improved indentation of #34
paulson
parents: 2997
diff changeset
   291
\              ((? x. p(x)) = (! y. q(y))))";
2891
d8f254ad1ab9 Calls Blast_tac
paulson
parents: 2715
diff changeset
   292
by (Blast_tac 1);
969
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   293
result();
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   294
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   295
writeln"Problem 35";
5150
6e2e9b92c301 Addition of "Theorem B" of Peter Andrews
paulson
parents: 4463
diff changeset
   296
Goal "? x y. P x y -->  (! u v. P u v)";
2891
d8f254ad1ab9 Calls Blast_tac
paulson
parents: 2715
diff changeset
   297
by (Blast_tac 1);
969
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   298
result();
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   299
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   300
writeln"Problem 36";
5150
6e2e9b92c301 Addition of "Theorem B" of Peter Andrews
paulson
parents: 4463
diff changeset
   301
Goal "(! x. ? y. J x y) & \
969
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   302
\       (! x. ? y. G x y) & \
1465
5d7a7e439cec expanded tabs
clasohm
parents: 1404
diff changeset
   303
\       (! x y. J x y | G x y -->       \
969
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   304
\       (! z. J y z | G y z --> H x z))   \
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   305
\   --> (! x. ? y. H x y)";
2891
d8f254ad1ab9 Calls Blast_tac
paulson
parents: 2715
diff changeset
   306
by (Blast_tac 1);
969
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   307
result();
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   308
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   309
writeln"Problem 37";
5150
6e2e9b92c301 Addition of "Theorem B" of Peter Andrews
paulson
parents: 4463
diff changeset
   310
Goal "(! z. ? w. ! x. ? y. \
3842
b55686a7b22c fixed dots;
wenzelm
parents: 3347
diff changeset
   311
\          (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
   312
\       (! x z. ~(P x z) --> (? y. Q y z)) & \
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   313
\       ((? x y. Q x y) --> (! x. R x x))  \
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   314
\   --> (! x. ? y. R x y)";
2891
d8f254ad1ab9 Calls Blast_tac
paulson
parents: 2715
diff changeset
   315
by (Blast_tac 1);
969
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   316
result();
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   317
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   318
writeln"Problem 38";
5278
a903b66822e2 even more tidying of Goal commands
paulson
parents: 5150
diff changeset
   319
Goal "(! x. p(a) & (p(x) --> (? y. p(y) & r x y)) -->            \
1465
5d7a7e439cec expanded tabs
clasohm
parents: 1404
diff changeset
   320
\          (? z. ? w. p(z) & r x w & r w z))  =                 \
5d7a7e439cec expanded tabs
clasohm
parents: 1404
diff changeset
   321
\    (! 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
   322
\          (~p(a) | ~(? y. p(y) & r x y) |                      \
969
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   323
\           (? z. ? w. p(z) & r x w & r w z)))";
2891
d8f254ad1ab9 Calls Blast_tac
paulson
parents: 2715
diff changeset
   324
by (Blast_tac 1);  (*beats fast_tac!*)
1716
8dbf9ca61ce5 Restored a proof of Pelletier #38 -- mysteriously deleted
paulson
parents: 1712
diff changeset
   325
result();
969
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   326
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   327
writeln"Problem 39";
5150
6e2e9b92c301 Addition of "Theorem B" of Peter Andrews
paulson
parents: 4463
diff changeset
   328
Goal "~ (? x. ! y. F y x = (~ F y y))";
2891
d8f254ad1ab9 Calls Blast_tac
paulson
parents: 2715
diff changeset
   329
by (Blast_tac 1);
969
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   330
result();
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   331
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   332
writeln"Problem 40.  AMENDED";
5150
6e2e9b92c301 Addition of "Theorem B" of Peter Andrews
paulson
parents: 4463
diff changeset
   333
Goal "(? y. ! x. F x y = F x x)  \
969
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   334
\       -->  ~ (! x. ? y. ! z. F z y = (~ F z x))";
2891
d8f254ad1ab9 Calls Blast_tac
paulson
parents: 2715
diff changeset
   335
by (Blast_tac 1);
969
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   336
result();
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   337
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   338
writeln"Problem 41";
5150
6e2e9b92c301 Addition of "Theorem B" of Peter Andrews
paulson
parents: 4463
diff changeset
   339
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
   340
\              --> ~ (? z. ! x. f x z)";
2891
d8f254ad1ab9 Calls Blast_tac
paulson
parents: 2715
diff changeset
   341
by (Blast_tac 1);
969
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   342
result();
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   343
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   344
writeln"Problem 42";
5150
6e2e9b92c301 Addition of "Theorem B" of Peter Andrews
paulson
parents: 4463
diff changeset
   345
Goal "~ (? y. ! x. p x y = (~ (? z. p x z & p z x)))";
2891
d8f254ad1ab9 Calls Blast_tac
paulson
parents: 2715
diff changeset
   346
by (Blast_tac 1);
969
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   347
result();
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   348
2891
d8f254ad1ab9 Calls Blast_tac
paulson
parents: 2715
diff changeset
   349
writeln"Problem 43!!";
5278
a903b66822e2 even more tidying of Goal commands
paulson
parents: 5150
diff changeset
   350
Goal "(! 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
   351
\ --> (! x. (! y. q x y = (q y x::bool)))";
2891
d8f254ad1ab9 Calls Blast_tac
paulson
parents: 2715
diff changeset
   352
by (Blast_tac 1);
3347
4e7dfe8ae41b Added a missing "result();" after problem 43.
paulson
parents: 3019
diff changeset
   353
result();
969
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   354
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   355
writeln"Problem 44";
5150
6e2e9b92c301 Addition of "Theorem B" of Peter Andrews
paulson
parents: 4463
diff changeset
   356
Goal "(! x. f(x) -->                                    \
969
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   357
\             (? y. g(y) & h x y & (? y. g(y) & ~ h x y)))  &   \
1465
5d7a7e439cec expanded tabs
clasohm
parents: 1404
diff changeset
   358
\             (? x. j(x) & (! y. g(y) --> h x y))               \
969
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   359
\             --> (? x. j(x) & ~f(x))";
2891
d8f254ad1ab9 Calls Blast_tac
paulson
parents: 2715
diff changeset
   360
by (Blast_tac 1);
969
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   361
result();
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   362
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   363
writeln"Problem 45";
5278
a903b66822e2 even more tidying of Goal commands
paulson
parents: 5150
diff changeset
   364
Goal "(! x. f(x) & (! y. g(y) & h x y --> j x y) \
1465
5d7a7e439cec expanded tabs
clasohm
parents: 1404
diff changeset
   365
\                     --> (! y. g(y) & h x y --> k(y))) &       \
5d7a7e439cec expanded tabs
clasohm
parents: 1404
diff changeset
   366
\    ~ (? y. l(y) & k(y)) &                                     \
5d7a7e439cec expanded tabs
clasohm
parents: 1404
diff changeset
   367
\    (? x. f(x) & (! y. h x y --> l(y))                         \
5d7a7e439cec expanded tabs
clasohm
parents: 1404
diff changeset
   368
\               & (! y. g(y) & h x y --> j x y))                \
969
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   369
\     --> (? x. f(x) & ~ (? y. g(y) & h x y))";
2891
d8f254ad1ab9 Calls Blast_tac
paulson
parents: 2715
diff changeset
   370
by (Blast_tac 1); 
969
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   371
result();
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   372
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   373
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   374
writeln"Problems (mainly) involving equality or functions";
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   375
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   376
writeln"Problem 48";
5150
6e2e9b92c301 Addition of "Theorem B" of Peter Andrews
paulson
parents: 4463
diff changeset
   377
Goal "(a=b | c=d) & (a=c | b=d) --> a=d | b=c";
2891
d8f254ad1ab9 Calls Blast_tac
paulson
parents: 2715
diff changeset
   378
by (Blast_tac 1);
969
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   379
result();
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   380
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   381
writeln"Problem 49  NOT PROVED AUTOMATICALLY";
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   382
(*Hard because it involves substitution for Vars;
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   383
  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
   384
Goal "(? x y::'a. ! z. z=x | z=y) & P(a) & P(b) & (~a=b) \
3842
b55686a7b22c fixed dots;
wenzelm
parents: 3347
diff changeset
   385
\               --> (! u::'a. P(u))";
4153
e534c4c32d54 Ran expandshort, especially to introduce Safe_tac
paulson
parents: 4089
diff changeset
   386
by (Classical.Safe_tac);
969
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   387
by (res_inst_tac [("x","a")] allE 1);
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   388
by (assume_tac 1);
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   389
by (res_inst_tac [("x","b")] allE 1);
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   390
by (assume_tac 1);
4353
d565d2197a5f updated for latest Blast_tac, which treats equality differently
paulson
parents: 4153
diff changeset
   391
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
   392
result();
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   393
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   394
writeln"Problem 50";  
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   395
(*What has this to do with equality?*)
5150
6e2e9b92c301 Addition of "Theorem B" of Peter Andrews
paulson
parents: 4463
diff changeset
   396
Goal "(! x. P a x | (! y. P x y)) --> (? x. ! y. P x y)";
2891
d8f254ad1ab9 Calls Blast_tac
paulson
parents: 2715
diff changeset
   397
by (Blast_tac 1);
969
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   398
result();
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   399
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   400
writeln"Problem 51";
5278
a903b66822e2 even more tidying of Goal commands
paulson
parents: 5150
diff changeset
   401
Goal "(? z w. ! x y. P x y = (x=z & y=w)) -->  \
969
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. *)
5278
a903b66822e2 even more tidying of Goal commands
paulson
parents: 5150
diff changeset
   408
Goal "(? z w. ! x y. P x y = (x=z & y=w)) -->  \
969
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   409
\    (? w. ! y. ? z. (! x. P x y = (x=z)) = (y=w))";
2891
d8f254ad1ab9 Calls Blast_tac
paulson
parents: 2715
diff changeset
   410
by (Blast_tac 1);
969
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   411
result();
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   412
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   413
writeln"Problem 55";
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   414
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   415
(*Non-equational version, from Manthey and Bry, CADE-9 (Springer, 1988).
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   416
  fast_tac DISCOVERS who killed Agatha. *)
5150
6e2e9b92c301 Addition of "Theorem B" of Peter Andrews
paulson
parents: 4463
diff changeset
   417
Goal "lives(agatha) & lives(butler) & lives(charles) & \
969
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   418
\  (killed agatha agatha | killed butler agatha | killed charles agatha) & \
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   419
\  (!x y. killed x y --> hates x y & ~richer x y) & \
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   420
\  (!x. hates agatha x --> ~hates charles x) & \
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   421
\  (hates agatha agatha & hates agatha charles) & \
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   422
\  (!x. lives(x) & ~richer x agatha --> hates butler x) & \
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   423
\  (!x. hates agatha x --> hates butler x) & \
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   424
\  (!x. ~hates x agatha | ~hates x butler | ~hates x charles) --> \
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   425
\   killed ?who agatha";
2922
580647a879cf Using Blast_tac
paulson
parents: 2891
diff changeset
   426
by (Fast_tac 1);
969
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   427
result();
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   428
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   429
writeln"Problem 56";
5278
a903b66822e2 even more tidying of Goal commands
paulson
parents: 5150
diff changeset
   430
Goal "(! 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
   431
by (Blast_tac 1);
969
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   432
result();
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   433
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   434
writeln"Problem 57";
5278
a903b66822e2 even more tidying of Goal commands
paulson
parents: 5150
diff changeset
   435
Goal "P (f a b) (f b c) & P (f b c) (f a c) & \
969
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   436
\    (! 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
   437
by (Blast_tac 1);
969
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   438
result();
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   439
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   440
writeln"Problem 58  NOT PROVED AUTOMATICALLY";
5150
6e2e9b92c301 Addition of "Theorem B" of Peter Andrews
paulson
parents: 4463
diff changeset
   441
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
   442
val f_cong = read_instantiate [("f","f")] arg_cong;
4089
96fba19bcbe2 isatool fixclasimp;
wenzelm
parents: 4061
diff changeset
   443
by (fast_tac (claset() addIs [f_cong]) 1);
969
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   444
result();
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   445
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   446
writeln"Problem 59";
5150
6e2e9b92c301 Addition of "Theorem B" of Peter Andrews
paulson
parents: 4463
diff changeset
   447
Goal "(! x. P(x) = (~P(f(x)))) --> (? x. P(x) & ~P(f(x)))";
2891
d8f254ad1ab9 Calls Blast_tac
paulson
parents: 2715
diff changeset
   448
by (Blast_tac 1);
969
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   449
result();
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   450
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   451
writeln"Problem 60";
5278
a903b66822e2 even more tidying of Goal commands
paulson
parents: 5150
diff changeset
   452
Goal "! 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
   453
by (Blast_tac 1);
969
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   454
result();
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   455
2715
79c35a051196 Updated reference to Pelletier erratum
paulson
parents: 2575
diff changeset
   456
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
   457
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
   458
\     (ALL x. (~ p a | p x | p(f(f x))) &                        \
6e2e9b92c301 Addition of "Theorem B" of Peter Andrews
paulson
parents: 4463
diff changeset
   459
\             (~ p a | ~ p(f x) | p(f(f x))))";
2891
d8f254ad1ab9 Calls Blast_tac
paulson
parents: 2715
diff changeset
   460
by (Blast_tac 1);
1404
57c3f6d2e692 Added Pelletier's problem 62, as corrected in AAR
paulson
parents: 969
diff changeset
   461
result();
57c3f6d2e692 Added Pelletier's problem 62, as corrected in AAR
paulson
parents: 969
diff changeset
   462
4463
76769b48bd88 New example
paulson
parents: 4353
diff changeset
   463
(*From Davis, Obvious Logical Inferences, IJCAI-81, 530-531
76769b48bd88 New example
paulson
parents: 4353
diff changeset
   464
  Fast_tac indeed copes!*)
11025
a70b796d9af8 converted to Isar therory, adding attributes complete_split and split_format
oheimb
parents: 10212
diff changeset
   465
goal (theory "Product_Type") 
a70b796d9af8 converted to Isar therory, adding attributes complete_split and split_format
oheimb
parents: 10212
diff changeset
   466
             "(ALL x. F(x) & ~G(x) --> (EX y. H(x,y) & J(y))) & \
4463
76769b48bd88 New example
paulson
parents: 4353
diff changeset
   467
\             (EX x. K(x) & F(x) & (ALL y. H(x,y) --> K(y))) &   \
76769b48bd88 New example
paulson
parents: 4353
diff changeset
   468
\             (ALL x. K(x) --> ~G(x))  -->  (EX x. K(x) & J(x))";
76769b48bd88 New example
paulson
parents: 4353
diff changeset
   469
by (Fast_tac 1);
76769b48bd88 New example
paulson
parents: 4353
diff changeset
   470
result();
76769b48bd88 New example
paulson
parents: 4353
diff changeset
   471
1712
c064cae981d6 Two new "obvious" examples
paulson
parents: 1465
diff changeset
   472
(*From Rudnicki, Obvious Inferences, JAR 3 (1987), 383-393.  
c064cae981d6 Two new "obvious" examples
paulson
parents: 1465
diff changeset
   473
  It does seem obvious!*)
11025
a70b796d9af8 converted to Isar therory, adding attributes complete_split and split_format
oheimb
parents: 10212
diff changeset
   474
goal (theory "Product_Type")
1712
c064cae981d6 Two new "obvious" examples
paulson
parents: 1465
diff changeset
   475
    "(ALL x. F(x) & ~G(x) --> (EX y. H(x,y) & J(y))) &        \
c064cae981d6 Two new "obvious" examples
paulson
parents: 1465
diff changeset
   476
\    (EX x. K(x) & F(x) & (ALL y. H(x,y) --> K(y)))  &        \
c064cae981d6 Two new "obvious" examples
paulson
parents: 1465
diff changeset
   477
\    (ALL x. K(x) --> ~G(x))   -->   (EX x. K(x) --> ~G(x))";
4463
76769b48bd88 New example
paulson
parents: 4353
diff changeset
   478
by (Fast_tac 1);
1712
c064cae981d6 Two new "obvious" examples
paulson
parents: 1465
diff changeset
   479
result();
c064cae981d6 Two new "obvious" examples
paulson
parents: 1465
diff changeset
   480
6799
95abcc002a21 new classical example from Lewis Carroll via S G Pulman
paulson
parents: 5278
diff changeset
   481
(*Attributed to Lewis Carroll by S. G. Pulman.  The first or last assumption
95abcc002a21 new classical example from Lewis Carroll via S G Pulman
paulson
parents: 5278
diff changeset
   482
can be deleted.*)
95abcc002a21 new classical example from Lewis Carroll via S G Pulman
paulson
parents: 5278
diff changeset
   483
Goal "(ALL x. honest(x) & industrious(x) --> healthy(x)) & \
95abcc002a21 new classical example from Lewis Carroll via S G Pulman
paulson
parents: 5278
diff changeset
   484
\     ~ (EX x. grocer(x) & healthy(x)) & \
95abcc002a21 new classical example from Lewis Carroll via S G Pulman
paulson
parents: 5278
diff changeset
   485
\     (ALL x. industrious(x) & grocer(x) --> honest(x)) & \
95abcc002a21 new classical example from Lewis Carroll via S G Pulman
paulson
parents: 5278
diff changeset
   486
\     (ALL x. cyclist(x) --> industrious(x)) & \
95abcc002a21 new classical example from Lewis Carroll via S G Pulman
paulson
parents: 5278
diff changeset
   487
\     (ALL x. ~healthy(x) & cyclist(x) --> ~honest(x))  \
95abcc002a21 new classical example from Lewis Carroll via S G Pulman
paulson
parents: 5278
diff changeset
   488
\     --> (ALL x. grocer(x) --> ~cyclist(x))";
95abcc002a21 new classical example from Lewis Carroll via S G Pulman
paulson
parents: 5278
diff changeset
   489
by (Blast_tac 1);
95abcc002a21 new classical example from Lewis Carroll via S G Pulman
paulson
parents: 5278
diff changeset
   490
result();
95abcc002a21 new classical example from Lewis Carroll via S G Pulman
paulson
parents: 5278
diff changeset
   491
11025
a70b796d9af8 converted to Isar therory, adding attributes complete_split and split_format
oheimb
parents: 10212
diff changeset
   492
goal (theory "Product_Type")
1712
c064cae981d6 Two new "obvious" examples
paulson
parents: 1465
diff changeset
   493
    "(ALL x y. R(x,y) | R(y,x)) &                \
c064cae981d6 Two new "obvious" examples
paulson
parents: 1465
diff changeset
   494
\    (ALL x y. S(x,y) & S(y,x) --> x=y) &        \
c064cae981d6 Two new "obvious" examples
paulson
parents: 1465
diff changeset
   495
\    (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
   496
by (Blast_tac 1);
1712
c064cae981d6 Two new "obvious" examples
paulson
parents: 1465
diff changeset
   497
result();
c064cae981d6 Two new "obvious" examples
paulson
parents: 1465
diff changeset
   498
c064cae981d6 Two new "obvious" examples
paulson
parents: 1465
diff changeset
   499
c064cae981d6 Two new "obvious" examples
paulson
parents: 1465
diff changeset
   500
969
b051e2fc2e34 converted ex with curried function application
clasohm
parents:
diff changeset
   501
writeln"Reached end of file.";