src/FOLP/ex/Intuitionistic.thy
author haftmann
Mon, 01 Mar 2010 13:40:23 +0100
changeset 35416 d8d7d1b785af
parent 26322 eaf634e975fa
child 35762 af3ff2ba4c54
permissions -rw-r--r--
replaced a couple of constsdefs by definitions (also some old primrecs by modern ones)
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
26322
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
     1
(*  Title:      FOLP/ex/Intuitionistic.thy
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
     2
    ID:         $Id$
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
     3
    Author:     Lawrence C Paulson, Cambridge University Computer Laboratory
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
     4
    Copyright   1991  University of Cambridge
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
     5
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
     6
Intuitionistic First-Order Logic.
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
     7
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
     8
Single-step commands:
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
     9
by (IntPr.step_tac 1)
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
    10
by (biresolve_tac safe_brls 1);
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
    11
by (biresolve_tac haz_brls 1);
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
    12
by (assume_tac 1);
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
    13
by (IntPr.safe_tac 1);
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
    14
by (IntPr.mp_tac 1);
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
    15
by (IntPr.fast_tac 1);
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
    16
*)
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
    17
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
    18
(*Note: for PROPOSITIONAL formulae...
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
    19
  ~A is classically provable iff it is intuitionistically provable.  
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
    20
  Therefore A is classically provable iff ~~A is intuitionistically provable.
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
    21
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
    22
Let Q be the conjuction of the propositions A|~A, one for each atom A in
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
    23
P.  If P is provable classically, then clearly P&Q is provable
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
    24
intuitionistically, so ~~(P&Q) is also provable intuitionistically.
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
    25
The latter is intuitionistically equivalent to ~~P&~~Q, hence to ~~P,
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
    26
since ~~Q is intuitionistically provable.  Finally, if P is a negation then
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
    27
~~P is intuitionstically equivalent to P.  [Andy Pitts]
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
    28
*)
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
    29
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
    30
theory Intuitionistic
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
    31
imports IFOLP
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
    32
begin
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
    33
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
    34
lemma "?p : ~~(P&Q) <-> ~~P & ~~Q"
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
    35
  by (tactic {* IntPr.fast_tac 1 *})
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
    36
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
    37
lemma "?p : ~~~P <-> ~P"
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
    38
  by (tactic {* IntPr.fast_tac 1 *})
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
    39
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
    40
lemma "?p : ~~((P --> Q | R)  -->  (P-->Q) | (P-->R))"
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
    41
  by (tactic {* IntPr.fast_tac 1 *})
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
    42
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
    43
lemma "?p : (P<->Q) <-> (Q<->P)"
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
    44
  by (tactic {* IntPr.fast_tac 1 *})
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
    45
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
    46
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
    47
subsection {* Lemmas for the propositional double-negation translation *}
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
    48
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
    49
lemma "?p : P --> ~~P"
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
    50
  by (tactic {* IntPr.fast_tac 1 *})
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
    51
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
    52
lemma "?p : ~~(~~P --> P)"
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
    53
  by (tactic {* IntPr.fast_tac 1 *})
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
    54
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
    55
lemma "?p : ~~P & ~~(P --> Q) --> ~~Q"
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
    56
  by (tactic {* IntPr.fast_tac 1 *})
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
    57
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
    58
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
    59
subsection {* The following are classically but not constructively valid *}
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
    60
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
    61
(*The attempt to prove them terminates quickly!*)
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
    62
lemma "?p : ((P-->Q) --> P)  -->  P"
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
    63
  apply (tactic {* IntPr.fast_tac 1 *})?
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
    64
  oops
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
    65
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
    66
lemma "?p : (P&Q-->R)  -->  (P-->R) | (Q-->R)"
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
    67
  apply (tactic {* IntPr.fast_tac 1 *})?
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
    68
  oops
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
    69
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
    70
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
    71
subsection {* Intuitionistic FOL: propositional problems based on Pelletier *}
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
    72
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
    73
text "Problem ~~1"
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
    74
lemma "?p : ~~((P-->Q)  <->  (~Q --> ~P))"
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
    75
  by (tactic {* IntPr.fast_tac 1 *})
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
    76
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
    77
text "Problem ~~2"
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
    78
lemma "?p : ~~(~~P  <->  P)"
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
    79
  by (tactic {* IntPr.fast_tac 1 *})
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
    80
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
    81
