src/HOL/Parity.thy
author haftmann
Sat Mar 12 22:04:52 2016 +0100 (2016-03-12)
changeset 62597 b3f2b8c906a6
parent 62083 7582b39f51ed
child 63654 f90e3926e627
permissions -rw-r--r--
model characters directly as range 0..255
* * *
operate on syntax terms rather than asts
wenzelm@41959
     1
(*  Title:      HOL/Parity.thy
wenzelm@41959
     2
    Author:     Jeremy Avigad
wenzelm@41959
     3
    Author:     Jacques D. Fleuriot
wenzelm@21256
     4
*)
wenzelm@21256
     5
wenzelm@60758
     6
section \<open>Parity in rings and semirings\<close>
wenzelm@21256
     7
wenzelm@21256
     8
theory Parity
haftmann@58778
     9
imports Nat_Transfer
wenzelm@21256
    10
begin
wenzelm@21256
    11
wenzelm@61799
    12
subsection \<open>Ring structures with parity and \<open>even\<close>/\<open>odd\<close> predicates\<close>
haftmann@58678
    13
lp15@60562
    14
class semiring_parity = comm_semiring_1_cancel + numeral +
haftmann@58787
    15
  assumes odd_one [simp]: "\<not> 2 dvd 1"
haftmann@58787
    16
  assumes odd_even_add: "\<not> 2 dvd a \<Longrightarrow> \<not> 2 dvd b \<Longrightarrow> 2 dvd a + b"
haftmann@58787
    17
  assumes even_multD: "2 dvd a * b \<Longrightarrow> 2 dvd a \<or> 2 dvd b"
haftmann@58787
    18
  assumes odd_ex_decrement: "\<not> 2 dvd a \<Longrightarrow> \<exists>b. a = b + 1"
haftmann@54227
    19
begin
wenzelm@21256
    20
haftmann@59816
    21
subclass semiring_numeral ..
haftmann@59816
    22
haftmann@58740
    23
abbreviation even :: "'a \<Rightarrow> bool"
haftmann@54228
    24
where
haftmann@58740
    25
  "even a \<equiv> 2 dvd a"
haftmann@54228
    26
haftmann@58678
    27
abbreviation odd :: "'a \<Rightarrow> bool"
haftmann@58678
    28
where
haftmann@58740
    29
  "odd a \<equiv> \<not> 2 dvd a"
haftmann@58678
    30
haftmann@58787
    31
lemma even_zero [simp]:
haftmann@58787
    32
  "even 0"
haftmann@58787
    33
  by (fact dvd_0_right)
haftmann@58787
    34
haftmann@58787
    35
lemma even_plus_one_iff [simp]:
haftmann@58787
    36
  "even (a + 1) \<longleftrightarrow> odd a"
haftmann@58787
    37
  by (auto simp add: dvd_add_right_iff intro: odd_even_add)
haftmann@58787
    38
haftmann@58690
    39
lemma evenE [elim?]:
haftmann@58690
    40
  assumes "even a"
haftmann@58690
    41
  obtains b where "a = 2 * b"
haftmann@58740
    42
  using assms by (rule dvdE)
haftmann@58690
    43
haftmann@58681
    44
lemma oddE [elim?]:
haftmann@58680
    45
  assumes "odd a"
haftmann@58680
    46
  obtains b where "a = 2 * b + 1"
haftmann@58787
    47
proof -
haftmann@58787
    48
  from assms obtain b where *: "a = b + 1"
haftmann@58787
    49
    by (blast dest: odd_ex_decrement)
haftmann@58787
    50
  with assms have "even (b + 2)" by simp
haftmann@58787
    51
  then have "even b" by simp
haftmann@58787
    52
  then obtain c where "b = 2 * c" ..
haftmann@58787
    53
  with * have "a = 2 * c + 1" by simp
haftmann@58787
    54
  with that show thesis .
haftmann@58787
    55
qed
haftmann@58787
    56
 
haftmann@58770
    57
lemma even_times_iff [simp]:
haftmann@58678
    58
  "even (a * b) \<longleftrightarrow> even a \<or> even b"
haftmann@58787
    59
  by (auto dest: even_multD)
haftmann@58678
    60
haftmann@58678
    61
lemma even_numeral [simp]:
haftmann@58678
    62
  "even (numeral (Num.Bit0 n))"
