From 8f9efd688432cbbfe92c32a0b0b06c4d715f5c77 Mon Sep 17 00:00:00 2001 From: Jireh Loreaux Date: Mon, 22 Aug 2022 23:29:07 +0000 Subject: [PATCH] feat(topology/algebra/module/character_space): provide instances of `continuous_linear_map_class`, `non_unital_alg_hom_class` and `alg_hom_class` (#16178) This updates `character_space` to utilize the new hom classes `continuous_linear_map_class`, `non_unital_alg_hom_class` and `alg_hom_class`. Also performs some minor housekeeping related to `simp` lemmas. --- .../algebra/module/character_space.lean | 76 +++++++++++-------- 1 file changed, 45 insertions(+), 31 deletions(-) diff --git a/src/topology/algebra/module/character_space.lean b/src/topology/algebra/module/character_space.lean index d937e17b09bc9..ff31ed7f83132 100644 --- a/src/topology/algebra/module/character_space.lean +++ b/src/topology/algebra/module/character_space.lean @@ -50,29 +50,39 @@ variables [comm_semiring π•œ] [topological_space π•œ] [has_continuous_add π•œ [has_continuous_const_smul π•œ π•œ] [non_unital_non_assoc_semiring A] [topological_space A] [module π•œ A] -lemma coe_apply (Ο† : character_space π•œ A) (x : A) : (Ο† : weak_dual π•œ A) x = Ο† x := rfl +@[simp, norm_cast, protected] +lemma coe_coe (Ο† : character_space π•œ A) : ⇑(Ο† : weak_dual π•œ A) = Ο† := rfl + +/-- Elements of the character space are continuous linear maps. -/ +instance : continuous_linear_map_class (character_space π•œ A) π•œ A π•œ := +{ coe := Ξ» Ο†, (Ο† : A β†’ π•œ), + coe_injective' := Ξ» Ο† ψ h, by { ext, exact congr_fun h x }, + map_smulβ‚›β‚— := Ξ» Ο†, (Ο† : weak_dual π•œ A).map_smul, + map_add := Ξ» Ο†, (Ο† : weak_dual π•œ A).map_add, + map_continuous := Ξ» Ο†, (Ο† : weak_dual π•œ A).cont } /-- An element of the character space, as a continuous linear map. -/ def to_clm (Ο† : character_space π•œ A) : A β†’L[π•œ] π•œ := (Ο† : weak_dual π•œ A) -lemma to_clm_apply (Ο† : character_space π•œ A) (x : A) : Ο† x = to_clm Ο† x := rfl +@[simp] lemma coe_to_clm (Ο† : character_space π•œ A) : ⇑(to_clm Ο†) = Ο† := rfl + +/-- Elements of the character space are non-unital algebra homomorphisms. -/ +instance : non_unital_alg_hom_class (character_space π•œ A) π•œ A π•œ := +{ map_smul := Ξ» Ο†, map_smul Ο†, + map_zero := Ξ» Ο†, map_zero Ο†, + map_mul := Ξ» Ο†, Ο†.prop.2, + .. character_space.continuous_linear_map_class } /-- An element of the character space, as an non-unital algebra homomorphism. -/ -@[simps] def to_non_unital_alg_hom (Ο† : character_space π•œ A) : A →ₙₐ[π•œ] π•œ := +def to_non_unital_alg_hom (Ο† : character_space π•œ A) : A →ₙₐ[π•œ] π•œ := { to_fun := (Ο† : A β†’ π•œ), - map_mul' := Ο†.prop.2, - map_smul' := (to_clm Ο†).map_smul, - map_zero' := continuous_linear_map.map_zero _, - map_add' := continuous_linear_map.map_add _ } - -lemma map_zero (Ο† : character_space π•œ A) : Ο† 0 = 0 := (to_non_unital_alg_hom Ο†).map_zero -lemma map_add (Ο† : character_space π•œ A) (x y : A) : Ο† (x + y) = Ο† x + Ο† y := - (to_non_unital_alg_hom Ο†).map_add _ _ -lemma map_smul (Ο† : character_space π•œ A) (r : π•œ) (x : A) : Ο† (r β€’ x) = r β€’ (Ο† x) := - (to_clm Ο†).map_smul _ _ -lemma map_mul (Ο† : character_space π•œ A) (x y : A) : Ο† (x * y) = Ο† x * Ο† y := - (to_non_unital_alg_hom Ο†).map_mul _ _ -lemma continuous (Ο† : character_space π•œ A) : continuous Ο† := (to_clm Ο†).continuous + map_mul' := map_mul Ο†, + map_smul' := map_smul Ο†, + map_zero' := map_zero Ο†, + map_add' := map_add Ο† } + +@[simp] +lemma coe_to_non_unital_alg_hom (Ο† : character_space π•œ A) : ⇑(to_non_unital_alg_hom Ο†) = Ο† := rfl end non_unital_non_assoc_semiring @@ -81,32 +91,36 @@ section unital variables [comm_ring π•œ] [no_zero_divisors π•œ] [topological_space π•œ] [has_continuous_add π•œ] [has_continuous_const_smul π•œ π•œ] [topological_space A] [semiring A] [algebra π•œ A] -lemma map_one (Ο† : character_space π•œ A) : Ο† 1 = 1 := +/-- In a unital algebra, elements of the character space are algebra homomorphisms. -/ +instance : alg_hom_class (character_space π•œ A) π•œ A π•œ := +have map_one' : βˆ€ Ο† : character_space π•œ A, Ο† 1 = 1 := Ξ» Ο†, begin have h₁ : (Ο† 1) * (1 - Ο† 1) = 0 := by rw [mul_sub, sub_eq_zero, mul_one, ←map_mul Ο†, one_mul], - rcases mul_eq_zero.mp h₁ with hβ‚‚|hβ‚‚, - { exfalso, - apply Ο†.prop.1, - ext, - rw [continuous_linear_map.zero_apply, ←one_mul x, coe_apply, map_mul Ο†, hβ‚‚, zero_mul] }, - { rw [sub_eq_zero] at hβ‚‚, - exact hβ‚‚.symm }, -end + rcases mul_eq_zero.mp h₁ with hβ‚‚ | hβ‚‚, + { have : βˆ€ a, Ο† (a * 1) = 0 := Ξ» a, by simp only [map_mul Ο†, hβ‚‚, mul_zero], + exact false.elim (Ο†.prop.1 $ continuous_linear_map.ext $ by simpa only [mul_one] using this) }, + { exact (sub_eq_zero.mp hβ‚‚).symm }, +end, +{ map_one := map_one', + commutes := Ξ» Ο† r, + begin + { rw [algebra.algebra_map_eq_smul_one, algebra.id.map_eq_id, ring_hom.id_apply], + change ((Ο† : weak_dual π•œ A) : A β†’L[π•œ] π•œ) (r β€’ 1) = r, + rw [map_smul, algebra.id.smul_eq_mul, character_space.coe_coe, map_one' Ο†, mul_one] }, + end, + .. character_space.non_unital_alg_hom_class } -/-- An element of the character space, as an algebra homomorphism. -/ +/-- An element of the character space of a unital algebra, as an algebra homomorphism. -/ @[simps] def to_alg_hom (Ο† : character_space π•œ A) : A →ₐ[π•œ] π•œ := { map_one' := map_one Ο†, - commutes' := Ξ» r, by - { rw [algebra.algebra_map_eq_smul_one, algebra.id.map_eq_id, ring_hom.id_apply], - change ((Ο† : weak_dual π•œ A) : A β†’L[π•œ] π•œ) (r β€’ 1) = r, - rw [continuous_linear_map.map_smul, algebra.id.smul_eq_mul, coe_apply, map_one Ο†, mul_one] }, + commutes' := alg_hom_class.commutes Ο†, ..to_non_unital_alg_hom Ο† } lemma eq_set_map_one_map_mul [nontrivial π•œ] : character_space π•œ A = {Ο† : weak_dual π•œ A | (Ο† 1 = 1) ∧ (βˆ€ (x y : A), Ο† (x * y) = (Ο† x) * (Ο† y))} := begin ext x, - refine ⟨λ h, ⟨map_one ⟨x, h⟩, h.2⟩, Ξ» h, ⟨_, h.2⟩⟩, + refine ⟨λ h, ⟨map_one (⟨x, h⟩ : character_space π•œ A), h.2⟩, Ξ» h, ⟨_, h.2⟩⟩, rintro rfl, simpa using h.1, end