src/HOL/ex/Refute_Examples.thy
author kleing
Mon, 21 Jun 2004 10:25:57 +0200
changeset 14981 e73f8140af78
parent 14809 eaa5d6987ba2
child 15161 065ce5385a06
permissions -rw-r--r--
Merged in license change from Isabelle2004
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
     1
(*  Title:      HOL/ex/Refute_Examples.thy
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
     2
    ID:         $Id$
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
     3
    Author:     Tjark Weber
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
     4
    Copyright   2003-2004
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
     5
*)
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
     6
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
     7
(* See 'HOL/Refute.thy' for help. *)
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
     8
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
     9
header {* Examples for the 'refute' command *}
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    10
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    11
theory Refute_Examples = Main:
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    12
14455
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
    13
lemma "P x"
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    14
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    15
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    16
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    17
lemma "P \<and> Q"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    18
  apply (rule conjI)
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    19
  refute 1  -- {* refutes @{term "P"} *}
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    20
  refute 2  -- {* refutes @{term "Q"} *}
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    21
  refute    -- {* equivalent to 'refute 1' *}
14455
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
    22
    -- {* here 'refute 3' would cause an exception, since we only have 2 subgoals *}
14465
8cc21ed7ef41 \<dots> replaced by ...
webertj
parents: 14462
diff changeset
    23
  refute [maxsize=5]           -- {* we can override parameters ... *}
8cc21ed7ef41 \<dots> replaced by ...
webertj
parents: 14462
diff changeset
    24
  refute [satsolver="dpll"] 2  -- {* ... and specify a subgoal at the same time *}
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    25
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    26
14455
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
    27
section {* Examples and Test Cases *}
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    28
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    29
subsection {* Propositional logic *}
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    30
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    31
lemma "True"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    32
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    33
  apply auto
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    34
done
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    35
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    36
lemma "False"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    37
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    38
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    39
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    40
lemma "P"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    41
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    42
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    43
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    44
lemma "~ P"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    45
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    46
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    47
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    48
lemma "P & Q"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    49
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    50
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    51
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    52
lemma "P | Q"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    53
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    54
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    55
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    56
lemma "P \<longrightarrow> Q"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    57
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    58
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    59
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    60
lemma "(P::bool) = Q"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    61
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    62
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    63
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    64
lemma "(P | Q) \<longrightarrow> (P & Q)"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    65
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    66
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    67
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    68
subsection {* Predicate logic *}
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    69
14455
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
    70
lemma "P x y z"
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    71
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    72
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    73
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    74
lemma "P x y \<longrightarrow> P y x"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    75
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    76
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    77
14455
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
    78
lemma "P (f (f x)) \<longrightarrow> P x \<longrightarrow> P (f x)"
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
    79
  refute
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
    80
oops
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
    81
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    82
subsection {* Equality *}
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    83
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    84
lemma "P = True"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    85
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    86
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    87
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    88
lemma "P = False"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    89
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    90
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    91
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    92
lemma "x = y"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    93
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    94
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    95
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    96
lemma "f x = g x"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    97
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    98
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
    99
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   100
lemma "(f::'a\<Rightarrow>'b) = g"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   101
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   102
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   103
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   104
lemma "(f::('d\<Rightarrow>'d)\<Rightarrow>('c\<Rightarrow>'d)) = g"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   105
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   106
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   107
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   108
lemma "distinct [a,b]"
14809
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   109
  refute
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   110
  apply simp
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   111
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   112
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   113
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   114
subsection {* First-Order Logic *}
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   115
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   116
lemma "\<exists>x. P x"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   117
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   118
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   119
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   120
lemma "\<forall>x. P x"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   121
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   122
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   123
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   124
lemma "EX! x. P x"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   125
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   126
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   127
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   128
lemma "Ex P"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   129
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   130
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   131
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   132
lemma "All P"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   133
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   134
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   135
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   136
lemma "Ex1 P"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   137
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   138
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   139
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   140
lemma "(\<exists>x. P x) \<longrightarrow> (\<forall>x. P x)"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   141
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   142
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   143
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   144
lemma "(\<forall>x. \<exists>y. P x y) \<longrightarrow> (\<exists>y. \<forall>x. P x y)"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   145
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   146
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   147
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   148
lemma "(\<exists>x. P x) \<longrightarrow> (EX! x. P x)"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   149
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   150
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   151
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   152
text {* A true statement (also testing names of free and bound variables being identical) *}
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   153
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   154
lemma "(\<forall>x y. P x y \<longrightarrow> P y x) \<longrightarrow> (\<forall>x. P x y) \<longrightarrow> P y x"
14809
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   155
  refute [maxsize=6]
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   156
  apply fast
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   157
done
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   158
14809
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   159
text {* "A type has at most 4 elements." *}
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   160
14809
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   161
lemma "a=b | a=c | a=d | a=e | b=c | b=d | b=e | c=d | c=e | d=e"
14455
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   162
  refute
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   163
oops
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   164
14809
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   165
lemma "\<forall>a b c d e. a=b | a=c | a=d | a=e | b=c | b=d | b=e | c=d | c=e | d=e"
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   166
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   167
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   168
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   169
text {* "Every reflexive and symmetric relation is transitive." *}
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   170
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   171
lemma "\<lbrakk> \<forall>x. P x x; \<forall>x y. P x y \<longrightarrow> P y x \<rbrakk> \<Longrightarrow> P x y \<longrightarrow> P y z \<longrightarrow> P x z"
14489
3676def6b8b9 satsolver=dpll
webertj
parents: 14465
diff changeset
   172
  refute
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   173
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   174
14465
8cc21ed7ef41 \<dots> replaced by ...
webertj
parents: 14462
diff changeset
   175