haftmann@58678
    63
proof -
haftmann@58678
    64
  have "even (2 * numeral n)"
haftmann@58740
    65
    unfolding even_times_iff by simp
haftmann@58678
    66
  then have "even (numeral n + numeral n)"
haftmann@58678
    67
    unfolding mult_2 .
haftmann@58678
    68
  then show ?thesis
haftmann@58678
    69
    unfolding numeral.simps .
haftmann@58678
    70
qed
haftmann@58678
    71
haftmann@58678
    72
lemma odd_numeral [simp]:
haftmann@58678
    73
  "odd (numeral (Num.Bit1 n))"
haftmann@58678
    74
proof
haftmann@58678
    75
  assume "even (numeral (num.Bit1 n))"
haftmann@58678
    76
  then have "even (numeral n + numeral n + 1)"
haftmann@58678
    77
    unfolding numeral.simps .
haftmann@58678
    78
  then have "even (2 * numeral n + 1)"
haftmann@58678
    79
    unfolding mult_2 .
haftmann@58678
    80
  then have "2 dvd numeral n * 2 + 1"
haftmann@58740
    81
    by (simp add: ac_simps)
haftmann@58678
    82
  with dvd_add_times_triv_left_iff [of 2 "numeral n" 1]
haftmann@58678
    83
    have "2 dvd 1"
haftmann@58678
    84
    by simp
haftmann@58678
    85
  then show False by simp
haftmann@58678
    86
qed
haftmann@58678
    87
haftmann@58680
    88
lemma even_add [simp]:
haftmann@58680
    89
  "even (a + b) \<longleftrightarrow> (even a \<longleftrightarrow> even b)"
haftmann@58787
    90
  by (auto simp add: dvd_add_right_iff dvd_add_left_iff odd_even_add)
haftmann@58680
    91
haftmann@58680
    92
lemma odd_add [simp]:
haftmann@58680
    93
  "odd (a + b) \<longleftrightarrow> (\<not> (odd a \<longleftrightarrow> odd b))"
haftmann@58680
    94
  by simp
haftmann@58680
    95
haftmann@58770
    96
lemma even_power [simp]:
haftmann@58771
    97
  "even (a ^ n) \<longleftrightarrow> even a \<and> n > 0"
haftmann@58680
    98
  by (induct n) auto
haftmann@58680
    99
haftmann@58678
   100
end
haftmann@58678
   101
haftmann@59816
   102
class ring_parity = ring + semiring_parity
haftmann@58679
   103
begin
haftmann@58679
   104
haftmann@59816
   105
subclass comm_ring_1 ..
haftmann@59816
   106
haftmann@58770
   107
lemma even_minus [simp]:
haftmann@58679
   108
  "even (- a) \<longleftrightarrow> even a"
haftmann@58740
   109
  by (fact dvd_minus_iff)
haftmann@58679
   110
haftmann@58680
   111
lemma even_diff [simp]:
haftmann@58680
   112
  "even (a - b) \<longleftrightarrow> even (a + b)"
haftmann@58680
   113
  using even_add [of a "- b"] by simp
haftmann@58680
   114
haftmann@58679
   115
end
haftmann@58679
   116
haftmann@58710
   117
wenzelm@60758
   118
subsection \<open>Instances for @{typ nat} and @{typ int}\<close>
haftmann@58787
   119
haftmann@58787
   120
lemma even_Suc_Suc_iff [simp]:
haftmann@60343
   121
  "2 dvd Suc (Suc n) \<longleftrightarrow> 2 dvd n"
haftmann@58787
   122
  using dvd_add_triv_right_iff [of 2 n] by simp
haftmann@58687
   123
haftmann@58770
   124
lemma even_Suc [simp]:
haftmann@60343
   125
  "2 dvd Suc n \<longleftrightarrow> \<not> 2 dvd n"
haftmann@58787
   126
  by (induct n) auto
haftmann@58787
   127
haftmann@58787
   128
lemma even_diff_nat [simp]:
haftmann@58787
   129
  fixes m n :: nat
haftmann@60343
   130
  shows "2 dvd (m - n) \<longleftrightarrow> m < n \<or> 2 dvd (m + n)"
haftmann@58787
   131
proof (cases "n \<le> m")
haftmann@58787
   132
  case True
