src/HOL/ex/Intuitionistic.thy
author blanchet
Fri, 27 May 2011 10:30:08 +0200
changeset 43016 42330f25142c
parent 41460 ea56b98aee83
child 58889 5b7a9633cfa8
permissions -rw-r--r--
renamed "try" "try_methods"
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
12450
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
     1
(*  Title:      HOL/ex/Intuitionistic.thy
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
     2
    Author:     Lawrence C Paulson, Cambridge University Computer Laboratory
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
     3
    Copyright   1991  University of Cambridge
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
     4
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
     5
Taken from FOL/ex/int.ML
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
     6
*)
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
     7
17388
495c799df31d tuned headers etc.;
wenzelm
parents: 16417
diff changeset
     8
header {* Higher-Order Logic: Intuitionistic predicate calculus problems *}
495c799df31d tuned headers etc.;
wenzelm
parents: 16417
diff changeset
     9
16417
9bc16273c2d4 migrated theory headers to new format
haftmann
parents: 12450
diff changeset
    10
theory Intuitionistic imports Main begin
12450
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
    11
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
    12
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
    13
(*Metatheorem (for PROPOSITIONAL formulae...):
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
    14
  P is classically provable iff ~~P is intuitionistically provable.
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
    15
  Therefore ~P is classically provable iff it is intuitionistically provable.  
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
    16
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
    17
Proof: Let Q be the conjuction of the propositions A|~A, one for each atom A
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
    18
in P.  Now ~~Q is intuitionistically provable because ~~(A|~A) is and because
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
    19
~~ distributes over &.  If P is provable classically, then clearly Q-->P is
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
    20
provable intuitionistically, so ~~(Q-->P) is also provable intuitionistically.
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
    21
The latter is intuitionistically equivalent to ~~Q-->~~P, hence to ~~P, since
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
    22
~~Q is intuitionistically provable.  Finally, if P is a negation then ~~P is
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
    23
intuitionstically equivalent to P.  [Andy Pitts] *)
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
    24
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
    25
lemma "(~~(P&Q)) = ((~~P) & (~~Q))"
17589
58eeffd73be1 renamed rules to iprover
nipkow
parents: 17388
diff changeset
    26
  by iprover
12450
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
    27
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
    28
lemma "~~ ((~P --> Q) --> (~P --> ~Q) --> P)"
17589
58eeffd73be1 renamed rules to iprover
nipkow
parents: 17388
diff changeset
    29
  by iprover
12450
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
    30
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
    31
(* ~~ does NOT distribute over | *)
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
    32
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
    33
lemma "(~~(P-->Q))  = (~~P --> ~~Q)"
17589
58eeffd73be1 renamed rules to iprover
nipkow
parents: 17388
diff changeset
    34
  by iprover
12450
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
    35
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
    36
lemma "(~~~P) = (~P)"
17589
58eeffd73be1 renamed rules to iprover
nipkow
parents: 17388
diff changeset
    37
  by iprover
12450
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
    38
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
    39
lemma "~~((P --> Q | R)  -->  (P-->Q) | (P-->R))"
17589
58eeffd73be1 renamed rules to iprover
nipkow
parents: 17388
diff changeset
    40
  by iprover
12450
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
    41
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
    42
lemma "(P=Q) = (Q=P)"
17589
58eeffd73be1 renamed rules to iprover
nipkow
parents: 17388
diff changeset
    43
  by iprover
12450
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
    44
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
    45
lemma "((P --> (Q | (Q-->R))) --> R) --> R"
17589
58eeffd73be1 renamed rules to iprover
nipkow
parents: 17388
diff changeset
    46
  by iprover
12450
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
    47
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
    48
lemma "(((G-->A) --> J) --> D --> E) --> (((H-->B)-->I)-->C-->J)
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
    49
      --> (A-->H) --> F --> G --> (((C-->B)-->I)-->D)-->(A-->C)
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
    50
      --> (((F-->A)-->B) --> I) --> E"
17589
58eeffd73be1 renamed rules to iprover
nipkow
parents: 17388
diff changeset
    51
  by iprover
12450
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
    52
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
    53
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
    54
(* Lemmas for the propositional double-negation translation *)
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
    55
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
    56
lemma "P --> ~~P"
17589
58eeffd73be1 renamed rules to iprover
nipkow
parents: 17388
diff changeset
    57
  by iprover
12450
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
    58
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
    59
lemma "~~(~~P --> P)"
17589
58eeffd73be1 renamed rules to iprover
nipkow
parents: 17388
diff changeset
    60
  by iprover
