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

Commit 91cbe46

Browse files
adomanieric-wieser
andcommitted
feat(algebra/monoid_algebra/basic): lifts of (add_)monoid_algebras (#13382)
We show that homomorphisms of the grading (add) monoids of (add) monoid algebras lift to ring/algebra homs of the algebras themselves. This PR is preparation for introducing Laurent polynomials (see [adomani_laurent_polynomials](https://github.com/leanprover-community/mathlib/tree/adomani_laurent_polynomials), file `data/polynomial/laurent` for a preliminary version). [Zulip](https://leanprover.zulipchat.com/#narrow/stream/116395-maths/topic/Laurent.20polynomials) Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
1 parent 8044794 commit 91cbe46

File tree

1 file changed

+72
-5
lines changed

1 file changed

+72
-5
lines changed

src/algebra/monoid_algebra/basic.lean

Lines changed: 72 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -548,14 +548,24 @@ lemma single_one_comm [comm_semiring k] [mul_one_class G] (r : k) (f : monoid_al
548548
by { ext, rw [single_one_mul_apply, mul_single_one_apply, mul_comm] }
549549

550550
/-- `finsupp.single 1` as a `ring_hom` -/
551-
@[simps] def single_one_ring_hom [semiring k] [monoid G] : k →+* monoid_algebra k G :=
551+
@[simps] def single_one_ring_hom [semiring k] [mul_one_class G] : k →+* monoid_algebra k G :=
552552
{ map_one' := rfl,
553553
map_mul' := λ x y, by rw [single_add_hom, single_mul_single, one_mul],
554554
..finsupp.single_add_hom 1}
555555

556+
/-- If `f : G → H` is a multiplicative homomorphism between two monoids, then
557+
`finsupp.map_domain f` is a ring homomorphism between their monoid algebras. -/
558+
@[simps]
559+
def map_domain_ring_hom (k : Type*) {H F : Type*} [semiring k] [monoid G] [monoid H]
560+
[monoid_hom_class F G H] (f : F) :
561+
monoid_algebra k G →+* monoid_algebra k H :=
562+
{ map_one' := map_domain_one f,
563+
map_mul' := λ x y, map_domain_mul f x y,
564+
..(finsupp.map_domain.add_monoid_hom f : monoid_algebra k G →+ monoid_algebra k H) }
565+
556566
/-- If two ring homomorphisms from `monoid_algebra k G` are equal on all `single a 1`
557567
and `single 1 b`, then they are equal. -/
558-
lemma ring_hom_ext {R} [semiring k] [monoid G] [semiring R]
568+
lemma ring_hom_ext {R} [semiring k] [mul_one_class G] [semiring R]
559569
{f g : monoid_algebra k G →+* R} (h₁ : ∀ b, f (single 1 b) = g (single 1 b))
560570
(h_of : ∀ a, f (single a 1) = g (single a 1)) : f = g :=
561571
ring_hom.coe_add_monoid_hom_injective $ add_hom_ext $ λ a b,
@@ -566,7 +576,7 @@ ring_hom.coe_add_monoid_hom_injective $ add_hom_ext $ λ a b,
566576
and `single 1 b`, then they are equal.
567577
568578
See note [partially-applied ext lemmas]. -/
569-
@[ext] lemma ring_hom_ext' {R} [semiring k] [monoid G] [semiring R]
579+
@[ext] lemma ring_hom_ext' {R} [semiring k] [mul_one_class G] [semiring R]
570580
{f g : monoid_algebra k G →+* R} (h₁ : f.comp single_one_ring_hom = g.comp single_one_ring_hom)
571581
(h_of : (f : monoid_algebra k G →* R).comp (of k G) =
572582
(g : monoid_algebra k G →* R).comp (of k G)) :
@@ -684,6 +694,31 @@ lemma lift_unique (F : monoid_algebra k G →ₐ[k] A) (f : monoid_algebra k G)
684694
F f = f.sum (λ a b, b • F (single a 1)) :=
685695
by conv_lhs { rw lift_unique' F, simp [lift_apply] }
686696

697+
/-- If `f : G → H` is a homomorphism between two magmas, then
698+
`finsupp.map_domain f` is a non-unital algebra homomorphism between their magma algebras. -/
699+
@[simps]
700+
def map_domain_non_unital_alg_hom (k A : Type*) [comm_semiring k] [semiring A] [algebra k A]
701+
{G H F : Type*} [has_mul G] [has_mul H] [mul_hom_class F G H] (f : F) :
702+
monoid_algebra A G →ₙₐ[k] monoid_algebra A H :=
703+
{ map_mul' := λ x y, map_domain_mul f x y,
704+
map_smul' := λ r x, map_domain_smul r x,
705+
..(finsupp.map_domain.add_monoid_hom f : monoid_algebra A G →+ monoid_algebra A H) }
706+
707+
lemma map_domain_algebra_map (k A : Type*) {H F : Type*} [comm_semiring k] [semiring A]
708+
[algebra k A] [monoid H] [monoid_hom_class F G H] (f : F) (r : k) :
709+
map_domain f (algebra_map k (monoid_algebra A G) r) =
710+
algebra_map k (monoid_algebra A H) r :=
711+
by simp only [coe_algebra_map, map_domain_single, map_one]
712+
713+
/-- If `f : G → H` is a multiplicative homomorphism between two monoids, then
714+
`finsupp.map_domain f` is an algebra homomorphism between their monoid algebras. -/
715+
@[simps]
716+
def map_domain_alg_hom (k A : Type*) [comm_semiring k] [semiring A] [algebra k A] {H F : Type*}
717+
[monoid H] [monoid_hom_class F G H] (f : F) :
718+
monoid_algebra A G →ₐ[k] monoid_algebra A H :=
719+
{ commutes' := map_domain_algebra_map k A f,
720+
..map_domain_ring_hom A f}
721+
687722
end lift
688723

689724
section
@@ -1211,8 +1246,6 @@ lemma lift_nc_smul {R : Type*} [add_zero_class G] [semiring R] (f : k →+* R)
12111246
lift_nc (f : k →+ R) g (c • φ) = f c * lift_nc (f : k →+ R) g φ :=
12121247
@monoid_algebra.lift_nc_smul k (multiplicative G) _ _ _ _ f g c φ
12131248

1214-
variables {k G}
1215-
12161249
lemma induction_on [add_monoid G] {p : add_monoid_algebra k G → Prop} (f : add_monoid_algebra k G)
12171250
(hM : ∀ g, p (of k G (multiplicative.of_add g)))
12181251
(hadd : ∀ f g : add_monoid_algebra k G, p f → p g → p (f + g))
@@ -1224,6 +1257,16 @@ begin
12241257
simp only [mul_one, to_add_of_add, smul_single', of_apply] },
12251258
end
12261259

1260+
/-- If `f : G → H` is an additive homomorphism between two additive monoids, then
1261+
`finsupp.map_domain f` is a ring homomorphism between their add monoid algebras. -/
1262+
@[simps]
1263+
def map_domain_ring_hom (k : Type*) [semiring k] {H F : Type*} [add_monoid G] [add_monoid H]
1264+
[add_monoid_hom_class F G H] (f : F) :
1265+
add_monoid_algebra k G →+* add_monoid_algebra k H :=
1266+
{ map_one' := map_domain_one f,
1267+
map_mul' := λ x y, map_domain_mul f x y,
1268+
..(finsupp.map_domain.add_monoid_hom f : monoid_algebra k G →+ monoid_algebra k H) }
1269+
12271270
end misc_theorems
12281271

12291272
section span
@@ -1503,6 +1546,30 @@ finset.induction_on s rfl $ λ a s has ih, by rw [prod_insert has, ih,
15031546

15041547
end
15051548

1549+
lemma map_domain_algebra_map {A H F : Type*} [comm_semiring k] [semiring A]
1550+
[algebra k A] [add_monoid G] [add_monoid H] [add_monoid_hom_class F G H] (f : F) (r : k) :
1551+
map_domain f (algebra_map k (add_monoid_algebra A G) r) =
1552+
algebra_map k (add_monoid_algebra A H) r :=
1553+
by simp only [function.comp_app, map_domain_single, add_monoid_algebra.coe_algebra_map, map_zero]
1554+
1555+
/-- If `f : G → H` is a homomorphism between two additive magmas, then `finsupp.map_domain f` is a
1556+
non-unital algebra homomorphism between their additive magma algebras. -/
1557+
@[simps]
1558+
def map_domain_non_unital_alg_hom (k A : Type*) [comm_semiring k] [semiring A] [algebra k A]
1559+
{G H F : Type*} [has_add G] [has_add H] [add_hom_class F G H] (f : F) :
1560+
add_monoid_algebra A G →ₙₐ[k] add_monoid_algebra A H :=
1561+
{ map_mul' := λ x y, map_domain_mul f x y,
1562+
map_smul' := λ r x, map_domain_smul r x,
1563+
..(finsupp.map_domain.add_monoid_hom f : monoid_algebra A G →+ monoid_algebra A H) }
1564+
1565+
/-- If `f : G → H` is an additive homomorphism between two additive monoids, then
1566+
`finsupp.map_domain f` is an algebra homomorphism between their add monoid algebras. -/
1567+
@[simps] def map_domain_alg_hom (k A : Type*) [comm_semiring k] [semiring A] [algebra k A]
1568+
[add_monoid G] {H F : Type*} [add_monoid H] [add_monoid_hom_class F G H] (f : F) :
1569+
add_monoid_algebra A G →ₐ[k] add_monoid_algebra A H :=
1570+
{ commutes' := map_domain_algebra_map f,
1571+
..map_domain_ring_hom A f}
1572+
15061573
end add_monoid_algebra
15071574

15081575
variables [comm_semiring R] (k G)

0 commit comments

Comments
 (0)