src/HOL/Library/Poly_Deriv.thy
 author huffman Sun Mar 25 20:15:39 2012 +0200 (2012-03-25) changeset 47108 2a1953f0d20d parent 44317 b7e9fa025f15 child 52380 3cc46b8cca5e permissions -rw-r--r--
merged fork with new numeral representation (see NEWS)
 wenzelm@41959 ` 1` ```(* Title: HOL/Library/Poly_Deriv.thy ``` huffman@29985 ` 2` ``` Author: Amine Chaieb ``` wenzelm@41959 ` 3` ``` Author: Brian Huffman ``` huffman@29985 ` 4` ```*) ``` huffman@29985 ` 5` huffman@29985 ` 6` ```header{* Polynomials and Differentiation *} ``` huffman@29985 ` 7` huffman@29985 ` 8` ```theory Poly_Deriv ``` huffman@29985 ` 9` ```imports Deriv Polynomial ``` huffman@29985 ` 10` ```begin ``` huffman@29985 ` 11` huffman@29985 ` 12` ```subsection {* Derivatives of univariate polynomials *} ``` huffman@29985 ` 13` huffman@29985 ` 14` ```definition ``` huffman@29985 ` 15` ``` pderiv :: "'a::real_normed_field poly \ 'a poly" where ``` huffman@29985 ` 16` ``` "pderiv = poly_rec 0 (\a p p'. p + pCons 0 p')" ``` huffman@29985 ` 17` huffman@29985 ` 18` ```lemma pderiv_0 [simp]: "pderiv 0 = 0" ``` huffman@29985 ` 19` ``` unfolding pderiv_def by (simp add: poly_rec_0) ``` huffman@29985 ` 20` huffman@29985 ` 21` ```lemma pderiv_pCons: "pderiv (pCons a p) = p + pCons 0 (pderiv p)" ``` huffman@29985 ` 22` ``` unfolding pderiv_def by (simp add: poly_rec_pCons) ``` huffman@29985 ` 23` huffman@29985 ` 24` ```lemma coeff_pderiv: "coeff (pderiv p) n = of_nat (Suc n) * coeff p (Suc n)" ``` huffman@29985 ` 25` ``` apply (induct p arbitrary: n, simp) ``` huffman@29985 ` 26` ``` apply (simp add: pderiv_pCons coeff_pCons algebra_simps split: nat.split) ``` huffman@29985 ` 27` ``` done ``` huffman@29985 ` 28` huffman@29985 ` 29` ```lemma pderiv_eq_0_iff: "pderiv p = 0 \ degree p = 0" ``` huffman@29985 ` 30` ``` apply (rule iffI) ``` huffman@29985 ` 31` ``` apply (cases p, simp) ``` huffman@29985 ` 32` ``` apply (simp add: expand_poly_eq coeff_pderiv del: of_nat_Suc) ``` huffman@29985 ` 33` ``` apply (simp add: expand_poly_eq coeff_pderiv coeff_eq_0) ``` huffman@29985 ` 34` ``` done ``` huffman@29985 ` 35` huffman@29985 ` 36` ```lemma degree_pderiv: "degree (pderiv p) = degree p - 1" ``` huffman@29985 ` 37` ``` apply (rule order_antisym [OF degree_le]) ``` huffman@29985 ` 38` ``` apply (simp add: coeff_pderiv coeff_eq_0) ``` huffman@29985 ` 39` ``` apply (cases "degree p", simp) ``` huffman@29985 ` 40` ``` apply (rule le_degree) ``` huffman@29985 ` 41` ``` apply (simp add: coeff_pderiv del: of_nat_Suc) ``` huffman@29985 ` 42` ``` apply (rule subst, assumption) ``` huffman@29985 ` 43` ``` apply (rule leading_coeff_neq_0, clarsimp) ``` huffman@29985 ` 44` ``` done ``` huffman@29985 ` 45` huffman@29985 ` 46` ```lemma pderiv_singleton [simp]: "pderiv [:a:] = 0" ``` huffman@29985 ` 47` ```by (simp add: pderiv_pCons) ``` huffman@29985 ` 48` huffman@29985 ` 49` ```lemma pderiv_add: "pderiv (p + q) = pderiv p + pderiv q" ``` huffman@29985 ` 50` ```by (rule poly_ext, simp add: coeff_pderiv algebra_simps) ``` huffman@29985 ` 51` huffman@29985 ` 52` ```lemma pderiv_minus: "pderiv (- p) = - pderiv p" ``` huffman@29985 ` 53` ```by (rule poly_ext, simp add: coeff_pderiv) ``` huffman@29985 ` 54` huffman@29985 ` 55` ```lemma pderiv_diff: "pderiv (p - q) = pderiv p - pderiv q" ``` huffman@29985 ` 56` ```by (rule poly_ext, simp add: coeff_pderiv algebra_simps) ``` huffman@29985 ` 57` huffman@29985 ` 58` ```lemma pderiv_smult: "pderiv (smult a p) = smult a (pderiv p)" ``` huffman@29985 ` 59` ```by (rule poly_ext, simp add: coeff_pderiv algebra_simps) ``` huffman@29985 ` 60` huffman@29985 ` 61` ```lemma pderiv_mult: "pderiv (p * q) = p * pderiv q + q * pderiv p" ``` huffman@29985 ` 62` ```apply (induct p) ``` huffman@29985 ` 63` ```apply simp ``` huffman@29985 ` 64` ```apply (simp add: pderiv_add pderiv_smult pderiv_pCons algebra_simps) ``` huffman@29985 ` 65` ```done ``` huffman@29985 ` 66` huffman@29985 ` 67` ```lemma pderiv_power_Suc: ``` huffman@29985 ` 68` ``` "pderiv (p ^ Suc n) = smult (of_nat (Suc n)) (p ^ n) * pderiv p" ``` huffman@29985 ` 69` ```apply (induct n) ``` huffman@29985 ` 70` ```apply simp ``` huffman@29985 ` 71` ```apply (subst power_Suc) ``` huffman@29985 ` 72` ```apply (subst pderiv_mult) ``` huffman@29985 ` 73` ```apply (erule ssubst) ``` huffman@47108 ` 74` ```apply (simp only: of_nat_Suc smult_add_left smult_1_left) ``` huffman@47108 ` 75` ```apply (simp add: algebra_simps) (* FIXME *) ``` huffman@29985 ` 76` ```done ``` huffman@29985 ` 77` huffman@29985 ` 78` ```lemma DERIV_cmult2: "DERIV f x :> D ==> DERIV (%x. (f x) * c :: real) x :> D * c" ``` huffman@29985 ` 79` ```by (simp add: DERIV_cmult mult_commute [of _ c]) ``` huffman@29985 ` 80` huffman@29985 ` 81` ```lemma DERIV_pow2: "DERIV (%x. x ^ Suc n) x :> real (Suc n) * (x ^ n)" ``` huffman@44317 ` 82` ```by (rule DERIV_cong, rule DERIV_pow, simp) ``` huffman@29985 ` 83` ```declare DERIV_pow2 [simp] DERIV_pow [simp] ``` huffman@29985 ` 84` huffman@29985 ` 85` ```lemma DERIV_add_const: "DERIV f x :> D ==> DERIV (%x. a + f x :: 'a::real_normed_field) x :> D" ``` huffman@44317 ` 86` ```by (rule DERIV_cong, rule DERIV_add, auto) ``` huffman@29985 ` 87` huffman@29985 ` 88` ```lemma poly_DERIV[simp]: "DERIV (%x. poly p x) x :> poly (pderiv p) x" ``` hoelzl@31881 ` 89` ``` by (induct p, auto intro!: DERIV_intros simp add: pderiv_pCons) ``` huffman@29985 ` 90` huffman@29985 ` 91` ```text{* Consequences of the derivative theorem above*} ``` huffman@29985 ` 92` huffman@29985 ` 93` ```lemma poly_differentiable[simp]: "(%x. poly p x) differentiable (x::real)" ``` huffman@29985 ` 94` ```apply (simp add: differentiable_def) ``` huffman@29985 ` 95` ```apply (blast intro: poly_DERIV) ``` huffman@29985 ` 96` ```done ``` huffman@29985 ` 97` huffman@29985 ` 98` ```lemma poly_isCont[simp]: "isCont (%x. poly p x) (x::real)" ``` huffman@29985 ` 99` ```by (rule poly_DERIV [THEN DERIV_isCont]) ``` huffman@29985 ` 100` huffman@29985 ` 101` ```lemma poly_IVT_pos: "[| a < b; poly p (a::real) < 0; 0 < poly p b |] ``` huffman@29985 ` 102` ``` ==> \x. a < x & x < b & (poly p x = 0)" ``` huffman@29985 ` 103` ```apply (cut_tac f = "%x. poly p x" and a = a and b = b and y = 0 in IVT_objl) ``` huffman@29985 ` 104` ```apply (auto simp add: order_le_less) ``` huffman@29985 ` 105` ```done ``` huffman@29985 ` 106` huffman@29985 ` 107` ```lemma poly_IVT_neg: "[| (a::real) < b; 0 < poly p a; poly p b < 0 |] ``` huffman@29985 ` 108` ``` ==> \x. a < x & x < b & (poly p x = 0)" ``` huffman@29985 ` 109` ```by (insert poly_IVT_pos [where p = "- p" ]) simp ``` huffman@29985 ` 110` huffman@29985 ` 111` ```lemma poly_MVT: "(a::real) < b ==> ``` huffman@29985 ` 112` ``` \x. a < x & x < b & (poly p b - poly p a = (b - a) * poly (pderiv p) x)" ``` huffman@29985 ` 113` ```apply (drule_tac f = "poly p" in MVT, auto) ``` huffman@29985 ` 114` ```apply (rule_tac x = z in exI) ``` huffman@29985 ` 115` ```apply (auto simp add: real_mult_left_cancel poly_DERIV [THEN DERIV_unique]) ``` huffman@29985 ` 116` ```done ``` huffman@29985 ` 117` huffman@29985 ` 118` ```text{*Lemmas for Derivatives*} ``` huffman@29985 ` 119` huffman@29985 ` 120` ```lemma order_unique_lemma: ``` huffman@29985 ` 121` ``` fixes p :: "'a::idom poly" ``` huffman@29985 ` 122` ``` assumes "[:-a, 1:] ^ n dvd p \ \ [:-a, 1:] ^ Suc n dvd p" ``` huffman@29985 ` 123` ``` shows "n = order a p" ``` huffman@29985 ` 124` ```unfolding Polynomial.order_def ``` huffman@29985 ` 125` ```apply (rule Least_equality [symmetric]) ``` huffman@29985 ` 126` ```apply (rule assms [THEN conjunct2]) ``` huffman@29985 ` 127` ```apply (erule contrapos_np) ``` huffman@29985 ` 128` ```apply (rule power_le_dvd) ``` huffman@29985 ` 129` ```apply (rule assms [THEN conjunct1]) ``` huffman@29985 ` 130` ```apply simp ``` huffman@29985 ` 131` ```done ``` huffman@29985 ` 132` huffman@29985 ` 133` ```lemma lemma_order_pderiv1: ``` huffman@29985 ` 134` ``` "pderiv ([:- a, 1:] ^ Suc n * q) = [:- a, 1:] ^ Suc n * pderiv q + ``` huffman@29985 ` 135` ``` smult (of_nat (Suc n)) (q * [:- a, 1:] ^ n)" ``` huffman@29985 ` 136` ```apply (simp only: pderiv_mult pderiv_power_Suc) ``` huffman@30273 ` 137` ```apply (simp del: power_Suc of_nat_Suc add: pderiv_pCons) ``` huffman@29985 ` 138` ```done ``` huffman@29985 ` 139` huffman@29985 ` 140` ```lemma dvd_add_cancel1: ``` huffman@29985 ` 141` ``` fixes a b c :: "'a::comm_ring_1" ``` huffman@29985 ` 142` ``` shows "a dvd b + c \ a dvd b \ a dvd c" ``` haftmann@35050 ` 143` ``` by (drule (1) Rings.dvd_diff, simp) ``` huffman@29985 ` 144` huffman@29985 ` 145` ```lemma lemma_order_pderiv [rule_format]: ``` huffman@29985 ` 146` ``` "\p q a. 0 < n & ``` huffman@29985 ` 147` ``` pderiv p \ 0 & ``` huffman@29985 ` 148` ``` p = [:- a, 1:] ^ n * q & ~ [:- a, 1:] dvd q ``` huffman@29985 ` 149` ``` --> n = Suc (order a (pderiv p))" ``` huffman@29985 ` 150` ``` apply (cases "n", safe, rename_tac n p q a) ``` huffman@29985 ` 151` ``` apply (rule order_unique_lemma) ``` huffman@29985 ` 152` ``` apply (rule conjI) ``` huffman@29985 ` 153` ``` apply (subst lemma_order_pderiv1) ``` huffman@29985 ` 154` ``` apply (rule dvd_add) ``` huffman@29985 ` 155` ``` apply (rule dvd_mult2) ``` huffman@29985 ` 156` ``` apply (rule le_imp_power_dvd, simp) ``` huffman@29985 ` 157` ``` apply (rule dvd_smult) ``` huffman@29985 ` 158` ``` apply (rule dvd_mult) ``` huffman@29985 ` 159` ``` apply (rule dvd_refl) ``` huffman@29985 ` 160` ``` apply (subst lemma_order_pderiv1) ``` huffman@29985 ` 161` ``` apply (erule contrapos_nn) back ``` huffman@29985 ` 162` ``` apply (subgoal_tac "[:- a, 1:] ^ Suc n dvd q * [:- a, 1:] ^ n") ``` huffman@29985 ` 163` ``` apply (simp del: mult_pCons_left) ``` huffman@29985 ` 164` ``` apply (drule dvd_add_cancel1) ``` huffman@29985 ` 165` ``` apply (simp del: mult_pCons_left) ``` huffman@29985 ` 166` ``` apply (drule dvd_smult_cancel, simp del: of_nat_Suc) ``` huffman@29985 ` 167` ``` apply assumption ``` huffman@29985 ` 168` ```done ``` huffman@29985 ` 169` huffman@29985 ` 170` ```lemma order_decomp: ``` huffman@29985 ` 171` ``` "p \ 0 ``` huffman@29985 ` 172` ``` ==> \q. p = [:-a, 1:] ^ (order a p) * q & ``` huffman@29985 ` 173` ``` ~([:-a, 1:] dvd q)" ``` huffman@29985 ` 174` ```apply (drule order [where a=a]) ``` huffman@29985 ` 175` ```apply (erule conjE) ``` huffman@29985 ` 176` ```apply (erule dvdE) ``` huffman@29985 ` 177` ```apply (rule exI) ``` huffman@29985 ` 178` ```apply (rule conjI, assumption) ``` huffman@29985 ` 179` ```apply (erule contrapos_nn) ``` huffman@29985 ` 180` ```apply (erule ssubst) back ``` huffman@29985 ` 181` ```apply (subst power_Suc2) ``` huffman@29985 ` 182` ```apply (erule mult_dvd_mono [OF dvd_refl]) ``` huffman@29985 ` 183` ```done ``` huffman@29985 ` 184` huffman@29985 ` 185` ```lemma order_pderiv: "[| pderiv p \ 0; order a p \ 0 |] ``` huffman@29985 ` 186` ``` ==> (order a p = Suc (order a (pderiv p)))" ``` huffman@29985 ` 187` ```apply (case_tac "p = 0", simp) ``` huffman@29985 ` 188` ```apply (drule_tac a = a and p = p in order_decomp) ``` huffman@29985 ` 189` ```using neq0_conv ``` huffman@29985 ` 190` ```apply (blast intro: lemma_order_pderiv) ``` huffman@29985 ` 191` ```done ``` huffman@29985 ` 192` huffman@29985 ` 193` ```lemma order_mult: "p * q \ 0 \ order a (p * q) = order a p + order a q" ``` huffman@29985 ` 194` ```proof - ``` huffman@29985 ` 195` ``` def i \ "order a p" ``` huffman@29985 ` 196` ``` def j \ "order a q" ``` huffman@29985 ` 197` ``` def t \ "[:-a, 1:]" ``` huffman@29985 ` 198` ``` have t_dvd_iff: "\u. t dvd u \ poly u a = 0" ``` huffman@29985 ` 199` ``` unfolding t_def by (simp add: dvd_iff_poly_eq_0) ``` huffman@29985 ` 200` ``` assume "p * q \ 0" ``` huffman@29985 ` 201` ``` then show "order a (p * q) = i + j" ``` huffman@29985 ` 202` ``` apply clarsimp ``` huffman@29985 ` 203` ``` apply (drule order [where a=a and p=p, folded i_def t_def]) ``` huffman@29985 ` 204` ``` apply (drule order [where a=a and p=q, folded j_def t_def]) ``` huffman@29985 ` 205` ``` apply clarify ``` huffman@29985 ` 206` ``` apply (rule order_unique_lemma [symmetric], fold t_def) ``` huffman@29985 ` 207` ``` apply (erule dvdE)+ ``` huffman@29985 ` 208` ``` apply (simp add: power_add t_dvd_iff) ``` huffman@29985 ` 209` ``` done ``` huffman@29985 ` 210` ```qed ``` huffman@29985 ` 211` huffman@29985 ` 212` ```text{*Now justify the standard squarefree decomposition, i.e. f / gcd(f,f'). *} ``` huffman@29985 ` 213` huffman@29985 ` 214` ```lemma order_divides: "[:-a, 1:] ^ n dvd p \ p = 0 \ n \ order a p" ``` huffman@29985 ` 215` ```apply (cases "p = 0", auto) ``` huffman@29985 ` 216` ```apply (drule order_2 [where a=a and p=p]) ``` huffman@29985 ` 217` ```apply (erule contrapos_np) ``` huffman@29985 ` 218` ```apply (erule power_le_dvd) ``` huffman@29985 ` 219` ```apply simp ``` huffman@29985 ` 220` ```apply (erule power_le_dvd [OF order_1]) ``` huffman@29985 ` 221` ```done ``` huffman@29985 ` 222` huffman@29985 ` 223` ```lemma poly_squarefree_decomp_order: ``` huffman@29985 ` 224` ``` assumes "pderiv p \ 0" ``` huffman@29985 ` 225` ``` and p: "p = q * d" ``` huffman@29985 ` 226` ``` and p': "pderiv p = e * d" ``` huffman@29985 ` 227` ``` and d: "d = r * p + s * pderiv p" ``` huffman@29985 ` 228` ``` shows "order a q = (if order a p = 0 then 0 else 1)" ``` huffman@29985 ` 229` ```proof (rule classical) ``` huffman@29985 ` 230` ``` assume 1: "order a q \ (if order a p = 0 then 0 else 1)" ``` huffman@29985 ` 231` ``` from `pderiv p \ 0` have "p \ 0" by auto ``` huffman@29985 ` 232` ``` with p have "order a p = order a q + order a d" ``` huffman@29985 ` 233` ``` by (simp add: order_mult) ``` huffman@29985 ` 234` ``` with 1 have "order a p \ 0" by (auto split: if_splits) ``` huffman@29985 ` 235` ``` have "order a (pderiv p) = order a e + order a d" ``` huffman@29985 ` 236` ``` using `pderiv p \ 0` `pderiv p = e * d` by (simp add: order_mult) ``` huffman@29985 ` 237` ``` have "order a p = Suc (order a (pderiv p))" ``` huffman@29985 ` 238` ``` using `pderiv p \ 0` `order a p \ 0` by (rule order_pderiv) ``` huffman@29985 ` 239` ``` have "d \ 0" using `p \ 0` `p = q * d` by simp ``` huffman@29985 ` 240` ``` have "([:-a, 1:] ^ (order a (pderiv p))) dvd d" ``` huffman@29985 ` 241` ``` apply (simp add: d) ``` huffman@29985 ` 242` ``` apply (rule dvd_add) ``` huffman@29985 ` 243` ``` apply (rule dvd_mult) ``` huffman@29985 ` 244` ``` apply (simp add: order_divides `p \ 0` ``` huffman@29985 ` 245` ``` `order a p = Suc (order a (pderiv p))`) ``` huffman@29985 ` 246` ``` apply (rule dvd_mult) ``` huffman@29985 ` 247` ``` apply (simp add: order_divides) ``` huffman@29985 ` 248` ``` done ``` huffman@29985 ` 249` ``` then have "order a (pderiv p) \ order a d" ``` huffman@29985 ` 250` ``` using `d \ 0` by (simp add: order_divides) ``` huffman@29985 ` 251` ``` show ?thesis ``` huffman@29985 ` 252` ``` using `order a p = order a q + order a d` ``` huffman@29985 ` 253` ``` using `order a (pderiv p) = order a e + order a d` ``` huffman@29985 ` 254` ``` using `order a p = Suc (order a (pderiv p))` ``` huffman@29985 ` 255` ``` using `order a (pderiv p) \ order a d` ``` huffman@29985 ` 256` ``` by auto ``` huffman@29985 ` 257` ```qed ``` huffman@29985 ` 258` huffman@29985 ` 259` ```lemma poly_squarefree_decomp_order2: "[| pderiv p \ 0; ``` huffman@29985 ` 260` ``` p = q * d; ``` huffman@29985 ` 261` ``` pderiv p = e * d; ``` huffman@29985 ` 262` ``` d = r * p + s * pderiv p ``` huffman@29985 ` 263` ``` |] ==> \a. order a q = (if order a p = 0 then 0 else 1)" ``` huffman@29985 ` 264` ```apply (blast intro: poly_squarefree_decomp_order) ``` huffman@29985 ` 265` ```done ``` huffman@29985 ` 266` huffman@29985 ` 267` ```lemma order_pderiv2: "[| pderiv p \ 0; order a p \ 0 |] ``` huffman@29985 ` 268` ``` ==> (order a (pderiv p) = n) = (order a p = Suc n)" ``` huffman@29985 ` 269` ```apply (auto dest: order_pderiv) ``` huffman@29985 ` 270` ```done ``` huffman@29985 ` 271` huffman@29985 ` 272` ```definition ``` huffman@29985 ` 273` ``` rsquarefree :: "'a::idom poly => bool" where ``` huffman@29985 ` 274` ``` "rsquarefree p = (p \ 0 & (\a. (order a p = 0) | (order a p = 1)))" ``` huffman@29985 ` 275` huffman@29985 ` 276` ```lemma pderiv_iszero: "pderiv p = 0 \ \h. p = [:h:]" ``` huffman@29985 ` 277` ```apply (simp add: pderiv_eq_0_iff) ``` huffman@29985 ` 278` ```apply (case_tac p, auto split: if_splits) ``` huffman@29985 ` 279` ```done ``` huffman@29985 ` 280` huffman@29985 ` 281` ```lemma rsquarefree_roots: ``` huffman@29985 ` 282` ``` "rsquarefree p = (\a. ~(poly p a = 0 & poly (pderiv p) a = 0))" ``` huffman@29985 ` 283` ```apply (simp add: rsquarefree_def) ``` huffman@29985 ` 284` ```apply (case_tac "p = 0", simp, simp) ``` huffman@29985 ` 285` ```apply (case_tac "pderiv p = 0") ``` huffman@29985 ` 286` ```apply simp ``` huffman@29985 ` 287` ```apply (drule pderiv_iszero, clarify) ``` huffman@29985 ` 288` ```apply simp ``` huffman@29985 ` 289` ```apply (rule allI) ``` huffman@29985 ` 290` ```apply (cut_tac p = "[:h:]" and a = a in order_root) ``` huffman@29985 ` 291` ```apply simp ``` huffman@29985 ` 292` ```apply (auto simp add: order_root order_pderiv2) ``` huffman@29985 ` 293` ```apply (erule_tac x="a" in allE, simp) ``` huffman@29985 ` 294` ```done ``` huffman@29985 ` 295` huffman@29985 ` 296` ```lemma poly_squarefree_decomp: ``` huffman@29985 ` 297` ``` assumes "pderiv p \ 0" ``` huffman@29985 ` 298` ``` and "p = q * d" ``` huffman@29985 ` 299` ``` and "pderiv p = e * d" ``` huffman@29985 ` 300` ``` and "d = r * p + s * pderiv p" ``` huffman@29985 ` 301` ``` shows "rsquarefree q & (\a. (poly q a = 0) = (poly p a = 0))" ``` huffman@29985 ` 302` ```proof - ``` huffman@29985 ` 303` ``` from `pderiv p \ 0` have "p \ 0" by auto ``` huffman@29985 ` 304` ``` with `p = q * d` have "q \ 0" by simp ``` huffman@29985 ` 305` ``` have "\a. order a q = (if order a p = 0 then 0 else 1)" ``` huffman@29985 ` 306` ``` using assms by (rule poly_squarefree_decomp_order2) ``` huffman@29985 ` 307` ``` with `p \ 0` `q \ 0` show ?thesis ``` huffman@29985 ` 308` ``` by (simp add: rsquarefree_def order_root) ``` huffman@29985 ` 309` ```qed ``` huffman@29985 ` 310` huffman@29985 ` 311` ```end ```