src/HOL/Library/Commutative_Ring.thy
author wenzelm
Fri Sep 22 13:04:30 2006 +0200 (2006-09-22)
changeset 20678 f6d602833557
parent 20622 e1a573146be5
child 21256 47195501ecf7
permissions -rw-r--r--
tuned proofs;
wenzelm@17516
     1
(*  ID:         $Id$
wenzelm@17516
     2
    Author:     Bernhard Haeupler
wenzelm@17516
     3
wenzelm@17516
     4
Proving equalities in commutative rings done "right" in Isabelle/HOL.
wenzelm@17516
     5
*)
wenzelm@17516
     6
wenzelm@17516
     7
header {* Proving equalities in commutative rings *}
wenzelm@17516
     8
wenzelm@17516
     9
theory Commutative_Ring
wenzelm@17516
    10
imports Main
wenzelm@17516
    11
uses ("comm_ring.ML")
wenzelm@17516
    12
begin
wenzelm@17516
    13
wenzelm@17516
    14
text {* Syntax of multivariate polynomials (pol) and polynomial expressions. *}
wenzelm@17516
    15
wenzelm@17516
    16
datatype 'a pol =
wenzelm@17516
    17
    Pc 'a
wenzelm@17516
    18
  | Pinj nat "'a pol"
wenzelm@17516
    19
  | PX "'a pol" nat "'a pol"
wenzelm@17516
    20
wenzelm@17516
    21
datatype 'a polex =
wenzelm@20622
    22
    Pol "'a pol"
wenzelm@17516
    23
  | Add "'a polex" "'a polex"
wenzelm@17516
    24
  | Sub "'a polex" "'a polex"
wenzelm@17516
    25
  | Mul "'a polex" "'a polex"
wenzelm@17516
    26
  | Pow "'a polex" nat
wenzelm@17516
    27
  | Neg "'a polex"
wenzelm@17516
    28
wenzelm@17516
    29
text {* Interpretation functions for the shadow syntax. *}
wenzelm@17516
    30
wenzelm@17516
    31
consts
wenzelm@17516
    32
  Ipol :: "'a::{comm_ring,recpower} list \<Rightarrow> 'a pol \<Rightarrow> 'a"
wenzelm@17516
    33
  Ipolex :: "'a::{comm_ring,recpower} list \<Rightarrow> 'a polex \<Rightarrow> 'a"
wenzelm@17516
    34
wenzelm@17516
    35
primrec
wenzelm@17516
    36
  "Ipol l (Pc c) = c"
wenzelm@17516
    37
  "Ipol l (Pinj i P) = Ipol (drop i l) P"
wenzelm@17516
    38
  "Ipol l (PX P x Q) = Ipol l P * (hd l)^x + Ipol (drop 1 l) Q"
wenzelm@17516
    39
wenzelm@17516
    40
primrec
wenzelm@17516
    41
  "Ipolex l (Pol P) = Ipol l P"
wenzelm@17516
    42
  "Ipolex l (Add P Q) = Ipolex l P + Ipolex l Q"
wenzelm@17516
    43
  "Ipolex l (Sub P Q) = Ipolex l P - Ipolex l Q"
wenzelm@17516
    44
  "Ipolex l (Mul P Q) = Ipolex l P * Ipolex l Q"
wenzelm@17516
    45
  "Ipolex l (Pow p n) = Ipolex l p ^ n"
wenzelm@17516
    46
  "Ipolex l (Neg P) = - Ipolex l P"
wenzelm@17516
    47
wenzelm@17516
    48
text {* Create polynomial normalized polynomials given normalized inputs. *}
wenzelm@17516
    49
wenzelm@19736
    50
definition
wenzelm@17516
    51
  mkPinj :: "nat \<Rightarrow> 'a pol \<Rightarrow> 'a pol"
wenzelm@19736
    52
  "mkPinj x P = (case P of
wenzelm@17516
    53
    Pc c \<Rightarrow> Pc c |
wenzelm@17516
    54
    Pinj y P \<Rightarrow> Pinj (x + y) P |
wenzelm@17516
    55
    PX p1 y p2 \<Rightarrow> Pinj x P)"
wenzelm@17516
    56
wenzelm@19736
    57
definition
wenzelm@17516
    58
  mkPX :: "'a::{comm_ring,recpower} pol \<Rightarrow> nat \<Rightarrow> 'a pol \<Rightarrow> 'a pol"
