src/HOL/Nitpick_Examples/Core_Nits.thy
author hoelzl
Tue Jan 18 21:37:23 2011 +0100 (2011-01-18)
changeset 41654 32fe42892983
parent 41278 8e1cde88aae6
child 42208 02513eb26eb7
permissions -rw-r--r--
Gauge measure removed
blanchet@33197
     1
(*  Title:      HOL/Nitpick_Examples/Core_Nits.thy
blanchet@33197
     2
    Author:     Jasmin Blanchette, TU Muenchen
blanchet@35076
     3
    Copyright   2009, 2010
blanchet@33197
     4
blanchet@33197
     5
Examples featuring Nitpick's functional core.
blanchet@33197
     6
*)
blanchet@33197
     7
blanchet@33197
     8
header {* Examples Featuring Nitpick's Functional Core *}
blanchet@33197
     9
blanchet@33197
    10
theory Core_Nits
blanchet@33197
    11
imports Main
blanchet@33197
    12
begin
blanchet@33197
    13
blanchet@41278
    14
nitpick_params [verbose, card = 1\<midarrow>6, unary_ints, max_potential = 0,
blanchet@40341
    15
                sat_solver = MiniSat_JNI, max_threads = 1, timeout = 60]
blanchet@34082
    16
blanchet@33197
    17
subsection {* Curry in a Hurry *}
blanchet@33197
    18
blanchet@33197
    19
lemma "(\<lambda>f x y. (curry o split) f x y) = (\<lambda>f x y. (\<lambda>x. x) f x y)"
blanchet@37704
    20
nitpick [card = 1\<midarrow>12, expect = none]
blanchet@33197
    21
by auto
blanchet@33197
    22
blanchet@33197
    23
lemma "(\<lambda>f p. (split o curry) f p) = (\<lambda>f p. (\<lambda>x. x) f p)"
blanchet@37704
    24
nitpick [card = 1\<midarrow>12, expect = none]
blanchet@33197
    25
by auto
blanchet@33197
    26
blanchet@33197
    27
lemma "split (curry f) = f"
blanchet@35284
    28
nitpick [card = 1\<midarrow>12, expect = none]
blanchet@33197
    29
by auto
blanchet@33197
    30
blanchet@33197
    31
lemma "curry (split f) = f"
blanchet@35284
    32
nitpick [card = 1\<midarrow>12, expect = none]
blanchet@33197
    33
by auto
blanchet@33197
    34
blanchet@33197
    35
lemma "split (\<lambda>x y. f (x, y)) = f"
blanchet@35284
    36
nitpick [card = 1\<midarrow>12, expect = none]
blanchet@33197
    37
by auto
blanchet@33197
    38
blanchet@33197
    39
subsection {* Representations *}
blanchet@33197
    40
blanchet@33197
    41
lemma "\<exists>f. f = (\<lambda>x. x) \<and> f y = y"
blanchet@33197
    42
nitpick [expect = none]
blanchet@33197
    43
by auto
blanchet@33197
    44
blanchet@33197
    45
lemma "(\<exists>g. \<forall>x. g (f x) = x) \<longrightarrow> (\<forall>y. \<exists>x. y = f x)"
blanchet@35284
    46
nitpick [card 'a = 25, card 'b = 24, expect = genuine]
blanchet@35284
    47
nitpick [card = 1\<midarrow>10, mono, expect = none]
blanchet@33197
    48
oops
blanchet@33197
    49
blanchet@33197
    50
lemma "\<exists>f. f = (\<lambda>x. x) \<and> f y \<noteq> y"
blanchet@33197
    51
nitpick [card = 1, expect = genuine]
blanchet@33197
    52
nitpick [card = 5, expect = genuine]
blanchet@33197
    53
oops
blanchet@33197
    54
blanchet@33197
    55
lemma "P (\<lambda>x. x)"
blanchet@33197
    56
nitpick [card = 1, expect = genuine]
blanchet@33197
    57
nitpick [card = 5, expect = genuine]
blanchet@33197
    58
oops
blanchet@33197
    59
blanchet@33197
    60
lemma "{(a\<Colon>'a\<times>'a, b\<Colon>'b)}^-1 = {(b, a)}"
blanchet@35284
    61
nitpick [card = 1\<midarrow>12, expect = none]
blanchet@33197
    62
by auto
blanchet@33197
    63
blanchet@33197
    64
lemma "fst (a, b) = a"
blanchet@33197
    65
nitpick [card = 1\<midarrow>20, expect = none]
blanchet@33197
    66
by auto
blanchet@33197
    67
blanchet@33197
    68
lemma "\<exists>P. P = Id"
blanchet@35284
    69
nitpick [card = 1\<midarrow>20, expect = none]
blanchet@33197
    70
by auto
blanchet@33197
    71
blanchet@33197
    72
lemma "(a\<Colon>'a\<Rightarrow>'b, a) \<in> Id\<^sup>*"
blanchet@33197
    73
nitpick [card = 1\<midarrow>3, expect = none]
blanchet@33197
    74
by auto
blanchet@33197
    75
blanchet@33197
    76
lemma "(a\<Colon>'a\<times>'a, a) \<in> Id\<^sup>* \<union> {(a, b)}\<^sup>*"
blanchet@35284
    77
nitpick [card = 1\<midarrow>4, expect = none]
blanchet@33197
    78
by auto
blanchet@33197
    79
blanchet@33197
    80
lemma "Id (a, a)"
blanchet@35284
    81
nitpick [card = 1\<midarrow>50, expect = none]
blanchet@33197
    82
by (auto simp: Id_def Collect_def)
blanchet@33197
    83
blanchet@33197
    84
lemma "Id ((a\<Colon>'a, b\<Colon>'a), (a, b))"
blanchet@34082
    85
nitpick [card = 1\<midarrow>10, expect = none]
blanchet@33197
    86
by (auto simp: Id_def Collect_def)
blanchet@33197
    87
blanchet@33197
    88
lemma "UNIV (x\<Colon>'a\<times>'a)"
blanchet@33197
    89
nitpick [card = 1\<midarrow>50, expect = none]
blanchet@33197
    90
sorry
blanchet@33197
    91
blanchet@33197
    92
lemma "{} = A - A"
blanchet@33197
    93
nitpick [card = 1\<midarrow>100, expect = none]
blanchet@33197
    94
by auto
blanchet@33197
    95
blanchet@33197
    96
lemma "g = Let (A \<or> B)"
blanchet@33197
    97
nitpick [card = 1, expect = none]
blanchet@33197
    98
nitpick [card = 2, expect = genuine]
blanchet@35284
    99
nitpick [card = 12, expect = genuine]
blanchet@33197
   100
oops
blanchet@33197
   101
blanchet@33197
   102
lemma "(let a_or_b = A \<or> B in a_or_b \<or> \<not> a_or_b)"
blanchet@33197
   103
nitpick [expect = none]
blanchet@33197
   104
by auto
blanchet@33197
   105
blanchet@33197
   106
lemma "A \<subseteq> B"
blanchet@33197
   107
nitpick [card = 100, expect = genuine]
blanchet@33197
   108
oops
blanchet@33197
   109
blanchet@33197
   110
lemma "A = {b}"
blanchet@33197
   111
nitpick [card = 100, expect = genuine]
blanchet@33197
   112
oops
blanchet@33197
   113
blanchet@33197
   114
lemma "{a, b} = {b}"
blanchet@39221
   115
nitpick [card = 50, expect = genuine]
blanchet@33197
   116
oops
blanchet@33197
   117
blanchet@33197
   118
lemma "(a\<Colon>'a\<times>'a, a\<Colon>'a\<times>'a) \<in> R"
blanchet@33197
   119
nitpick [card = 1, expect = genuine]
blanchet@39221
   120
nitpick [card = 10, expect = genuine]
blanchet@35284
   121
nitpick [card = 5, dont_box, expect = genuine]
blanchet@33197
   122
oops
blanchet@33197
   123
blanchet@33197
   124
lemma "f (g\<Colon>'a\<Rightarrow>'a) = x"
blanchet@33197
   125
nitpick [card = 3, expect = genuine]
blanchet@33197
   126
nitpick [card = 3, dont_box, expect = genuine]
blanchet@39221
   127
nitpick [card = 8, expect = genuine]
blanchet@33197
   128
oops
blanchet@33197
   129
blanchet@33197
   130
lemma "f (a, b) = x"
blanchet@39221
   131
nitpick [card = 10, expect = genuine]
blanchet@33197
   132
oops
blanchet@33197
   133
blanchet@33197
   134
lemma "f (a, a) = f (c, d)"
blanchet@39221
   135
nitpick [card = 10, expect = genuine]
blanchet@33197
   136
oops
blanchet@33197
   137
blanchet@33197
   138
lemma "(x\<Colon>'a) = (\<lambda>a. \<lambda>b. \<lambda>c. if c then a else b) x x True"
blanchet@39221
   139
nitpick [card = 1\<midarrow>10, expect = none]
blanchet@33197
   140
by auto
blanchet@33197
   141
blanchet@33197
   142
lemma "\<exists>F. F a b = G a b"
blanchet@35284
   143
nitpick [card = 2, expect = none]
blanchet@33197
   144
by auto
blanchet@33197
   145
blanchet@33197
   146
lemma "f = split"
blanchet@33197
   147
nitpick [card = 1, expect = none]
blanchet@33197
   148
nitpick [card = 2, expect = genuine]
blanchet@33197
   149
oops
blanchet@33197
   150
blanchet@33197
   151
lemma "(A\<Colon>'a\<times>'a, B\<Colon>'a\<times>'a) \<in> R \<Longrightarrow> (A, B) \<in> R"
blanchet@39221
   152
nitpick [card = 15, expect = none]
blanchet@33197
   153
by auto
blanchet@33197
   154
blanchet@33197
   155
lemma "(A, B) \<in> R \<or> (\<exists>C. (A, C) \<in> R \<and> (C, B) \<in> R) \<Longrightarrow> 
blanchet@33197
   156
       A = B \<or> (A, B) \<in> R \<or> (\<exists>C. (A, C) \<in> R \<and> (C, B) \<in> R)"
blanchet@35284
   157
nitpick [card = 1\<midarrow>25, expect = none]
blanchet@33197
   158
by auto
blanchet@33197
   159
blanchet@33197
   160
lemma "f = (\<lambda>x\<Colon>'a\<times>'b. x)"
blanchet@33197
   161
nitpick [card = 8, expect = genuine]
blanchet@33197
   162
oops
blanchet@33197
   163
blanchet@33197
   164
subsection {* Quantifiers *}
blanchet@33197
   165
blanchet@33197
   166
lemma "x = y"
blanchet@33197
   167
nitpick [card 'a = 1, expect = none]
blanchet@33197
   168
nitpick [card 'a = 2, expect = genuine]
blanchet@39221
   169
nitpick [card 'a = 100, expect = genuine]
blanchet@33197
   170
oops
blanchet@33197
   171
blanchet@33197
   172
lemma "\<forall>x. x = y"
blanchet@33197
   173
nitpick [card 'a = 1, expect = none]
blanchet@33197
   174
nitpick [card 'a = 2, expect = genuine]
blanchet@39221
   175
nitpick [card 'a = 100, expect = genuine]
blanchet@33197
   176
oops
blanchet@33197
   177
blanchet@33197
   178
lemma "\<forall>x\<Colon>'a \<Rightarrow> bool. x = y"
blanchet@33197
   179
nitpick [card 'a = 1, expect = genuine]
blanchet@39221
   180
nitpick [card 'a = 100, expect = genuine]
blanchet@33197
   181
oops
blanchet@33197
   182
blanchet@33197
   183
lemma "\<exists>x\<Colon>'a \<Rightarrow> bool. x = y"
blanchet@39221
   184
nitpick [card 'a = 1\<midarrow>15, expect = none]
blanchet@33197
   185
by auto
blanchet@33197
   186
blanchet@33197
   187
lemma "\<exists>x y\<Colon>'a \<Rightarrow> bool. x = y"
blanchet@39221
   188
nitpick [card = 1\<midarrow>15, expect = none]
blanchet@33197
   189
by auto
blanchet@33197
   190
blanchet@33197
   191
lemma "\<forall>x. \<exists>y. f x y = f x (g x)"
blanchet@39221
   192
nitpick [card = 1\<midarrow>4, expect = none]
blanchet@33197
   193
by auto
blanchet@33197
   194
blanchet@33197
   195
lemma "\<forall>u. \<exists>v. \<forall>w. \<exists>x. f u v w x = f u (g u) w (h u w)"
blanchet@35284
   196
nitpick [card = 1\<midarrow>4, expect = none]
blanchet@33197
   197
by auto
blanchet@33197
   198
blanchet@33197
   199
lemma "\<forall>u. \<exists>v. \<forall>w. \<exists>x. f u v w x = f u (g u w) w (h u)"
blanchet@33197
   200
nitpick [card = 3, expect = genuine]
blanchet@33197
   201
oops
blanchet@33197
   202
blanchet@33197
   203
lemma "\<forall>u. \<exists>v. \<forall>w. \<exists>x. \<forall>y. \<exists>z.
blanchet@33197
   204
       f u v w x y z = f u (g u) w (h u w) y (k u w y)"
blanchet@33197
   205
nitpick [card = 1\<midarrow>2, expect = none]
blanchet@33197
   206
sorry
blanchet@33197
   207
blanchet@33197
   208
lemma "\<forall>u. \<exists>v. \<forall>w. \<exists>x. \<forall>y. \<exists>z.
blanchet@33197
   209
       f u v w x y z = f u (g u) w (h u w y) y (k u w y)"
blanchet@33197
   210
nitpick [card = 1\<midarrow>2, expect = genuine]
blanchet@33197
   211
oops
blanchet@33197
   212
blanchet@33197
   213
lemma "\<forall>u. \<exists>v. \<forall>w. \<exists>x. \<forall>y. \<exists>z.
blanchet@33197
   214
       f u v w x y z = f u (g u w) w (h u w) y (k u w y)"
blanchet@33197
   215
nitpick [card = 1\<midarrow>2, expect = genuine]
blanchet@33197
   216
oops
blanchet@33197
   217
blanchet@33197
   218
lemma "\<forall>u\<Colon>'a \<times> 'b. \<exists>v\<Colon>'c. \<forall>w\<Colon>'d. \<exists>x\<Colon>'e \<times> 'f.
blanchet@33197
   219
       f u v w x = f u (g u) w (h u w)"
blanchet@33197
   220
nitpick [card = 1\<midarrow>2, expect = none]
blanchet@33197
   221
sorry
blanchet@33197
   222
blanchet@33197
   223
lemma "\<forall>u\<Colon>'a \<times> 'b. \<exists>v\<Colon>'c. \<forall>w\<Colon>'d. \<exists>x\<Colon>'e \<times> 'f.
blanchet@33197
   224
       f u v w x = f u (g u w) w (h u)"
blanchet@33197
   225
nitpick [card = 1\<midarrow>2, dont_box, expect = genuine]
blanchet@33197
   226
oops
blanchet@33197
   227
blanchet@33197
   228
lemma "\<forall>u\<Colon>'a \<Rightarrow> 'b. \<exists>v\<Colon>'c. \<forall>w\<Colon>'d. \<exists>x\<Colon>'e \<Rightarrow> 'f.
blanchet@33197
   229
       f u v w x = f u (g u) w (h u w)"
blanchet@33197
   230
nitpick [card = 1\<midarrow>2, dont_box, expect = none]
blanchet@33197
   231
sorry
blanchet@33197
   232
blanchet@33197
   233
lemma "\<forall>u\<Colon>'a \<Rightarrow> 'b. \<exists>v\<Colon>'c. \<forall>w\<Colon>'d. \<exists>x\<Colon>'e \<Rightarrow> 'f.
blanchet@33197
   234
       f u v w x = f u (g u w) w (h u)"
blanchet@33197
   235
nitpick [card = 1\<midarrow>2, dont_box, expect = genuine]
blanchet@33197
   236
oops
blanchet@33197
   237
blanchet@33197
   238
lemma "\<forall>x. if (\<forall>y. x = y) then False else True"
blanchet@33197
   239
nitpick [card = 1, expect = genuine]
blanchet@33197
   240
nitpick [card = 2\<midarrow>5, expect = none]
blanchet@33197
   241
oops
blanchet@33197
   242
blanchet@33197
   243
lemma "\<forall>x\<Colon>'a\<times>'b. if (\<forall>y. x = y) then False else True"
blanchet@33197
   244
nitpick [card = 1, expect = genuine]
blanchet@33197
   245
nitpick [card = 2, expect = none]
blanchet@33197
   246
oops
blanchet@33197
   247
blanchet@33197
   248
lemma "\<forall>x. if (\<exists>y. x = y) then True else False"
blanchet@33197
   249
nitpick [expect = none]
blanchet@33197
   250
sorry
blanchet@33197
   251
blanchet@33197
   252
lemma "(\<exists>x\<Colon>'a. \<forall>y. P x y) \<or> (\<exists>x\<Colon>'a \<times> 'a. \<forall>y. P y x)"
blanchet@33197
   253
nitpick [card 'a = 1, expect = genuine]
blanchet@33197
   254
nitpick [card 'a = 5, expect = genuine]
blanchet@33197
   255
oops
blanchet@33197
   256
blanchet@33197
   257
lemma "\<exists>x. if x = y then (\<forall>y. y = x \<or> y \<noteq> x)
blanchet@33197
   258
           else (\<forall>y. y = (x, x) \<or> y \<noteq> (x, x))"
blanchet@33197
   259
nitpick [expect = none]
blanchet@33197
   260
by auto
blanchet@33197
   261
blanchet@33197
   262
lemma "\<exists>x. if x = y then (\<exists>y. y = x \<or> y \<noteq> x)
blanchet@33197
   263
           else (\<exists>y. y = (x, x) \<or> y \<noteq> (x, x))"
blanchet@33197
   264
nitpick [expect = none]
blanchet@33197
   265
by auto
blanchet@33197
   266
blanchet@33197
   267
lemma "let x = (\<forall>x. P x) in if x then x else \<not> x"
blanchet@33197
   268
nitpick [expect = none]
blanchet@33197
   269
by auto
blanchet@33197
   270
blanchet@33197
   271
lemma "let x = (\<forall>x\<Colon>'a \<times> 'b. P x) in if x then x else \<not> x"
blanchet@33197
   272
nitpick [expect = none]
blanchet@33197
   273
by auto
blanchet@33197
   274
blanchet@33197
   275
subsection {* Schematic Variables *}
blanchet@33197
   276
wenzelm@36319
   277
schematic_lemma "x = ?x"
blanchet@33197
   278
nitpick [expect = none]
blanchet@33197
   279
by auto
blanchet@33197
   280
wenzelm@36319
   281
schematic_lemma "\<forall>x. x = ?x"
blanchet@33197
   282
nitpick [expect = genuine]
blanchet@33197
   283
oops
blanchet@33197
   284
wenzelm@36319
   285
schematic_lemma "\<exists>x. x = ?x"
blanchet@33197
   286
nitpick [expect = none]
blanchet@33197
   287
by auto
blanchet@33197
   288
wenzelm@36319
   289
schematic_lemma "\<exists>x\<Colon>'a \<Rightarrow> 'b. x = ?x"
blanchet@33197
   290
nitpick [expect = none]
blanchet@33197
   291
by auto
blanchet@33197
   292
wenzelm@36319
   293
schematic_lemma "\<forall>x. ?x = ?y"
blanchet@33197
   294
nitpick [expect = none]
blanchet@33197
   295
by auto
blanchet@33197
   296
wenzelm@36319
   297
schematic_lemma "\<exists>x. ?x = ?y"
blanchet@33197
   298
nitpick [expect = none]
blanchet@33197
   299
by auto
blanchet@33197
   300
blanchet@33197
   301
subsection {* Known Constants *}
blanchet@33197
   302
blanchet@33197
   303
lemma "x \<equiv> all \<Longrightarrow> False"
blanchet@33197
   304
nitpick [card = 1, expect = genuine]
blanchet@33197
   305
nitpick [card = 1, box "('a \<Rightarrow> prop) \<Rightarrow> prop", expect = genuine]
blanchet@33197
   306
nitpick [card = 2, expect = genuine]
blanchet@35284
   307
nitpick [card = 6, expect = genuine]
blanchet@33197
   308
oops
blanchet@33197
   309
blanchet@33197
   310
lemma "\<And>x. f x y = f x y"
blanchet@33197
   311
nitpick [expect = none]
blanchet@33197
   312
oops
blanchet@33197
   313
blanchet@33197
   314
lemma "\<And>x. f x y = f y x"
blanchet@33197
   315
nitpick [expect = genuine]
blanchet@33197
   316
oops
blanchet@33197
   317
blanchet@33197
   318
lemma "all (\<lambda>x. Trueprop (f x y = f x y)) \<equiv> Trueprop True"
blanchet@33197
   319
nitpick [expect = none]
blanchet@33197
   320
by auto
blanchet@33197
   321
blanchet@33197
   322
lemma "all (\<lambda>x. Trueprop (f x y = f x y)) \<equiv> Trueprop False"
blanchet@33197
   323
nitpick [expect = genuine]
blanchet@33197
   324
oops
blanchet@33197
   325
blanchet@33197
   326
lemma "I = (\<lambda>x. x) \<Longrightarrow> all P \<equiv> all (\<lambda>x. P (I x))"
blanchet@33197
   327
nitpick [expect = none]
blanchet@33197
   328
by auto
blanchet@33197
   329
blanchet@33197
   330
lemma "x \<equiv> (op \<equiv>) \<Longrightarrow> False"
blanchet@33197
   331
nitpick [card = 1, expect = genuine]
blanchet@35284
   332
nitpick [card = 20, expect = genuine]
blanchet@33197
   333
oops
blanchet@33197
   334
blanchet@33197
   335
lemma "P x \<equiv> P x"
blanchet@33197
   336
nitpick [card = 1\<midarrow>10, expect = none]
blanchet@33197
   337
by auto
blanchet@33197
   338
blanchet@33197
   339
lemma "P x \<equiv> Q x \<Longrightarrow> P x = Q x"
blanchet@33197
   340
nitpick [card = 1\<midarrow>10, expect = none]
blanchet@33197
   341
by auto
blanchet@33197
   342
blanchet@33197
   343
lemma "P x = Q x \<Longrightarrow> P x \<equiv> Q x"
blanchet@33197
   344
nitpick [card = 1\<midarrow>10, expect = none]
blanchet@33197
   345
by auto
blanchet@33197
   346
blanchet@33197
   347
lemma "x \<equiv> (op \<Longrightarrow>) \<Longrightarrow> False"
blanchet@33197
   348
nitpick [expect = genuine]
blanchet@33197
   349
oops
blanchet@33197
   350
blanchet@33197
   351
lemma "I \<equiv> (\<lambda>x. x) \<Longrightarrow> (op \<Longrightarrow> x) \<equiv> (\<lambda>y. (op \<Longrightarrow> x (I y)))"
blanchet@33197
   352
nitpick [expect = none]
blanchet@33197
   353
by auto
blanchet@33197
   354
blanchet@33197
   355
lemma "P x \<Longrightarrow> P x"
blanchet@33197
   356
nitpick [card = 1\<midarrow>10, expect = none]
blanchet@33197
   357
by auto
blanchet@33197
   358
blanchet@33197
   359
lemma "True \<Longrightarrow> True" "False \<Longrightarrow> True" "False \<Longrightarrow> False"
blanchet@33197
   360
nitpick [expect = none]
blanchet@33197
   361
by auto
blanchet@33197
   362
blanchet@33197
   363
lemma "True \<Longrightarrow> False"
blanchet@33197
   364
nitpick [expect = genuine]
blanchet@33197
   365
oops
blanchet@33197
   366
blanchet@33197
   367
lemma "x = Not"
blanchet@33197
   368
nitpick [expect = genuine]
blanchet@33197
   369
oops
blanchet@33197
   370
blanchet@33197
   371
lemma "I = (\<lambda>x. x) \<Longrightarrow> Not = (\<lambda>x. Not (I x))"
blanchet@33197
   372
nitpick [expect = none]
blanchet@33197
   373
by auto
blanchet@33197
   374
blanchet@33197
   375
lemma "x = True"
blanchet@33197
   376
nitpick [expect = genuine]
blanchet@33197
   377
oops
blanchet@33197
   378
blanchet@33197
   379
lemma "x = False"
blanchet@33197
   380
nitpick [expect = genuine]
blanchet@33197
   381
oops
blanchet@33197
   382
blanchet@33197
   383
lemma "x = undefined"
blanchet@33197
   384
nitpick [expect = genuine]
blanchet@33197
   385
oops
blanchet@33197
   386
blanchet@33197
   387
lemma "(False, ()) = undefined \<Longrightarrow> ((), False) = undefined"
blanchet@33197
   388
nitpick [expect = genuine]
blanchet@33197
   389
oops
blanchet@33197
   390
blanchet@33197
   391
lemma "undefined = undefined"
blanchet@33197
   392
nitpick [expect = none]
blanchet@33197
   393
by auto
blanchet@33197
   394
blanchet@33197
   395
lemma "f undefined = f undefined"
blanchet@33197
   396
nitpick [expect = none]
blanchet@33197
   397
by auto
blanchet@33197
   398
blanchet@33197
   399
lemma "f undefined = g undefined"
blanchet@33197
   400
nitpick [card = 33, expect = genuine]
blanchet@33197
   401
oops
blanchet@33197
   402
blanchet@33197
   403
lemma "\<exists>!x. x = undefined"
blanchet@39221
   404
nitpick [card = 15, expect = none]
blanchet@33197
   405
by auto
blanchet@33197
   406
blanchet@33197
   407
lemma "x = All \<Longrightarrow> False"
blanchet@33197
   408
nitpick [card = 1, dont_box, expect = genuine]
blanchet@39221
   409
nitpick [card = 5, dont_box, expect = genuine]
blanchet@33197
   410
oops
blanchet@33197
   411
blanchet@33197
   412
lemma "\<forall>x. f x y = f x y"
blanchet@33197
   413
nitpick [expect = none]
blanchet@33197
   414
oops
blanchet@33197
   415
blanchet@33197
   416
lemma "\<forall>x. f x y = f y x"
blanchet@33197
   417
nitpick [expect = genuine]
blanchet@33197
   418
oops
blanchet@33197
   419
blanchet@33197
   420
lemma "All (\<lambda>x. f x y = f x y) = True"
blanchet@33197
   421
nitpick [expect = none]
blanchet@33197
   422
by auto
blanchet@33197
   423
blanchet@33197
   424
lemma "All (\<lambda>x. f x y = f x y) = False"
blanchet@33197
   425
nitpick [expect = genuine]
blanchet@33197
   426
oops
blanchet@33197
   427
blanchet@33197
   428
lemma "x = Ex \<Longrightarrow> False"
blanchet@33197
   429
nitpick [card = 1, dont_box, expect = genuine]
blanchet@39221
   430
nitpick [card = 5, dont_box, expect = genuine]
blanchet@33197
   431
oops
blanchet@33197
   432
blanchet@33197
   433
lemma "\<exists>x. f x y = f x y"
blanchet@33197
   434
nitpick [expect = none]
blanchet@33197
   435
oops
blanchet@33197
   436
blanchet@33197
   437
lemma "\<exists>x. f x y = f y x"
blanchet@33197
   438
nitpick [expect = none]
blanchet@33197
   439
oops
blanchet@33197
   440
blanchet@33197
   441
lemma "Ex (\<lambda>x. f x y = f x y) = True"
blanchet@33197
   442
nitpick [expect = none]
blanchet@33197
   443
by auto
blanchet@33197
   444
blanchet@33197
   445
lemma "Ex (\<lambda>x. f x y = f y x) = True"
blanchet@33197
   446
nitpick [expect = none]
blanchet@33197
   447
by auto
blanchet@33197
   448
blanchet@33197
   449
lemma "Ex (\<lambda>x. f x y = f x y) = False"
blanchet@33197
   450
nitpick [expect = genuine]
blanchet@33197
   451
oops
blanchet@33197
   452
blanchet@33197
   453
lemma "Ex (\<lambda>x. f x y \<noteq> f x y) = False"
blanchet@33197
   454
nitpick [expect = none]
blanchet@33197
   455
by auto
blanchet@33197
   456
blanchet@33197
   457
lemma "I = (\<lambda>x. x) \<Longrightarrow> Ex P = Ex (\<lambda>x. P (I x))"
blanchet@33197
   458
nitpick [expect = none]
blanchet@33197
   459
by auto
blanchet@33197
   460
blanchet@33197
   461
lemma "x = y \<Longrightarrow> y = x"
blanchet@33197
   462
nitpick [expect = none]
blanchet@33197
   463
by auto
blanchet@33197
   464
blanchet@33197
   465
lemma "x = y \<Longrightarrow> f x = f y"
blanchet@33197
   466
nitpick [expect = none]
blanchet@33197
   467
by auto
blanchet@33197
   468
blanchet@33197
   469
lemma "x = y \<and> y = z \<Longrightarrow> x = z"
blanchet@33197
   470
nitpick [expect = none]
blanchet@33197
   471
by auto
blanchet@33197
   472
blanchet@35284
   473
lemma "I = (\<lambda>x. x) \<Longrightarrow> (op \<and>) = (\<lambda>x. op \<and> (I x))"
blanchet@35284
   474
      "I = (\<lambda>x. x) \<Longrightarrow> (op \<and>) = (\<lambda>x y. x \<and> (I y))"
blanchet@33197
   475
nitpick [expect = none]
blanchet@33197
   476
by auto
blanchet@33197
   477
blanchet@33197
   478
lemma "(a \<and> b) = (\<not> (\<not> a \<or> \<not> b))"
blanchet@33197
   479
nitpick [expect = none]
blanchet@33197
   480
by auto
blanchet@33197
   481
blanchet@33197
   482
lemma "a \<and> b \<Longrightarrow> a" "a \<and> b \<Longrightarrow> b"
blanchet@33197
   483
nitpick [expect = none]
blanchet@33197
   484
by auto
blanchet@33197
   485
blanchet@33197
   486
lemma "(op \<longrightarrow>) = (\<lambda>x. op\<longrightarrow> x)" "(op\<longrightarrow> ) = (\<lambda>x y. x \<longrightarrow> y)"
blanchet@33197
   487
nitpick [expect = none]
blanchet@33197
   488
by auto
blanchet@33197
   489
blanchet@33197
   490
lemma "((if a then b else c) = d) = ((a \<longrightarrow> (b = d)) \<and> (\<not> a \<longrightarrow> (c = d)))"
blanchet@33197
   491
nitpick [expect = none]
blanchet@33197
   492
by auto
blanchet@33197
   493
blanchet@33197
   494
lemma "(if a then b else c) = (THE d. (a \<longrightarrow> (d = b)) \<and> (\<not> a \<longrightarrow> (d = c)))"
blanchet@33197
   495
nitpick [expect = none]
blanchet@33197
   496
by auto
blanchet@33197
   497
blanchet@33197
   498
lemma "fst (x, y) = x"
blanchet@33197
   499
nitpick [expect = none]
blanchet@33197
   500
by (simp add: fst_def)
blanchet@33197
   501
blanchet@33197
   502
lemma "snd (x, y) = y"
blanchet@33197
   503
nitpick [expect = none]
blanchet@33197
   504
by (simp add: snd_def)
blanchet@33197
   505
blanchet@33197
   506
lemma "fst (x\<Colon>'a\<Rightarrow>'b, y) = x"
blanchet@33197
   507
nitpick [expect = none]
blanchet@33197
   508
by (simp add: fst_def)
blanchet@33197
   509
blanchet@33197
   510
lemma "snd (x\<Colon>'a\<Rightarrow>'b, y) = y"
blanchet@33197
   511
nitpick [expect = none]
blanchet@33197
   512
by (simp add: snd_def)
blanchet@33197
   513
blanchet@33197
   514
lemma "fst (x, y\<Colon>'a\<Rightarrow>'b) = x"
blanchet@33197
   515
nitpick [expect = none]
blanchet@33197
   516
by (simp add: fst_def)
blanchet@33197
   517
blanchet@33197
   518
lemma "snd (x, y\<Colon>'a\<Rightarrow>'b) = y"
blanchet@33197
   519
nitpick [expect = none]
blanchet@33197
   520
by (simp add: snd_def)
blanchet@33197
   521
blanchet@33197
   522
lemma "fst (x\<Colon>'a\<times>'b, y) = x"
blanchet@33197
   523
nitpick [expect = none]
blanchet@33197
   524
by (simp add: fst_def)
blanchet@33197
   525
blanchet@33197
   526
lemma "snd (x\<Colon>'a\<times>'b, y) = y"
blanchet@33197
   527
nitpick [expect = none]
blanchet@33197
   528
by (simp add: snd_def)
blanchet@33197
   529
blanchet@33197
   530
lemma "fst (x, y\<Colon>'a\<times>'b) = x"
blanchet@33197
   531
nitpick [expect = none]
blanchet@33197
   532
by (simp add: fst_def)
blanchet@33197
   533
blanchet@33197
   534
lemma "snd (x, y\<Colon>'a\<times>'b) = y"
blanchet@33197
   535
nitpick [expect = none]
blanchet@33197
   536
by (simp add: snd_def)
blanchet@33197
   537
blanchet@33197
   538
lemma "I = (\<lambda>x. x) \<Longrightarrow> fst = (\<lambda>x. fst (I x))"
blanchet@33197
   539
nitpick [expect = none]
blanchet@33197
   540
by auto
blanchet@33197
   541
blanchet@33197
   542
lemma "fst (x, y) = snd (y, x)"
blanchet@33197
   543
nitpick [expect = none]
blanchet@33197
   544
by auto
blanchet@33197
   545
blanchet@33197
   546
lemma "(x, x) \<in> Id"
blanchet@33197
   547
nitpick [expect = none]
blanchet@33197
   548
by auto
blanchet@33197
   549
blanchet@33197
   550
lemma "(x, y) \<in> Id \<Longrightarrow> x = y"
blanchet@33197
   551
nitpick [expect = none]
blanchet@33197
   552
by auto
blanchet@33197
   553
blanchet@33197
   554
lemma "I = (\<lambda>x. x) \<Longrightarrow> Id = (\<lambda>x. Id (I x))"
blanchet@33197
   555
nitpick [expect = none]
blanchet@33197
   556
by auto
blanchet@33197
   557
blanchet@33197
   558
lemma "{} = (\<lambda>x. False)"
blanchet@33197
   559
nitpick [expect = none]
blanchet@33199
   560
by (metis Collect_def empty_def)
blanchet@33197
   561
blanchet@33197
   562
lemma "x \<in> {}"
blanchet@33197
   563
nitpick [expect = genuine]
blanchet@33197
   564
oops
blanchet@33197
   565
blanchet@33197
   566
lemma "{a, b} = {b}"
blanchet@33197
   567
nitpick [expect = genuine]
blanchet@33197
   568
oops
blanchet@33197
   569
blanchet@33197
   570
lemma "{a, b} \<noteq> {b}"
blanchet@33197
   571
nitpick [expect = genuine]
blanchet@33197
   572
oops
blanchet@33197
   573
blanchet@33197
   574
lemma "{a} = {b}"
blanchet@33197
   575
nitpick [expect = genuine]
blanchet@33197
   576
oops
blanchet@33197
   577
blanchet@33197
   578
lemma "{a} \<noteq> {b}"
blanchet@33197
   579
nitpick [expect = genuine]
blanchet@33197
   580
oops
blanchet@33197
   581
blanchet@33197
   582
lemma "{a, b, c} = {c, b, a}"
blanchet@33197
   583
nitpick [expect = none]
blanchet@33197
   584
by auto
blanchet@33197
   585
blanchet@33197
   586
lemma "UNIV = (\<lambda>x. True)"
blanchet@33197
   587
nitpick [expect = none]
blanchet@33197
   588
by (simp only: UNIV_def Collect_def)
blanchet@33197
   589
blanchet@33197
   590
lemma "UNIV x = True"
blanchet@33197
   591
nitpick [expect = none]
blanchet@33197
   592
by (simp only: UNIV_def Collect_def)
blanchet@33197
   593
blanchet@33197
   594
lemma "x \<notin> UNIV"
blanchet@33197
   595
nitpick [expect = genuine]
blanchet@33197
   596
oops
blanchet@33197
   597
blanchet@33197
   598
lemma "op \<in> = (\<lambda>x P. P x)"
blanchet@33197
   599
nitpick [expect = none]
blanchet@33197
   600
apply (rule ext)
blanchet@33197
   601
apply (rule ext)
blanchet@33197
   602
by (simp add: mem_def)
blanchet@33197
   603
blanchet@33197
   604
lemma "I = (\<lambda>x. x) \<Longrightarrow> op \<in> = (\<lambda>x. (op \<in> (I x)))"
blanchet@33197
   605
nitpick [expect = none]
blanchet@33197
   606
apply (rule ext)
blanchet@33197
   607
apply (rule ext)
blanchet@33197
   608
by (simp add: mem_def)
blanchet@33197
   609
blanchet@33197
   610
lemma "P x = (x \<in> P)"
blanchet@33197
   611
nitpick [expect = none]
blanchet@33197
   612
by (simp add: mem_def)
blanchet@33197
   613
blanchet@33197
   614
lemma "insert = (\<lambda>x y. insert x (y \<union> y))"
blanchet@33197
   615
nitpick [expect = none]
blanchet@33197
   616
by simp
blanchet@33197
   617
blanchet@33197
   618
lemma "I = (\<lambda>x. x) \<Longrightarrow> trancl = (\<lambda>x. trancl (I x))"
blanchet@33197
   619
nitpick [card = 1\<midarrow>2, expect = none]
blanchet@33197
   620
by auto
blanchet@33197
   621
blanchet@33197
   622
lemma "rtrancl = (\<lambda>x. rtrancl x \<union> {(y, y)})"
blanchet@33197
   623
nitpick [card = 1\<midarrow>3, expect = none]
blanchet@33197
   624
apply (rule ext)
blanchet@33197
   625
by auto
blanchet@33197
   626
blanchet@33197
   627
lemma "(x, x) \<in> rtrancl {(y, y)}"
blanchet@33197
   628
nitpick [expect = none]
blanchet@33197
   629
by auto
blanchet@33197
   630
blanchet@33197
   631
lemma "((x, x), (x, x)) \<in> rtrancl {}"
blanchet@35284
   632
nitpick [card = 1\<midarrow>5, expect = none]
blanchet@33197
   633
by auto
blanchet@33197
   634
blanchet@33197
   635
lemma "I = (\<lambda>x. x) \<Longrightarrow> op \<union> = (\<lambda>x. op \<union> (I x))"
blanchet@33197
   636
nitpick [card = 1\<midarrow>5, expect = none]
blanchet@33197
   637
by auto
blanchet@33197
   638
blanchet@33197
   639
lemma "a \<in> A \<Longrightarrow> a \<in> (A \<union> B)" "b \<in> B \<Longrightarrow> b \<in> (A \<union> B)"
blanchet@33197
   640
nitpick [expect = none]
blanchet@33197
   641
by auto
blanchet@33197
   642
blanchet@33197
   643
lemma "I = (\<lambda>x. x) \<Longrightarrow> op \<inter> = (\<lambda>x. op \<inter> (I x))"
blanchet@33197
   644
nitpick [card = 1\<midarrow>5, expect = none]
blanchet@33197
   645
by auto
blanchet@33197
   646
blanchet@33197
   647
lemma "a \<notin> A \<Longrightarrow> a \<notin> (A \<inter> B)" "b \<notin> B \<Longrightarrow> b \<notin> (A \<inter> B)"
blanchet@33197
   648
nitpick [card = 1\<midarrow>5, expect = none]
blanchet@33197
   649
by auto
blanchet@33197
   650
blanchet@33197
   651
lemma "x \<in> ((A\<Colon>'a set) - B) \<longleftrightarrow> x \<in> A \<and> x \<notin> B"
blanchet@33197
   652
nitpick [card = 1\<midarrow>5, expect = none]
blanchet@33197
   653
by auto
blanchet@33197
   654
blanchet@33197
   655
lemma "I = (\<lambda>x. x) \<Longrightarrow> op \<subset> = (\<lambda>x. op \<subset> (I x))"
blanchet@33197
   656
nitpick [card = 1\<midarrow>5, expect = none]
blanchet@33197
   657
by auto
blanchet@33197
   658
blanchet@33197
   659
lemma "A \<subset> B \<Longrightarrow> (\<forall>a \<in> A. a \<in> B) \<and> (\<exists>b \<in> B. b \<notin> A)"
blanchet@33197
   660
nitpick [card = 1\<midarrow>5, expect = none]
blanchet@33197
   661
by auto
blanchet@33197
   662
blanchet@33197
   663
lemma "A \<subseteq> B \<Longrightarrow> \<forall>a \<in> A. a \<in> B"
blanchet@33197
   664
nitpick [card = 1\<midarrow>5, expect = none]
blanchet@33197
   665
by auto
blanchet@33197
   666
blanchet@33197
   667
lemma "A \<subseteq> B \<Longrightarrow> A \<subset> B"
blanchet@33197
   668
nitpick [card = 5, expect = genuine]
blanchet@33197
   669
oops
blanchet@33197
   670
blanchet@33197
   671
lemma "A \<subset> B \<Longrightarrow> A \<subseteq> B"
blanchet@33197
   672
nitpick [expect = none]
blanchet@33197
   673
by auto
blanchet@33197
   674
blanchet@33197
   675
lemma "I = (\<lambda>x\<Colon>'a set. x) \<Longrightarrow> uminus = (\<lambda>x. uminus (I x))"
blanchet@34126
   676
nitpick [card = 1\<midarrow>7, expect = none]
blanchet@33197
   677
by auto
blanchet@33197
   678
blanchet@33197
   679
lemma "A \<union> - A = UNIV"
blanchet@33197
   680
nitpick [expect = none]
blanchet@33197
   681
by auto
blanchet@33197
   682
blanchet@33197
   683
lemma "A \<inter> - A = {}"
blanchet@33197
   684
nitpick [expect = none]
blanchet@33197
   685
by auto
blanchet@33197
   686
blanchet@33197
   687
lemma "A = -(A\<Colon>'a set)"
blanchet@33197
   688
nitpick [card 'a = 10, expect = genuine]
blanchet@33197
   689
oops
blanchet@33197
   690
blanchet@33197
   691
lemma "finite A"
blanchet@33197
   692
nitpick [expect = none]
blanchet@33197
   693
oops
blanchet@33197
   694
blanchet@33197
   695
lemma "finite A \<Longrightarrow> finite B"
blanchet@33197
   696
nitpick [expect = none]
blanchet@33197
   697
oops
blanchet@33197
   698
blanchet@33197
   699
lemma "All finite"
blanchet@33197
   700
nitpick [expect = none]
blanchet@33197
   701
oops
blanchet@33197
   702
blanchet@33197
   703
subsection {* The and Eps *}
blanchet@33197
   704
blanchet@33197
   705
lemma "x = The"
blanchet@33197
   706
nitpick [card = 5, expect = genuine]
blanchet@33197
   707
oops
blanchet@33197
   708
blanchet@33197
   709
lemma "\<exists>x. x = The"
blanchet@33197
   710
nitpick [card = 1\<midarrow>3]
blanchet@33197
   711
by auto
blanchet@33197
   712
blanchet@33197
   713
lemma "P x \<and> (\<forall>y. P y \<longrightarrow> y = x) \<longrightarrow> The P = x"
blanchet@33197
   714
nitpick [expect = none]
blanchet@33197
   715
by auto
blanchet@33197
   716
blanchet@33197
   717
lemma "P x \<and> P y \<and> x \<noteq> y \<longrightarrow> The P = z"
blanchet@33197
   718
nitpick [expect = genuine]
blanchet@33197
   719
oops
blanchet@33197
   720
blanchet@33197
   721
lemma "P x \<and> P y \<and> x \<noteq> y \<longrightarrow> The P = x \<or> The P = y"
blanchet@33197
   722
nitpick [card = 2, expect = none]
blanchet@33197
   723
nitpick [card = 3\<midarrow>5, expect = genuine]
blanchet@33197
   724
oops
blanchet@33197
   725
blanchet@33197
   726
lemma "P x \<Longrightarrow> P (The P)"
blanchet@33197
   727
nitpick [card = 1\<midarrow>2, expect = none]
blanchet@35284
   728
nitpick [card = 3, expect = genuine]
blanchet@33197
   729
nitpick [card = 8, expect = genuine]
blanchet@33197
   730
oops
blanchet@33197
   731
blanchet@33197
   732
lemma "(\<forall>x. \<not> P x) \<longrightarrow> The P = y"
blanchet@33197
   733
nitpick [expect = genuine]
blanchet@33197
   734
oops
blanchet@33197
   735
blanchet@33197
   736
lemma "I = (\<lambda>x. x) \<Longrightarrow> The = (\<lambda>x. The (I x))"
blanchet@33197
   737
nitpick [card = 1\<midarrow>5, expect = none]
blanchet@33197
   738
by auto
blanchet@33197
   739
blanchet@33197
   740
lemma "x = Eps"
blanchet@33197
   741
nitpick [card = 5, expect = genuine]
blanchet@33197
   742
oops
blanchet@33197
   743
blanchet@33197
   744
lemma "\<exists>x. x = Eps"
blanchet@33197
   745
nitpick [card = 1\<midarrow>3, expect = none]
blanchet@33197
   746
by auto
blanchet@33197
   747
blanchet@33197
   748
lemma "P x \<and> (\<forall>y. P y \<longrightarrow> y = x) \<longrightarrow> Eps P = x"
blanchet@33197
   749
nitpick [expect = none]
blanchet@33197
   750
by auto
blanchet@33197
   751
blanchet@33197
   752
lemma "P x \<and> P y \<and> x \<noteq> y \<longrightarrow> Eps P = z"
blanchet@33197
   753
nitpick [expect = genuine]
blanchet@33197
   754
apply auto
blanchet@33197
   755
oops
blanchet@33197
   756
blanchet@33197
   757
lemma "P x \<Longrightarrow> P (Eps P)"
blanchet@33197
   758
nitpick [card = 1\<midarrow>8, expect = none]
blanchet@33197
   759
by (metis exE_some)
blanchet@33197
   760
blanchet@33197
   761
lemma "\<forall>x. \<not> P x \<longrightarrow> Eps P = y"
blanchet@33197
   762
nitpick [expect = genuine]
blanchet@33197
   763
oops
blanchet@33197
   764
blanchet@33197
   765
lemma "P (Eps P)"
blanchet@33197
   766
nitpick [expect = genuine]
blanchet@33197
   767
oops
blanchet@33197
   768
blanchet@33197
   769
lemma "(P\<Colon>nat set) (Eps P)"
blanchet@33197
   770
nitpick [expect = genuine]
blanchet@33197
   771
oops
blanchet@33197
   772
blanchet@33197
   773
lemma "\<not> P (Eps P)"
blanchet@33197
   774
nitpick [expect = genuine]
blanchet@33197
   775
oops
blanchet@33197
   776
blanchet@33197
   777
lemma "\<not> (P\<Colon>nat set) (Eps P)"
blanchet@33197
   778
nitpick [expect = genuine]
blanchet@33197
   779
oops
blanchet@33197
   780
blanchet@33197
   781
lemma "P \<noteq> {} \<Longrightarrow> P (Eps P)"
blanchet@33197
   782
nitpick [expect = none]
blanchet@33197
   783
sorry
blanchet@33197
   784
blanchet@33197
   785
lemma "(P\<Colon>nat set) \<noteq> {} \<Longrightarrow> P (Eps P)"
blanchet@33197
   786
nitpick [expect = none]
blanchet@33197
   787
sorry
blanchet@33197
   788
blanchet@33197
   789
lemma "P (The P)"
blanchet@33197
   790
nitpick [expect = genuine]
blanchet@33197
   791
oops
blanchet@33197
   792
blanchet@33197
   793
lemma "(P\<Colon>nat set) (The P)"
blanchet@33197
   794
nitpick [expect = genuine]
blanchet@33197
   795
oops
blanchet@33197
   796
blanchet@33197
   797
lemma "\<not> P (The P)"
blanchet@33197
   798
nitpick [expect = genuine]
blanchet@33197
   799
oops
blanchet@33197
   800
blanchet@33197
   801
lemma "\<not> (P\<Colon>nat set) (The P)"
blanchet@33197
   802
nitpick [expect = genuine]
blanchet@33197
   803
oops
blanchet@33197
   804
blanchet@33197
   805
lemma "The P \<noteq> x"
blanchet@33197
   806
nitpick [expect = genuine]
blanchet@33197
   807
oops
blanchet@33197
   808
blanchet@33197
   809
lemma "The P \<noteq> (x\<Colon>nat)"
blanchet@33197
   810
nitpick [expect = genuine]
blanchet@33197
   811
oops
blanchet@33197
   812
blanchet@33197
   813
lemma "P x \<Longrightarrow> P (The P)"
blanchet@33197
   814
nitpick [expect = genuine]
blanchet@33197
   815
oops
blanchet@33197
   816
blanchet@33197
   817
lemma "P (x\<Colon>nat) \<Longrightarrow> P (The P)"
blanchet@33197
   818
nitpick [expect = genuine]
blanchet@33197
   819
oops
blanchet@33197
   820
blanchet@33197
   821
lemma "P = {x} \<Longrightarrow> P (The P)"
blanchet@33197
   822
nitpick [expect = none]
blanchet@33197
   823
oops
blanchet@33197
   824
blanchet@33197
   825
lemma "P = {x\<Colon>nat} \<Longrightarrow> P (The P)"
blanchet@33197
   826
nitpick [expect = none]
blanchet@33197
   827
oops
blanchet@33197
   828
blanchet@33197
   829
consts Q :: 'a
blanchet@33197
   830
blanchet@33197
   831
lemma "Q (Eps Q)"
blanchet@33197
   832
nitpick [expect = genuine]
blanchet@33197
   833
oops
blanchet@33197
   834
blanchet@33197
   835
lemma "(Q\<Colon>nat set) (Eps Q)"
blanchet@35386
   836
nitpick [expect = none] (* unfortunate *)
blanchet@33197
   837
oops
blanchet@33197
   838
blanchet@33197
   839
lemma "\<not> Q (Eps Q)"
blanchet@33197
   840
nitpick [expect = genuine]
blanchet@33197
   841
oops
blanchet@33197
   842
blanchet@33197
   843
lemma "\<not> (Q\<Colon>nat set) (Eps Q)"
blanchet@33197
   844
nitpick [expect = genuine]
blanchet@33197
   845
oops
blanchet@33197
   846
blanchet@33197
   847
lemma "(Q\<Colon>'a set) \<noteq> {} \<Longrightarrow> (Q\<Colon>'a set) (Eps Q)"
blanchet@33197
   848
nitpick [expect = none]
blanchet@33197
   849
sorry
blanchet@33197
   850
blanchet@33197
   851
lemma "(Q\<Colon>nat set) \<noteq> {} \<Longrightarrow> (Q\<Colon>nat set) (Eps Q)"
blanchet@33197
   852
nitpick [expect = none]
blanchet@33197
   853
sorry
blanchet@33197
   854
blanchet@33197
   855
lemma "Q (The Q)"
blanchet@33197
   856
nitpick [expect = genuine]
blanchet@33197
   857
oops
blanchet@33197
   858
blanchet@33197
   859
lemma "(Q\<Colon>nat set) (The Q)"
blanchet@33197
   860
nitpick [expect = genuine]
blanchet@33197
   861
oops
blanchet@33197
   862
blanchet@33197
   863
lemma "\<not> Q (The Q)"
blanchet@33197
   864
nitpick [expect = genuine]
blanchet@33197
   865
oops
blanchet@33197
   866
blanchet@33197
   867
lemma "\<not> (Q\<Colon>nat set) (The Q)"
blanchet@33197
   868
nitpick [expect = genuine]
blanchet@33197
   869
oops
blanchet@33197
   870
blanchet@33197
   871
lemma "The Q \<noteq> x"
blanchet@33197
   872
nitpick [expect = genuine]
blanchet@33197
   873
oops
blanchet@33197
   874
blanchet@33197
   875
lemma "The Q \<noteq> (x\<Colon>nat)"
blanchet@33197
   876
nitpick [expect = genuine]
blanchet@33197
   877
oops
blanchet@33197
   878
blanchet@33197
   879
lemma "Q x \<Longrightarrow> Q (The Q)"
blanchet@33197
   880
nitpick [expect = genuine]
blanchet@33197
   881
oops
blanchet@33197
   882
blanchet@33197
   883
lemma "Q (x\<Colon>nat) \<Longrightarrow> Q (The Q)"
blanchet@33197
   884
nitpick [expect = genuine]
blanchet@33197
   885
oops
blanchet@33197
   886
blanchet@33197
   887
lemma "Q = {x\<Colon>'a} \<Longrightarrow> (Q\<Colon>'a set) (The Q)"
blanchet@33197
   888
nitpick [expect = none]
blanchet@35386
   889
sorry
blanchet@33197
   890
blanchet@33197
   891
lemma "Q = {x\<Colon>nat} \<Longrightarrow> (Q\<Colon>nat set) (The Q)"
blanchet@33197
   892
nitpick [expect = none]
blanchet@35386
   893
sorry
blanchet@33197
   894
blanchet@39359
   895
nitpick_params [max_potential = 1]
blanchet@37275
   896
blanchet@37434
   897
lemma "(THE j. j > Suc 2 \<and> j \<le> 3) \<noteq> 0"
blanchet@37434
   898
nitpick [card nat = 2, expect = potential]
blanchet@37434
   899
nitpick [card nat = 6, expect = potential] (* unfortunate *)
blanchet@37270
   900
oops
blanchet@37270
   901
blanchet@37434
   902
lemma "(THE j. j > Suc 2 \<and> j \<le> 4) = x \<Longrightarrow> x \<noteq> 0"
blanchet@37434
   903
nitpick [card nat = 2, expect = potential]
blanchet@37434
   904
nitpick [card nat = 6, expect = none]
blanchet@37270
   905
sorry
blanchet@37270
   906
blanchet@37434
   907
lemma "(THE j. j > Suc 2 \<and> j \<le> 4) = x \<Longrightarrow> x = 4"
blanchet@37434
   908
nitpick [card nat = 2, expect = potential]
blanchet@37434
   909
nitpick [card nat = 6, expect = none]
blanchet@37270
   910
sorry
blanchet@37270
   911
blanchet@37434
   912
lemma "(THE j. j > Suc 2 \<and> j \<le> 5) = x \<Longrightarrow> x = 4"
blanchet@37434
   913
nitpick [card nat = 6, expect = genuine]
blanchet@37270
   914
oops
blanchet@37270
   915
blanchet@37434
   916
lemma "(THE j. j > Suc 2 \<and> j \<le> 5) = x \<Longrightarrow> x = 4 \<or> x = 5"
blanchet@37434
   917
nitpick [card nat = 6, expect = genuine]
blanchet@37270
   918
oops
blanchet@37270
   919
blanchet@37434
   920
lemma "(SOME j. j > Suc 2 \<and> j \<le> 3) \<noteq> 0"
blanchet@37434
   921
nitpick [card nat = 2, expect = potential]
blanchet@37434
   922
nitpick [card nat = 6, expect = genuine]
blanchet@37270
   923
oops
blanchet@37270
   924
blanchet@37434
   925
lemma "(SOME j. j > Suc 2 \<and> j \<le> 4) = x \<Longrightarrow> x \<noteq> 0"
blanchet@37434
   926
nitpick [card nat = 2, expect = potential]
blanchet@37434
   927
nitpick [card nat = 6, expect = none]
blanchet@37270
   928
oops
blanchet@37270
   929
blanchet@37434
   930
lemma "(SOME j. j > Suc 2 \<and> j \<le> 4) = x \<Longrightarrow> x = 4"
blanchet@37434
   931
nitpick [card nat = 2, expect = potential]
blanchet@37434
   932
nitpick [card nat = 6, expect = none]
blanchet@37270
   933
sorry
blanchet@37270
   934
blanchet@37434
   935
lemma "(SOME j. j > Suc 2 \<and> j \<le> 5) = x \<Longrightarrow> x = 4"
blanchet@37434
   936
nitpick [card nat = 6, expect = genuine]
blanchet@37270
   937
oops
blanchet@37270
   938
blanchet@37434
   939
lemma "(SOME j. j > Suc 2 \<and> j \<le> 5) = x \<Longrightarrow> x = 4 \<or> x = 5"
blanchet@37434
   940
nitpick [card nat = 6, expect = none]
blanchet@37270
   941
sorry
blanchet@37270
   942
blanchet@39359
   943
nitpick_params [max_potential = 0]
blanchet@37275
   944
blanchet@33197
   945
subsection {* Destructors and Recursors *}
blanchet@33197
   946
blanchet@33197
   947
lemma "(x\<Colon>'a) = (case True of True \<Rightarrow> x | False \<Rightarrow> x)"
blanchet@33197
   948
nitpick [card = 2, expect = none]
blanchet@33197
   949
by auto
blanchet@33197
   950
blanchet@33197
   951
lemma "bool_rec x y True = x"
blanchet@33197
   952
nitpick [card = 2, expect = none]
blanchet@33197
   953
by auto
blanchet@33197
   954
blanchet@33197
   955
lemma "bool_rec x y False = y"
blanchet@33197
   956
nitpick [card = 2, expect = none]
blanchet@33197
   957
by auto
blanchet@33197
   958
blanchet@33197
   959
lemma "(x\<Colon>bool) = bool_rec x x True"
blanchet@33197
   960
nitpick [card = 2, expect = none]
blanchet@33197
   961
by auto
blanchet@33197
   962
blanchet@33197
   963
lemma "x = (case (x, y) of (x', y') \<Rightarrow> x')"
blanchet@33197
   964
nitpick [expect = none]
blanchet@33197
   965
sorry
blanchet@33197
   966
blanchet@33197
   967
end