haftmann@58787
   133
  then have "m - n + n * 2 = m + n" by (simp add: mult_2_right)
haftmann@60343
   134
  moreover have "2 dvd (m - n) \<longleftrightarrow> 2 dvd (m - n + n * 2)" by simp
haftmann@60343
   135
  ultimately have "2 dvd (m - n) \<longleftrightarrow> 2 dvd (m + n)" by (simp only:)
haftmann@58787
   136
  then show ?thesis by auto
haftmann@58787
   137
next
haftmann@58787
   138
  case False
haftmann@58787
   139
  then show ?thesis by simp
haftmann@58787
   140
qed 
haftmann@58787
   141
  
haftmann@58787
   142
instance nat :: semiring_parity
haftmann@58787
   143
proof
haftmann@60343
   144
  show "\<not> 2 dvd (1 :: nat)"
haftmann@58787
   145
    by (rule notI, erule dvdE) simp
haftmann@58787
   146
next
haftmann@58787
   147
  fix m n :: nat
haftmann@60343
   148
  assume "\<not> 2 dvd m"
haftmann@60343
   149
  moreover assume "\<not> 2 dvd n"
haftmann@60343
   150
  ultimately have *: "2 dvd Suc m \<and> 2 dvd Suc n"
haftmann@58787
   151
    by simp
haftmann@60343
   152
  then have "2 dvd (Suc m + Suc n)"
haftmann@58787
   153
    by (blast intro: dvd_add)
haftmann@58787
   154
  also have "Suc m + Suc n = m + n + 2"
haftmann@58787
   155
    by simp
haftmann@60343
   156
  finally show "2 dvd (m + n)"
haftmann@58787
   157
    using dvd_add_triv_right_iff [of 2 "m + n"] by simp
haftmann@58787
   158
next
haftmann@58787
   159
  fix m n :: nat
haftmann@60343
   160
  assume *: "2 dvd (m * n)"
haftmann@60343
   161
  show "2 dvd m \<or> 2 dvd n"
haftmann@58787
   162
  proof (rule disjCI)
haftmann@60343
   163
    assume "\<not> 2 dvd n"
haftmann@60343
   164
    then have "2 dvd (Suc n)" by simp
haftmann@58787
   165
    then obtain r where "Suc n = 2 * r" ..
haftmann@58787
   166
    moreover from * obtain s where "m * n = 2 * s" ..
haftmann@58787
   167
    then have "2 * s + m = m * Suc n" by simp
haftmann@58787
   168
    ultimately have " 2 * s + m = 2 * (m * r)" by (simp add: algebra_simps)
haftmann@58787
   169
    then have "m = 2 * (m * r - s)" by simp
haftmann@60343
   170
    then show "2 dvd m" ..
haftmann@58787
   171
  qed
haftmann@58787
   172
next
haftmann@58787
   173
  fix n :: nat
haftmann@60343
   174
  assume "\<not> 2 dvd n"
haftmann@58787
   175
  then show "\<exists>m. n = m + 1"
haftmann@58787
   176
    by (cases n) simp_all
haftmann@58787
   177
qed
haftmann@58687
   178
haftmann@58689
   179
lemma odd_pos: 
haftmann@58689
   180
  "odd (n :: nat) \<Longrightarrow> 0 < n"
haftmann@58690
   181
  by (auto elim: oddE)
haftmann@60343
   182
haftmann@62597
   183
lemma Suc_double_not_eq_double:
haftmann@62597
   184
  fixes m n :: nat
haftmann@62597
   185
  shows "Suc (2 * m) \<noteq> 2 * n"
haftmann@62597
   186
proof
haftmann@62597
   187
  assume "Suc (2 * m) = 2 * n"
haftmann@62597
   188
  moreover have "odd (Suc (2 * m))" and "even (2 * n)"
haftmann@62597
   189
    by simp_all
haftmann@62597
   190
  ultimately show False by simp
haftmann@62597
   191
qed
haftmann@62597
   192
haftmann@62597
   193
lemma double_not_eq_Suc_double:
haftmann@62597
   194
  fixes m n :: nat
haftmann@62597
   195
  shows "2 * m \<noteq> Suc (2 * n)"
haftmann@62597
   196
  using Suc_double_not_eq_double [of n m] by simp
haftmann@62597
   197
haftmann@60343
   198
lemma even_diff_iff [simp]:
haftmann@60343
   199
  fixes k l :: int