wenzelm@19736
    59
  "mkPX P i Q = (case P of
wenzelm@17516
    60
    Pc c \<Rightarrow> (if (c = 0) then (mkPinj 1 Q) else (PX P i Q)) |
wenzelm@17516
    61
    Pinj j R \<Rightarrow> PX P i Q |
wenzelm@17516
    62
    PX P2 i2 Q2 \<Rightarrow> (if (Q2 = (Pc 0)) then (PX P2 (i+i2) Q) else (PX P i Q)) )"
wenzelm@17516
    63
wenzelm@17516
    64
text {* Defining the basic ring operations on normalized polynomials *}
wenzelm@17516
    65
wenzelm@17516
    66
consts
wenzelm@17516
    67
  add :: "'a::{comm_ring,recpower} pol \<times> 'a pol \<Rightarrow> 'a pol"
wenzelm@17516
    68
  mul :: "'a::{comm_ring,recpower} pol \<times> 'a pol \<Rightarrow> 'a pol"
wenzelm@17516
    69
  neg :: "'a::{comm_ring,recpower} pol \<Rightarrow> 'a pol"
wenzelm@17516
    70
  sqr :: "'a::{comm_ring,recpower} pol \<Rightarrow> 'a pol"
wenzelm@17516
    71
  pow :: "'a::{comm_ring,recpower} pol \<times> nat \<Rightarrow> 'a pol"
wenzelm@17516
    72
wenzelm@17516
    73
text {* Addition *}
wenzelm@17516
    74
recdef add "measure (\<lambda>(x, y). size x + size y)"
wenzelm@17516
    75
  "add (Pc a, Pc b) = Pc (a + b)"
wenzelm@17516
    76
  "add (Pc c, Pinj i P) = Pinj i (add (P, Pc c))"
wenzelm@17516
    77
  "add (Pinj i P, Pc c) = Pinj i (add (P, Pc c))"
wenzelm@17516
    78
  "add (Pc c, PX P i Q) = PX P i (add (Q, Pc c))"
wenzelm@17516
    79
  "add (PX P i Q, Pc c) = PX P i (add (Q, Pc c))"
wenzelm@17516
    80
  "add (Pinj x P, Pinj y Q) =
wenzelm@17516
    81
  (if x=y then mkPinj x (add (P, Q))
wenzelm@17516
    82
   else (if x>y then mkPinj y (add (Pinj (x-y) P, Q))
wenzelm@17516
    83
         else mkPinj x (add (Pinj (y-x) Q, P)) ))"
wenzelm@17516
    84
  "add (Pinj x P, PX Q y R) =
wenzelm@17516
    85
  (if x=0 then add(P, PX Q y R)
wenzelm@17516
    86
   else (if x=1 then PX Q y (add (R, P))
wenzelm@17516
    87
         else PX Q y (add (R, Pinj (x - 1) P))))"
wenzelm@17516
    88
  "add (PX P x R, Pinj y Q) =
wenzelm@17516
    89
  (if y=0 then add(PX P x R, Q)
wenzelm@17516
    90
   else (if y=1 then PX P x (add (R, Q))
wenzelm@17516
    91
         else PX P x (add (R, Pinj (y - 1) Q))))"
wenzelm@17516
    92
  "add (PX P1 x P2, PX Q1 y Q2) =
wenzelm@17516
    93
  (if x=y then mkPX (add (P1, Q1)) x (add (P2, Q2))
wenzelm@17516
    94
  else (if x>y then mkPX (add (PX P1 (x-y) (Pc 0), Q1)) y (add (P2,Q2))
wenzelm@17516
    95
        else mkPX (add (PX Q1 (y-x) (Pc 0), P1)) x (add (P2,Q2)) ))"
wenzelm@17516
    96
wenzelm@17516
    97
text {* Multiplication *}
wenzelm@17516
    98
recdef mul "measure (\<lambda>(x, y). size x + size y)"
wenzelm@17516
    99
  "mul (Pc a, Pc b) = Pc (a*b)"
wenzelm@17516
   100
  "mul (Pc c, Pinj i P) = (if c=0 then Pc 0 else mkPinj i (mul (P, Pc c)))"