text {* The "Drinker's theorem" ... *}
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   176
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   177
lemma "\<exists>x. f x = g x \<longrightarrow> f = g"
14809
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   178
  refute [maxsize=4]
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   179
  apply (auto simp add: ext)
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   180
done
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   181
14465
8cc21ed7ef41 \<dots> replaced by ...
webertj
parents: 14462
diff changeset
   182
text {* ... and an incorrect version of it *}
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   183
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   184
lemma "(\<exists>x. f x = g x) \<longrightarrow> f = g"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   185
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   186
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   187
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   188
text {* "Every function has a fixed point." *}
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   189
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   190
lemma "\<exists>x. f x = x"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   191
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   192
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   193
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   194
text {* "Function composition is commutative." *}
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   195
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   196
lemma "f (g x) = g (f x)"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   197
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   198
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   199
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   200
text {* "Two functions that are equivalent wrt.\ the same predicate 'P' are equal." *}
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   201
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   202
lemma "((P::('a\<Rightarrow>'b)\<Rightarrow>bool) f = P g) \<longrightarrow> (f x = g x)"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   203
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   204
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   205
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   206
subsection {* Higher-Order Logic *}
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   207
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   208
lemma "\<exists>P. P"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   209
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   210
  apply auto
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   211
done
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   212
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   213
lemma "\<forall>P. P"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   214
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   215
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   216
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   217
lemma "EX! P. P"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   218
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   219
  apply auto
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   220
done
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   221
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   222
lemma "EX! P. P x"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   223
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   224
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   225
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   226
lemma "P Q | Q x"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   227
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   228
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   229
14455
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   230
lemma "P All"
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   231
  refute
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   232
oops
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   233
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   234
lemma "P Ex"
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   235
  refute
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   236
oops
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   237
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   238
lemma "P Ex1"
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   239
  refute
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   240
oops
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   241
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   242
text {* "The transitive closure 'T' of an arbitrary relation 'P' is non-empty." *}
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   243
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   244
constdefs
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   245
  "trans" :: "('a \<Rightarrow> 'a \<Rightarrow> bool) \<Rightarrow> bool"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   246
  "trans P == (ALL x y z. P x y \<longrightarrow> P y z \<longrightarrow> P x z)"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   247
  "subset" :: "('a \<Rightarrow> 'a \<Rightarrow> bool) \<Rightarrow> ('a \<Rightarrow> 'a \<Rightarrow> bool) \<Rightarrow> bool"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   248
  "subset P Q == (ALL x y. P x y \<longrightarrow> Q x y)"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   249
  "trans_closure" :: "('a \<Rightarrow> 'a \<Rightarrow> bool) \<Rightarrow> ('a \<Rightarrow> 'a \<Rightarrow> bool) \<Rightarrow> bool"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   250
  "trans_closure P Q == (subset Q P) & (trans P) & (ALL R. subset Q R \<longrightarrow> trans R \<longrightarrow> subset P R)"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   251
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   252
lemma "trans_closure T P \<longrightarrow> (\<exists>x y. T x y)"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   253
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   254
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   255
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   256
text {* "The union of transitive closures is equal to the transitive closure of unions." *}
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   257
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   258
lemma "(\<forall>x y. (P x y | R x y) \<longrightarrow> T x y) \<longrightarrow> trans T \<longrightarrow> (\<forall>Q. (\<forall>x y. (P x y | R x y) \<longrightarrow> Q x y) \<longrightarrow> trans Q \<longrightarrow> subset T Q)
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   259
        \<longrightarrow> trans_closure TP P
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   260
        \<longrightarrow> trans_closure TR R
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   261
        \<longrightarrow> (T x y = (TP x y | TR x y))"