12450
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
    61
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
    62
lemma "~~P & ~~(P --> Q) --> ~~Q"
17589
58eeffd73be1 renamed rules to iprover
nipkow
parents: 17388
diff changeset
    63
  by iprover
12450
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
    64
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
    65
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
    66
(* de Bruijn formulae *)
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
    67
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
    68
(*de Bruijn formula with three predicates*)
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
    69
lemma "((P=Q) --> P&Q&R) &
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
    70
       ((Q=R) --> P&Q&R) &
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
    71
       ((R=P) --> P&Q&R) --> P&Q&R"
17589
58eeffd73be1 renamed rules to iprover
nipkow
parents: 17388
diff changeset
    72
  by iprover
12450
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
    73
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
    74
(*de Bruijn formula with five predicates*)
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
    75
lemma "((P=Q) --> P&Q&R&S&T) &
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
    76
       ((Q=R) --> P&Q&R&S&T) &
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
    77
       ((R=S) --> P&Q&R&S&T) &
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
    78
       ((S=T) --> P&Q&R&S&T) &
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
    79
       ((T=P) --> P&Q&R&S&T) --> P&Q&R&S&T"
17589
58eeffd73be1 renamed rules to iprover
nipkow
parents: 17388
diff changeset
    80
  by iprover
12450
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
    81
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
    82
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
    83
(*** Problems from Sahlin, Franzen and Haridi, 
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
    84
     An Intuitionistic Predicate Logic Theorem Prover.
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
    85
     J. Logic and Comp. 2 (5), October 1992, 619-656.
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
    86
***)
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
    87
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
    88
(*Problem 1.1*)
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
    89
lemma "(ALL x. EX y. ALL z. p(x) & q(y) & r(z)) =
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
    90
       (ALL z. EX y. ALL x. p(x) & q(y) & r(z))"
