380 qed |
380 qed |
381 |
381 |
382 lemma (in idom_char_0) poly_entire: |
382 lemma (in idom_char_0) poly_entire: |
383 "poly (p *** q) = poly [] \<longleftrightarrow> poly p = poly [] \<or> poly q = poly []" |
383 "poly (p *** q) = poly [] \<longleftrightarrow> poly p = poly [] \<or> poly q = poly []" |
384 using poly_entire_lemma2[of p q] |
384 using poly_entire_lemma2[of p q] |
385 by (auto simp add: ext_iff poly_mult) |
385 by (auto simp add: fun_eq_iff poly_mult) |
386 |
386 |
387 lemma (in idom_char_0) poly_entire_neg: "(poly (p *** q) \<noteq> poly []) = ((poly p \<noteq> poly []) & (poly q \<noteq> poly []))" |
387 lemma (in idom_char_0) poly_entire_neg: "(poly (p *** q) \<noteq> poly []) = ((poly p \<noteq> poly []) & (poly q \<noteq> poly []))" |
388 by (simp add: poly_entire) |
388 by (simp add: poly_entire) |
389 |
389 |
390 lemma fun_eq: " (f = g) = (\<forall>x. f x = g x)" |
390 lemma fun_eq: " (f = g) = (\<forall>x. f x = g x)" |
845 lemma (in idom_char_0) poly_Cons_eq: "poly (c#cs) = poly (d#ds) \<longleftrightarrow> c=d \<and> poly cs = poly ds" (is "?lhs \<longleftrightarrow> ?rhs") |
845 lemma (in idom_char_0) poly_Cons_eq: "poly (c#cs) = poly (d#ds) \<longleftrightarrow> c=d \<and> poly cs = poly ds" (is "?lhs \<longleftrightarrow> ?rhs") |
846 proof |
846 proof |
847 assume eq: ?lhs |
847 assume eq: ?lhs |
848 hence "\<And>x. poly ((c#cs) +++ -- (d#ds)) x = 0" |
848 hence "\<And>x. poly ((c#cs) +++ -- (d#ds)) x = 0" |
849 by (simp only: poly_minus poly_add algebra_simps) simp |
849 by (simp only: poly_minus poly_add algebra_simps) simp |
850 hence "poly ((c#cs) +++ -- (d#ds)) = poly []" by(simp add: ext_iff) |
850 hence "poly ((c#cs) +++ -- (d#ds)) = poly []" by(simp add: fun_eq_iff) |
851 hence "c = d \<and> list_all (\<lambda>x. x=0) ((cs +++ -- ds))" |
851 hence "c = d \<and> list_all (\<lambda>x. x=0) ((cs +++ -- ds))" |
852 unfolding poly_zero by (simp add: poly_minus_def algebra_simps) |
852 unfolding poly_zero by (simp add: poly_minus_def algebra_simps) |
853 hence "c = d \<and> (\<forall>x. poly (cs +++ -- ds) x = 0)" |
853 hence "c = d \<and> (\<forall>x. poly (cs +++ -- ds) x = 0)" |
854 unfolding poly_zero[symmetric] by simp |
854 unfolding poly_zero[symmetric] by simp |
855 thus ?rhs by (simp add: poly_minus poly_add algebra_simps ext_iff) |
855 thus ?rhs by (simp add: poly_minus poly_add algebra_simps fun_eq_iff) |
856 next |
856 next |
857 assume ?rhs then show ?lhs by(simp add:ext_iff) |
857 assume ?rhs then show ?lhs by(simp add:fun_eq_iff) |
858 qed |
858 qed |
859 |
859 |
860 lemma (in idom_char_0) pnormalize_unique: "poly p = poly q \<Longrightarrow> pnormalize p = pnormalize q" |
860 lemma (in idom_char_0) pnormalize_unique: "poly p = poly q \<Longrightarrow> pnormalize p = pnormalize q" |
861 proof(induct q arbitrary: p) |
861 proof(induct q arbitrary: p) |
862 case Nil thus ?case by (simp only: poly_zero lemma_degree_zero) simp |
862 case Nil thus ?case by (simp only: poly_zero lemma_degree_zero) simp |