equal
deleted
inserted
replaced
1 (* Title: Univ_Poly.thy |
1 (* Title: Univ_Poly.thy |
2 Author: Amine Chaieb |
2 Author: Amine Chaieb |
3 *) |
3 *) |
4 |
4 |
5 header{*Univariate Polynomials*} |
5 header {* Univariate Polynomials *} |
6 |
6 |
7 theory Univ_Poly |
7 theory Univ_Poly |
8 imports Plain List |
8 imports Plain List |
9 begin |
9 begin |
10 |
10 |
366 |
366 |
367 lemma (in ring_char_0) UNIV_ring_char_0_infinte: |
367 lemma (in ring_char_0) UNIV_ring_char_0_infinte: |
368 "\<not> (finite (UNIV:: 'a set))" |
368 "\<not> (finite (UNIV:: 'a set))" |
369 proof |
369 proof |
370 assume F: "finite (UNIV :: 'a set)" |
370 assume F: "finite (UNIV :: 'a set)" |
371 have th0: "of_nat ` UNIV \<subseteq> UNIV" by simp |
371 have "finite (UNIV :: nat set)" |
372 from finite_subset[OF th0] have th: "finite (of_nat ` UNIV :: 'a set)" . |
372 proof (rule finite_imageD) |
373 have th': "inj_on (of_nat::nat \<Rightarrow> 'a) (UNIV)" |
373 have "of_nat ` UNIV \<subseteq> UNIV" by simp |
374 unfolding inj_on_def by auto |
374 then show "finite (of_nat ` UNIV :: 'a set)" using F by (rule finite_subset) |
375 from finite_imageD[OF th th'] UNIV_nat_infinite |
375 show "inj (of_nat :: nat \<Rightarrow> 'a)" by (simp add: inj_on_def) |
376 show False by blast |
376 qed |
|
377 with UNIV_nat_infinite show False .. |
377 qed |
378 qed |
378 |
379 |
379 lemma (in idom_char_0) poly_roots_finite: "(poly p \<noteq> poly []) = |
380 lemma (in idom_char_0) poly_roots_finite: "(poly p \<noteq> poly []) = |
380 finite {x. poly p x = 0}" |
381 finite {x. poly p x = 0}" |
381 proof |
382 proof |
578 proof(induct d arbitrary: p) |
579 proof(induct d arbitrary: p) |
579 case 0 thus ?case by simp |
580 case 0 thus ?case by simp |
580 next |
581 next |
581 case (Suc n p) |
582 case (Suc n p) |
582 {assume p0: "poly p a = 0" |
583 {assume p0: "poly p a = 0" |
583 from Suc.prems have h: "length p = Suc n" "poly p \<noteq> poly []" by blast |
584 from Suc.prems have h: "length p = Suc n" "poly p \<noteq> poly []" by auto |
584 hence pN: "p \<noteq> []" by - (rule ccontr, simp) |
585 hence pN: "p \<noteq> []" by auto |
585 from p0[unfolded poly_linear_divides] pN obtain q where |
586 from p0[unfolded poly_linear_divides] pN obtain q where |
586 q: "p = [-a, 1] *** q" by blast |
587 q: "p = [-a, 1] *** q" by blast |
587 from q h p0 have qh: "length q = n" "poly q \<noteq> poly []" |
588 from q h p0 have qh: "length q = n" "poly q \<noteq> poly []" |
588 apply - |
589 apply - |
589 apply simp |
590 apply simp |