haftmann@60343
   200
  shows "2 dvd (k - l) \<longleftrightarrow> 2 dvd (k + l)"
haftmann@60343
   201
  using dvd_add_times_triv_right_iff [of 2 "k - l" l] by (simp add: mult_2_right)
haftmann@60343
   202
haftmann@60343
   203
lemma even_abs_add_iff [simp]:
haftmann@60343
   204
  fixes k l :: int
haftmann@60343
   205
  shows "2 dvd (\<bar>k\<bar> + l) \<longleftrightarrow> 2 dvd (k + l)"
haftmann@60343
   206
  by (cases "k \<ge> 0") (simp_all add: ac_simps)
haftmann@60343
   207
haftmann@60343
   208
lemma even_add_abs_iff [simp]:
haftmann@60343
   209
  fixes k l :: int
haftmann@60343
   210
  shows "2 dvd (k + \<bar>l\<bar>) \<longleftrightarrow> 2 dvd (k + l)"
haftmann@60343
   211
  using even_abs_add_iff [of l k] by (simp add: ac_simps)
haftmann@60343
   212
haftmann@60867
   213
lemma odd_Suc_minus_one [simp]:
haftmann@60867
   214
  "odd n \<Longrightarrow> Suc (n - Suc 0) = n"
haftmann@60867
   215
  by (auto elim: oddE)
haftmann@60867
   216
haftmann@58787
   217
instance int :: ring_parity
haftmann@58787
   218
proof
haftmann@60343
   219
  show "\<not> 2 dvd (1 :: int)" by (simp add: dvd_int_unfold_dvd_nat)
haftmann@58787
   220
  fix k l :: int
haftmann@60343
   221
  assume "\<not> 2 dvd k"
haftmann@60343
   222
  moreover assume "\<not> 2 dvd l"
haftmann@60343
   223
  ultimately have "2 dvd (nat \<bar>k\<bar> + nat \<bar>l\<bar>)" 
haftmann@58787
   224
    by (auto simp add: dvd_int_unfold_dvd_nat intro: odd_even_add)
haftmann@60343
   225
  then have "2 dvd (\<bar>k\<bar> + \<bar>l\<bar>)"
haftmann@58787
   226
    by (simp add: dvd_int_unfold_dvd_nat nat_add_distrib)
haftmann@60343
   227
  then show "2 dvd (k + l)"
haftmann@58787
   228
    by simp
haftmann@58787
   229
next
haftmann@58787
   230
  fix k l :: int
haftmann@60343
   231
  assume "2 dvd (k * l)"
haftmann@60343
   232
  then show "2 dvd k \<or> 2 dvd l"
haftmann@58787
   233
    by (simp add: dvd_int_unfold_dvd_nat even_multD nat_abs_mult_distrib)
haftmann@58787
   234
next
haftmann@58787
   235
  fix k :: int
haftmann@58787
   236
  have "k = (k - 1) + 1" by simp
haftmann@58787
   237
  then show "\<exists>l. k = l + 1" ..
haftmann@58787
   238
qed
haftmann@58680
   239
haftmann@58787
   240
lemma even_int_iff [simp]:
haftmann@58679
   241
  "even (int n) \<longleftrightarrow> even n"
haftmann@58740
   242
  by (simp add: dvd_int_iff)
haftmann@33318
   243
haftmann@58687
   244
lemma even_nat_iff:
haftmann@58687
   245
  "0 \<le> k \<Longrightarrow> even (nat k) \<longleftrightarrow> even k"
haftmann@58687
   246
  by (simp add: even_int_iff [symmetric])
haftmann@58687
   247
haftmann@58687
   248
wenzelm@60758
   249
subsection \<open>Parity and powers\<close>
haftmann@58689
   250
eberlm@61531
   251
context ring_1
haftmann@58689
   252
begin
haftmann@58689
   253
haftmann@58689
   254
lemma power_minus_even [simp]:
haftmann@58689
   255
  "even n \<Longrightarrow> (- a) ^ n = a ^ n"
haftmann@58690
   256
  by (auto elim: evenE)
haftmann@58689
   257
haftmann@58689
   258
lemma power_minus_odd [simp]:
haftmann@58689
   259
  "odd n \<Longrightarrow> (- a) ^ n = - (a ^ n)"
