src/HOL/Library/Polynomial.thy
changeset 35028 108662d50512
parent 34973 ae634fad947e
child 36350 bc7982c54e37
equal deleted inserted replaced
35027:ed7d12bcf8f8 35028:108662d50512
   704 
   704 
   705 
   705 
   706 subsection {* Polynomials form an ordered integral domain *}
   706 subsection {* Polynomials form an ordered integral domain *}
   707 
   707 
   708 definition
   708 definition
   709   pos_poly :: "'a::ordered_idom poly \<Rightarrow> bool"
   709   pos_poly :: "'a::linordered_idom poly \<Rightarrow> bool"
   710 where
   710 where
   711   "pos_poly p \<longleftrightarrow> 0 < coeff p (degree p)"
   711   "pos_poly p \<longleftrightarrow> 0 < coeff p (degree p)"
   712 
   712 
   713 lemma pos_poly_pCons:
   713 lemma pos_poly_pCons:
   714   "pos_poly (pCons a p) \<longleftrightarrow> pos_poly p \<or> (p = 0 \<and> 0 < a)"
   714   "pos_poly (pCons a p) \<longleftrightarrow> pos_poly p \<or> (p = 0 \<and> 0 < a)"
   730   done
   730   done
   731 
   731 
   732 lemma pos_poly_total: "p = 0 \<or> pos_poly p \<or> pos_poly (- p)"
   732 lemma pos_poly_total: "p = 0 \<or> pos_poly p \<or> pos_poly (- p)"
   733 by (induct p) (auto simp add: pos_poly_pCons)
   733 by (induct p) (auto simp add: pos_poly_pCons)
   734 
   734 
   735 instantiation poly :: (ordered_idom) ordered_idom
   735 instantiation poly :: (linordered_idom) linordered_idom
   736 begin
   736 begin
   737 
   737 
   738 definition
   738 definition
   739   [code del]:
   739   [code del]:
   740     "x < y \<longleftrightarrow> pos_poly (y - x)"
   740     "x < y \<longleftrightarrow> pos_poly (y - x)"