17589
58eeffd73be1 renamed rules to iprover
nipkow
parents: 17388
diff changeset
    91
  by (iprover del: allE elim 2: allE')
12450
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
    92
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
    93
(*Problem 3.1*)
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
    94
lemma "~ (EX x. ALL y. p y x = (~ p x x))"
17589
58eeffd73be1 renamed rules to iprover
nipkow
parents: 17388
diff changeset
    95
  by iprover
12450
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
    96
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
    97
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
    98
(* Intuitionistic FOL: propositional problems based on Pelletier. *)
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
    99
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   100
(* Problem ~~1 *)
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   101
lemma "~~((P-->Q)  =  (~Q --> ~P))"
17589
58eeffd73be1 renamed rules to iprover
nipkow
parents: 17388
diff changeset
   102
  by iprover
12450
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   103
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   104
(* Problem ~~2 *)
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   105
lemma "~~(~~P  =  P)"
17589
58eeffd73be1 renamed rules to iprover
nipkow
parents: 17388
diff changeset
   106
  by iprover
12450
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   107
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   108
(* Problem 3 *)
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   109
lemma "~(P-->Q) --> (Q-->P)"
17589
58eeffd73be1 renamed rules to iprover
nipkow
parents: 17388
diff changeset
   110
  by iprover
12450
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   111
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   112
(* Problem ~~4 *)
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   113
lemma "~~((~P-->Q)  =  (~Q --> P))"
17589
58eeffd73be1 renamed rules to iprover
nipkow
parents: 17388
diff changeset
   114
  by iprover
12450
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   115
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   116
(* Problem ~~5 *)
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   117
lemma "~~((P|Q-->P|R) --> P|(Q-->R))"
17589
58eeffd73be1 renamed rules to iprover
nipkow
parents: 17388
diff changeset
   118
  by iprover
12450
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   119
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   120
(* Problem ~~6 *)
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   121
lemma "~~(P | ~P)"
17589
58eeffd73be1 renamed rules to iprover
nipkow
parents: 17388
diff changeset
   122
  by iprover
12450
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   123
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   124
(* Problem ~~7 *)
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   125
lemma "~~(P | ~~~P)"
17589
58eeffd73be1 renamed rules to iprover
nipkow
parents: 17388
diff changeset
   126
  by iprover
12450
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   127
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   128
(* Problem ~~8.  Peirce's law *)
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   129
lemma "~~(((P-->Q) --> P)  -->  P)"
17589
58eeffd73be1 renamed rules to iprover
nipkow
parents: 17388
diff changeset
   130
  by iprover
12450
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   131
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   132
(* Problem 9 *)
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   133
lemma "((P|Q) & (~P|Q) & (P| ~Q)) --> ~ (~P | ~Q)"
17589
58eeffd73be1 renamed rules to iprover
nipkow
parents: 17388
diff changeset
   134
  by iprover
12450
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   135
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   136
(* Problem 10 *)
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   137
lemma "(Q-->R) --> (R-->P&Q) --> (P-->(Q|R)) --> (P=Q)"
17589
58eeffd73be1 renamed rules to iprover
nipkow
parents: 17388
diff changeset
   138
  by iprover
12450
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   139
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   140
(* 11.  Proved in each direction (incorrectly, says Pelletier!!) *)
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   141
lemma "P=P"
17589
58eeffd73be1 renamed rules to iprover
nipkow
parents: 17388
diff changeset
   142
  by iprover
12450
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   143
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   144
(* Problem ~~12.  Dijkstra's law *)
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   145
lemma "~~(((P = Q) = R)  =  (P = (Q = R)))"
17589
58eeffd73be1 renamed rules to iprover
nipkow
parents: 17388
diff changeset
   146
  by iprover
12450
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   147
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   148
lemma "((P = Q) = R)  -->  ~~(P = (Q = R))"
17589
58eeffd73be1 renamed rules to iprover
nipkow
parents: 17388
diff changeset
   149
  by iprover
12450
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   150
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   151
(* Problem 13.  Distributive law *)
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   152
lemma "(P | (Q & R))  = ((P | Q) & (P | R))"
17589
58eeffd73be1 renamed rules to iprover
nipkow
parents: 17388
diff changeset
   153
  by iprover
12450
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   154
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   155
(* Problem ~~14 *)
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   156
lemma "~~((P = Q) = ((Q | ~P) & (~Q|P)))"
17589
58eeffd73be1 renamed rules to iprover
nipkow
parents: 17388
diff changeset
   157
  by iprover
12450
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   158
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   159
(* Problem ~~15 *)
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   160
lemma "~~((P --> Q) = (~P | Q))"
17589
58eeffd73be1 renamed rules to iprover
nipkow
parents: 17388
diff changeset
   161
  by iprover
12450
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   162
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   163
(* Problem ~~16 *)
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   164
lemma "~~((P-->Q) | (Q-->P))"
17589
58eeffd73be1 renamed rules to iprover
nipkow
parents: 17388
diff changeset
   165
by iprover
12450
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   166
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   167
(* Problem ~~17 *)
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   168
lemma "~~(((P & (Q-->R))-->S) = ((~P | Q | S) & (~P | ~R | S)))"
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   169
  oops
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   170
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   171
(*Dijkstra's "Golden Rule"*)
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   172
lemma "(P&Q) = (P = (Q = (P|Q)))"
17589
58eeffd73be1 renamed rules to iprover
nipkow
parents: 17388
diff changeset
   173
  by iprover
12450
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   174
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   175
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   176
(****Examples with quantifiers****)
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   177
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   178
(* The converse is classical in the following implications... *)
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   179
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   180
lemma "(EX x. P(x)-->Q)  -->  (ALL x. P(x)) --> Q"
17589
58eeffd73be1 renamed rules to iprover
nipkow
parents: 17388
diff changeset
   181
  by iprover
12450
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   182
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   183
lemma "((ALL x. P(x))-->Q) --> ~ (ALL x. P(x) & ~Q)"
17589
58eeffd73be1 renamed rules to iprover
nipkow
parents: 17388
diff changeset
   184
  by iprover
12450
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   185
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   186
lemma "((ALL x. ~P(x))-->Q)  -->  ~ (ALL x. ~ (P(x)|Q))"
17589
58eeffd73be1 renamed rules to iprover
nipkow
parents: 17388
diff changeset
   187
  by iprover
12450
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   188
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   189
lemma "(ALL x. P(x)) | Q  -->  (ALL x. P(x) | Q)"
17589
58eeffd73be1 renamed rules to iprover
nipkow
parents: 17388
diff changeset
   190
  by iprover 
12450
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   191
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   192
lemma "(EX x. P --> Q(x)) --> (P --> (EX x. Q(x)))"
17589
58eeffd73be1 renamed rules to iprover
nipkow
parents: 17388
diff changeset
   193
  by iprover
12450
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   194
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   195
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   196
(* Hard examples with quantifiers *)
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   197
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   198
(*The ones that have not been proved are not known to be valid!
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   199
  Some will require quantifier duplication -- not currently available*)
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   200
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   201
(* Problem ~~19 *)
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   202
lemma "~~(EX x. ALL y z. (P(y)-->Q(z)) --> (P(x)-->Q(x)))"
17589
58eeffd73be1 renamed rules to iprover
nipkow
parents: 17388
diff changeset
   203
  by iprover
12450
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   204
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   205
(* Problem 20 *)
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   206
lemma "(ALL x y. EX z. ALL w. (P(x)&Q(y)-->R(z)&S(w)))
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   207
    --> (EX x y. P(x) & Q(y)) --> (EX z. R(z))"
17589
58eeffd73be1 renamed rules to iprover
nipkow
parents: 17388
diff changeset
   208
  by iprover
12450
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   209
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   210
(* Problem 21 *)
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   211
lemma "(EX x. P-->Q(x)) & (EX x. Q(x)-->P) --> ~~(EX x. P=Q(x))"
17589
58eeffd73be1 renamed rules to iprover
nipkow
parents: 17388
diff changeset
   212
  by iprover
12450
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   213
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   214
(* Problem 22 *)
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   215
lemma "(ALL x. P = Q(x))  -->  (P = (ALL x. Q(x)))"
17589
58eeffd73be1 renamed rules to iprover
nipkow
parents: 17388
diff changeset
   216
  by iprover
12450
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   217
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   218
(* Problem ~~23 *)
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   219
lemma "~~ ((ALL x. P | Q(x))  =  (P | (ALL x. Q(x))))"
17589
58eeffd73be1 renamed rules to iprover
nipkow
parents: 17388
diff changeset
   220
  by iprover
12450
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   221
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   222
(* Problem 25 *)
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   223
lemma "(EX x. P(x)) &
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   224
       (ALL x. L(x) --> ~ (M(x) & R(x))) &
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   225
       (ALL x. P(x) --> (M(x) & L(x))) &
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   226
       ((ALL x. P(x)-->Q(x)) | (EX x. P(x)&R(x)))
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   227
   --> (EX x. Q(x)&P(x))"
17589
58eeffd73be1 renamed rules to iprover
nipkow
parents: 17388
diff changeset
   228
  by iprover
12450
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   229
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   230
(* Problem 27 *)
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   231
lemma "(EX x. P(x) & ~Q(x)) &
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   232
             (ALL x. P(x) --> R(x)) &
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   233
             (ALL x. M(x) & L(x) --> P(x)) &
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   234
             ((EX x. R(x) & ~ Q(x)) --> (ALL x. L(x) --> ~ R(x)))
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   235
         --> (ALL x. M(x) --> ~L(x))"
17589
58eeffd73be1 renamed rules to iprover
nipkow
parents: 17388
diff changeset
   236
  by iprover
12450
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   237
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   238
(* Problem ~~28.  AMENDED *)
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   239
lemma "(ALL x. P(x) --> (ALL x. Q(x))) &
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   240
       (~~(ALL x. Q(x)|R(x)) --> (EX x. Q(x)&S(x))) &
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   241
       (~~(EX x. S(x)) --> (ALL x. L(x) --> M(x)))
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   242
   --> (ALL x. P(x) & L(x) --> M(x))"
17589
58eeffd73be1 renamed rules to iprover
nipkow
parents: 17388
diff changeset
   243
  by iprover
12450
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   244
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   245
(* Problem 29.  Essentially the same as Principia Mathematica *11.71 *)
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   246
lemma "(((EX x. P(x)) & (EX y. Q(y))) -->
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   247
   (((ALL x. (P(x) --> R(x))) & (ALL y. (Q(y) --> S(y)))) =
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   248
    (ALL x y. ((P(x) & Q(y)) --> (R(x) & S(y))))))"
17589
58eeffd73be1 renamed rules to iprover
nipkow
parents: 17388
diff changeset
   249
  by iprover
12450
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   250
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   251
(* Problem ~~30 *)
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   252
lemma "(ALL x. (P(x) | Q(x)) --> ~ R(x)) &
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   253
       (ALL x. (Q(x) --> ~ S(x)) --> P(x) & R(x))
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   254
   --> (ALL x. ~~S(x))"
17589
58eeffd73be1 renamed rules to iprover
nipkow
parents: 17388
diff changeset
   255
  by iprover
12450
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   256
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   257
(* Problem 31 *)
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   258
lemma "~(EX x. P(x) & (Q(x) | R(x))) & 
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   259
        (EX x. L(x) & P(x)) &
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   260
        (ALL x. ~ R(x) --> M(x))
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   261
    --> (EX x. L(x) & M(x))"
17589
58eeffd73be1 renamed rules to iprover
nipkow
parents: 17388
diff changeset
   262
  by iprover
12450
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   263
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   264
(* Problem 32 *)
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   265
lemma "(ALL x. P(x) & (Q(x)|R(x))-->S(x)) &
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   266
       (ALL x. S(x) & R(x) --> L(x)) &
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   267
       (ALL x. M(x) --> R(x))
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   268
   --> (ALL x. P(x) & M(x) --> L(x))"
17589
58eeffd73be1 renamed rules to iprover
nipkow
parents: 17388
diff changeset
   269
  by iprover
12450
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   270
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   271
(* Problem ~~33 *)
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   272
lemma "(ALL x. ~~(P(a) & (P(x)-->P(b))-->P(c)))  =
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   273
       (ALL x. ~~((~P(a) | P(x) | P(c)) & (~P(a) | ~P(b) | P(c))))"
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   274
  oops
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   275
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   276
(* Problem 36 *)
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   277
lemma
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   278
     "(ALL x. EX y. J x y) &
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   279
      (ALL x. EX y. G x y) &
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   280
      (ALL x y. J x y | G x y --> (ALL z. J y z | G y z --> H x z))
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   281
  --> (ALL x. EX y. H x y)"
17589
58eeffd73be1 renamed rules to iprover
nipkow
parents: 17388
diff changeset
   282
  by iprover
12450
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   283
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   284
(* Problem 39 *)
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   285
lemma "~ (EX x. ALL y. F y x = (~F y y))"
17589
58eeffd73be1 renamed rules to iprover
nipkow
parents: 17388
diff changeset
   286
  by iprover
12450
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   287
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   288
(* Problem 40.  AMENDED *)
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   289
lemma "(EX y. ALL x. F x y = F x x) -->
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   290
             ~(ALL x. EX y. ALL z. F z y = (~ F z x))"
17589
58eeffd73be1 renamed rules to iprover
nipkow
parents: 17388
diff changeset
   291
  by iprover
12450
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   292
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   293
(* Problem 44 *)
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   294
lemma "(ALL x. f(x) -->
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   295
             (EX y. g(y) & h x y & (EX y. g(y) & ~ h x y)))  &
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   296
             (EX x. j(x) & (ALL y. g(y) --> h x y))
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   297
             --> (EX x. j(x) & ~f(x))"
17589
58eeffd73be1 renamed rules to iprover
nipkow
parents: 17388
diff changeset
   298
  by iprover
12450
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   299
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   300
(* Problem 48 *)
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   301
lemma "(a=b | c=d) & (a=c | b=d) --> a=d | b=c"
17589
58eeffd73be1 renamed rules to iprover
nipkow
parents: 17388
diff changeset
   302
  by iprover
12450
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   303
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   304
(* Problem 51 *)
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   305
lemma "((EX z w. (ALL x y. (P x y = ((x = z) & (y = w))))) -->
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   306
  (EX z. (ALL x. (EX w. ((ALL y. (P x y = (y = w))) = (x = z))))))"
17589
58eeffd73be1 renamed rules to iprover
nipkow
parents: 17388
diff changeset
   307
  by iprover
12450
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   308
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   309
(* Problem 52 *)
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   310
(*Almost the same as 51. *)
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   311
lemma "((EX z w. (ALL x y. (P x y = ((x = z) & (y = w))))) -->
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   312
   (EX w. (ALL y. (EX z. ((ALL x. (P x y = (x = z))) = (y = w))))))"
17589
58eeffd73be1 renamed rules to iprover
nipkow
parents: 17388
diff changeset
   313
  by iprover
12450
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   314
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   315
(* Problem 56 *)
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   316
lemma "(ALL x. (EX y. P(y) & x=f(y)) --> P(x)) = (ALL x. P(x) --> P(f(x)))"
17589
58eeffd73be1 renamed rules to iprover
nipkow
parents: 17388
diff changeset
   317
  by iprover
12450
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   318
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   319
(* Problem 57 *)
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   320
lemma "P (f a b) (f b c) & P (f b c) (f a c) &
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   321
     (ALL x y z. P x y & P y z --> P x z) --> P (f a b) (f a c)"
17589
58eeffd73be1 renamed rules to iprover
nipkow
parents: 17388
diff changeset
   322
  by iprover
12450
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   323
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   324
(* Problem 60 *)
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   325
lemma "ALL x. P x (f x) = (EX y. (ALL z. P z y --> P z (f x)) & P x y)"
17589
58eeffd73be1 renamed rules to iprover
nipkow
parents: 17388
diff changeset
   326
  by iprover
12450
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   327
1162b280700a Added example file for intuitionistic logic (taken from FOL).
berghofe
parents:
diff changeset
   328
end