|
| 1 | +/- |
| 2 | +Copyright (c) 2021 Oliver Nash. All rights reserved. |
| 3 | +Released under Apache 2.0 license as described in the file LICENSE. |
| 4 | +Authors: Oliver Nash |
| 5 | +-/ |
| 6 | +import algebra.algebra.basic |
| 7 | + |
| 8 | +/-! |
| 9 | +# Morphisms of non-unital algebras |
| 10 | +
|
| 11 | +This file defines morphisms between two types, each of which carries: |
| 12 | + * an addition, |
| 13 | + * an additive zero, |
| 14 | + * a multiplication, |
| 15 | + * a scalar action. |
| 16 | +
|
| 17 | +The multiplications are not assumed to be associative or unital, or even to be compatible with the |
| 18 | +scalar actions. In a typical application, the operations will satisfy compatibility conditions |
| 19 | +making them into algebras (albeit possibly non-associative and/or non-unital) but such conditions |
| 20 | +are not required to make this definition. |
| 21 | +
|
| 22 | +This notion of morphism should be useful for any category of non-unital algebras. The motivating |
| 23 | +application at the time it was introduced was to be able to state the adjunction property for |
| 24 | +magma algebras. These are non-unital, non-associative algebras obtained by applying the |
| 25 | +group-algebra construction except where we take a type carrying just `has_mul` instead of `group`. |
| 26 | +
|
| 27 | +For a plausible future application, one could take the non-unital algebra of compactly-supported |
| 28 | +functions on a non-compact topological space. A proper map between a pair of such spaces |
| 29 | +(contravariantly) induces a morphism between their algebras of compactly-supported functions which |
| 30 | +will be a `non_unital_alg_hom`. |
| 31 | +
|
| 32 | +TODO: add `non_unital_alg_equiv` when needed. |
| 33 | +
|
| 34 | +## Main definitions |
| 35 | +
|
| 36 | + * `non_unital_alg_hom` |
| 37 | + * `alg_hom.to_non_unital_alg_hom` |
| 38 | +
|
| 39 | +## Tags |
| 40 | +
|
| 41 | +non-unital, algebra, morphism |
| 42 | +-/ |
| 43 | + |
| 44 | +universes u v w w₁ w₂ w₃ |
| 45 | + |
| 46 | +variables (R : Type u) (A : Type v) (B : Type w) (C : Type w₁) |
| 47 | + |
| 48 | +set_option old_structure_cmd true |
| 49 | + |
| 50 | +/-- A morphism respecting addition, multiplication, and scalar multiplication. When these arise from |
| 51 | +algebra structures, this is the same as a not-necessarily-unital morphism of algebras. -/ |
| 52 | +structure non_unital_alg_hom [monoid R] |
| 53 | + [non_unital_non_assoc_semiring A] [distrib_mul_action R A] |
| 54 | + [non_unital_non_assoc_semiring B] [distrib_mul_action R B] |
| 55 | + extends A →+[R] B, mul_hom A B |
| 56 | + |
| 57 | +attribute [nolint doc_blame] non_unital_alg_hom.to_distrib_mul_action_hom |
| 58 | +attribute [nolint doc_blame] non_unital_alg_hom.to_mul_hom |
| 59 | + |
| 60 | +initialize_simps_projections non_unital_alg_hom (to_fun → apply) |
| 61 | + |
| 62 | +namespace non_unital_alg_hom |
| 63 | + |
| 64 | +variables {R A B C} [semiring R] |
| 65 | +variables [non_unital_non_assoc_semiring A] [distrib_mul_action R A] |
| 66 | +variables [non_unital_non_assoc_semiring B] [distrib_mul_action R B] |
| 67 | +variables [non_unital_non_assoc_semiring C] [distrib_mul_action R C] |
| 68 | + |
| 69 | +/-- see Note [function coercion] -/ |
| 70 | +instance : has_coe_to_fun (non_unital_alg_hom R A B) := ⟨_, to_fun⟩ |
| 71 | + |
| 72 | +@[simp] lemma to_fun_eq_coe (f : non_unital_alg_hom R A B) : f.to_fun = ⇑f := rfl |
| 73 | + |
| 74 | +lemma coe_injective : |
| 75 | + @function.injective (non_unital_alg_hom R A B) (A → B) coe_fn := |
| 76 | +by rintro ⟨f, _⟩ ⟨g, _⟩ ⟨h⟩; congr |
| 77 | + |
| 78 | +@[ext] lemma ext {f g : non_unital_alg_hom R A B} (h : ∀ x, f x = g x) : f = g := |
| 79 | +coe_injective $ funext h |
| 80 | + |
| 81 | +lemma ext_iff {f g : non_unital_alg_hom R A B} : f = g ↔ ∀ x, f x = g x := |
| 82 | +⟨by { rintro rfl x, refl }, ext⟩ |
| 83 | + |
| 84 | +@[simp] lemma coe_mk (f : A → B) (h₁ h₂ h₃ h₄) : |
| 85 | + ((⟨f, h₁, h₂, h₃, h₄⟩ : non_unital_alg_hom R A B) : A → B) = f := |
| 86 | +rfl |
| 87 | + |
| 88 | +@[simp] lemma mk_coe (f : non_unital_alg_hom R A B) (h₁ h₂ h₃ h₄) : |
| 89 | + (⟨f, h₁, h₂, h₃, h₄⟩ : non_unital_alg_hom R A B) = f := |
| 90 | +by { ext, refl, } |
| 91 | + |
| 92 | +instance : has_coe (non_unital_alg_hom R A B) (A →+[R] B) := |
| 93 | +⟨to_distrib_mul_action_hom⟩ |
| 94 | + |
| 95 | +instance : has_coe (non_unital_alg_hom R A B) (mul_hom A B) := ⟨to_mul_hom⟩ |
| 96 | + |
| 97 | +@[simp] lemma to_distrib_mul_action_hom_eq_coe (f : non_unital_alg_hom R A B) : |
| 98 | + f.to_distrib_mul_action_hom = ↑f := |
| 99 | +rfl |
| 100 | + |
| 101 | +@[simp] lemma to_mul_hom_eq_coe (f : non_unital_alg_hom R A B) : f.to_mul_hom = ↑f := |
| 102 | +rfl |
| 103 | + |
| 104 | +@[simp, norm_cast] lemma coe_to_distrib_mul_action_hom (f : non_unital_alg_hom R A B) : |
| 105 | + ((f : A →+[R] B) : A → B) = f := |
| 106 | +rfl |
| 107 | + |
| 108 | +@[simp, norm_cast] lemma coe_to_mul_hom (f : non_unital_alg_hom R A B) : |
| 109 | + ((f : mul_hom A B) : A → B) = f := |
| 110 | +rfl |
| 111 | + |
| 112 | +@[norm_cast] lemma coe_distrib_mul_action_hom_mk (f : non_unital_alg_hom R A B) (h₁ h₂ h₃ h₄) : |
| 113 | + ((⟨f, h₁, h₂, h₃, h₄⟩ : non_unital_alg_hom R A B) : A →+[R] B) = |
| 114 | + ⟨f, h₁, h₂, h₃⟩ := |
| 115 | +by { ext, refl, } |
| 116 | + |
| 117 | +@[norm_cast] lemma coe_mul_hom_mk (f : non_unital_alg_hom R A B) (h₁ h₂ h₃ h₄) : |
| 118 | + ((⟨f, h₁, h₂, h₃, h₄⟩ : non_unital_alg_hom R A B) : mul_hom A B) = ⟨f, h₄⟩ := |
| 119 | +by { ext, refl, } |
| 120 | + |
| 121 | +@[simp] lemma map_smul (f : non_unital_alg_hom R A B) (c : R) (x : A) : |
| 122 | + f (c • x) = c • f x := |
| 123 | +f.to_distrib_mul_action_hom.map_smul c x |
| 124 | + |
| 125 | +@[simp] lemma map_add (f : non_unital_alg_hom R A B) (x y : A) : |
| 126 | + f (x + y) = (f x) + (f y) := |
| 127 | +f.to_distrib_mul_action_hom.map_add x y |
| 128 | + |
| 129 | +@[simp] lemma map_mul (f : non_unital_alg_hom R A B) (x y : A) : |
| 130 | + f (x * y) = (f x) * (f y) := |
| 131 | +f.to_mul_hom.map_mul x y |
| 132 | + |
| 133 | +@[simp] lemma map_zero (f : non_unital_alg_hom R A B) : f 0 = 0 := |
| 134 | +f.to_distrib_mul_action_hom.map_zero |
| 135 | + |
| 136 | +instance : has_zero (non_unital_alg_hom R A B) := |
| 137 | +⟨{ map_mul' := by simp, |
| 138 | + .. (0 : A →+[R] B) }⟩ |
| 139 | + |
| 140 | +instance : has_one (non_unital_alg_hom R A A) := |
| 141 | +⟨{ map_mul' := by simp, |
| 142 | + .. (1 : A →+[R] A) }⟩ |
| 143 | + |
| 144 | +@[simp] lemma coe_zero : ((0 : non_unital_alg_hom R A B) : A → B) = 0 := rfl |
| 145 | + |
| 146 | +@[simp] lemma coe_one : ((1 : non_unital_alg_hom R A A) : A → A) = id := rfl |
| 147 | + |
| 148 | +lemma zero_apply (a : A) : (0 : non_unital_alg_hom R A B) a = 0 := rfl |
| 149 | + |
| 150 | +lemma one_apply (a : A) : (1 : non_unital_alg_hom R A A) a = a := rfl |
| 151 | + |
| 152 | +instance : inhabited (non_unital_alg_hom R A B) := ⟨0⟩ |
| 153 | + |
| 154 | +/-- The composition of morphisms is a morphism. -/ |
| 155 | +def comp (f : non_unital_alg_hom R B C) (g : non_unital_alg_hom R A B) : non_unital_alg_hom R A C := |
| 156 | +{ .. (f : mul_hom B C).comp (g : mul_hom A B), |
| 157 | + .. (f : B →+[R] C).comp (g : A →+[R] B) } |
| 158 | + |
| 159 | +@[simp, norm_cast] lemma coe_comp (f : non_unital_alg_hom R B C) (g : non_unital_alg_hom R A B) : |
| 160 | + (f.comp g : A → C) = (f : B → C) ∘ (g : A → B) := |
| 161 | +rfl |
| 162 | + |
| 163 | +lemma comp_apply (f : non_unital_alg_hom R B C) (g : non_unital_alg_hom R A B) (x : A) : |
| 164 | + f.comp g x = f (g x) := |
| 165 | +rfl |
| 166 | + |
| 167 | +/-- The inverse of a bijective morphism is a morphism. -/ |
| 168 | +def inverse (f : non_unital_alg_hom R A B) (g : B → A) |
| 169 | + (h₁ : function.left_inverse g f) (h₂ : function.right_inverse g f) : |
| 170 | + non_unital_alg_hom R B A := |
| 171 | +{ .. (f : mul_hom A B).inverse g h₁ h₂, |
| 172 | + .. (f : A →+[R] B).inverse g h₁ h₂ } |
| 173 | + |
| 174 | +@[simp] lemma coe_inverse (f : non_unital_alg_hom R A B) (g : B → A) |
| 175 | + (h₁ : function.left_inverse g f) (h₂ : function.right_inverse g f) : |
| 176 | + (inverse f g h₁ h₂ : B → A) = g := |
| 177 | +rfl |
| 178 | + |
| 179 | +end non_unital_alg_hom |
| 180 | + |
| 181 | +namespace alg_hom |
| 182 | + |
| 183 | +variables {R A B} [comm_semiring R] [semiring A] [semiring B] [algebra R A] [algebra R B] |
| 184 | + |
| 185 | +/-- A unital morphism of algebras is a `non_unital_alg_hom`. -/ |
| 186 | +def to_non_unital_alg_hom (f : A →ₐ[R] B) : non_unital_alg_hom R A B := |
| 187 | +{ map_smul' := f.map_smul, .. f, } |
| 188 | + |
| 189 | +instance non_unital_alg_hom.has_coe : has_coe (A →ₐ[R] B) (non_unital_alg_hom R A B) := |
| 190 | +⟨to_non_unital_alg_hom⟩ |
| 191 | + |
| 192 | +@[simp] lemma to_non_unital_alg_hom_eq_coe (f : A →ₐ[R] B) : f.to_non_unital_alg_hom = f := |
| 193 | +rfl |
| 194 | + |
| 195 | +@[simp, norm_cast] lemma coe_to_non_unital_alg_hom (f : A →ₐ[R] B) : |
| 196 | + ((f : non_unital_alg_hom R A B) : A → B) = f := |
| 197 | +rfl |
| 198 | + |
| 199 | +end alg_hom |
0 commit comments