Skip to content

Commit

Permalink
feat(data/polynomial): lemma about aeval on functions, and on subalge…
Browse files Browse the repository at this point in the history
…bras (#7252)





Co-authored-by: Scott Morrison <scott.morrison@gmail.com>
Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
  • Loading branch information
3 people committed Apr 27, 2021
1 parent 89c27cc commit 4f9543b
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/data/polynomial/algebra_map.lean
Expand Up @@ -119,7 +119,7 @@ alg_hom.map_zero (aeval x)

@[simp] lemma aeval_C (r : R) : aeval x (C r) = algebra_map R A r := eval₂_C _ x

lemma aeval_monomial {n : ℕ} {r : R} : aeval x (monomial n r) = (algebra_map _ _ r) * x^n :=
@[simp] lemma aeval_monomial {n : ℕ} {r : R} : aeval x (monomial n r) = (algebra_map _ _ r) * x^n :=
eval₂_monomial _ _

@[simp] lemma aeval_X_pow {n : ℕ} : aeval x ((X : polynomial R)^n) = x^n :=
Expand Down Expand Up @@ -178,6 +178,15 @@ aeval_alg_hom_apply (algebra.of_id R A) x p
@[simp] lemma coe_aeval_eq_eval (r : R) :
(aeval r : polynomial R → R) = eval r := rfl

@[simp] lemma aeval_fn_apply {X : Type*} (g : polynomial R) (f : X → R) (x : X) :
((aeval f) g) x = aeval (f x) g :=
(aeval_alg_hom_apply (pi.alg_hom.apply _ _ _ x) f g).symm

@[norm_cast] lemma aeval_subalgebra_coe
(g : polynomial R) {A : Type*} [semiring A] [algebra R A] (s : subalgebra R A) (f : s) :
(aeval f g : A) = aeval (f : A) g :=
(aeval_alg_hom_apply s.val f g).symm

lemma coeff_zero_eq_aeval_zero (p : polynomial R) : p.coeff 0 = aeval 0 p :=
by simp [coeff_zero_eq_eval_zero]

Expand Down

0 comments on commit 4f9543b

Please sign in to comment.