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

Commit 5cdbb4c

Browse files
committed
feat(algebra/*/pi, topology/continuous_function/algebra): homomorphism induced by left-composition (#7984)
Given a monoid homomorphism from `α` to `β`, there is an induced monoid homomorphism from `I → α` to `I → β`, by left-composition. Same result for semirings, modules, algebras. Same result for topological monoids, topological semirings, etc, and the function spaces `C(I, α)`, `C(I, β)`, if the homomorphism is continuous. Of these eight constructions, the only one I particularly want is the last one (topological algebras). If reviewers feel it is better not to clog mathlib up with unused constructions, I am happy to cut the other seven from this PR.
1 parent 18c1c4a commit 5cdbb4c

File tree

6 files changed

+99
-10
lines changed

6 files changed

+99
-10
lines changed

src/algebra/algebra/basic.lean

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1537,3 +1537,19 @@ begin
15371537
end
15381538

15391539
end submodule
1540+
1541+
namespace alg_hom
1542+
1543+
variables {R : Type u} {A : Type v} {B : Type w} {I : Type*}
1544+
1545+
variables [comm_semiring R] [semiring A] [semiring B]
1546+
variables [algebra R A] [algebra R B]
1547+
1548+
/-- `R`-algebra homomorphism between the function spaces `I → A` and `I → B`, induced by an
1549+
`R`-algebra homomorphism `f` between `A` and `B`. -/
1550+
@[simps] protected def comp_left (f : A →ₐ[R] B) (I : Type*) : (I → A) →ₐ[R] (I → B) :=
1551+
{ to_fun := λ h, f ∘ h,
1552+
commutes' := λ c, by { ext, exact f.commutes' c },
1553+
.. f.to_ring_hom.comp_left I }
1554+
1555+
end alg_hom

src/algebra/group/pi.lean

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,17 @@ def monoid_hom.coe_fn (α β : Type*) [mul_one_class α] [comm_monoid β] : (α
165165
map_one' := rfl,
166166
map_mul' := λ x y, rfl, }
167167

168+
/-- Monoid homomorphism between the function spaces `I → α` and `I → β`, induced by a monoid
169+
homomorphism `f` between `α` and `β`. -/
170+
@[to_additive "Additive monoid homomorphism between the function spaces `I → α` and `I → β`,
171+
induced by an additive monoid homomorphism `f` between `α` and `β`", simps]
172+
protected def monoid_hom.comp_left {α β : Type*} [mul_one_class α] [mul_one_class β] (f : α →* β)
173+
(I : Type*) :
174+
(I → α) →* (I → β) :=
175+
{ to_fun := λ h, f ∘ h,
176+
map_one' := by ext; simp,
177+
map_mul' := λ _ _, by ext; simp }
178+
168179
end monoid_hom
169180

170181
section single

src/algebra/ring/pi.lean

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -75,17 +75,28 @@ protected def ring_hom
7575
pi.ring_hom f g a = f a g :=
7676
rfl
7777

78+
end pi
79+
7880
section ring_hom
7981

80-
variables [Π i, non_assoc_semiring (f i)] (f)
82+
universes u v
83+
variable {I : Type u}
8184

8285
/-- Evaluation of functions into an indexed collection of monoids at a point is a monoid
8386
homomorphism. This is `function.eval` as a `ring_hom`. -/
8487
@[simps]
85-
def eval_ring_hom (i : I) : (Π i, f i) →+* f i :=
86-
{ ..(eval_monoid_hom f i),
87-
..(eval_add_monoid_hom f i) }
88+
def pi.eval_ring_hom (f : I → Type v) [Π i, non_assoc_semiring (f i)] (i : I) :
89+
(Π i, f i) →+* f i :=
90+
{ ..(pi.eval_monoid_hom f i),
91+
..(pi.eval_add_monoid_hom f i) }
92+
93+
/-- Ring homomorphism between the function spaces `I → α` and `I → β`, induced by a ring
94+
homomorphism `f` between `α` and `β`. -/
95+
@[simps] protected def ring_hom.comp_left {α β : Type*} [non_assoc_semiring α]
96+
[non_assoc_semiring β] (f : α →+* β) (I : Type*) :
97+
(I → α) →+* (I → β) :=
98+
{ to_fun := λ h, f ∘ h,
99+
.. f.to_monoid_hom.comp_left I,
100+
.. f.to_add_monoid_hom.comp_left I }
88101

89102
end ring_hom
90-
91-
end pi

src/linear_algebra/bilinear_form.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -727,7 +727,7 @@ end
727727

728728
lemma bilin_form.to_matrix'_comp_left (B : bilin_form R₃ (n → R₃)) (f : (n → R₃) →ₗ[R₃] (n → R₃)) :
729729
(B.comp_left f).to_matrix' = f.to_matrix'ᵀ ⬝ B.to_matrix' :=
730-
by simp only [comp_left, bilin_form.to_matrix'_comp, to_matrix'_id, matrix.mul_one]
730+
by simp only [bilin_form.comp_left, bilin_form.to_matrix'_comp, to_matrix'_id, matrix.mul_one]
731731

732732
lemma bilin_form.to_matrix'_comp_right (B : bilin_form R₃ (n → R₃)) (f : (n → R₃) →ₗ[R₃] (n → R₃)) :
733733
(B.comp_right f).to_matrix' = B.to_matrix' ⬝ f.to_matrix' :=

src/linear_algebra/pi.lean

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,10 @@ by ext; refl
5656
lemma pi_comp (f : Πi, M₂ →ₗ[R] φ i) (g : M₃ →ₗ[R] M₂) : (pi f).comp g = pi (λi, (f i).comp g) :=
5757
rfl
5858

59-
/-- The projections from a family of modules are linear maps. -/
59+
/-- The projections from a family of modules are linear maps.
60+
61+
Note: known here as `linear_map.proj`, this construction is in other categories called `eval`, for
62+
example `pi.eval_monoid_hom`, `pi.eval_ring_hom`. -/
6063
def proj (i : ι) : (Πi, φ i) →ₗ[R] φ i :=
6164
⟨ λa, a i, assume f g, rfl, assume c f, rfl ⟩
6265

@@ -74,6 +77,13 @@ begin
7477
exact (mem_bot _).2 (funext $ assume i, h i)
7578
end
7679

80+
/-- Linear map between the function spaces `I → M₂` and `I → M₃`, induced by a linear map `f`
81+
between `M₂` and `M₃`. -/
82+
@[simps] protected def comp_left (f : M₂ →ₗ[R] M₃) (I : Type*) : (I → M₂) →ₗ[R] (I → M₃) :=
83+
{ to_fun := λ h, f ∘ h,
84+
map_smul' := λ c h, by { ext x, exact f.map_smul' c (h x) },
85+
.. f.to_add_monoid_hom.comp_left I }
86+
7787
lemma apply_single [add_comm_monoid M] [module R M] [decidable_eq ι]
7888
(f : Π i, φ i →ₗ[R] M) (i j : ι) (x : φ i) :
7989
f j (pi.single i x j) = pi.single i (f i x) j :=

src/topology/continuous_function/algebra.lean

Lines changed: 43 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,19 @@ def coe_fn_monoid_hom {α : Type*} {β : Type*} [topological_space α] [topologi
123123
[monoid β] [has_continuous_mul β] : C(α, β) →* (α → β) :=
124124
{ to_fun := coe_fn, map_one' := coe_one, map_mul' := coe_mul }
125125

126-
/-- Composition on the right as an `monoid_hom`. Similar to `monoid_hom.comp_hom'`. -/
126+
/-- Composition on the left by a (continuous) homomorphism of topological monoids, as a
127+
`monoid_hom`. Similar to `monoid_hom.comp_left`. -/
128+
@[to_additive "Composition on the left by a (continuous) homomorphism of topological `add_monoid`s,
129+
as an `add_monoid_hom`. Similar to `add_monoid_hom.comp_left`.", simps]
130+
protected def _root_.monoid_hom.comp_left_continuous (α : Type*) {β : Type*} {γ : Type*}
131+
[topological_space α] [topological_space β] [monoid β] [has_continuous_mul β]
132+
[topological_space γ] [monoid γ] [has_continuous_mul γ] (g : β →* γ) (hg : continuous g) :
133+
C(α, β) →* C(α, γ) :=
134+
{ to_fun := λ f, (⟨g, hg⟩ : C(β, γ)).comp f,
135+
map_one' := ext $ λ x, g.map_one,
136+
map_mul' := λ f₁ f₂, ext $ λ x, g.map_mul _ _ }
137+
138+
/-- Composition on the right as a `monoid_hom`. Similar to `monoid_hom.comp_hom'`. -/
127139
@[to_additive "Composition on the right as an `add_monoid_hom`. Similar to
128140
`add_monoid_hom.comp_hom'`.", simps]
129141
def comp_monoid_hom' {α : Type*} {β : Type*} {γ : Type*}
@@ -255,6 +267,15 @@ instance {α : Type*} {β : Type*} [topological_space α]
255267
..continuous_map.add_comm_group,
256268
..continuous_map.comm_monoid,}
257269

270+
/-- Composition on the left by a (continuous) homomorphism of topological rings, as a `ring_hom`.
271+
Similar to `ring_hom.comp_left`. -/
272+
@[simps] protected def _root_.ring_hom.comp_left_continuous (α : Type*) {β : Type*} {γ : Type*}
273+
[topological_space α] [topological_space β] [semiring β] [topological_semiring β]
274+
[topological_space γ] [semiring γ] [topological_semiring γ] (g : β →+* γ) (hg : continuous g) :
275+
C(α, β) →+* C(α, γ) :=
276+
{ .. g.to_monoid_hom.comp_left_continuous α hg,
277+
.. g.to_add_monoid_hom.comp_left_continuous α hg }
278+
258279
/-- Coercion to a function as a `ring_hom`. -/
259280
@[simps]
260281
def coe_fn_ring_hom {α : Type*} {β : Type*} [topological_space α] [topological_space β]
@@ -307,6 +328,7 @@ namespace continuous_map
307328
variables {α : Type*} [topological_space α]
308329
{R : Type*} [semiring R] [topological_space R]
309330
{M : Type*} [topological_space M] [add_comm_monoid M]
331+
{M₂ : Type*} [topological_space M₂] [add_comm_monoid M₂]
310332

311333
instance
312334
[module R M] [has_continuous_smul R M] :
@@ -328,6 +350,7 @@ by simp
328350
by { ext, simp, }
329351

330352
variables [has_continuous_add M] [module R M] [has_continuous_smul R M]
353+
variables [has_continuous_add M₂] [module R M₂] [has_continuous_smul R M₂]
331354

332355
instance module : module R C(α, M) :=
333356
{ smul := (•),
@@ -340,6 +363,14 @@ instance module : module R C(α, M) :=
340363

341364
variables (R)
342365

366+
/-- Composition on the left by a continuous linear map, as a `linear_map`.
367+
Similar to `linear_map.comp_left`. -/
368+
@[simps] protected def _root_.continuous_linear_map.comp_left_continuous (α : Type*)
369+
[topological_space α] (g : M →L[R] M₂) :
370+
C(α, M) →ₗ[R] C(α, M₂) :=
371+
{ map_smul' := λ c f, ext $ λ x, g.map_smul' c _,
372+
.. g.to_linear_map.to_add_monoid_hom.comp_left_continuous α g.continuous }
373+
343374
/-- Coercion to a function as a `linear_map`. -/
344375
@[simps]
345376
def coe_fn_linear_map : C(α, M) →ₗ[R] (α → M) :=
@@ -401,6 +432,8 @@ variables {α : Type*} [topological_space α]
401432
{R : Type*} [comm_semiring R]
402433
{A : Type*} [topological_space A] [semiring A]
403434
[algebra R A] [topological_semiring A]
435+
{A₂ : Type*} [topological_space A₂] [semiring A₂]
436+
[algebra R A₂] [topological_semiring A₂]
404437

405438
/-- Continuous constant functions as a `ring_hom`. -/
406439
def continuous_map.C : R →+* C(α, A) :=
@@ -413,7 +446,7 @@ def continuous_map.C : R →+* C(α, A) :=
413446
@[simp] lemma continuous_map.C_apply (r : R) (a : α) : continuous_map.C r a = algebra_map R A r :=
414447
rfl
415448

416-
variables [topological_space R] [has_continuous_smul R A]
449+
variables [topological_space R] [has_continuous_smul R A] [has_continuous_smul R A₂]
417450

418451
instance continuous_map.algebra : algebra R C(α, A) :=
419452
{ to_ring_hom := continuous_map.C,
@@ -422,6 +455,14 @@ instance continuous_map.algebra : algebra R C(α, A) :=
422455

423456
variables (R)
424457

458+
/-- Composition on the left by a (continuous) homomorphism of topological `R`-algebras, as an
459+
`alg_hom`. Similar to `alg_hom.comp_left`. -/
460+
@[simps] protected def alg_hom.comp_left_continuous {α : Type*} [topological_space α]
461+
(g : A →ₐ[R] A₂) (hg : continuous g) :
462+
C(α, A) →ₐ[R] C(α, A₂) :=
463+
{ commutes' := λ c, continuous_map.ext $ λ _, g.commutes' _,
464+
.. g.to_ring_hom.comp_left_continuous α hg }
465+
425466
/-- Coercion to a function as an `alg_hom`. -/
426467
@[simps]
427468
def continuous_map.coe_fn_alg_hom : C(α, A) →ₐ[R] (α → A) :=

0 commit comments

Comments
 (0)