283 |
283 |
284 lemma (in ring) indexed_eval_inj_on_carrier: |
284 lemma (in ring) indexed_eval_inj_on_carrier: |
285 assumes "\<And>P. P \<in> carrier L \<Longrightarrow> carrier_coeff P" and "\<And>P. P \<in> carrier L \<Longrightarrow> index_free P i" and "\<zero>\<^bsub>L\<^esub> = indexed_const \<zero>" |
285 assumes "\<And>P. P \<in> carrier L \<Longrightarrow> carrier_coeff P" and "\<And>P. P \<in> carrier L \<Longrightarrow> index_free P i" and "\<zero>\<^bsub>L\<^esub> = indexed_const \<zero>" |
286 shows "inj_on (\<lambda>Ps. indexed_eval Ps i) (carrier (poly_ring L))" |
286 shows "inj_on (\<lambda>Ps. indexed_eval Ps i) (carrier (poly_ring L))" |
287 proof - |
287 proof - |
288 { fix Ps |
288 have aux_lemma: "Ps = []" |
289 assume "Ps \<in> carrier (poly_ring L)" and "indexed_eval Ps i = indexed_const \<zero>" |
289 if "Ps \<in> carrier (poly_ring L)" and "indexed_eval Ps i = indexed_const \<zero>" for Ps |
290 have "Ps = []" |
290 proof (rule ccontr) |
291 proof (rule ccontr) |
291 assume "\<not> ?thesis" |
292 assume "Ps \<noteq> []" |
292 then obtain P' Ps' where Ps: "Ps = P' # Ps'" |
293 then obtain P' Ps' where Ps: "Ps = P' # Ps'" |
293 using list.exhaust by blast |
294 using list.exhaust by blast |
294 with \<open>Ps \<in> carrier (poly_ring L)\<close> |
295 with \<open>Ps \<in> carrier (poly_ring L)\<close> |
295 have "P' \<noteq> indexed_const \<zero>" and "list_all carrier_coeff Ps" and "list_all (\<lambda>P. index_free P i) Ps" |
296 have "P' \<noteq> indexed_const \<zero>" and "list_all carrier_coeff Ps" and "list_all (\<lambda>P. index_free P i) Ps" |
296 using assms unfolding sym[OF univ_poly_carrier[of L "carrier L"]] polynomial_def |
297 using assms unfolding sym[OF univ_poly_carrier[of L "carrier L"]] polynomial_def |
297 by (simp add: list.pred_set subset_code(1))+ |
298 by (simp add: list.pred_set subset_code(1))+ |
298 then obtain m where "(indexed_eval Ps i) m \<noteq> \<zero>" |
299 then obtain m where "(indexed_eval Ps i) m \<noteq> \<zero>" |
299 using exists_indexed_eval_monomial'[of P' Ps'] unfolding Ps by auto |
300 using exists_indexed_eval_monomial'[of P' Ps'] unfolding Ps by auto |
300 hence "indexed_eval Ps i \<noteq> indexed_const \<zero>" |
301 hence "indexed_eval Ps i \<noteq> indexed_const \<zero>" |
301 unfolding indexed_const_def by auto |
302 unfolding indexed_const_def by auto |
302 with \<open>indexed_eval Ps i = indexed_const \<zero>\<close> show False by simp |
303 with \<open>indexed_eval Ps i = indexed_const \<zero>\<close> show False by simp |
303 qed |
304 qed } note aux_lemma = this |
|
305 |
304 |
306 show ?thesis |
305 show ?thesis |
307 proof (rule inj_onI) |
306 proof (rule inj_onI) |
308 fix Ps Qs |
307 fix Ps Qs |
309 assume "Ps \<in> carrier (poly_ring L)" and "Qs \<in> carrier (poly_ring L)" |
308 assume "Ps \<in> carrier (poly_ring L)" and "Qs \<in> carrier (poly_ring L)" |
354 by (metis insert_DiffM insert_noteq_member) |
353 by (metis insert_DiffM insert_noteq_member) |
355 |
354 |
356 lemma (in ring) indexed_eval_index_free: |
355 lemma (in ring) indexed_eval_index_free: |
357 assumes "list_all (\<lambda>P. index_free P j) Ps" and "i \<noteq> j" shows "index_free (indexed_eval Ps i) j" |
356 assumes "list_all (\<lambda>P. index_free P j) Ps" and "i \<noteq> j" shows "index_free (indexed_eval Ps i) j" |
358 proof - |
357 proof - |
359 { fix Ps assume "list_all (\<lambda>P. index_free P j) Ps" hence "index_free (indexed_eval_aux Ps i) j" |
358 have "index_free (indexed_eval_aux Ps i) j" if "list_all (\<lambda>P. index_free P j) Ps" for Ps |
360 using indexed_padd_index_free[OF indexed_pmult_index_free[OF _ assms(2)]] |
359 using that indexed_padd_index_free[OF indexed_pmult_index_free[OF _ assms(2)]] |
361 by (induct Ps) (auto simp add: indexed_zero_def index_free_def) } |
360 by (induct Ps) (auto simp add: indexed_zero_def index_free_def) |
362 thus ?thesis |
361 thus ?thesis |
363 using assms(1) by auto |
362 using assms(1) by auto |
364 qed |
363 qed |
365 |
364 |
366 context |
365 context |