haftmann@58690
   260
  by (auto elim: oddE)
haftmann@58690
   261
haftmann@58689
   262
lemma neg_one_even_power [simp]:
haftmann@58689
   263
  "even n \<Longrightarrow> (- 1) ^ n = 1"
haftmann@58690
   264
  by simp
haftmann@58689
   265
haftmann@58689
   266
lemma neg_one_odd_power [simp]:
haftmann@58689
   267
  "odd n \<Longrightarrow> (- 1) ^ n = - 1"
haftmann@58690
   268
  by simp
haftmann@58689
   269
haftmann@58689
   270
end  
haftmann@58689
   271
haftmann@58689
   272
context linordered_idom
haftmann@58689
   273
begin
haftmann@58689
   274
haftmann@58689
   275
lemma zero_le_even_power:
haftmann@58689
   276
  "even n \<Longrightarrow> 0 \<le> a ^ n"
haftmann@58690
   277
  by (auto elim: evenE)
haftmann@58689
   278
haftmann@58689
   279
lemma zero_le_odd_power:
haftmann@58689
   280
  "odd n \<Longrightarrow> 0 \<le> a ^ n \<longleftrightarrow> 0 \<le> a"
haftmann@58689
   281
  by (auto simp add: power_even_eq zero_le_mult_iff elim: oddE)
haftmann@58689
   282
haftmann@58770
   283
lemma zero_le_power_eq:
haftmann@58689
   284
  "0 \<le> a ^ n \<longleftrightarrow> even n \<or> odd n \<and> 0 \<le> a"
haftmann@58787
   285
  by (auto simp add: zero_le_even_power zero_le_odd_power)
haftmann@58787
   286
  
haftmann@58770
   287
lemma zero_less_power_eq:
haftmann@58689
   288
  "0 < a ^ n \<longleftrightarrow> n = 0 \<or> even n \<and> a \<noteq> 0 \<or> odd n \<and> 0 < a"
haftmann@58689
   289
proof -
haftmann@58689
   290
  have [simp]: "0 = a ^ n \<longleftrightarrow> a = 0 \<and> n > 0"
haftmann@58787
   291
    unfolding power_eq_0_iff [of a n, symmetric] by blast
haftmann@58689
   292
  show ?thesis
haftmann@58710
   293
  unfolding less_le zero_le_power_eq by auto
haftmann@58689
   294
qed
haftmann@58689
   295
haftmann@58787
   296
lemma power_less_zero_eq [simp]:
haftmann@58689
   297
  "a ^ n < 0 \<longleftrightarrow> odd n \<and> a < 0"
haftmann@58689
   298
  unfolding not_le [symmetric] zero_le_power_eq by auto
haftmann@58689
   299
  
haftmann@58770
   300
lemma power_le_zero_eq:
haftmann@58689
   301
  "a ^ n \<le> 0 \<longleftrightarrow> n > 0 \<and> (odd n \<and> a \<le> 0 \<or> even n \<and> a = 0)"
haftmann@58689
   302
  unfolding not_less [symmetric] zero_less_power_eq by auto 
haftmann@58689
   303
haftmann@58689
   304
lemma power_even_abs:
haftmann@58689
   305
  "even n \<Longrightarrow> \<bar>a\<bar> ^ n = a ^ n"
haftmann@58689
   306
  using power_abs [of a n] by (simp add: zero_le_even_power)
haftmann@58689
   307
haftmann@58689
   308
lemma power_mono_even:
haftmann@58689
   309
  assumes "even n" and "\<bar>a\<bar> \<le> \<bar>b\<bar>"
haftmann@58689
   310
  shows "a ^ n \<le> b ^ n"
haftmann@58689
   311
proof -
haftmann@58689
   312
  have "0 \<le> \<bar>a\<bar>" by auto
wenzelm@60758
   313
  with \<open>\<bar>a\<bar> \<le> \<bar>b\<bar>\<close>
haftmann@58689
   314
  have "\<bar>a\<bar> ^ n \<le> \<bar>b\<bar> ^ n" by (rule power_mono)
wenzelm@60758
   315
  with \<open>even n\<close> show ?thesis by (simp add: power_even_abs)  
haftmann@58689
   316
qed
haftmann@58689
   317
haftmann@58689
   318
lemma power_mono_odd:
haftmann@58689
   319
  assumes "odd n" and "a \<le> b"
