src/HOL/Algebra/poly/UnivPoly2.thy
changeset 23350 50c5b0912a0c
parent 22931 11cc1ccad58e
child 24993 92dfacb32053
equal deleted inserted replaced
23349:23a8345f89f5 23350:50c5b0912a0c
   437 lemma deg_aboveI:
   437 lemma deg_aboveI:
   438   "(!!m. n < m ==> coeff p m = 0) ==> deg p <= n"
   438   "(!!m. n < m ==> coeff p m = 0) ==> deg p <= n"
   439 by (unfold deg_def) (fast intro: Least_le)
   439 by (unfold deg_def) (fast intro: Least_le)
   440 
   440 
   441 lemma deg_aboveD:
   441 lemma deg_aboveD:
   442   assumes prem: "deg p < m" shows "coeff p m = 0"
   442   assumes "deg p < m" shows "coeff p m = 0"
   443 proof -
   443 proof -
   444   obtain n where "bound n (coeff p)" by (rule bound_coeff_obtain)
   444   obtain n where "bound n (coeff p)" by (rule bound_coeff_obtain)
   445   then have "bound (deg p) (coeff p)" by (unfold deg_def, rule LeastI)
   445   then have "bound (deg p) (coeff p)" by (unfold deg_def, rule LeastI)
   446   then show "coeff p m = 0" by (rule boundD)
   446   then show "coeff p m = 0" using `deg p < m` by (rule boundD)
   447 qed
   447 qed
   448 
   448 
   449 lemma deg_belowI:
   449 lemma deg_belowI:
   450   assumes prem: "n ~= 0 ==> coeff p n ~= 0" shows "n <= deg p"
   450   assumes prem: "n ~= 0 ==> coeff p n ~= 0" shows "n <= deg p"
   451 (* logically, this is a slightly stronger version of deg_aboveD *)
   451 (* logically, this is a slightly stronger version of deg_aboveD *)
   468       by (unfold deg_def) arith
   468       by (unfold deg_def) arith
   469     then have "~ bound (deg p - 1) (coeff p)" by (rule not_less_Least)
   469     then have "~ bound (deg p - 1) (coeff p)" by (rule not_less_Least)
   470     then have "EX m. deg p - 1 < m & coeff p m ~= 0"
   470     then have "EX m. deg p - 1 < m & coeff p m ~= 0"
   471       by (unfold bound_def) fast
   471       by (unfold bound_def) fast
   472     then have "EX m. deg p <= m & coeff p m ~= 0" by (simp add: deg minus)
   472     then have "EX m. deg p <= m & coeff p m ~= 0" by (simp add: deg minus)
   473     then show ?thesis by auto 
   473     then show ?thesis by (auto intro: that)
   474   qed
   474   qed
   475   with deg_belowI have "deg p = m" by fastsimp
   475   with deg_belowI have "deg p = m" by fastsimp
   476   with m_coeff show ?thesis by simp
   476   with m_coeff show ?thesis by simp
   477 qed
   477 qed
   478 
   478