14809
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   262
  refute [satsolver="dpll"]
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   263
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   264
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   265
text {* "Every surjective function is invertible." *}
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   266
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   267
lemma "(\<forall>y. \<exists>x. y = f x) \<longrightarrow> (\<exists>g. \<forall>x. g (f x) = x)"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   268
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   269
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   270
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   271
text {* "Every invertible function is surjective." *}
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   272
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   273
lemma "(\<exists>g. \<forall>x. g (f x) = x) \<longrightarrow> (\<forall>y. \<exists>x. y = f x)"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   274
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   275
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   276
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   277
text {* Every point is a fixed point of some function. *}
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   278
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   279
lemma "\<exists>f. f x = x"
14809
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   280
  refute [maxsize=4]
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   281
  apply (rule_tac x="\<lambda>x. x" in exI)
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   282
  apply simp
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   283
done
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   284
14465
8cc21ed7ef41 \<dots> replaced by ...
webertj
parents: 14462
diff changeset
   285
text {* Axiom of Choice: first an incorrect version ... *}
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   286
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   287
lemma "(\<forall>x. \<exists>y. P x y) \<longrightarrow> (EX!f. \<forall>x. P x (f x))"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   288
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   289
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   290
14465
8cc21ed7ef41 \<dots> replaced by ...
webertj
parents: 14462
diff changeset
   291
text {* ... and now two correct ones *}
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   292
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   293
lemma "(\<forall>x. \<exists>y. P x y) \<longrightarrow> (\<exists>f. \<forall>x. P x (f x))"
14809
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   294
  refute [maxsize=4]
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   295
  apply (simp add: choice)
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   296
done
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   297
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   298
lemma "(\<forall>x. EX!y. P x y) \<longrightarrow> (EX!f. \<forall>x. P x (f x))"
14809
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   299
  refute [maxsize=2, satsolver="dpll"]
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   300
  apply auto
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   301
    apply (simp add: ex1_implies_ex choice)
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   302
  apply (fast intro: ext)
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   303
done
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   304
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   305
subsection {* Meta-logic *}
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   306
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   307
lemma "!!x. P x"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   308
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   309
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   310
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   311
lemma "f x == g x"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   312
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   313
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   314
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   315
lemma "P \<Longrightarrow> Q"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   316
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   317
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   318
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   319
lemma "\<lbrakk> P; Q; R \<rbrakk> \<Longrightarrow> S"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   320
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   321
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   322
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   323
subsection {* Schematic variables *}
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   324
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   325
lemma "?P"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   326
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   327
  apply auto
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   328
done
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   329
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   330
lemma "x = ?y"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   331
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   332
  apply auto
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   333
done
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   334
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   335
subsection {* Abstractions *}
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   336
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   337
lemma "(\<lambda>x. x) = (\<lambda>x. y)"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   338
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   339
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   340
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   341
lemma "(\<lambda>f. f x) = (\<lambda>f. True)"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   342
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   343
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   344
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   345
lemma "(\<lambda>x. x) = (\<lambda>y. y)"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   346
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   347
  apply simp
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   348
done
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   349
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   350
subsection {* Sets *}
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   351
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   352
lemma "P (A::'a set)"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   353
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   354
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   355
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   356
lemma "P (A::'a set set)"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   357
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   358
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   359
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   360
lemma "{x. P x} = {y. P y}"
14489
3676def6b8b9 satsolver=dpll
webertj
parents: 14465
diff changeset
   361
  refute
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   362
  apply simp
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   363
done
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   364
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   365
lemma "x : {x. P x}"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   366
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   367
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   368
14455
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   369
lemma "P op:"
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   370
  refute
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   371
oops
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   372
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   373
lemma "P (op: x)"
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   374
  refute
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   375
oops
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   376
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   377
lemma "P Collect"
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   378
  refute
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   379
oops
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   380
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   381
lemma "A Un B = A Int B"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   382
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   383
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   384
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   385
lemma "(A Int B) Un C = (A Un C) Int B"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   386
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   387
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   388
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   389
lemma "Ball A P \<longrightarrow> Bex A P"
14455
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   390
  refute
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   391
oops
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   392
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   393
subsection {* arbitrary *}
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   394
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   395
lemma "arbitrary"
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   396
  refute
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   397
oops
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   398
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   399
lemma "P arbitrary"
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   400
  refute
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   401
oops
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   402
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   403
lemma "arbitrary x"
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   404
  refute
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   405
oops
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   406
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   407
lemma "arbitrary arbitrary"
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   408
  refute
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   409
oops
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   410
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   411
subsection {* The *}
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   412
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   413
lemma "The P"
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   414
  refute
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   415
oops
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   416
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   417
lemma "P The"
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   418
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   419
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   420
14455
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   421
lemma "P (The P)"
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   422
  refute
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   423
oops
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   424
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   425
lemma "(THE x. x=y) = z"
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   426
  refute
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   427
oops
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   428
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   429
lemma "Ex P \<longrightarrow> P (The P)"
14489
3676def6b8b9 satsolver=dpll
webertj
parents: 14465
diff changeset
   430
  refute
