Skip to content
This repository was archived by the owner on Jul 24, 2024. It is now read-only.

Commit d268bb7

Browse files
committed
feat(data/polynomial/eval): add polynomial.map_bit0/1 (#16481)
1 parent c0ad3bf commit d268bb7

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/data/polynomial/eval.lean

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -538,7 +538,7 @@ end
538538
@[simp] protected lemma map_mul : (p * q).map f = p.map f * q.map f :=
539539
by { rw [map, eval₂_mul_noncomm], exact λ k, (commute_X _).symm }
540540

541-
@[simp] lemma map_smul (r : R) : (r • p).map f = f r • p.map f :=
541+
@[simp] protected lemma map_smul (r : R) : (r • p).map f = f r • p.map f :=
542542
by rw [map, eval₂_smul, ring_hom.comp_apply, C_mul']
543543

544544
/-- `polynomial.map` as a `ring_hom`. -/
@@ -561,6 +561,12 @@ def map_ring_hom (f : R →+* S) : R[X] →+* S[X] :=
561561
@[simp] protected theorem map_nat_cast (n : ℕ) : (n : R[X]).map f = n :=
562562
map_nat_cast (map_ring_hom f) n
563563

564+
@[simp] protected lemma map_bit0 : (bit0 p).map f = bit0 (p.map f) :=
565+
map_bit0 (map_ring_hom f) p
566+
567+
@[simp] protected lemma map_bit1 : (bit1 p).map f = bit1 (p.map f) :=
568+
map_bit1 (map_ring_hom f) p
569+
564570
@[simp]
565571
lemma coeff_map (n : ℕ) : coeff (p.map f) n = f (coeff p n) :=
566572
begin

0 commit comments

Comments
 (0)