text "Problem 3"
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
    82
lemma "?p : ~(P-->Q) --> (Q-->P)"
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
    83
  by (tactic {* IntPr.fast_tac 1 *})
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
    84
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
    85
text "Problem ~~4"
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
    86
lemma "?p : ~~((~P-->Q)  <->  (~Q --> P))"
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
    87
  by (tactic {* IntPr.fast_tac 1 *})
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
    88
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
    89
text "Problem ~~5"
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
    90
lemma "?p : ~~((P|Q-->P|R) --> P|(Q-->R))"
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
    91
  by (tactic {* IntPr.fast_tac 1 *})
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
    92
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
    93
text "Problem ~~6"
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
    94
lemma "?p : ~~(P | ~P)"
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
    95
  by (tactic {* IntPr.fast_tac 1 *})
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
    96
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
    97
text "Problem ~~7"
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
    98
lemma "?p : ~~(P | ~~~P)"
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
    99
  by (tactic {* IntPr.fast_tac 1 *})
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   100
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   101
text "Problem ~~8.  Peirce's law"
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   102
lemma "?p : ~~(((P-->Q) --> P)  -->  P)"
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   103
  by (tactic {* IntPr.fast_tac 1 *})
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   104
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   105
text "Problem 9"
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   106
lemma "?p : ((P|Q) & (~P|Q) & (P| ~Q)) --> ~ (~P | ~Q)"
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   107
  by (tactic {* IntPr.fast_tac 1 *})
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   108
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   109
text "Problem 10"
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   110
lemma "?p : (Q-->R) --> (R-->P&Q) --> (P-->(Q|R)) --> (P<->Q)"
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   111
  by (tactic {* IntPr.fast_tac 1 *})
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   112
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   113
text "11.  Proved in each direction (incorrectly, says Pelletier!!) "
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   114
lemma "?p : P<->P"
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   115
  by (tactic {* IntPr.fast_tac 1 *})
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   116
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   117
text "Problem ~~12.  Dijkstra's law  "
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   118
lemma "?p : ~~(((P <-> Q) <-> R)  <->  (P <-> (Q <-> R)))"
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   119
  by (tactic {* IntPr.fast_tac 1 *})
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   120
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   121
lemma "?p : ((P <-> Q) <-> R)  -->  ~~(P <-> (Q <-> R))"
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   122
  by (tactic {* IntPr.fast_tac 1 *})
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   123
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   124
text "Problem 13.  Distributive law"
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   125
lemma "?p : P | (Q & R)  <-> (P | Q) & (P | R)"
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   126
  by (tactic {* IntPr.fast_tac 1 *})
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   127
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   128
text "Problem ~~14"
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   129
lemma "?p : ~~((P <-> Q) <-> ((Q | ~P) & (~Q|P)))"
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   130
  by (tactic {* IntPr.fast_tac 1 *})
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   131
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   132
text "Problem ~~15"
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   133
lemma "?p : ~~((P --> Q) <-> (~P | Q))"
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   134
  by (tactic {* IntPr.fast_tac 1 *})
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   135
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   136
text "Problem ~~16"
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   137
lemma "?p : ~~((P-->Q) | (Q-->P))"
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   138
  by (tactic {* IntPr.fast_tac 1 *})
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   139
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   140
text "Problem ~~17"
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   141
lemma "?p : ~~(((P & (Q-->R))-->S) <-> ((~P | Q | S) & (~P | ~R | S)))"
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   142
  by (tactic {* IntPr.fast_tac 1 *})  -- slow
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   143
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   144
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   145
subsection {* Examples with quantifiers *}
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   146
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   147
text "The converse is classical in the following implications..."
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   148
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   149
lemma "?p : (EX x. P(x)-->Q)  -->  (ALL x. P(x)) --> Q"
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   150
  by (tactic {* IntPr.fast_tac 1 *})
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   151
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   152
lemma "?p : ((ALL x. P(x))-->Q) --> ~ (ALL x. P(x) & ~Q)"
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   153
  by (tactic {* IntPr.fast_tac 1 *})
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   154
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   155
lemma "?p : ((ALL x. ~P(x))-->Q)  -->  ~ (ALL x. ~ (P(x)|Q))"
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   156
  by (tactic {* IntPr.fast_tac 1 *})
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   157
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   158
lemma "?p : (ALL x. P(x)) | Q  -->  (ALL x. P(x) | Q)"
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   159
  by (tactic {* IntPr.fast_tac 1 *})
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   160
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   161
lemma "?p : (EX x. P --> Q(x)) --> (P --> (EX x. Q(x)))"
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   162
  by (tactic {* IntPr.fast_tac 1 *})
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   163
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   164
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   165
text "The following are not constructively valid!"
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   166
text "The attempt to prove them terminates quickly!"
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   167
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   168
lemma "?p : ((ALL x. P(x))-->Q) --> (EX x. P(x)-->Q)"
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   169
  apply (tactic {* IntPr.fast_tac 1 *})?
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   170
  oops
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   171
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   172
lemma "?p : (P --> (EX x. Q(x))) --> (EX x. P-->Q(x))"
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   173
  apply (tactic {* IntPr.fast_tac 1 *})?
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   174
  oops
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   175
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   176
lemma "?p : (ALL x. P(x) | Q) --> ((ALL x. P(x)) | Q)"
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   177
  apply (tactic {* IntPr.fast_tac 1 *})?
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   178
  oops
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   179
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   180
lemma "?p : (ALL x. ~~P(x)) --> ~~(ALL x. P(x))"
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   181
  apply (tactic {* IntPr.fast_tac 1 *})?
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   182
  oops
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   183
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   184
(*Classically but not intuitionistically valid.  Proved by a bug in 1986!*)
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   185
lemma "?p : EX x. Q(x) --> (ALL x. Q(x))"
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   186
  apply (tactic {* IntPr.fast_tac 1 *})?
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   187
  oops
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   188
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   189
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   190
subsection "Hard examples with quantifiers"
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   191
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   192
text {*
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   193
  The ones that have not been proved are not known to be valid!
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   194
  Some will require quantifier duplication -- not currently available.
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   195
*}
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   196
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   197
text "Problem ~~18"
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   198
lemma "?p : ~~(EX y. ALL x. P(y)-->P(x))" oops
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   199
(*NOT PROVED*)
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   200
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   201
text "Problem ~~19"
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   202
lemma "?p : ~~(EX x. ALL y z. (P(y)-->Q(z)) --> (P(x)-->Q(x)))" oops
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   203
(*NOT PROVED*)
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   204
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   205
text "Problem 20"
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   206
lemma "?p : (ALL x y. EX z. ALL w. (P(x)&Q(y)-->R(z)&S(w)))      
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   207
    --> (EX x y. P(x) & Q(y)) --> (EX z. R(z))"
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   208
  by (tactic {* IntPr.fast_tac 1 *})
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   209
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   210
text "Problem 21"
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   211
lemma "?p : (EX x. P-->Q(x)) & (EX x. Q(x)-->P) --> ~~(EX x. P<->Q(x))" oops
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   212
(*NOT PROVED*)
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   213
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   214
text "Problem 22"
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   215
lemma "?p : (ALL x. P <-> Q(x))  -->  (P <-> (ALL x. Q(x)))"
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   216
  by (tactic {* IntPr.fast_tac 1 *})
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   217
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   218
text "Problem ~~23"
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   219
lemma "?p : ~~ ((ALL x. P | Q(x))  <->  (P | (ALL x. Q(x))))"
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   220
  by (tactic {* IntPr.fast_tac 1 *})
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   221
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   222
text "Problem 24"
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   223
lemma "?p : ~(EX x. S(x)&Q(x)) & (ALL x. P(x) --> Q(x)|R(x)) &   
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   224
     (~(EX x. P(x)) --> (EX x. Q(x))) & (ALL x. Q(x)|R(x) --> S(x))   
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   225
    --> ~~(EX x. P(x)&R(x))"
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   226
(*Not clear why fast_tac, best_tac, ASTAR and ITER_DEEPEN all take forever*)
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   227
  apply (tactic "IntPr.safe_tac")
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   228
  apply (erule impE)
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   229
   apply (tactic "IntPr.fast_tac 1")
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   230
  apply (tactic "IntPr.fast_tac 1")
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   231
  done
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   232
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   233
text "Problem 25"
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   234
lemma "?p : (EX x. P(x)) &   
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   235
        (ALL x. L(x) --> ~ (M(x) & R(x))) &   
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   236
        (ALL x. P(x) --> (M(x) & L(x))) &    
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   237
        ((ALL x. P(x)-->Q(x)) | (EX x. P(x)&R(x)))   
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   238
    --> (EX x. Q(x)&P(x))"
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   239
  by (tactic "IntPr.best_tac 1")
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   240
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   241
text "Problem 29.  Essentially the same as Principia Mathematica *11.71"
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   242
lemma "?p : (EX x. P(x)) & (EX y. Q(y))   
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   243
    --> ((ALL x. P(x)-->R(x)) & (ALL y. Q(y)-->S(y))   <->      
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   244
         (ALL x y. P(x) & Q(y) --> R(x) & S(y)))"
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   245
  by (tactic "IntPr.fast_tac 1")
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   246
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   247
text "Problem ~~30"
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   248
lemma "?p : (ALL x. (P(x) | Q(x)) --> ~ R(x)) &  
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   249
        (ALL x. (Q(x) --> ~ S(x)) --> P(x) & R(x))   
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   250
    --> (ALL x. ~~S(x))"
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   251
  by (tactic "IntPr.fast_tac 1")
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   252
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   253
text "Problem 31"
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   254
lemma "?p : ~(EX x. P(x) & (Q(x) | R(x))) &  
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   255
        (EX x. L(x) & P(x)) &  
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   256
        (ALL x. ~ R(x) --> M(x))   
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   257
    --> (EX x. L(x) & M(x))"
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   258
  by (tactic "IntPr.fast_tac 1")
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   259
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   260
text "Problem 32"
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   261
lemma "?p : (ALL x. P(x) & (Q(x)|R(x))-->S(x)) &  
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   262
        (ALL x. S(x) & R(x) --> L(x)) &  
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   263
        (ALL x. M(x) --> R(x))   
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   264
    --> (ALL x. P(x) & M(x) --> L(x))"
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   265
  by (tactic "IntPr.best_tac 1") -- slow
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   266
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   267
text "Problem 39"
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   268
lemma "?p : ~ (EX x. ALL y. F(y,x) <-> ~F(y,y))"
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   269
  by (tactic "IntPr.best_tac 1")
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   270
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   271
text "Problem 40.  AMENDED"
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   272
lemma "?p : (EX y. ALL x. F(x,y) <-> F(x,x)) -->   
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   273
              ~(ALL x. EX y. ALL z. F(z,y) <-> ~ F(z,x))"
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   274
  by (tactic "IntPr.best_tac 1") -- slow
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   275
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   276
text "Problem 44"
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   277
lemma "?p : (ALL x. f(x) -->                                    
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   278
              (EX y. g(y) & h(x,y) & (EX y. g(y) & ~ h(x,y))))  &        
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   279
              (EX x. j(x) & (ALL y. g(y) --> h(x,y)))                    
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   280
              --> (EX x. j(x) & ~f(x))"
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   281
  by (tactic "IntPr.best_tac 1")
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   282
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   283
text "Problem 48"
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   284
lemma "?p : (a=b | c=d) & (a=c | b=d) --> a=d | b=c"
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   285
  by (tactic "IntPr.best_tac 1")
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   286
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   287
text "Problem 51"
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   288
lemma
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   289
    "?p : (EX z w. ALL x y. P(x,y) <->  (x=z & y=w)) -->   
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   290
     (EX z. ALL x. EX w. (ALL y. P(x,y) <-> y=w) <-> x=z)"
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   291
  by (tactic "IntPr.best_tac 1") -- {*60 seconds*}
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   292
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   293
text "Problem 56"
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   294
lemma "?p : (ALL x. (EX y. P(y) & x=f(y)) --> P(x)) <-> (ALL x. P(x) --> P(f(x)))"
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   295
  by (tactic "IntPr.best_tac 1")
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   296
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   297
text "Problem 57"
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   298
lemma
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   299
    "?p : P(f(a,b), f(b,c)) & P(f(b,c), f(a,c)) &  
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   300
     (ALL x y z. P(x,y) & P(y,z) --> P(x,z))    -->   P(f(a,b), f(a,c))"
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   301
  by (tactic "IntPr.best_tac 1")
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   302
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   303
text "Problem 60"
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   304
lemma "?p : ALL x. P(x,f(x)) <-> (EX y. (ALL z. P(z,y) --> P(z,f(x))) & P(x,y))"
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   305
  by (tactic "IntPr.best_tac 1")
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   306
eaf634e975fa converted legacy ML scripts;
wenzelm
parents:
diff changeset
   307
end