equal
deleted
inserted
replaced
229 |
229 |
230 instance fps :: (group_add) group_add |
230 instance fps :: (group_add) group_add |
231 proof |
231 proof |
232 fix a b :: "'a fps" |
232 fix a b :: "'a fps" |
233 show "- a + a = 0" by (simp add: fps_ext) |
233 show "- a + a = 0" by (simp add: fps_ext) |
234 show "a - b = a + - b" by (simp add: fps_ext diff_minus) |
234 show "a + - b = a - b" by (simp add: fps_ext) |
235 qed |
235 qed |
236 |
236 |
237 instance fps :: (ab_group_add) ab_group_add |
237 instance fps :: (ab_group_add) ab_group_add |
238 proof |
238 proof |
239 fix a b :: "'a fps" |
239 fix a b :: "'a fps" |
346 subsection {* Formal power series form an integral domain*} |
346 subsection {* Formal power series form an integral domain*} |
347 |
347 |
348 instance fps :: (ring) ring .. |
348 instance fps :: (ring) ring .. |
349 |
349 |
350 instance fps :: (ring_1) ring_1 |
350 instance fps :: (ring_1) ring_1 |
351 by (intro_classes, auto simp add: diff_minus distrib_right) |
351 by (intro_classes, auto simp add: distrib_right) |
352 |
352 |
353 instance fps :: (comm_ring_1) comm_ring_1 |
353 instance fps :: (comm_ring_1) comm_ring_1 |
354 by (intro_classes, auto simp add: diff_minus distrib_right) |
354 by (intro_classes, auto simp add: distrib_right) |
355 |
355 |
356 instance fps :: (ring_no_zero_divisors) ring_no_zero_divisors |
356 instance fps :: (ring_no_zero_divisors) ring_no_zero_divisors |
357 proof |
357 proof |
358 fix a b :: "'a fps" |
358 fix a b :: "'a fps" |
359 assume a0: "a \<noteq> 0" and b0: "b \<noteq> 0" |
359 assume a0: "a \<noteq> 0" and b0: "b \<noteq> 0" |
886 |
886 |
887 lemma fps_deriv_add[simp]: "fps_deriv ((f:: ('a::comm_ring_1) fps) + g) = fps_deriv f + fps_deriv g" |
887 lemma fps_deriv_add[simp]: "fps_deriv ((f:: ('a::comm_ring_1) fps) + g) = fps_deriv f + fps_deriv g" |
888 using fps_deriv_linear[of 1 f 1 g] by simp |
888 using fps_deriv_linear[of 1 f 1 g] by simp |
889 |
889 |
890 lemma fps_deriv_sub[simp]: "fps_deriv ((f:: ('a::comm_ring_1) fps) - g) = fps_deriv f - fps_deriv g" |
890 lemma fps_deriv_sub[simp]: "fps_deriv ((f:: ('a::comm_ring_1) fps) - g) = fps_deriv f - fps_deriv g" |
891 unfolding diff_minus by simp |
891 using fps_deriv_add [of f "- g"] by simp |
892 |
892 |
893 lemma fps_deriv_const[simp]: "fps_deriv (fps_const c) = 0" |
893 lemma fps_deriv_const[simp]: "fps_deriv (fps_const c) = 0" |
894 by (simp add: fps_ext fps_deriv_def fps_const_def) |
894 by (simp add: fps_ext fps_deriv_def fps_const_def) |
895 |
895 |
896 lemma fps_deriv_mult_const_left[simp]: |
896 lemma fps_deriv_mult_const_left[simp]: |
976 "fps_nth_deriv n ((f:: ('a::comm_ring_1) fps) + g) = fps_nth_deriv n f + fps_nth_deriv n g" |
976 "fps_nth_deriv n ((f:: ('a::comm_ring_1) fps) + g) = fps_nth_deriv n f + fps_nth_deriv n g" |
977 using fps_nth_deriv_linear[of n 1 f 1 g] by simp |
977 using fps_nth_deriv_linear[of n 1 f 1 g] by simp |
978 |
978 |
979 lemma fps_nth_deriv_sub[simp]: |
979 lemma fps_nth_deriv_sub[simp]: |
980 "fps_nth_deriv n ((f:: ('a::comm_ring_1) fps) - g) = fps_nth_deriv n f - fps_nth_deriv n g" |
980 "fps_nth_deriv n ((f:: ('a::comm_ring_1) fps) - g) = fps_nth_deriv n f - fps_nth_deriv n g" |
981 unfolding diff_minus fps_nth_deriv_add by simp |
981 using fps_nth_deriv_add [of n f "- g"] by simp |
982 |
982 |
983 lemma fps_nth_deriv_0[simp]: "fps_nth_deriv n 0 = 0" |
983 lemma fps_nth_deriv_0[simp]: "fps_nth_deriv n 0 = 0" |
984 by (induct n) simp_all |
984 by (induct n) simp_all |
985 |
985 |
986 lemma fps_nth_deriv_1[simp]: "fps_nth_deriv n 1 = (if n = 0 then 1 else 0)" |
986 lemma fps_nth_deriv_1[simp]: "fps_nth_deriv n 1 = (if n = 0 then 1 else 0)" |
2632 |
2632 |
2633 lemma fps_compose_uminus: "- (a::'a::ring_1 fps) oo c = - (a oo c)" |
2633 lemma fps_compose_uminus: "- (a::'a::ring_1 fps) oo c = - (a oo c)" |
2634 by (simp add: fps_eq_iff fps_compose_nth field_simps setsum_negf[symmetric]) |
2634 by (simp add: fps_eq_iff fps_compose_nth field_simps setsum_negf[symmetric]) |
2635 |
2635 |
2636 lemma fps_compose_sub_distrib: "(a - b) oo (c::'a::ring_1 fps) = (a oo c) - (b oo c)" |
2636 lemma fps_compose_sub_distrib: "(a - b) oo (c::'a::ring_1 fps) = (a oo c) - (b oo c)" |
2637 unfolding diff_minus fps_compose_uminus fps_compose_add_distrib .. |
2637 using fps_compose_add_distrib [of a "- b" c] by (simp add: fps_compose_uminus) |
2638 |
2638 |
2639 lemma X_fps_compose: "X oo a = Abs_fps (\<lambda>n. if n = 0 then (0::'a::comm_ring_1) else a$n)" |
2639 lemma X_fps_compose: "X oo a = Abs_fps (\<lambda>n. if n = 0 then (0::'a::comm_ring_1) else a$n)" |
2640 by (simp add: fps_eq_iff fps_compose_nth mult_delta_left setsum_delta) |
2640 by (simp add: fps_eq_iff fps_compose_nth mult_delta_left setsum_delta) |
2641 |
2641 |
2642 lemma fps_inverse_compose: |
2642 lemma fps_inverse_compose: |