wenzelm@17516
   101
  "mul (Pinj i P, Pc c) = (if c=0 then Pc 0 else mkPinj i (mul (P, Pc c)))"
wenzelm@17516
   102
  "mul (Pc c, PX P i Q) =
wenzelm@17516
   103
  (if c=0 then Pc 0 else mkPX (mul (P, Pc c)) i (mul (Q, Pc c)))"
wenzelm@17516
   104
  "mul (PX P i Q, Pc c) =
wenzelm@17516
   105
  (if c=0 then Pc 0 else mkPX (mul (P, Pc c)) i (mul (Q, Pc c)))"
wenzelm@17516
   106
  "mul (Pinj x P, Pinj y Q) =
wenzelm@17516
   107
  (if x=y then mkPinj x (mul (P, Q))
wenzelm@17516
   108
   else (if x>y then mkPinj y (mul (Pinj (x-y) P, Q))
wenzelm@17516
   109
         else mkPinj x (mul (Pinj (y-x) Q, P)) ))"
wenzelm@17516
   110
  "mul (Pinj x P, PX Q y R) =
wenzelm@17516
   111
  (if x=0 then mul(P, PX Q y R)
wenzelm@17516
   112
   else (if x=1 then mkPX (mul (Pinj x P, Q)) y (mul (R, P))
wenzelm@17516
   113
         else mkPX (mul (Pinj x P, Q)) y (mul (R, Pinj (x - 1) P))))"
wenzelm@17516
   114
  "mul (PX P x R, Pinj y Q) =
wenzelm@17516
   115
  (if y=0 then mul(PX P x R, Q)
wenzelm@17516
   116
   else (if y=1 then mkPX (mul (Pinj y Q, P)) x (mul (R, Q))
wenzelm@17516
   117
         else mkPX (mul (Pinj y Q, P)) x (mul (R, Pinj (y - 1) Q))))"
wenzelm@17516
   118
  "mul (PX P1 x P2, PX Q1 y Q2) =
wenzelm@17516
   119
  add (mkPX (mul (P1, Q1)) (x+y) (mul (P2, Q2)),
wenzelm@17516
   120
  add (mkPX (mul (P1, mkPinj 1 Q2)) x (Pc 0), mkPX (mul (Q1, mkPinj 1 P2)) y (Pc 0)) )"
wenzelm@17516
   121
(hints simp add: mkPinj_def split: pol.split)
wenzelm@17516
   122
wenzelm@17516
   123
text {* Negation*}
wenzelm@17516
   124
primrec
wenzelm@17516
   125
  "neg (Pc c) = Pc (-c)"
wenzelm@17516
   126
  "neg (Pinj i P) = Pinj i (neg P)"
wenzelm@17516
   127
  "neg (PX P x Q) = PX (neg P) x (neg Q)"
wenzelm@17516
   128
wenzelm@17516
   129
text {* Substraction *}
wenzelm@19736
   130
definition
wenzelm@17516
   131
  sub :: "'a::{comm_ring,recpower} pol \<Rightarrow> 'a pol \<Rightarrow> 'a pol"
wenzelm@19736
   132
  "sub p q = add (p, neg q)"
wenzelm@17516
   133
wenzelm@17516
   134
text {* Square for Fast Exponentation *}
wenzelm@17516
   135
primrec
wenzelm@17516
   136
  "sqr (Pc c) = Pc (c * c)"
wenzelm@17516
   137
  "sqr (Pinj i P) = mkPinj i (sqr P)"
wenzelm@17516
   138
  "sqr (PX A x B) = add (mkPX (sqr A) (x + x) (sqr B),
wenzelm@17516
   139
    mkPX (mul (mul (Pc (1 + 1), A), mkPinj 1 B)) x (Pc 0))"
wenzelm@17516
   140
wenzelm@17516
   141
text {* Fast Exponentation *}
wenzelm@20622
   142
lemma pow_wf: "odd n \<Longrightarrow> (n::nat) div 2 < n" by (cases n) auto
wenzelm@17516
   143
recdef pow "measure (\<lambda>(x, y). y)"
wenzelm@17516
   144
  "pow (p, 0) = Pc 1"
wenzelm@17516
   145
  "pow (p, n) = (if even n then (pow (sqr p, n div 2)) else mul (p, pow (sqr p, n div 2)))"
wenzelm@17516
   146