haftmann@58689
   320
  shows "a ^ n \<le> b ^ n"
haftmann@58689
   321
proof (cases "b < 0")
wenzelm@60758
   322
  case True with \<open>a \<le> b\<close> have "- b \<le> - a" and "0 \<le> - b" by auto
haftmann@58689
   323
  hence "(- b) ^ n \<le> (- a) ^ n" by (rule power_mono)
wenzelm@60758
   324
  with \<open>odd n\<close> show ?thesis by simp
haftmann@58689
   325
next
haftmann@58689
   326
  case False then have "0 \<le> b" by auto
haftmann@58689
   327
  show ?thesis
haftmann@58689
   328
  proof (cases "a < 0")
wenzelm@60758
   329
    case True then have "n \<noteq> 0" and "a \<le> 0" using \<open>odd n\<close> [THEN odd_pos] by auto
wenzelm@60758
   330
    then have "a ^ n \<le> 0" unfolding power_le_zero_eq using \<open>odd n\<close> by auto
haftmann@58689
   331
    moreover
wenzelm@60758
   332
    from \<open>0 \<le> b\<close> have "0 \<le> b ^ n" by auto
haftmann@58689
   333
    ultimately show ?thesis by auto
haftmann@58689
   334
  next
haftmann@58689
   335
    case False then have "0 \<le> a" by auto
wenzelm@60758
   336
    with \<open>a \<le> b\<close> show ?thesis using power_mono by auto
haftmann@58689
   337
  qed
haftmann@58689
   338
qed
hoelzl@62083
   339
hoelzl@62083
   340
lemma (in comm_ring_1) uminus_power_if: "(- x) ^ n = (if even n then x^n else - (x ^ n))"
hoelzl@62083
   341
  by auto
hoelzl@62083
   342
wenzelm@60758
   343
text \<open>Simplify, when the exponent is a numeral\<close>
haftmann@58689
   344
haftmann@58689
   345
lemma zero_le_power_eq_numeral [simp]:
haftmann@58689
   346
  "0 \<le> a ^ numeral w \<longleftrightarrow> even (numeral w :: nat) \<or> odd (numeral w :: nat) \<and> 0 \<le> a"
haftmann@58689
   347
  by (fact zero_le_power_eq)
haftmann@58689
   348
haftmann@58689
   349
lemma zero_less_power_eq_numeral [simp]:
haftmann@58689
   350
  "0 < a ^ numeral w \<longleftrightarrow> numeral w = (0 :: nat)
haftmann@58689
   351
    \<or> even (numeral w :: nat) \<and> a \<noteq> 0 \<or> odd (numeral w :: nat) \<and> 0 < a"
haftmann@58689
   352
  by (fact zero_less_power_eq)
haftmann@58689
   353
haftmann@58689
   354
lemma power_le_zero_eq_numeral [simp]:
haftmann@58689
   355
  "a ^ numeral w \<le> 0 \<longleftrightarrow> (0 :: nat) < numeral w
haftmann@58689
   356
    \<and> (odd (numeral w :: nat) \<and> a \<le> 0 \<or> even (numeral w :: nat) \<and> a = 0)"
haftmann@58689
   357
  by (fact power_le_zero_eq)
haftmann@58689
   358
haftmann@58689
   359
lemma power_less_zero_eq_numeral [simp]:
haftmann@58689
   360
  "a ^ numeral w < 0 \<longleftrightarrow> odd (numeral w :: nat) \<and> a < 0"
haftmann@58689
   361
  by (fact power_less_zero_eq)
haftmann@58689
   362
haftmann@58689
   363
lemma power_even_abs_numeral [simp]:
haftmann@58689
   364
  "even (numeral w :: nat) \<Longrightarrow> \<bar>a\<bar> ^ numeral w = a ^ numeral w"
haftmann@58689
   365
  by (fact power_even_abs)
haftmann@58689
   366
haftmann@58689
   367
end
haftmann@58689
   368
haftmann@58689
   369
wenzelm@60758
   370
subsubsection \<open>Tools setup\<close>
haftmann@58687
   371
haftmann@58679
   372
declare transfer_morphism_int_nat [transfer add return:
haftmann@58679
   373
  even_int_iff
haftmann@33318
   374
]
wenzelm@21256
   375
haftmann@58770
   376
end