14455
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   431
oops
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   432
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   433
subsection {* Eps *}
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   434
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   435
lemma "Eps P"
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   436
  refute
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   437
oops
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   438
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   439
lemma "P Eps"
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   440
  refute
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   441
oops
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   442
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   443
lemma "P (Eps P)"
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   444
  refute
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   445
oops
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   446
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   447
lemma "(SOME x. x=y) = z"
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   448
  refute
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   449
oops
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   450
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   451
lemma "Ex P \<longrightarrow> P (Eps P)"
14489
3676def6b8b9 satsolver=dpll
webertj
parents: 14465
diff changeset
   452
  refute [maxsize=3]
14455
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   453
  apply (auto simp add: someI)
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   454
done
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   455
14809
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   456
subsection {* Subtypes (typedef), typedecl *}
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   457
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   458
typedef 'a myTdef = "insert (arbitrary::'a) (arbitrary::'a set)"
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   459
  -- {* a completely unspecified non-empty subset of @{typ "'a"} *}
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   460
  by auto
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   461
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   462
lemma "(x::'a myTdef) = y"
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   463
  refute [satsolver=dpll]
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   464
oops
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   465
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   466
typedecl myTdecl
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   467
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   468
typedef 'a T_bij = "{(f::'a\<Rightarrow>'a). \<forall>y. \<exists>!x. f x = y}"
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   469
  by auto
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   470
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   471
lemma "P (f::(myTdecl myTdef) T_bij)"
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   472
  refute
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   473
oops
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   474
14455
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   475
subsection {* Inductive datatypes *}
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   476
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   477
subsubsection {* unit *}
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   478
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   479
lemma "P (x::unit)"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   480
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   481
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   482
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   483
lemma "\<forall>x::unit. P x"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   484
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   485
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   486
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   487
lemma "P ()"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   488
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   489
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   490
14455
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   491
subsubsection {* option *}
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   492
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   493
lemma "P (x::'a option)"
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   494
  refute
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   495
oops
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   496
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   497
lemma "\<forall>x::'a option. P x"
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   498
  refute
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   499
oops
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   500
14809
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   501
lemma "P None"
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   502
  refute
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   503
oops
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   504
14455
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   505
lemma "P (Some x)"
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   506
  refute
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   507
oops
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   508
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   509
subsubsection {* * *}
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   510
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   511
lemma "P (x::'a*'b)"
14455
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   512
  refute
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   513
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   514
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   515
lemma "\<forall>x::'a*'b. P x"
14455
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   516
  refute
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   517
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   518
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   519
lemma "P (x,y)"
14455
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   520
  refute
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   521
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   522
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   523
lemma "P (fst x)"
14455
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   524
  refute
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   525
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   526
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   527
lemma "P (snd x)"
14455
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   528
  refute
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   529
oops
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   530
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   531
lemma "P Pair"
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   532
  refute
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   533
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   534
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   535
subsubsection {* + *}
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   536
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   537
lemma "P (x::'a+'b)"
14455
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   538
  refute
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   539
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   540
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   541
lemma "\<forall>x::'a+'b. P x"
14455
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   542
  refute
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   543
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   544
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   545
lemma "P (Inl x)"
14455
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   546
  refute
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   547
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   548
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   549
lemma "P (Inr x)"
14455
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   550
  refute
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   551
oops
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   552
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   553
lemma "P Inl"
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   554
  refute
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   555
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   556
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   557
subsubsection {* Non-recursive datatypes *}
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   558
14455
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   559
datatype T1 = A | B
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   560
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   561
lemma "P (x::T1)"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   562
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   563
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   564
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   565
lemma "\<forall>x::T1. P x"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   566
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   567
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   568
14455
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   569
lemma "P A"
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   570
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   571
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   572
14455
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   573
datatype 'a T2 = C T1 | D 'a
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   574
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   575
lemma "P (x::'a T2)"
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   576
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   577
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   578
14455
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   579
lemma "\<forall>x::'a T2. P x"
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   580
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   581
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   582
14455
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   583
lemma "P D"
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   584
  refute
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   585
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   586
14455
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   587
datatype ('a,'b) T3 = E "'a \<Rightarrow> 'b"
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   588
14809
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   589
lemma "P (x::('a,'b) T3)"
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   590
  refute
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   591
oops
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   592
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   593
lemma "\<forall>x::('a,'b) T3. P x"
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   594
  refute
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   595
oops
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   596
14455
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   597
lemma "P E"
5c4a1e96efd6 Updated examples
webertj
parents: 14350
diff changeset
   598
  refute
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   599
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   600
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   601
subsubsection {* Recursive datatypes *}
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   602
14809
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   603
lemma "P (x::nat)"
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   604
  refute
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   605
oops
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   606
14809
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   607
lemma "\<forall>x::nat. P x"
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   608
  refute
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   609
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   610
14809
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   611
lemma "P (Suc 0)"
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   612
  refute
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   613
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   614
14809
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   615
lemma "P Suc"
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   616
  refute  -- {* @{term "Suc"} is a partial function (regardless of the size
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   617
                of the model), hence @{term "P Suc"} is undefined, hence no
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   618
                model will be found *}
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   619
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   620
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   621
datatype 'a BinTree = Leaf 'a | Node "'a BinTree" "'a BinTree"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   622
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   623
lemma "P (x::'a BinTree)"
14809
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   624
  refute
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   625
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   626
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   627
lemma "\<forall>x::'a BinTree. P x"
14809
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   628
  refute
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   629
oops
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   630
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   631
lemma "P (Node (Leaf x) (Leaf y))"
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   632
  refute
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   633
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   634
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   635
subsubsection {* Mutually recursive datatypes *}
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   636
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   637
datatype 'a aexp = Number 'a | ITE "'a bexp" "'a aexp" "'a aexp"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   638
     and 'a bexp = Equal "'a aexp" "'a aexp"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   639
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   640
lemma "P (x::'a aexp)"
14809
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   641
  refute
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   642
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   643
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   644
lemma "\<forall>x::'a aexp. P x"
14809
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   645
  refute
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   646
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   647
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   648
lemma "P (x::'a bexp)"
14809
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   649
  refute
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   650
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   651
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   652
lemma "\<forall>x::'a bexp. P x"
14809
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   653
  refute
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   654
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   655
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   656
lemma "P (ITE (Equal (Number x) (Number y)) (Number x) (Number y))"
14809
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   657
  refute
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   658
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   659
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   660
subsubsection {* Other datatype examples *}
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   661
14809
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   662
datatype InfTree = Leaf | Node "nat \<Rightarrow> InfTree"
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   663
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   664
lemma "P (x::InfTree)"
14809
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   665
  refute
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   666
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   667
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   668
datatype 'a lambda = Var 'a | App "'a lambda" "'a lambda" | Lam "'a \<Rightarrow> 'a lambda"
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   669
14809
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   670
lemma "P (x::'a lambda) | P (App x y)"
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   671
  refute
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   672
oops
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   673
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   674
lemma "(xs::'a list) = ys"
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   675
  refute
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   676
oops
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   677
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   678
lemma "a # xs = b # xs"
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   679
  refute
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   680
oops
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   681
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   682
lemma "P [x, y]"
eaa5d6987ba2 mainly new/different datatype examples
webertj
parents: 14489
diff changeset
   683
  refute
14350
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   684
oops
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   685
41b32020d0b3 Adding 'refute' to HOL.
webertj
parents:
diff changeset
   686
end