(hints simp add: pow_wf)
wenzelm@17516
   147
wenzelm@17516
   148
lemma pow_if:
wenzelm@17516
   149
  "pow (p,n) =
wenzelm@17516
   150
   (if n = 0 then Pc 1 else if even n then pow (sqr p, n div 2)
wenzelm@17516
   151
    else mul (p, pow (sqr p, n div 2)))"
wenzelm@17516
   152
  by (cases n) simp_all
wenzelm@17516
   153
wenzelm@17516
   154
(*
wenzelm@17516
   155
lemma number_of_nat_B0: "(number_of (w BIT bit.B0) ::nat) = 2* (number_of w)"
wenzelm@17516
   156
by simp
wenzelm@17516
   157
wenzelm@17516
   158
lemma number_of_nat_even: "even (number_of (w BIT bit.B0)::nat)"
wenzelm@17516
   159
by simp
wenzelm@17516
   160
wenzelm@17516
   161
lemma pow_even : "pow (p, number_of(w BIT bit.B0)) = pow (sqr p, number_of w)"
wenzelm@17516
   162
  ( is "pow(?p,?n) = pow (_,?n2)")
wenzelm@17516
   163
proof-
wenzelm@17516
   164
  have "even ?n" by simp
wenzelm@17516
   165
  hence "pow (p, ?n) = pow (sqr p, ?n div 2)"
wenzelm@17516
   166
    apply simp
wenzelm@17516
   167
    apply (cases "IntDef.neg (number_of w)")
wenzelm@17516
   168
    apply simp
wenzelm@17516
   169
    done
wenzelm@17516
   170
*)
wenzelm@17516
   171
wenzelm@17516
   172
text {* Normalization of polynomial expressions *}
wenzelm@17516
   173
wenzelm@17516
   174
consts norm :: "'a::{comm_ring,recpower} polex \<Rightarrow> 'a pol"
wenzelm@17516
   175
primrec
wenzelm@17516
   176
  "norm (Pol P) = P"
wenzelm@17516
   177
  "norm (Add P Q) = add (norm P, norm Q)"
wenzelm@17516
   178
  "norm (Sub p q) = sub (norm p) (norm q)"
wenzelm@17516
   179
  "norm (Mul P Q) = mul (norm P, norm Q)"
wenzelm@17516
   180
  "norm (Pow p n) = pow (norm p, n)"
wenzelm@17516
   181
  "norm (Neg P) = neg (norm P)"
wenzelm@17516
   182
wenzelm@17516
   183
text {* mkPinj preserve semantics *}
wenzelm@17516
   184
lemma mkPinj_ci: "Ipol l (mkPinj a B) = Ipol l (Pinj a B)"
wenzelm@17516
   185
  by (induct B) (auto simp add: mkPinj_def ring_eq_simps)
wenzelm@17516
   186
wenzelm@17516
   187
text {* mkPX preserves semantics *}
wenzelm@17516
   188
lemma mkPX_ci: "Ipol l (mkPX A b C) = Ipol l (PX A b C)"
wenzelm@17516
   189
  by (cases A) (auto simp add: mkPX_def mkPinj_ci power_add ring_eq_simps)
wenzelm@17516
   190
wenzelm@17516
   191
text {* Correctness theorems for the implemented operations *}
wenzelm@17516
   192
wenzelm@17516
   193
text {* Negation *}
wenzelm@20622
   194
lemma neg_ci: "Ipol l (neg P) = -(Ipol l P)"
wenzelm@20622
   195
  by (induct P arbitrary: l) auto
wenzelm@17516
   196
wenzelm@17516
   197
text {* Addition *}
wenzelm@20622
   198
lemma add_ci: "Ipol l (add (P, Q)) = Ipol l P + Ipol l Q"
wenzelm@20622
   199
proof (induct P Q arbitrary: l rule: add.induct)
wenzelm@17516
   200
  case (6 x P y Q)
wenzelm@17516
   201
  show ?case
wenzelm@17516
   202
  proof (rule linorder_cases)
wenzelm@17516
   203
    assume "x < y"
wenzelm@17516
   204
    with 6 show ?case by (simp add: mkPinj_ci ring_eq_simps)
wenzelm@17516
   205
  next
wenzelm@17516
   206
    assume "x = y"
wenzelm@17516
   207
    with 6 show ?case by (simp add: mkPinj_ci)
wenzelm@17516
   208
  next
wenzelm@17516
   209
    assume "x > y"
wenzelm@17516
   210
    with 6 show ?case by (simp add: mkPinj_ci ring_eq_simps)
wenzelm@17516
   211
  qed
wenzelm@17516
   212
next
wenzelm@17516
   213
  case (7 x P Q y R)
wenzelm@17516
   214
  have "x = 0 \<or> x = 1 \<or> x > 1" by arith
wenzelm@17516
   215
  moreover
wenzelm@17516
   216
  { assume "x = 0" with 7 have ?case by simp }
wenzelm@17516
   217
  moreover
wenzelm@17516
   218
  { assume "x = 1" with 7 have ?case by (simp add: ring_eq_simps) }
wenzelm@17516
   219
  moreover
wenzelm@17516
   220
  { assume "x > 1" from 7 have ?case by (cases x) simp_all }
wenzelm@17516
   221
  ultimately show ?case by blast
wenzelm@17516
   222
next
wenzelm@17516
   223
  case (8 P x R y Q)
wenzelm@17516
   224
  have "y = 0 \<or> y = 1 \<or> y > 1" by arith
wenzelm@17516
   225
  moreover
wenzelm@17516
   226
  { assume "y = 0" with 8 have ?case by simp }
wenzelm@17516
   227
  moreover
wenzelm@17516
   228
  { assume "y = 1" with 8 have ?case by simp }
wenzelm@17516
   229
  moreover
wenzelm@17516
   230
  { assume "y > 1" with 8 have ?case by simp }
wenzelm@17516
   231
  ultimately show ?case by blast
wenzelm@17516
   232
next
wenzelm@17516
   233
  case (9 P1 x P2 Q1 y Q2)
wenzelm@17516
   234
  show ?case
wenzelm@17516
   235
  proof (rule linorder_cases)
wenzelm@17516
   236
    assume a: "x < y" hence "EX d. d + x = y" by arith
wenzelm@17516
   237
    with 9 a show ?case by (auto simp add: mkPX_ci power_add ring_eq_simps)
wenzelm@17516
   238
  next
wenzelm@17516
   239
    assume a: "y < x" hence "EX d. d + y = x" by arith
wenzelm@17516
   240
    with 9 a show ?case by (auto simp add: power_add mkPX_ci ring_eq_simps)
wenzelm@17516
   241
  next
wenzelm@17516
   242
    assume "x = y"
wenzelm@17516
   243
    with 9 show ?case by (simp add: mkPX_ci ring_eq_simps)
wenzelm@17516
   244
  qed
wenzelm@17516
   245
qed (auto simp add: ring_eq_simps)
wenzelm@17516
   246
wenzelm@17516
   247
text {* Multiplication *}
wenzelm@20622
   248
lemma mul_ci: "Ipol l (mul (P, Q)) = Ipol l P * Ipol l Q"
wenzelm@20622
   249
  by (induct P Q arbitrary: l rule: mul.induct)
wenzelm@17516
   250
    (simp_all add: mkPX_ci mkPinj_ci ring_eq_simps add_ci power_add)
wenzelm@17516
   251
wenzelm@17516
   252
text {* Substraction *}
wenzelm@17516
   253
lemma sub_ci: "Ipol l (sub p q) = Ipol l p - Ipol l q"
wenzelm@17516
   254
  by (simp add: add_ci neg_ci sub_def)
wenzelm@17516
   255
wenzelm@17516
   256
text {* Square *}
wenzelm@20622
   257
lemma sqr_ci: "Ipol ls (sqr p) = Ipol ls p * Ipol ls p"
wenzelm@20622
   258
  by (induct p arbitrary: ls)
wenzelm@20622
   259
    (simp_all add: add_ci mkPinj_ci mkPX_ci mul_ci ring_eq_simps power_add)
wenzelm@17516
   260
wenzelm@17516
   261
wenzelm@17516
   262
text {* Power *}
wenzelm@20622
   263
lemma even_pow:"even n \<Longrightarrow> pow (p, n) = pow (sqr p, n div 2)"
wenzelm@20622
   264
  by (induct n) simp_all
wenzelm@17516
   265
wenzelm@20622
   266
lemma pow_ci: "Ipol ls (pow (p, n)) = Ipol ls p ^ n"
wenzelm@20622
   267
proof (induct n arbitrary: p rule: nat_less_induct)
wenzelm@17516
   268
  case (1 k)
wenzelm@17516
   269
  show ?case
wenzelm@17516
   270
  proof (cases k)
wenzelm@20622
   271
    case 0
wenzelm@20622
   272
    then show ?thesis by simp
wenzelm@20622
   273
  next
wenzelm@17516
   274
    case (Suc l)
wenzelm@17516
   275
    show ?thesis
wenzelm@17516
   276
    proof cases
wenzelm@20622
   277
      assume "even l"
wenzelm@20622
   278
      then have "Suc l div 2 = l div 2"
wenzelm@20622
   279
        by (simp add: nat_number even_nat_plus_one_div_two)
wenzelm@17516
   280
      moreover
wenzelm@17516
   281
      from Suc have "l < k" by simp
wenzelm@20622
   282
      with 1 have "\<And>p. Ipol ls (pow (p, l)) = Ipol ls p ^ l" by simp
wenzelm@17516
   283
      moreover
wenzelm@20622
   284
      note Suc `even l` even_nat_plus_one_div_two
wenzelm@17516
   285
      ultimately show ?thesis by (auto simp add: mul_ci power_Suc even_pow)
wenzelm@17516
   286
    next
wenzelm@20622
   287
      assume "odd l"
wenzelm@20622
   288
      {
wenzelm@20622
   289
        fix p
wenzelm@20622
   290
        have "Ipol ls (sqr p) ^ (Suc l div 2) = Ipol ls p ^ Suc l"
wenzelm@20622
   291
        proof (cases l)
wenzelm@20622
   292
          case 0
wenzelm@20622
   293
          with `odd l` show ?thesis by simp
wenzelm@20622
   294
        next
wenzelm@20622
   295
          case (Suc w)
wenzelm@20622
   296
          with `odd l` have "even w" by simp
wenzelm@20678
   297
          have two_times: "2 * (w div 2) = w"
wenzelm@20678
   298
            by (simp only: numerals even_nat_div_two_times_two [OF `even w`])
wenzelm@20622
   299
          have "Ipol ls p * Ipol ls p = Ipol ls p ^ Suc (Suc 0)"
wenzelm@20622
   300
            by (simp add: power_Suc)
wenzelm@20678
   301
	  then have "Ipol ls p * Ipol ls p = Ipol ls p ^ 2"
wenzelm@20678
   302
	    by (simp add: numerals)
wenzelm@20622
   303
          with Suc show ?thesis
wenzelm@20678
   304
            by (auto simp add: power_mult [symmetric, of _ 2 _] two_times mul_ci sqr_ci)
wenzelm@20622
   305
        qed
wenzelm@20622
   306
      } with 1 Suc `odd l` show ?thesis by simp
wenzelm@17516
   307
    qed
wenzelm@17516
   308
  qed
wenzelm@17516
   309
qed
wenzelm@17516
   310
wenzelm@17516
   311
text {* Normalization preserves semantics  *}
wenzelm@20622
   312
lemma norm_ci: "Ipolex l Pe = Ipol l (norm Pe)"
wenzelm@17516
   313
  by (induct Pe) (simp_all add: add_ci sub_ci mul_ci neg_ci pow_ci)
wenzelm@17516
   314
wenzelm@17516
   315
text {* Reflection lemma: Key to the (incomplete) decision procedure *}
wenzelm@17516
   316
lemma norm_eq:
wenzelm@20622
   317
  assumes "norm P1 = norm P2"
wenzelm@17516
   318
  shows "Ipolex l P1 = Ipolex l P2"
wenzelm@17516
   319
proof -
wenzelm@20622
   320
  from prems have "Ipol l (norm P1) = Ipol l (norm P2)" by simp
wenzelm@20622
   321
  then show ?thesis by (simp only: norm_ci)
wenzelm@17516
   322
qed
wenzelm@17516
   323
wenzelm@17516
   324
wenzelm@17516
   325
use "comm_ring.ML"
wenzelm@18708
   326
setup CommRing.setup
wenzelm@17516
   327
wenzelm@20678
   328
thm mkPX_def mkPinj_def sub_def power_add even_def pow_if power_add [symmetric]
wenzelm@20678
   329
wenzelm@17516
   330
end