diff --git "a/Extracted/Mathlib/TacticPrediction/Mathlib_Algebra_Algebra_NonUnitalHom.jsonl" "b/Extracted/Mathlib/TacticPrediction/Mathlib_Algebra_Algebra_NonUnitalHom.jsonl" deleted file mode 100644--- "a/Extracted/Mathlib/TacticPrediction/Mathlib_Algebra_Algebra_NonUnitalHom.jsonl" +++ /dev/null @@ -1,20 +0,0 @@ -{"state":"R : Type u\nA : Type v\nB : Type w\nC : Type w₁\ninst✝⁶ : Monoid R\ninst✝⁵ : NonUnitalNonAssocSemiring A\ninst✝⁴ : DistribMulAction R A\ninst✝³ : NonUnitalNonAssocSemiring B\ninst✝² : DistribMulAction R B\ninst✝¹ : NonUnitalNonAssocSemiring C\ninst✝ : DistribMulAction R C\n⊢ Function.Injective fun f => f.toFun","srcUpToTactic":"/-\nCopyright (c) 2021 Oliver Nash. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Oliver Nash\n-/\nimport Mathlib.Algebra.Algebra.Hom\n\n#align_import algebra.hom.non_unital_alg from \"leanprover-community/mathlib\"@\"bd9851ca476957ea4549eb19b40e7b5ade9428cc\"\n\n/-!\n# Morphisms of non-unital algebras\n\nThis file defines morphisms between two types, each of which carries:\n * an addition,\n * an additive zero,\n * a multiplication,\n * a scalar action.\n\nThe multiplications are not assumed to be associative or unital, or even to be compatible with the\nscalar actions. In a typical application, the operations will satisfy compatibility conditions\nmaking them into algebras (albeit possibly non-associative and/or non-unital) but such conditions\nare not required to make this definition.\n\nThis notion of morphism should be useful for any category of non-unital algebras. The motivating\napplication at the time it was introduced was to be able to state the adjunction property for\nmagma algebras. These are non-unital, non-associative algebras obtained by applying the\ngroup-algebra construction except where we take a type carrying just `Mul` instead of `Group`.\n\nFor a plausible future application, one could take the non-unital algebra of compactly-supported\nfunctions on a non-compact topological space. A proper map between a pair of such spaces\n(contravariantly) induces a morphism between their algebras of compactly-supported functions which\nwill be a `NonUnitalAlgHom`.\n\nTODO: add `NonUnitalAlgEquiv` when needed.\n\n## Main definitions\n\n * `NonUnitalAlgHom`\n * `AlgHom.toNonUnitalAlgHom`\n\n## Tags\n\nnon-unital, algebra, morphism\n-/\n\nset_option autoImplicit true\n\n\nuniverse u v w w₁ w₂ w₃\n\nvariable (R : Type u) (A : Type v) (B : Type w) (C : Type w₁)\n\n/-- A morphism respecting addition, multiplication, and scalar multiplication. When these arise from\nalgebra structures, this is the same as a not-necessarily-unital morphism of algebras. -/\nstructure NonUnitalAlgHom [Monoid R] [NonUnitalNonAssocSemiring A] [DistribMulAction R A]\n [NonUnitalNonAssocSemiring B] [DistribMulAction R B] extends A →+[R] B, A →ₙ* B\n#align non_unital_alg_hom NonUnitalAlgHom\n\n@[inherit_doc NonUnitalAlgHom]\ninfixr:25 \" →ₙₐ \" => NonUnitalAlgHom _\n\n@[inherit_doc]\nnotation:25 A \" →ₙₐ[\" R \"] \" B => NonUnitalAlgHom R A B\n\nattribute [nolint docBlame] NonUnitalAlgHom.toMulHom\n\n/-- `NonUnitalAlgHomClass F R A B` asserts `F` is a type of bundled algebra homomorphisms\nfrom `A` to `B`. -/\nclass NonUnitalAlgHomClass (F : Type*) (R : outParam (Type*)) (A : outParam (Type*))\n (B : outParam (Type*)) [Monoid R] [NonUnitalNonAssocSemiring A] [NonUnitalNonAssocSemiring B]\n [DistribMulAction R A] [DistribMulAction R B] extends DistribMulActionHomClass F R A B,\n MulHomClass F A B\n#align non_unital_alg_hom_class NonUnitalAlgHomClass\n\n-- Porting note: commented out, not dangerous\n-- attribute [nolint dangerousInstance] NonUnitalAlgHomClass.toMulHomClass\n\nnamespace NonUnitalAlgHomClass\n\n-- Porting note: Made following instance non-dangerous through [...] -> [...] replacement\n-- See note [lower instance priority]\ninstance (priority := 100) toNonUnitalRingHomClass {F R A B : Type*}\n [Monoid R] [NonUnitalNonAssocSemiring A] [DistribMulAction R A]\n [NonUnitalNonAssocSemiring B] [DistribMulAction R B]\n [NonUnitalAlgHomClass F R A B] : NonUnitalRingHomClass F A B :=\n { ‹NonUnitalAlgHomClass F R A B› with coe := (⇑) }\n#align non_unital_alg_hom_class.non_unital_alg_hom_class.to_non_unital_ring_hom_class NonUnitalAlgHomClass.toNonUnitalRingHomClass\n\nvariable [Semiring R] [NonUnitalNonAssocSemiring A] [Module R A]\n [NonUnitalNonAssocSemiring B] [Module R B]\n\n-- see Note [lower instance priority]\ninstance (priority := 100) {F : Type*} [NonUnitalAlgHomClass F R A B] : LinearMapClass F R A B :=\n { ‹NonUnitalAlgHomClass F R A B› with map_smulₛₗ := map_smul }\n\n/-- Turn an element of a type `F` satisfying `NonUnitalAlgHomClass F R A B` into an actual\n`NonUnitalAlgHom`. This is declared as the default coercion from `F` to `A →ₙₐ[R] B`. -/\n@[coe]\ndef toNonUnitalAlgHom {F R A B : Type*} [Monoid R] [NonUnitalNonAssocSemiring A]\n [DistribMulAction R A] [NonUnitalNonAssocSemiring B] [DistribMulAction R B]\n [NonUnitalAlgHomClass F R A B] (f : F) : A →ₙₐ[R] B :=\n { (f : A →ₙ+* B) with\n map_smul' := map_smul f }\n\ninstance {F R A B : Type*} [Monoid R] [NonUnitalNonAssocSemiring A] [DistribMulAction R A]\n [NonUnitalNonAssocSemiring B] [DistribMulAction R B] [NonUnitalAlgHomClass F R A B] :\n CoeTC F (A →���ₐ[R] B) :=\n ⟨toNonUnitalAlgHom⟩\n\nend NonUnitalAlgHomClass\n\nnamespace NonUnitalAlgHom\n\nvariable {R A B C} [Monoid R]\n\nvariable [NonUnitalNonAssocSemiring A] [DistribMulAction R A]\n\nvariable [NonUnitalNonAssocSemiring B] [DistribMulAction R B]\n\nvariable [NonUnitalNonAssocSemiring C] [DistribMulAction R C]\n\n-- Porting note: Replaced with FunLike instance\n-- /-- see Note [function coercion] -/\n-- instance : CoeFun (A →ₙₐ[R] B) fun _ => A → B :=\n-- ⟨toFun⟩\n\ninstance : FunLike (A →ₙₐ[R] B) A fun _ => B where\n coe f := f.toFun\n coe_injective' := by ","nextTactic":"rintro ⟨⟨⟨f, _⟩, _⟩, _⟩ ⟨⟨⟨g, _⟩, _⟩, _⟩ h","declUpToTactic":"instance : FunLike (A →ₙₐ[R] B) A fun _ => B where\n coe f := f.toFun\n coe_injective' := by ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_NonUnitalHom.127_0.9y3TORfxg2P0A5c","decl":"instance : FunLike (A →ₙₐ[R] B) A fun _ => B where\n coe f "} -{"state":"case mk.mk.mk.mk.mk.mk\nR : Type u\nA : Type v\nB : Type w\nC : Type w₁\ninst✝⁶ : Monoid R\ninst✝⁵ : NonUnitalNonAssocSemiring A\ninst✝⁴ : DistribMulAction R A\ninst✝³ : NonUnitalNonAssocSemiring B\ninst✝² : DistribMulAction R B\ninst✝¹ : NonUnitalNonAssocSemiring C\ninst✝ : DistribMulAction R C\nf : A → B\nmap_smul'✝¹ : ∀ (m : R) (x : A), f (m • x) = m • f x\nmap_zero'✝¹ : MulActionHom.toFun { toFun := f, map_smul' := map_smul'✝¹ } 0 = 0\nmap_add'✝¹ :\n ∀ (x y : A),\n MulActionHom.toFun { toFun := f, map_smul' := map_smul'✝¹ } (x + y) =\n MulActionHom.toFun { toFun := f, map_smul' := map_smul'✝¹ } x +\n MulActionHom.toFun { toFun := f, map_smul' := map_smul'✝¹ } y\nmap_mul'✝¹ :\n ∀ (x y : A),\n MulActionHom.toFun\n { toMulActionHom := { toFun := f, map_smul' := map_smul'✝¹ }, map_zero' := map_zero'✝¹,\n map_add' := map_add'✝¹ }.toMulActionHom\n (x * y) =\n MulActionHom.toFun\n { toMulActionHom := { toFun := f, map_smul' := map_smul'✝¹ }, map_zero' := map_zero'✝¹,\n map_add' := map_add'✝¹ }.toMulActionHom\n x *\n MulActionHom.toFun\n { toMulActionHom := { toFun := f, map_smul' := map_smul'✝¹ }, map_zero' := map_zero'✝¹,\n map_add' := map_add'✝¹ }.toMulActionHom\n y\ng : A → B\nmap_smul'✝ : ∀ (m : R) (x : A), g (m • x) = m • g x\nmap_zero'✝ : MulActionHom.toFun { toFun := g, map_smul' := map_smul'✝ } 0 = 0\nmap_add'✝ :\n ∀ (x y : A),\n MulActionHom.toFun { toFun := g, map_smul' := map_smul'✝ } (x + y) =\n MulActionHom.toFun { toFun := g, map_smul' := map_smul'✝ } x +\n MulActionHom.toFun { toFun := g, map_smul' := map_smul'✝ } y\nmap_mul'✝ :\n ∀ (x y : A),\n MulActionHom.toFun\n { toMulActionHom := { toFun := g, map_smul' := map_smul'✝ }, map_zero' := map_zero'✝,\n map_add' := map_add'✝ }.toMulActionHom\n (x * y) =\n MulActionHom.toFun\n { toMulActionHom := { toFun := g, map_smul' := map_smul'✝ }, map_zero' := map_zero'✝,\n map_add' := map_add'✝ }.toMulActionHom\n x *\n MulActionHom.toFun\n { toMulActionHom := { toFun := g, map_smul' := map_smul'✝ }, map_zero' := map_zero'✝,\n map_add' := map_add'✝ }.toMulActionHom\n y\nh :\n (fun f => f.toFun)\n {\n toDistribMulActionHom :=\n { toMulActionHom := { toFun := f, map_smul' := map_smul'✝¹ }, map_zero' := map_zero'✝¹,\n map_add' := map_add'✝¹ },\n map_mul' := map_mul'✝¹ } =\n (fun f => f.toFun)\n {\n toDistribMulActionHom :=\n { toMulActionHom := { toFun := g, map_smul' := map_smul'✝ }, map_zero' := map_zero'✝, map_add' := map_add'✝ },\n map_mul' := map_mul'✝ }\n⊢ {\n toDistribMulActionHom :=\n { toMulActionHom := { toFun := f, map_smul' := map_smul'✝¹ }, map_zero' := map_zero'✝¹,\n map_add' := map_add'✝¹ },\n map_mul' := map_mul'✝¹ } =\n {\n toDistribMulActionHom :=\n { toMulActionHom := { toFun := g, map_smul' := map_smul'✝ }, map_zero' := map_zero'✝, map_add' := map_add'✝ },\n map_mul' := map_mul'✝ }","srcUpToTactic":"/-\nCopyright (c) 2021 Oliver Nash. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Oliver Nash\n-/\nimport Mathlib.Algebra.Algebra.Hom\n\n#align_import algebra.hom.non_unital_alg from \"leanprover-community/mathlib\"@\"bd9851ca476957ea4549eb19b40e7b5ade9428cc\"\n\n/-!\n# Morphisms of non-unital algebras\n\nThis file defines morphisms between two types, each of which carries:\n * an addition,\n * an additive zero,\n * a multiplication,\n * a scalar action.\n\nThe multiplications are not assumed to be associative or unital, or even to be compatible with the\nscalar actions. In a typical application, the operations will satisfy compatibility conditions\nmaking them into algebras (albeit possibly non-associative and/or non-unital) but such conditions\nare not required to make this definition.\n\nThis notion of morphism should be useful for any category of non-unital algebras. The motivating\napplication at the time it was introduced was to be able to state the adjunction property for\nmagma algebras. These are non-unital, non-associative algebras obtained by applying the\ngroup-algebra construction except where we take a type carrying just `Mul` instead of `Group`.\n\nFor a plausible future application, one could take the non-unital algebra of compactly-supported\nfunctions on a non-compact topological space. A proper map between a pair of such spaces\n(contravariantly) induces a morphism between their algebras of compactly-supported functions which\nwill be a `NonUnitalAlgHom`.\n\nTODO: add `NonUnitalAlgEquiv` when needed.\n\n## Main definitions\n\n * `NonUnitalAlgHom`\n * `AlgHom.toNonUnitalAlgHom`\n\n## Tags\n\nnon-unital, algebra, morphism\n-/\n\nset_option autoImplicit true\n\n\nuniverse u v w w₁ w₂ w₃\n\nvariable (R : Type u) (A : Type v) (B : Type w) (C : Type w₁)\n\n/-- A morphism respecting addition, multiplication, and scalar multiplication. When these arise from\nalgebra structures, this is the same as a not-necessarily-unital morphism of algebras. -/\nstructure NonUnitalAlgHom [Monoid R] [NonUnitalNonAssocSemiring A] [DistribMulAction R A]\n [NonUnitalNonAssocSemiring B] [DistribMulAction R B] extends A →+[R] B, A →ₙ* B\n#align non_unital_alg_hom NonUnitalAlgHom\n\n@[inherit_doc NonUnitalAlgHom]\ninfixr:25 \" →ₙₐ \" => NonUnitalAlgHom _\n\n@[inherit_doc]\nnotation:25 A \" →ₙₐ[\" R \"] \" B => NonUnitalAlgHom R A B\n\nattribute [nolint docBlame] NonUnitalAlgHom.toMulHom\n\n/-- `NonUnitalAlgHomClass F R A B` asserts `F` is a type of bundled algebra homomorphisms\nfrom `A` to `B`. -/\nclass NonUnitalAlgHomClass (F : Type*) (R : outParam (Type*)) (A : outParam (Type*))\n (B : outParam (Type*)) [Monoid R] [NonUnitalNonAssocSemiring A] [NonUnitalNonAssocSemiring B]\n [DistribMulAction R A] [DistribMulAction R B] extends DistribMulActionHomClass F R A B,\n MulHomClass F A B\n#align non_unital_alg_hom_class NonUnitalAlgHomClass\n\n-- Porting note: commented out, not dangerous\n-- attribute [nolint dangerousInstance] NonUnitalAlgHomClass.toMulHomClass\n\nnamespace NonUnitalAlgHomClass\n\n-- Porting note: Made following instance non-dangerous through [...] -> [...] replacement\n-- See note [lower instance priority]\ninstance (priority := 100) toNonUnitalRingHomClass {F R A B : Type*}\n [Monoid R] [NonUnitalNonAssocSemiring A] [DistribMulAction R A]\n [NonUnitalNonAssocSemiring B] [DistribMulAction R B]\n [NonUnitalAlgHomClass F R A B] : NonUnitalRingHomClass F A B :=\n { ‹NonUnitalAlgHomClass F R A B› with coe := (⇑) }\n#align non_unital_alg_hom_class.non_unital_alg_hom_class.to_non_unital_ring_hom_class NonUnitalAlgHomClass.toNonUnitalRingHomClass\n\nvariable [Semiring R] [NonUnitalNonAssocSemiring A] [Module R A]\n [NonUnitalNonAssocSemiring B] [Module R B]\n\n-- see Note [lower instance priority]\ninstance (priority := 100) {F : Type*} [NonUnitalAlgHomClass F R A B] : LinearMapClass F R A B :=\n { ‹NonUnitalAlgHomClass F R A B› with map_smulₛₗ := map_smul }\n\n/-- Turn an element of a type `F` satisfying `NonUnitalAlgHomClass F R A B` into an actual\n`NonUnitalAlgHom`. This is declared as the default coercion from `F` to `A →ₙₐ[R] B`. -/\n@[coe]\ndef toNonUnitalAlgHom {F R A B : Type*} [Monoid R] [NonUnitalNonAssocSemiring A]\n [DistribMulAction R A] [NonUnitalNonAssocSemiring B] [DistribMulAction R B]\n [NonUnitalAlgHomClass F R A B] (f : F) : A →ₙₐ[R] B :=\n { (f : A →ₙ+* B) with\n map_smul' := map_smul f }\n\ninstance {F R A B : Type*} [Monoid R] [NonUnitalNonAssocSemiring A] [DistribMulAction R A]\n [NonUnitalNonAssocSemiring B] [DistribMulAction R B] [NonUnitalAlgHomClass F R A B] :\n CoeTC F (A →ₙₐ[R] B) :=\n ⟨toNonUnitalAlgHom⟩\n\nend NonUnitalAlgHomClass\n\nnamespace NonUnitalAlgHom\n\nvariable {R A B C} [Monoid R]\n\nvariable [NonUnitalNonAssocSemiring A] [DistribMulAction R A]\n\nvariable [NonUnitalNonAssocSemiring B] [DistribMulAction R B]\n\nvariable [NonUnitalNonAssocSemiring C] [DistribMulAction R C]\n\n-- Porting note: Replaced with FunLike instance\n-- /-- see Note [function coercion] -/\n-- instance : CoeFun (A →ₙₐ[R] B) fun _ => A → B :=\n-- ⟨toFun⟩\n\ninstance : FunLike (A →ₙₐ[R] B) A fun _ => B where\n coe f := f.toFun\n coe_injective' := by rintro ⟨⟨⟨f, _⟩, _⟩, _⟩ ⟨⟨⟨g, _⟩, _⟩, _⟩ h; ","nextTactic":"congr","declUpToTactic":"instance : FunLike (A →ₙₐ[R] B) A fun _ => B where\n coe f := f.toFun\n coe_injective' := by rintro ⟨⟨⟨f, _⟩, _⟩, _⟩ ⟨⟨⟨g, _⟩, _⟩, _⟩ h; ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_NonUnitalHom.127_0.9y3TORfxg2P0A5c","decl":"instance : FunLike (A →ₙₐ[R] B) A fun _ => B where\n coe f "} -{"state":"R : Type u\nA : Type v\nB : Type w\nC : Type w₁\ninst✝⁶ : Monoid R\ninst✝⁵ : NonUnitalNonAssocSemiring A\ninst✝⁴ : DistribMulAction R A\ninst✝³ : NonUnitalNonAssocSemiring B\ninst✝² : DistribMulAction R B\ninst✝¹ : NonUnitalNonAssocSemiring C\ninst✝ : DistribMulAction R C\n⊢ Function.Injective FunLike.coe","srcUpToTactic":"/-\nCopyright (c) 2021 Oliver Nash. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Oliver Nash\n-/\nimport Mathlib.Algebra.Algebra.Hom\n\n#align_import algebra.hom.non_unital_alg from \"leanprover-community/mathlib\"@\"bd9851ca476957ea4549eb19b40e7b5ade9428cc\"\n\n/-!\n# Morphisms of non-unital algebras\n\nThis file defines morphisms between two types, each of which carries:\n * an addition,\n * an additive zero,\n * a multiplication,\n * a scalar action.\n\nThe multiplications are not assumed to be associative or unital, or even to be compatible with the\nscalar actions. In a typical application, the operations will satisfy compatibility conditions\nmaking them into algebras (albeit possibly non-associative and/or non-unital) but such conditions\nare not required to make this definition.\n\nThis notion of morphism should be useful for any category of non-unital algebras. The motivating\napplication at the time it was introduced was to be able to state the adjunction property for\nmagma algebras. These are non-unital, non-associative algebras obtained by applying the\ngroup-algebra construction except where we take a type carrying just `Mul` instead of `Group`.\n\nFor a plausible future application, one could take the non-unital algebra of compactly-supported\nfunctions on a non-compact topological space. A proper map between a pair of such spaces\n(contravariantly) induces a morphism between their algebras of compactly-supported functions which\nwill be a `NonUnitalAlgHom`.\n\nTODO: add `NonUnitalAlgEquiv` when needed.\n\n## Main definitions\n\n * `NonUnitalAlgHom`\n * `AlgHom.toNonUnitalAlgHom`\n\n## Tags\n\nnon-unital, algebra, morphism\n-/\n\nset_option autoImplicit true\n\n\nuniverse u v w w₁ w₂ w₃\n\nvariable (R : Type u) (A : Type v) (B : Type w) (C : Type w₁)\n\n/-- A morphism respecting addition, multiplication, and scalar multiplication. When these arise from\nalgebra structures, this is the same as a not-necessarily-unital morphism of algebras. -/\nstructure NonUnitalAlgHom [Monoid R] [NonUnitalNonAssocSemiring A] [DistribMulAction R A]\n [NonUnitalNonAssocSemiring B] [DistribMulAction R B] extends A →+[R] B, A →ₙ* B\n#align non_unital_alg_hom NonUnitalAlgHom\n\n@[inherit_doc NonUnitalAlgHom]\ninfixr:25 \" →ₙₐ \" => NonUnitalAlgHom _\n\n@[inherit_doc]\nnotation:25 A \" →ₙₐ[\" R \"] \" B => NonUnitalAlgHom R A B\n\nattribute [nolint docBlame] NonUnitalAlgHom.toMulHom\n\n/-- `NonUnitalAlgHomClass F R A B` asserts `F` is a type of bundled algebra homomorphisms\nfrom `A` to `B`. -/\nclass NonUnitalAlgHomClass (F : Type*) (R : outParam (Type*)) (A : outParam (Type*))\n (B : outParam (Type*)) [Monoid R] [NonUnitalNonAssocSemiring A] [NonUnitalNonAssocSemiring B]\n [DistribMulAction R A] [DistribMulAction R B] extends DistribMulActionHomClass F R A B,\n MulHomClass F A B\n#align non_unital_alg_hom_class NonUnitalAlgHomClass\n\n-- Porting note: commented out, not dangerous\n-- attribute [nolint dangerousInstance] NonUnitalAlgHomClass.toMulHomClass\n\nnamespace NonUnitalAlgHomClass\n\n-- Porting note: Made following instance non-dangerous through [...] -> [...] replacement\n-- See note [lower instance priority]\ninstance (priority := 100) toNonUnitalRingHomClass {F R A B : Type*}\n [Monoid R] [NonUnitalNonAssocSemiring A] [DistribMulAction R A]\n [NonUnitalNonAssocSemiring B] [DistribMulAction R B]\n [NonUnitalAlgHomClass F R A B] : NonUnitalRingHomClass F A B :=\n { ‹NonUnitalAlgHomClass F R A B› with coe := (⇑) }\n#align non_unital_alg_hom_class.non_unital_alg_hom_class.to_non_unital_ring_hom_class NonUnitalAlgHomClass.toNonUnitalRingHomClass\n\nvariable [Semiring R] [NonUnitalNonAssocSemiring A] [Module R A]\n [NonUnitalNonAssocSemiring B] [Module R B]\n\n-- see Note [lower instance priority]\ninstance (priority := 100) {F : Type*} [NonUnitalAlgHomClass F R A B] : LinearMapClass F R A B :=\n { ‹NonUnitalAlgHomClass F R A B› with map_smulₛₗ := map_smul }\n\n/-- Turn an element of a type `F` satisfying `NonUnitalAlgHomClass F R A B` into an actual\n`NonUnitalAlgHom`. This is declared as the default coercion from `F` to `A →ₙₐ[R] B`. -/\n@[coe]\ndef toNonUnitalAlgHom {F R A B : Type*} [Monoid R] [NonUnitalNonAssocSemiring A]\n [DistribMulAction R A] [NonUnitalNonAssocSemiring B] [DistribMulAction R B]\n [NonUnitalAlgHomClass F R A B] (f : F) : A →ₙₐ[R] B :=\n { (f : A →ₙ+* B) with\n map_smul' := map_smul f }\n\ninstance {F R A B : Type*} [Monoid R] [NonUnitalNonAssocSemiring A] [DistribMulAction R A]\n [NonUnitalNonAssocSemiring B] [DistribMulAction R B] [NonUnitalAlgHomClass F R A B] :\n CoeTC F (A →ₙₐ[R] B) :=\n ⟨toNonUnitalAlgHom⟩\n\nend NonUnitalAlgHomClass\n\nnamespace NonUnitalAlgHom\n\nvariable {R A B C} [Monoid R]\n\nvariable [NonUnitalNonAssocSemiring A] [DistribMulAction R A]\n\nvariable [NonUnitalNonAssocSemiring B] [DistribMulAction R B]\n\nvariable [NonUnitalNonAssocSemiring C] [DistribMulAction R C]\n\n-- Porting note: Replaced with FunLike instance\n-- /-- see Note [function coercion] -/\n-- instance : CoeFun (A →ₙₐ[R] B) fun _ => A → B :=\n-- ⟨toFun⟩\n\ninstance : FunLike (A →ₙₐ[R] B) A fun _ => B where\n coe f := f.toFun\n coe_injective' := by rintro ⟨⟨⟨f, _⟩, _⟩, _⟩ ⟨⟨⟨g, _⟩, _⟩, _⟩ h; congr\n\n@[simp]\ntheorem toFun_eq_coe (f : A →ₙₐ[R] B) : f.toFun = ⇑f :=\n rfl\n#align non_unital_alg_hom.to_fun_eq_coe NonUnitalAlgHom.toFun_eq_coe\n\n/-- See Note [custom simps projection] -/\ndef Simps.apply (f : A →ₙₐ[R] B) : A → B := f\n\ninitialize_simps_projections NonUnitalAlgHom\n (toDistribMulActionHom_toMulActionHom_toFun → apply, -toDistribMulActionHom)\n\n@[simp]\nprotected theorem coe_coe {F : Type*} [NonUnitalAlgHomClass F R A B] (f : F) :\n ⇑(f : A →ₙₐ[R] B) = f :=\n rfl\n#align non_unital_alg_hom.coe_coe NonUnitalAlgHom.coe_coe\n\ntheorem coe_injective : @Function.Injective (A →ₙₐ[R] B) (A → B) (↑) := by\n ","nextTactic":"rintro ⟨⟨⟨f, _⟩, _⟩, _⟩ ⟨⟨⟨g, _⟩, _⟩, _⟩ h","declUpToTactic":"theorem coe_injective : @Function.Injective (A →ₙₐ[R] B) (A → B) (↑) := by\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_NonUnitalHom.148_0.9y3TORfxg2P0A5c","decl":"theorem coe_injective : @Function.Injective (A →ₙₐ[R] B) (A → B) (↑) "} -{"state":"case mk.mk.mk.mk.mk.mk\nR : Type u\nA : Type v\nB : Type w\nC : Type w₁\ninst✝⁶ : Monoid R\ninst✝⁵ : NonUnitalNonAssocSemiring A\ninst✝⁴ : DistribMulAction R A\ninst✝³ : NonUnitalNonAssocSemiring B\ninst✝² : DistribMulAction R B\ninst✝¹ : NonUnitalNonAssocSemiring C\ninst✝ : DistribMulAction R C\nf : A → B\nmap_smul'✝¹ : ∀ (m : R) (x : A), f (m • x) = m • f x\nmap_zero'✝¹ : MulActionHom.toFun { toFun := f, map_smul' := map_smul'✝¹ } 0 = 0\nmap_add'✝¹ :\n ∀ (x y : A),\n MulActionHom.toFun { toFun := f, map_smul' := map_smul'✝¹ } (x + y) =\n MulActionHom.toFun { toFun := f, map_smul' := map_smul'✝¹ } x +\n MulActionHom.toFun { toFun := f, map_smul' := map_smul'✝¹ } y\nmap_mul'✝¹ :\n ∀ (x y : A),\n MulActionHom.toFun\n { toMulActionHom := { toFun := f, map_smul' := map_smul'✝¹ }, map_zero' := map_zero'✝¹,\n map_add' := map_add'✝¹ }.toMulActionHom\n (x * y) =\n MulActionHom.toFun\n { toMulActionHom := { toFun := f, map_smul' := map_smul'✝¹ }, map_zero' := map_zero'✝¹,\n map_add' := map_add'✝¹ }.toMulActionHom\n x *\n MulActionHom.toFun\n { toMulActionHom := { toFun := f, map_smul' := map_smul'✝¹ }, map_zero' := map_zero'✝¹,\n map_add' := map_add'✝¹ }.toMulActionHom\n y\ng : A → B\nmap_smul'✝ : ∀ (m : R) (x : A), g (m • x) = m • g x\nmap_zero'✝ : MulActionHom.toFun { toFun := g, map_smul' := map_smul'✝ } 0 = 0\nmap_add'✝ :\n ∀ (x y : A),\n MulActionHom.toFun { toFun := g, map_smul' := map_smul'✝ } (x + y) =\n MulActionHom.toFun { toFun := g, map_smul' := map_smul'✝ } x +\n MulActionHom.toFun { toFun := g, map_smul' := map_smul'✝ } y\nmap_mul'✝ :\n ∀ (x y : A),\n MulActionHom.toFun\n { toMulActionHom := { toFun := g, map_smul' := map_smul'✝ }, map_zero' := map_zero'✝,\n map_add' := map_add'✝ }.toMulActionHom\n (x * y) =\n MulActionHom.toFun\n { toMulActionHom := { toFun := g, map_smul' := map_smul'✝ }, map_zero' := map_zero'✝,\n map_add' := map_add'✝ }.toMulActionHom\n x *\n MulActionHom.toFun\n { toMulActionHom := { toFun := g, map_smul' := map_smul'✝ }, map_zero' := map_zero'✝,\n map_add' := map_add'✝ }.toMulActionHom\n y\nh :\n ⇑{\n toDistribMulActionHom :=\n { toMulActionHom := { toFun := f, map_smul' := map_smul'✝¹ }, map_zero' := map_zero'✝¹,\n map_add' := map_add'✝¹ },\n map_mul' := map_mul'✝¹ } =\n ⇑{\n toDistribMulActionHom :=\n { toMulActionHom := { toFun := g, map_smul' := map_smul'✝ }, map_zero' := map_zero'✝, map_add' := map_add'✝ },\n map_mul' := map_mul'✝ }\n⊢ {\n toDistribMulActionHom :=\n { toMulActionHom := { toFun := f, map_smul' := map_smul'✝¹ }, map_zero' := map_zero'✝¹,\n map_add' := map_add'✝¹ },\n map_mul' := map_mul'✝¹ } =\n {\n toDistribMulActionHom :=\n { toMulActionHom := { toFun := g, map_smul' := map_smul'✝ }, map_zero' := map_zero'✝, map_add' := map_add'✝ },\n map_mul' := map_mul'✝ }","srcUpToTactic":"/-\nCopyright (c) 2021 Oliver Nash. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Oliver Nash\n-/\nimport Mathlib.Algebra.Algebra.Hom\n\n#align_import algebra.hom.non_unital_alg from \"leanprover-community/mathlib\"@\"bd9851ca476957ea4549eb19b40e7b5ade9428cc\"\n\n/-!\n# Morphisms of non-unital algebras\n\nThis file defines morphisms between two types, each of which carries:\n * an addition,\n * an additive zero,\n * a multiplication,\n * a scalar action.\n\nThe multiplications are not assumed to be associative or unital, or even to be compatible with the\nscalar actions. In a typical application, the operations will satisfy compatibility conditions\nmaking them into algebras (albeit possibly non-associative and/or non-unital) but such conditions\nare not required to make this definition.\n\nThis notion of morphism should be useful for any category of non-unital algebras. The motivating\napplication at the time it was introduced was to be able to state the adjunction property for\nmagma algebras. These are non-unital, non-associative algebras obtained by applying the\ngroup-algebra construction except where we take a type carrying just `Mul` instead of `Group`.\n\nFor a plausible future application, one could take the non-unital algebra of compactly-supported\nfunctions on a non-compact topological space. A proper map between a pair of such spaces\n(contravariantly) induces a morphism between their algebras of compactly-supported functions which\nwill be a `NonUnitalAlgHom`.\n\nTODO: add `NonUnitalAlgEquiv` when needed.\n\n## Main definitions\n\n * `NonUnitalAlgHom`\n * `AlgHom.toNonUnitalAlgHom`\n\n## Tags\n\nnon-unital, algebra, morphism\n-/\n\nset_option autoImplicit true\n\n\nuniverse u v w w₁ w₂ w₃\n\nvariable (R : Type u) (A : Type v) (B : Type w) (C : Type w₁)\n\n/-- A morphism respecting addition, multiplication, and scalar multiplication. When these arise from\nalgebra structures, this is the same as a not-necessarily-unital morphism of algebras. -/\nstructure NonUnitalAlgHom [Monoid R] [NonUnitalNonAssocSemiring A] [DistribMulAction R A]\n [NonUnitalNonAssocSemiring B] [DistribMulAction R B] extends A →+[R] B, A →ₙ* B\n#align non_unital_alg_hom NonUnitalAlgHom\n\n@[inherit_doc NonUnitalAlgHom]\ninfixr:25 \" →ₙₐ \" => NonUnitalAlgHom _\n\n@[inherit_doc]\nnotation:25 A \" →ₙₐ[\" R \"] \" B => NonUnitalAlgHom R A B\n\nattribute [nolint docBlame] NonUnitalAlgHom.toMulHom\n\n/-- `NonUnitalAlgHomClass F R A B` asserts `F` is a type of bundled algebra homomorphisms\nfrom `A` to `B`. -/\nclass NonUnitalAlgHomClass (F : Type*) (R : outParam (Type*)) (A : outParam (Type*))\n (B : outParam (Type*)) [Monoid R] [NonUnitalNonAssocSemiring A] [NonUnitalNonAssocSemiring B]\n [DistribMulAction R A] [DistribMulAction R B] extends DistribMulActionHomClass F R A B,\n MulHomClass F A B\n#align non_unital_alg_hom_class NonUnitalAlgHomClass\n\n-- Porting note: commented out, not dangerous\n-- attribute [nolint dangerousInstance] NonUnitalAlgHomClass.toMulHomClass\n\nnamespace NonUnitalAlgHomClass\n\n-- Porting note: Made following instance non-dangerous through [...] -> [...] replacement\n-- See note [lower instance priority]\ninstance (priority := 100) toNonUnitalRingHomClass {F R A B : Type*}\n [Monoid R] [NonUnitalNonAssocSemiring A] [DistribMulAction R A]\n [NonUnitalNonAssocSemiring B] [DistribMulAction R B]\n [NonUnitalAlgHomClass F R A B] : NonUnitalRingHomClass F A B :=\n { ‹NonUnitalAlgHomClass F R A B› with coe := (⇑) }\n#align non_unital_alg_hom_class.non_unital_alg_hom_class.to_non_unital_ring_hom_class NonUnitalAlgHomClass.toNonUnitalRingHomClass\n\nvariable [Semiring R] [NonUnitalNonAssocSemiring A] [Module R A]\n [NonUnitalNonAssocSemiring B] [Module R B]\n\n-- see Note [lower instance priority]\ninstance (priority := 100) {F : Type*} [NonUnitalAlgHomClass F R A B] : LinearMapClass F R A B :=\n { ‹NonUnitalAlgHomClass F R A B› with map_smulₛₗ := map_smul }\n\n/-- Turn an element of a type `F` satisfying `NonUnitalAlgHomClass F R A B` into an actual\n`NonUnitalAlgHom`. This is declared as the default coercion from `F` to `A →ₙₐ[R] B`. -/\n@[coe]\ndef toNonUnitalAlgHom {F R A B : Type*} [Monoid R] [NonUnitalNonAssocSemiring A]\n [DistribMulAction R A] [NonUnitalNonAssocSemiring B] [DistribMulAction R B]\n [NonUnitalAlgHomClass F R A B] (f : F) : A →ₙₐ[R] B :=\n { (f : A →ₙ+* B) with\n map_smul' := map_smul f }\n\ninstance {F R A B : Type*} [Monoid R] [NonUnitalNonAssocSemiring A] [DistribMulAction R A]\n [NonUnitalNonAssocSemiring B] [DistribMulAction R B] [NonUnitalAlgHomClass F R A B] :\n CoeTC F (A →ₙₐ[R] B) :=\n ⟨toNonUnitalAlgHom⟩\n\nend NonUnitalAlgHomClass\n\nnamespace NonUnitalAlgHom\n\nvariable {R A B C} [Monoid R]\n\nvariable [NonUnitalNonAssocSemiring A] [DistribMulAction R A]\n\nvariable [NonUnitalNonAssocSemiring B] [DistribMulAction R B]\n\nvariable [NonUnitalNonAssocSemiring C] [DistribMulAction R C]\n\n-- Porting note: Replaced with FunLike instance\n-- /-- see Note [function coercion] -/\n-- instance : CoeFun (A →ₙₐ[R] B) fun _ => A → B :=\n-- ⟨toFun⟩\n\ninstance : FunLike (A →ₙₐ[R] B) A fun _ => B where\n coe f := f.toFun\n coe_injective' := by rintro ��⟨⟨f, _⟩, _⟩, _⟩ ⟨⟨⟨g, _⟩, _⟩, _⟩ h; congr\n\n@[simp]\ntheorem toFun_eq_coe (f : A →ₙₐ[R] B) : f.toFun = ⇑f :=\n rfl\n#align non_unital_alg_hom.to_fun_eq_coe NonUnitalAlgHom.toFun_eq_coe\n\n/-- See Note [custom simps projection] -/\ndef Simps.apply (f : A →ₙₐ[R] B) : A → B := f\n\ninitialize_simps_projections NonUnitalAlgHom\n (toDistribMulActionHom_toMulActionHom_toFun → apply, -toDistribMulActionHom)\n\n@[simp]\nprotected theorem coe_coe {F : Type*} [NonUnitalAlgHomClass F R A B] (f : F) :\n ⇑(f : A →ₙₐ[R] B) = f :=\n rfl\n#align non_unital_alg_hom.coe_coe NonUnitalAlgHom.coe_coe\n\ntheorem coe_injective : @Function.Injective (A →ₙₐ[R] B) (A → B) (↑) := by\n rintro ⟨⟨⟨f, _⟩, _⟩, _⟩ ⟨⟨⟨g, _⟩, _⟩, _⟩ h; ","nextTactic":"congr","declUpToTactic":"theorem coe_injective : @Function.Injective (A →ₙₐ[R] B) (A → B) (↑) := by\n rintro ⟨⟨⟨f, _⟩, _⟩, _⟩ ⟨⟨⟨g, _⟩, _⟩, _⟩ h; ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_NonUnitalHom.148_0.9y3TORfxg2P0A5c","decl":"theorem coe_injective : @Function.Injective (A →ₙₐ[R] B) (A → B) (↑) "} -{"state":"R : Type u\nA : Type v\nB : Type w\nC : Type w₁\ninst✝⁶ : Monoid R\ninst✝⁵ : NonUnitalNonAssocSemiring A\ninst✝⁴ : DistribMulAction R A\ninst✝³ : NonUnitalNonAssocSemiring B\ninst✝² : DistribMulAction R B\ninst✝¹ : NonUnitalNonAssocSemiring C\ninst✝ : DistribMulAction R C\nf g : A →ₙₐ[R] B\n⊢ f = g → ∀ (x : A), f x = g x","srcUpToTactic":"/-\nCopyright (c) 2021 Oliver Nash. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Oliver Nash\n-/\nimport Mathlib.Algebra.Algebra.Hom\n\n#align_import algebra.hom.non_unital_alg from \"leanprover-community/mathlib\"@\"bd9851ca476957ea4549eb19b40e7b5ade9428cc\"\n\n/-!\n# Morphisms of non-unital algebras\n\nThis file defines morphisms between two types, each of which carries:\n * an addition,\n * an additive zero,\n * a multiplication,\n * a scalar action.\n\nThe multiplications are not assumed to be associative or unital, or even to be compatible with the\nscalar actions. In a typical application, the operations will satisfy compatibility conditions\nmaking them into algebras (albeit possibly non-associative and/or non-unital) but such conditions\nare not required to make this definition.\n\nThis notion of morphism should be useful for any category of non-unital algebras. The motivating\napplication at the time it was introduced was to be able to state the adjunction property for\nmagma algebras. These are non-unital, non-associative algebras obtained by applying the\ngroup-algebra construction except where we take a type carrying just `Mul` instead of `Group`.\n\nFor a plausible future application, one could take the non-unital algebra of compactly-supported\nfunctions on a non-compact topological space. A proper map between a pair of such spaces\n(contravariantly) induces a morphism between their algebras of compactly-supported functions which\nwill be a `NonUnitalAlgHom`.\n\nTODO: add `NonUnitalAlgEquiv` when needed.\n\n## Main definitions\n\n * `NonUnitalAlgHom`\n * `AlgHom.toNonUnitalAlgHom`\n\n## Tags\n\nnon-unital, algebra, morphism\n-/\n\nset_option autoImplicit true\n\n\nuniverse u v w w₁ w₂ w₃\n\nvariable (R : Type u) (A : Type v) (B : Type w) (C : Type w₁)\n\n/-- A morphism respecting addition, multiplication, and scalar multiplication. When these arise from\nalgebra structures, this is the same as a not-necessarily-unital morphism of algebras. -/\nstructure NonUnitalAlgHom [Monoid R] [NonUnitalNonAssocSemiring A] [DistribMulAction R A]\n [NonUnitalNonAssocSemiring B] [DistribMulAction R B] extends A →+[R] B, A →ₙ* B\n#align non_unital_alg_hom NonUnitalAlgHom\n\n@[inherit_doc NonUnitalAlgHom]\ninfixr:25 \" →ₙₐ \" => NonUnitalAlgHom _\n\n@[inherit_doc]\nnotation:25 A \" →ₙₐ[\" R \"] \" B => NonUnitalAlgHom R A B\n\nattribute [nolint docBlame] NonUnitalAlgHom.toMulHom\n\n/-- `NonUnitalAlgHomClass F R A B` asserts `F` is a type of bundled algebra homomorphisms\nfrom `A` to `B`. -/\nclass NonUnitalAlgHomClass (F : Type*) (R : outParam (Type*)) (A : outParam (Type*))\n (B : outParam (Type*)) [Monoid R] [NonUnitalNonAssocSemiring A] [NonUnitalNonAssocSemiring B]\n [DistribMulAction R A] [DistribMulAction R B] extends DistribMulActionHomClass F R A B,\n MulHomClass F A B\n#align non_unital_alg_hom_class NonUnitalAlgHomClass\n\n-- Porting note: commented out, not dangerous\n-- attribute [nolint dangerousInstance] NonUnitalAlgHomClass.toMulHomClass\n\nnamespace NonUnitalAlgHomClass\n\n-- Porting note: Made following instance non-dangerous through [...] -> [...] replacement\n-- See note [lower instance priority]\ninstance (priority := 100) toNonUnitalRingHomClass {F R A B : Type*}\n [Monoid R] [NonUnitalNonAssocSemiring A] [DistribMulAction R A]\n [NonUnitalNonAssocSemiring B] [DistribMulAction R B]\n [NonUnitalAlgHomClass F R A B] : NonUnitalRingHomClass F A B :=\n { ‹NonUnitalAlgHomClass F R A B› with coe := (⇑) }\n#align non_unital_alg_hom_class.non_unital_alg_hom_class.to_non_unital_ring_hom_class NonUnitalAlgHomClass.toNonUnitalRingHomClass\n\nvariable [Semiring R] [NonUnitalNonAssocSemiring A] [Module R A]\n [NonUnitalNonAssocSemiring B] [Module R B]\n\n-- see Note [lower instance priority]\ninstance (priority := 100) {F : Type*} [NonUnitalAlgHomClass F R A B] : LinearMapClass F R A B :=\n { ‹NonUnitalAlgHomClass F R A B› with map_smulₛₗ := map_smul }\n\n/-- Turn an element of a type `F` satisfying `NonUnitalAlgHomClass F R A B` into an actual\n`NonUnitalAlgHom`. This is declared as the default coercion from `F` to `A →ₙₐ[R] B`. -/\n@[coe]\ndef toNonUnitalAlgHom {F R A B : Type*} [Monoid R] [NonUnitalNonAssocSemiring A]\n [DistribMulAction R A] [NonUnitalNonAssocSemiring B] [DistribMulAction R B]\n [NonUnitalAlgHomClass F R A B] (f : F) : A →ₙₐ[R] B :=\n { (f : A →ₙ+* B) with\n map_smul' := map_smul f }\n\ninstance {F R A B : Type*} [Monoid R] [NonUnitalNonAssocSemiring A] [DistribMulAction R A]\n [NonUnitalNonAssocSemiring B] [DistribMulAction R B] [NonUnitalAlgHomClass F R A B] :\n CoeTC F (A →ₙₐ[R] B) :=\n ⟨toNonUnitalAlgHom⟩\n\nend NonUnitalAlgHomClass\n\nnamespace NonUnitalAlgHom\n\nvariable {R A B C} [Monoid R]\n\nvariable [NonUnitalNonAssocSemiring A] [DistribMulAction R A]\n\nvariable [NonUnitalNonAssocSemiring B] [DistribMulAction R B]\n\nvariable [NonUnitalNonAssocSemiring C] [DistribMulAction R C]\n\n-- Porting note: Replaced with FunLike instance\n-- /-- see Note [function coercion] -/\n-- instance : CoeFun (A →ₙₐ[R] B) fun _ => A → B :=\n-- ⟨toFun⟩\n\ninstance : FunLike (A →ₙₐ[R] B) A fun _ => B where\n coe f := f.toFun\n coe_injective' := by rintro ⟨⟨⟨f, _⟩, _⟩, _⟩ ⟨⟨⟨g, _⟩, _⟩, _⟩ h; congr\n\n@[simp]\ntheorem toFun_eq_coe (f : A →ₙₐ[R] B) : f.toFun = ⇑f :=\n rfl\n#align non_unital_alg_hom.to_fun_eq_coe NonUnitalAlgHom.toFun_eq_coe\n\n/-- See Note [custom simps projection] -/\ndef Simps.apply (f : A →ₙₐ[R] B) : A → B := f\n\ninitialize_simps_projections NonUnitalAlgHom\n (toDistribMulActionHom_toMulActionHom_toFun → apply, -toDistribMulActionHom)\n\n@[simp]\nprotected theorem coe_coe {F : Type*} [NonUnitalAlgHomClass F R A B] (f : F) :\n ⇑(f : A →ₙₐ[R] B) = f :=\n rfl\n#align non_unital_alg_hom.coe_coe NonUnitalAlgHom.coe_coe\n\ntheorem coe_injective : @Function.Injective (A →ₙₐ[R] B) (A → B) (↑) := by\n rintro ⟨⟨⟨f, _⟩, _⟩, _⟩ ⟨⟨⟨g, _⟩, _⟩, _⟩ h; congr\n#align non_unital_alg_hom.coe_injective NonUnitalAlgHom.coe_injective\n\ninstance : NonUnitalAlgHomClass (A →ₙₐ[R] B) R A B\n where\n coe f := f.toFun\n coe_injective' := coe_injective\n map_smul f := f.map_smul'\n map_add f := f.map_add'\n map_zero f := f.map_zero'\n map_mul f := f.map_mul'\n\n@[ext]\ntheorem ext {f g : A →ₙₐ[R] B} (h : ∀ x, f x = g x) : f = g :=\n coe_injective <| funext h\n#align non_unital_alg_hom.ext NonUnitalAlgHom.ext\n\ntheorem ext_iff {f g : A →ₙₐ[R] B} : f = g ↔ ∀ x, f x = g x :=\n ⟨by\n ","nextTactic":"rintro rfl x","declUpToTactic":"theorem ext_iff {f g : A →ₙₐ[R] B} : f = g ↔ ∀ x, f x = g x :=\n ⟨by\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_NonUnitalHom.166_0.9y3TORfxg2P0A5c","decl":"theorem ext_iff {f g : A →ₙₐ[R] B} : f = g ↔ ∀ x, f x = g x "} -{"state":"R : Type u\nA : Type v\nB : Type w\nC : Type w₁\ninst✝⁶ : Monoid R\ninst✝⁵ : NonUnitalNonAssocSemiring A\ninst✝⁴ : DistribMulAction R A\ninst✝³ : NonUnitalNonAssocSemiring B\ninst✝² : DistribMulAction R B\ninst✝¹ : NonUnitalNonAssocSemiring C\ninst✝ : DistribMulAction R C\nf : A →ₙₐ[R] B\nx : A\n⊢ f x = f x","srcUpToTactic":"/-\nCopyright (c) 2021 Oliver Nash. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Oliver Nash\n-/\nimport Mathlib.Algebra.Algebra.Hom\n\n#align_import algebra.hom.non_unital_alg from \"leanprover-community/mathlib\"@\"bd9851ca476957ea4549eb19b40e7b5ade9428cc\"\n\n/-!\n# Morphisms of non-unital algebras\n\nThis file defines morphisms between two types, each of which carries:\n * an addition,\n * an additive zero,\n * a multiplication,\n * a scalar action.\n\nThe multiplications are not assumed to be associative or unital, or even to be compatible with the\nscalar actions. In a typical application, the operations will satisfy compatibility conditions\nmaking them into algebras (albeit possibly non-associative and/or non-unital) but such conditions\nare not required to make this definition.\n\nThis notion of morphism should be useful for any category of non-unital algebras. The motivating\napplication at the time it was introduced was to be able to state the adjunction property for\nmagma algebras. These are non-unital, non-associative algebras obtained by applying the\ngroup-algebra construction except where we take a type carrying just `Mul` instead of `Group`.\n\nFor a plausible future application, one could take the non-unital algebra of compactly-supported\nfunctions on a non-compact topological space. A proper map between a pair of such spaces\n(contravariantly) induces a morphism between their algebras of compactly-supported functions which\nwill be a `NonUnitalAlgHom`.\n\nTODO: add `NonUnitalAlgEquiv` when needed.\n\n## Main definitions\n\n * `NonUnitalAlgHom`\n * `AlgHom.toNonUnitalAlgHom`\n\n## Tags\n\nnon-unital, algebra, morphism\n-/\n\nset_option autoImplicit true\n\n\nuniverse u v w w₁ w₂ w₃\n\nvariable (R : Type u) (A : Type v) (B : Type w) (C : Type w₁)\n\n/-- A morphism respecting addition, multiplication, and scalar multiplication. When these arise from\nalgebra structures, this is the same as a not-necessarily-unital morphism of algebras. -/\nstructure NonUnitalAlgHom [Monoid R] [NonUnitalNonAssocSemiring A] [DistribMulAction R A]\n [NonUnitalNonAssocSemiring B] [DistribMulAction R B] extends A →+[R] B, A →ₙ* B\n#align non_unital_alg_hom NonUnitalAlgHom\n\n@[inherit_doc NonUnitalAlgHom]\ninfixr:25 \" →ₙₐ \" => NonUnitalAlgHom _\n\n@[inherit_doc]\nnotation:25 A \" →ₙₐ[\" R \"] \" B => NonUnitalAlgHom R A B\n\nattribute [nolint docBlame] NonUnitalAlgHom.toMulHom\n\n/-- `NonUnitalAlgHomClass F R A B` asserts `F` is a type of bundled algebra homomorphisms\nfrom `A` to `B`. -/\nclass NonUnitalAlgHomClass (F : Type*) (R : outParam (Type*)) (A : outParam (Type*))\n (B : outParam (Type*)) [Monoid R] [NonUnitalNonAssocSemiring A] [NonUnitalNonAssocSemiring B]\n [DistribMulAction R A] [DistribMulAction R B] extends DistribMulActionHomClass F R A B,\n MulHomClass F A B\n#align non_unital_alg_hom_class NonUnitalAlgHomClass\n\n-- Porting note: commented out, not dangerous\n-- attribute [nolint dangerousInstance] NonUnitalAlgHomClass.toMulHomClass\n\nnamespace NonUnitalAlgHomClass\n\n-- Porting note: Made following instance non-dangerous through [...] -> [...] replacement\n-- See note [lower instance priority]\ninstance (priority := 100) toNonUnitalRingHomClass {F R A B : Type*}\n [Monoid R] [NonUnitalNonAssocSemiring A] [DistribMulAction R A]\n [NonUnitalNonAssocSemiring B] [DistribMulAction R B]\n [NonUnitalAlgHomClass F R A B] : NonUnitalRingHomClass F A B :=\n { ‹NonUnitalAlgHomClass F R A B› with coe := (⇑) }\n#align non_unital_alg_hom_class.non_unital_alg_hom_class.to_non_unital_ring_hom_class NonUnitalAlgHomClass.toNonUnitalRingHomClass\n\nvariable [Semiring R] [NonUnitalNonAssocSemiring A] [Module R A]\n [NonUnitalNonAssocSemiring B] [Module R B]\n\n-- see Note [lower instance priority]\ninstance (priority := 100) {F : Type*} [NonUnitalAlgHomClass F R A B] : LinearMapClass F R A B :=\n { ‹NonUnitalAlgHomClass F R A B› with map_smulₛₗ := map_smul }\n\n/-- Turn an element of a type `F` satisfying `NonUnitalAlgHomClass F R A B` into an actual\n`NonUnitalAlgHom`. This is declared as the default coercion from `F` to `A →ₙₐ[R] B`. -/\n@[coe]\ndef toNonUnitalAlgHom {F R A B : Type*} [Monoid R] [NonUnitalNonAssocSemiring A]\n [DistribMulAction R A] [NonUnitalNonAssocSemiring B] [DistribMulAction R B]\n [NonUnitalAlgHomClass F R A B] (f : F) : A →ₙₐ[R] B :=\n { (f : A →ₙ+* B) with\n map_smul' := map_smul f }\n\ninstance {F R A B : Type*} [Monoid R] [NonUnitalNonAssocSemiring A] [DistribMulAction R A]\n [NonUnitalNonAssocSemiring B] [DistribMulAction R B] [NonUnitalAlgHomClass F R A B] :\n CoeTC F (A →ₙₐ[R] B) :=\n ⟨toNonUnitalAlgHom⟩\n\nend NonUnitalAlgHomClass\n\nnamespace NonUnitalAlgHom\n\nvariable {R A B C} [Monoid R]\n\nvariable [NonUnitalNonAssocSemiring A] [DistribMulAction R A]\n\nvariable [NonUnitalNonAssocSemiring B] [DistribMulAction R B]\n\nvariable [NonUnitalNonAssocSemiring C] [DistribMulAction R C]\n\n-- Porting note: Replaced with FunLike instance\n-- /-- see Note [function coercion] -/\n-- instance : CoeFun (A →ₙₐ[R] B) fun _ => A → B :=\n-- ⟨toFun⟩\n\ninstance : FunLike (A →ₙₐ[R] B) A fun _ => B where\n coe f := f.toFun\n coe_injective' := by rintro ⟨⟨⟨f, _⟩, _⟩, _⟩ ⟨⟨⟨g, _⟩, _⟩, _⟩ h; congr\n\n@[simp]\ntheorem toFun_eq_coe (f : A →ₙₐ[R] B) : f.toFun = ⇑f :=\n rfl\n#align non_unital_alg_hom.to_fun_eq_coe NonUnitalAlgHom.toFun_eq_coe\n\n/-- See Note [custom simps projection] -/\ndef Simps.apply (f : A →ₙₐ[R] B) : A → B := f\n\ninitialize_simps_projections NonUnitalAlgHom\n (toDistribMulActionHom_toMulActionHom_toFun → apply, -toDistribMulActionHom)\n\n@[simp]\nprotected theorem coe_coe {F : Type*} [NonUnitalAlgHomClass F R A B] (f : F) :\n ⇑(f : A →ₙₐ[R] B) = f :=\n rfl\n#align non_unital_alg_hom.coe_coe NonUnitalAlgHom.coe_coe\n\ntheorem coe_injective : @Function.Injective (A →ₙₐ[R] B) (A → B) (↑) := by\n rintro ⟨⟨⟨f, _⟩, _⟩, _⟩ ⟨⟨⟨g, _⟩, _⟩, _⟩ h; congr\n#align non_unital_alg_hom.coe_injective NonUnitalAlgHom.coe_injective\n\ninstance : NonUnitalAlgHomClass (A →ₙₐ[R] B) R A B\n where\n coe f := f.toFun\n coe_injective' := coe_injective\n map_smul f := f.map_smul'\n map_add f := f.map_add'\n map_zero f := f.map_zero'\n map_mul f := f.map_mul'\n\n@[ext]\ntheorem ext {f g : A →ₙₐ[R] B} (h : ∀ x, f x = g x) : f = g :=\n coe_injective <| funext h\n#align non_unital_alg_hom.ext NonUnitalAlgHom.ext\n\ntheorem ext_iff {f g : A →ₙₐ[R] B} : f = g ↔ ∀ x, f x = g x :=\n ⟨by\n rintro rfl x\n ","nextTactic":"rfl","declUpToTactic":"theorem ext_iff {f g : A →ₙₐ[R] B} : f = g ↔ ∀ x, f x = g x :=\n ⟨by\n rintro rfl x\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_NonUnitalHom.166_0.9y3TORfxg2P0A5c","decl":"theorem ext_iff {f g : A →ₙₐ[R] B} : f = g ↔ ∀ x, f x = g x "} -{"state":"R : Type u\nA : Type v\nB : Type w\nC : Type w₁\ninst✝⁶ : Monoid R\ninst✝⁵ : NonUnitalNonAssocSemiring A\ninst✝⁴ : DistribMulAction R A\ninst✝³ : NonUnitalNonAssocSemiring B\ninst✝² : DistribMulAction R B\ninst✝¹ : NonUnitalNonAssocSemiring C\ninst✝ : DistribMulAction R C\nf : A →ₙₐ[R] B\nh₁ : ∀ (m : R) (x : A), f (m • x) = m • f x\nh₂ : MulActionHom.toFun { toFun := ⇑f, map_smul' := h₁ } 0 = 0\nh₃ :\n ∀ (x y : A),\n MulActionHom.toFun { toFun := ⇑f, map_smul' := h₁ } (x + y) =\n MulActionHom.toFun { toFun := ⇑f, map_smul' := h₁ } x + MulActionHom.toFun { toFun := ⇑f, map_smul' := h₁ } y\nh₄ :\n ∀ (x y : A),\n MulActionHom.toFun\n { toMulActionHom := { toFun := ⇑f, map_smul' := h₁ }, map_zero' := h₂, map_add' := h₃ }.toMulActionHom (x * y) =\n MulActionHom.toFun\n { toMulActionHom := { toFun := ⇑f, map_smul' := h₁ }, map_zero' := h₂, map_add' := h₃ }.toMulActionHom x *\n MulActionHom.toFun\n { toMulActionHom := { toFun := ⇑f, map_smul' := h₁ }, map_zero' := h₂, map_add' := h₃ }.toMulActionHom y\n⊢ { toDistribMulActionHom := { toMulActionHom := { toFun := ⇑f, map_smul' := h₁ }, map_zero' := h₂, map_add' := h₃ },\n map_mul' := h₄ } =\n f","srcUpToTactic":"/-\nCopyright (c) 2021 Oliver Nash. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Oliver Nash\n-/\nimport Mathlib.Algebra.Algebra.Hom\n\n#align_import algebra.hom.non_unital_alg from \"leanprover-community/mathlib\"@\"bd9851ca476957ea4549eb19b40e7b5ade9428cc\"\n\n/-!\n# Morphisms of non-unital algebras\n\nThis file defines morphisms between two types, each of which carries:\n * an addition,\n * an additive zero,\n * a multiplication,\n * a scalar action.\n\nThe multiplications are not assumed to be associative or unital, or even to be compatible with the\nscalar actions. In a typical application, the operations will satisfy compatibility conditions\nmaking them into algebras (albeit possibly non-associative and/or non-unital) but such conditions\nare not required to make this definition.\n\nThis notion of morphism should be useful for any category of non-unital algebras. The motivating\napplication at the time it was introduced was to be able to state the adjunction property for\nmagma algebras. These are non-unital, non-associative algebras obtained by applying the\ngroup-algebra construction except where we take a type carrying just `Mul` instead of `Group`.\n\nFor a plausible future application, one could take the non-unital algebra of compactly-supported\nfunctions on a non-compact topological space. A proper map between a pair of such spaces\n(contravariantly) induces a morphism between their algebras of compactly-supported functions which\nwill be a `NonUnitalAlgHom`.\n\nTODO: add `NonUnitalAlgEquiv` when needed.\n\n## Main definitions\n\n * `NonUnitalAlgHom`\n * `AlgHom.toNonUnitalAlgHom`\n\n## Tags\n\nnon-unital, algebra, morphism\n-/\n\nset_option autoImplicit true\n\n\nuniverse u v w w₁ w₂ w₃\n\nvariable (R : Type u) (A : Type v) (B : Type w) (C : Type w₁)\n\n/-- A morphism respecting addition, multiplication, and scalar multiplication. When these arise from\nalgebra structures, this is the same as a not-necessarily-unital morphism of algebras. -/\nstructure NonUnitalAlgHom [Monoid R] [NonUnitalNonAssocSemiring A] [DistribMulAction R A]\n [NonUnitalNonAssocSemiring B] [DistribMulAction R B] extends A →+[R] B, A →ₙ* B\n#align non_unital_alg_hom NonUnitalAlgHom\n\n@[inherit_doc NonUnitalAlgHom]\ninfixr:25 \" →ₙₐ \" => NonUnitalAlgHom _\n\n@[inherit_doc]\nnotation:25 A \" →ₙₐ[\" R \"] \" B => NonUnitalAlgHom R A B\n\nattribute [nolint docBlame] NonUnitalAlgHom.toMulHom\n\n/-- `NonUnitalAlgHomClass F R A B` asserts `F` is a type of bundled algebra homomorphisms\nfrom `A` to `B`. -/\nclass NonUnitalAlgHomClass (F : Type*) (R : outParam (Type*)) (A : outParam (Type*))\n (B : outParam (Type*)) [Monoid R] [NonUnitalNonAssocSemiring A] [NonUnitalNonAssocSemiring B]\n [DistribMulAction R A] [DistribMulAction R B] extends DistribMulActionHomClass F R A B,\n MulHomClass F A B\n#align non_unital_alg_hom_class NonUnitalAlgHomClass\n\n-- Porting note: commented out, not dangerous\n-- attribute [nolint dangerousInstance] NonUnitalAlgHomClass.toMulHomClass\n\nnamespace NonUnitalAlgHomClass\n\n-- Porting note: Made following instance non-dangerous through [...] -> [...] replacement\n-- See note [lower instance priority]\ninstance (priority := 100) toNonUnitalRingHomClass {F R A B : Type*}\n [Monoid R] [NonUnitalNonAssocSemiring A] [DistribMulAction R A]\n [NonUnitalNonAssocSemiring B] [DistribMulAction R B]\n [NonUnitalAlgHomClass F R A B] : NonUnitalRingHomClass F A B :=\n { ‹NonUnitalAlgHomClass F R A B› with coe := (⇑) }\n#align non_unital_alg_hom_class.non_unital_alg_hom_class.to_non_unital_ring_hom_class NonUnitalAlgHomClass.toNonUnitalRingHomClass\n\nvariable [Semiring R] [NonUnitalNonAssocSemiring A] [Module R A]\n [NonUnitalNonAssocSemiring B] [Module R B]\n\n-- see Note [lower instance priority]\ninstance (priority := 100) {F : Type*} [NonUnitalAlgHomClass F R A B] : LinearMapClass F R A B :=\n { ‹NonUnitalAlgHomClass F R A B› with map_smulₛₗ := map_smul }\n\n/-- Turn an element of a type `F` satisfying `NonUnitalAlgHomClass F R A B` into an actual\n`NonUnitalAlgHom`. This is declared as the default coercion from `F` to `A →ₙₐ[R] B`. -/\n@[coe]\ndef toNonUnitalAlgHom {F R A B : Type*} [Monoid R] [NonUnitalNonAssocSemiring A]\n [DistribMulAction R A] [NonUnitalNonAssocSemiring B] [DistribMulAction R B]\n [NonUnitalAlgHomClass F R A B] (f : F) : A →ₙₐ[R] B :=\n { (f : A →ₙ+* B) with\n map_smul' := map_smul f }\n\ninstance {F R A B : Type*} [Monoid R] [NonUnitalNonAssocSemiring A] [DistribMulAction R A]\n [NonUnitalNonAssocSemiring B] [DistribMulAction R B] [NonUnitalAlgHomClass F R A B] :\n CoeTC F (A →ₙₐ[R] B) :=\n ⟨toNonUnitalAlgHom⟩\n\nend NonUnitalAlgHomClass\n\nnamespace NonUnitalAlgHom\n\nvariable {R A B C} [Monoid R]\n\nvariable [NonUnitalNonAssocSemiring A] [DistribMulAction R A]\n\nvariable [NonUnitalNonAssocSemiring B] [DistribMulAction R B]\n\nvariable [NonUnitalNonAssocSemiring C] [DistribMulAction R C]\n\n-- Porting note: Replaced with FunLike instance\n-- /-- see Note [function coercion] -/\n-- instance : CoeFun (A →ₙₐ[R] B) fun _ => A → B :=\n-- ⟨toFun⟩\n\ninstance : FunLike (A →ₙₐ[R] B) A fun _ => B where\n coe f := f.toFun\n coe_injective' := by rintro ⟨⟨⟨f, _⟩, _⟩, _⟩ ⟨⟨⟨g, _⟩, _⟩, _⟩ h; congr\n\n@[simp]\ntheorem toFun_eq_coe (f : A →ₙₐ[R] B) : f.toFun = ⇑f :=\n rfl\n#align non_unital_alg_hom.to_fun_eq_coe NonUnitalAlgHom.toFun_eq_coe\n\n/-- See Note [custom simps projection] -/\ndef Simps.apply (f : A →ₙₐ[R] B) : A → B := f\n\ninitialize_simps_projections NonUnitalAlgHom\n (toDistribMulActionHom_toMulActionHom_toFun → apply, -toDistribMulActionHom)\n\n@[simp]\nprotected theorem coe_coe {F : Type*} [NonUnitalAlgHomClass F R A B] (f : F) :\n ⇑(f : A →ₙₐ[R] B) = f :=\n rfl\n#align non_unital_alg_hom.coe_coe NonUnitalAlgHom.coe_coe\n\ntheorem coe_injective : @Function.Injective (A →ₙₐ[R] B) (A → B) (↑) := by\n rintro ⟨⟨⟨f, _⟩, _⟩, _⟩ ⟨⟨⟨g, _⟩, _⟩, _⟩ h; congr\n#align non_unital_alg_hom.coe_injective NonUnitalAlgHom.coe_injective\n\ninstance : NonUnitalAlgHomClass (A →ₙₐ[R] B) R A B\n where\n coe f := f.toFun\n coe_injective' := coe_injective\n map_smul f := f.map_smul'\n map_add f := f.map_add'\n map_zero f := f.map_zero'\n map_mul f := f.map_mul'\n\n@[ext]\ntheorem ext {f g : A →ₙₐ[R] B} (h : ∀ x, f x = g x) : f = g :=\n coe_injective <| funext h\n#align non_unital_alg_hom.ext NonUnitalAlgHom.ext\n\ntheorem ext_iff {f g : A →ₙₐ[R] B} : f = g ↔ ∀ x, f x = g x :=\n ⟨by\n rintro rfl x\n rfl, ext⟩\n#align non_unital_alg_hom.ext_iff NonUnitalAlgHom.ext_iff\n\ntheorem congr_fun {f g : A →ₙₐ[R] B} (h : f = g) (x : A) : f x = g x :=\n h ▸ rfl\n#align non_unital_alg_hom.congr_fun NonUnitalAlgHom.congr_fun\n\n@[simp]\ntheorem coe_mk (f : A → B) (h₁ h₂ h₃ h₄) : ⇑(⟨⟨⟨f, h₁⟩, h₂, h₃⟩, h₄⟩ : A →ₙₐ[R] B) = f :=\n rfl\n#align non_unital_alg_hom.coe_mk NonUnitalAlgHom.coe_mk\n\n@[simp]\ntheorem mk_coe (f : A →ₙₐ[R] B) (h₁ h₂ h₃ h₄) : (⟨⟨⟨f, h₁⟩, h₂, h₃⟩, h₄⟩ : A →ₙₐ[R] B) = f := by\n ","nextTactic":"rfl","declUpToTactic":"@[simp]\ntheorem mk_coe (f : A →ₙₐ[R] B) (h₁ h₂ h₃ h₄) : (⟨⟨⟨f, h₁⟩, h₂, h₃⟩, h₄⟩ : A →ₙₐ[R] B) = f := by\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_NonUnitalHom.181_0.9y3TORfxg2P0A5c","decl":"@[simp]\ntheorem mk_coe (f : A →ₙₐ[R] B) (h₁ h₂ h₃ h₄) : (⟨⟨⟨f, h₁⟩, h₂, h₃⟩, h₄⟩ : A →ₙₐ[R] B) = f "} -{"state":"R : Type u\nA : Type v\nB : Type w\nC : Type w₁\ninst✝⁶ : Monoid R\ninst✝⁵ : NonUnitalNonAssocSemiring A\ninst✝⁴ : DistribMulAction R A\ninst✝³ : NonUnitalNonAssocSemiring B\ninst✝² : DistribMulAction R B\ninst✝¹ : NonUnitalNonAssocSemiring C\ninst✝ : DistribMulAction R C\nf g : A →ₙₐ[R] B\nh : ↑f = ↑g\n⊢ f = g","srcUpToTactic":"/-\nCopyright (c) 2021 Oliver Nash. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Oliver Nash\n-/\nimport Mathlib.Algebra.Algebra.Hom\n\n#align_import algebra.hom.non_unital_alg from \"leanprover-community/mathlib\"@\"bd9851ca476957ea4549eb19b40e7b5ade9428cc\"\n\n/-!\n# Morphisms of non-unital algebras\n\nThis file defines morphisms between two types, each of which carries:\n * an addition,\n * an additive zero,\n * a multiplication,\n * a scalar action.\n\nThe multiplications are not assumed to be associative or unital, or even to be compatible with the\nscalar actions. In a typical application, the operations will satisfy compatibility conditions\nmaking them into algebras (albeit possibly non-associative and/or non-unital) but such conditions\nare not required to make this definition.\n\nThis notion of morphism should be useful for any category of non-unital algebras. The motivating\napplication at the time it was introduced was to be able to state the adjunction property for\nmagma algebras. These are non-unital, non-associative algebras obtained by applying the\ngroup-algebra construction except where we take a type carrying just `Mul` instead of `Group`.\n\nFor a plausible future application, one could take the non-unital algebra of compactly-supported\nfunctions on a non-compact topological space. A proper map between a pair of such spaces\n(contravariantly) induces a morphism between their algebras of compactly-supported functions which\nwill be a `NonUnitalAlgHom`.\n\nTODO: add `NonUnitalAlgEquiv` when needed.\n\n## Main definitions\n\n * `NonUnitalAlgHom`\n * `AlgHom.toNonUnitalAlgHom`\n\n## Tags\n\nnon-unital, algebra, morphism\n-/\n\nset_option autoImplicit true\n\n\nuniverse u v w w₁ w₂ w₃\n\nvariable (R : Type u) (A : Type v) (B : Type w) (C : Type w₁)\n\n/-- A morphism respecting addition, multiplication, and scalar multiplication. When these arise from\nalgebra structures, this is the same as a not-necessarily-unital morphism of algebras. -/\nstructure NonUnitalAlgHom [Monoid R] [NonUnitalNonAssocSemiring A] [DistribMulAction R A]\n [NonUnitalNonAssocSemiring B] [DistribMulAction R B] extends A →+[R] B, A →ₙ* B\n#align non_unital_alg_hom NonUnitalAlgHom\n\n@[inherit_doc NonUnitalAlgHom]\ninfixr:25 \" →ₙₐ \" => NonUnitalAlgHom _\n\n@[inherit_doc]\nnotation:25 A \" →ₙₐ[\" R \"] \" B => NonUnitalAlgHom R A B\n\nattribute [nolint docBlame] NonUnitalAlgHom.toMulHom\n\n/-- `NonUnitalAlgHomClass F R A B` asserts `F` is a type of bundled algebra homomorphisms\nfrom `A` to `B`. -/\nclass NonUnitalAlgHomClass (F : Type*) (R : outParam (Type*)) (A : outParam (Type*))\n (B : outParam (Type*)) [Monoid R] [NonUnitalNonAssocSemiring A] [NonUnitalNonAssocSemiring B]\n [DistribMulAction R A] [DistribMulAction R B] extends DistribMulActionHomClass F R A B,\n MulHomClass F A B\n#align non_unital_alg_hom_class NonUnitalAlgHomClass\n\n-- Porting note: commented out, not dangerous\n-- attribute [nolint dangerousInstance] NonUnitalAlgHomClass.toMulHomClass\n\nnamespace NonUnitalAlgHomClass\n\n-- Porting note: Made following instance non-dangerous through [...] -> [...] replacement\n-- See note [lower instance priority]\ninstance (priority := 100) toNonUnitalRingHomClass {F R A B : Type*}\n [Monoid R] [NonUnitalNonAssocSemiring A] [DistribMulAction R A]\n [NonUnitalNonAssocSemiring B] [DistribMulAction R B]\n [NonUnitalAlgHomClass F R A B] : NonUnitalRingHomClass F A B :=\n { ‹NonUnitalAlgHomClass F R A B› with coe := (⇑) }\n#align non_unital_alg_hom_class.non_unital_alg_hom_class.to_non_unital_ring_hom_class NonUnitalAlgHomClass.toNonUnitalRingHomClass\n\nvariable [Semiring R] [NonUnitalNonAssocSemiring A] [Module R A]\n [NonUnitalNonAssocSemiring B] [Module R B]\n\n-- see Note [lower instance priority]\ninstance (priority := 100) {F : Type*} [NonUnitalAlgHomClass F R A B] : LinearMapClass F R A B :=\n { ‹NonUnitalAlgHomClass F R A B› with map_smulₛₗ := map_smul }\n\n/-- Turn an element of a type `F` satisfying `NonUnitalAlgHomClass F R A B` into an actual\n`NonUnitalAlgHom`. This is declared as the default coercion from `F` to `A →ₙₐ[R] B`. -/\n@[coe]\ndef toNonUnitalAlgHom {F R A B : Type*} [Monoid R] [NonUnitalNonAssocSemiring A]\n [DistribMulAction R A] [NonUnitalNonAssocSemiring B] [DistribMulAction R B]\n [NonUnitalAlgHomClass F R A B] (f : F) : A →ₙₐ[R] B :=\n { (f : A →ₙ+* B) with\n map_smul' := map_smul f }\n\ninstance {F R A B : Type*} [Monoid R] [NonUnitalNonAssocSemiring A] [DistribMulAction R A]\n [NonUnitalNonAssocSemiring B] [DistribMulAction R B] [NonUnitalAlgHomClass F R A B] :\n CoeTC F (A →ₙₐ[R] B) :=\n ⟨toNonUnitalAlgHom⟩\n\nend NonUnitalAlgHomClass\n\nnamespace NonUnitalAlgHom\n\nvariable {R A B C} [Monoid R]\n\nvariable [NonUnitalNonAssocSemiring A] [DistribMulAction R A]\n\nvariable [NonUnitalNonAssocSemiring B] [DistribMulAction R B]\n\nvariable [NonUnitalNonAssocSemiring C] [DistribMulAction R C]\n\n-- Porting note: Replaced with FunLike instance\n-- /-- see Note [function coercion] -/\n-- instance : CoeFun (A →ₙₐ[R] B) fun _ => A → B :=\n-- ⟨toFun⟩\n\ninstance : FunLike (A →ₙₐ[R] B) A fun _ => B where\n coe f := f.toFun\n coe_injective' := by rintro ⟨⟨⟨f, _⟩, _⟩, _⟩ ⟨⟨⟨g, _⟩, _⟩, _⟩ h; congr\n\n@[simp]\ntheorem toFun_eq_coe (f : A →ₙₐ[R] B) : f.toFun = ⇑f :=\n rfl\n#align non_unital_alg_hom.to_fun_eq_coe NonUnitalAlgHom.toFun_eq_coe\n\n/-- See Note [custom simps projection] -/\ndef Simps.apply (f : A →ₙₐ[R] B) : A → B := f\n\ninitialize_simps_projections NonUnitalAlgHom\n (toDistribMulActionHom_toMulActionHom_toFun → apply, -toDistribMulActionHom)\n\n@[simp]\nprotected theorem coe_coe {F : Type*} [NonUnitalAlgHomClass F R A B] (f : F) :\n ⇑(f : A →ₙₐ[R] B) = f :=\n rfl\n#align non_unital_alg_hom.coe_coe NonUnitalAlgHom.coe_coe\n\ntheorem coe_injective : @Function.Injective (A →ₙₐ[R] B) (A → B) (↑) := by\n rintro ⟨⟨⟨f, _⟩, _⟩, _⟩ ⟨⟨⟨g, _⟩, _⟩, _⟩ h; congr\n#align non_unital_alg_hom.coe_injective NonUnitalAlgHom.coe_injective\n\ninstance : NonUnitalAlgHomClass (A →ₙₐ[R] B) R A B\n where\n coe f := f.toFun\n coe_injective' := coe_injective\n map_smul f := f.map_smul'\n map_add f := f.map_add'\n map_zero f := f.map_zero'\n map_mul f := f.map_mul'\n\n@[ext]\ntheorem ext {f g : A →ₙₐ[R] B} (h : ∀ x, f x = g x) : f = g :=\n coe_injective <| funext h\n#align non_unital_alg_hom.ext NonUnitalAlgHom.ext\n\ntheorem ext_iff {f g : A →ₙₐ[R] B} : f = g ↔ ∀ x, f x = g x :=\n ⟨by\n rintro rfl x\n rfl, ext⟩\n#align non_unital_alg_hom.ext_iff NonUnitalAlgHom.ext_iff\n\ntheorem congr_fun {f g : A →ₙₐ[R] B} (h : f = g) (x : A) : f x = g x :=\n h ▸ rfl\n#align non_unital_alg_hom.congr_fun NonUnitalAlgHom.congr_fun\n\n@[simp]\ntheorem coe_mk (f : A → B) (h₁ h₂ h₃ h₄) : ⇑(⟨⟨⟨f, h₁⟩, h₂, h₃⟩, h₄⟩ : A →ₙₐ[R] B) = f :=\n rfl\n#align non_unital_alg_hom.coe_mk NonUnitalAlgHom.coe_mk\n\n@[simp]\ntheorem mk_coe (f : A →ₙₐ[R] B) (h₁ h₂ h₃ h₄) : (⟨⟨⟨f, h₁⟩, h₂, h₃⟩, h₄⟩ : A →ₙₐ[R] B) = f := by\n rfl\n#align non_unital_alg_hom.mk_coe NonUnitalAlgHom.mk_coe\n\ninstance : CoeOut (A →ₙₐ[R] B) (A →+[R] B) :=\n ⟨toDistribMulActionHom⟩\n\ninstance : CoeOut (A →ₙₐ[R] B) (A →ₙ* B) :=\n ⟨toMulHom⟩\n\n@[simp]\ntheorem toDistribMulActionHom_eq_coe (f : A →ₙₐ[R] B) : f.toDistribMulActionHom = ↑f :=\n rfl\n#align non_unital_alg_hom.to_distrib_mul_action_hom_eq_coe NonUnitalAlgHom.toDistribMulActionHom_eq_coe\n\n@[simp]\ntheorem toMulHom_eq_coe (f : A →ₙₐ[R] B) : f.toMulHom = ↑f :=\n rfl\n#align non_unital_alg_hom.to_mul_hom_eq_coe NonUnitalAlgHom.toMulHom_eq_coe\n\n@[simp, norm_cast]\ntheorem coe_to_distribMulActionHom (f : A →ₙₐ[R] B) : ⇑(f : A →+[R] B) = f :=\n rfl\n#align non_unital_alg_hom.coe_to_distrib_mul_action_hom NonUnitalAlgHom.coe_to_distribMulActionHom\n\n@[simp, norm_cast]\ntheorem coe_to_mulHom (f : A →ₙₐ[R] B) : ⇑(f : A →ₙ* B) = f :=\n rfl\n#align non_unital_alg_hom.coe_to_mul_hom NonUnitalAlgHom.coe_to_mulHom\n\ntheorem to_distribMulActionHom_injective {f g : A →ₙₐ[R] B}\n (h : (f : A →+[R] B) = (g : A →+[R] B)) : f = g := by\n ","nextTactic":"ext a","declUpToTactic":"theorem to_distribMulActionHom_injective {f g : A →ₙₐ[R] B}\n (h : (f : A →+[R] B) = (g : A →+[R] B)) : f = g := by\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_NonUnitalHom.212_0.9y3TORfxg2P0A5c","decl":"theorem to_distribMulActionHom_injective {f g : A →ₙₐ[R] B}\n (h : (f : A →+[R] B) = (g : A →+[R] B)) : f = g "} -{"state":"case h\nR : Type u\nA : Type v\nB : Type w\nC : Type w₁\ninst✝⁶ : Monoid R\ninst✝⁵ : NonUnitalNonAssocSemiring A\ninst✝⁴ : DistribMulAction R A\ninst✝³ : NonUnitalNonAssocSemiring B\ninst✝² : DistribMulAction R B\ninst✝¹ : NonUnitalNonAssocSemiring C\ninst✝ : DistribMulAction R C\nf g : A →ₙₐ[R] B\nh : ↑f = ↑g\na : A\n⊢ f a = g a","srcUpToTactic":"/-\nCopyright (c) 2021 Oliver Nash. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Oliver Nash\n-/\nimport Mathlib.Algebra.Algebra.Hom\n\n#align_import algebra.hom.non_unital_alg from \"leanprover-community/mathlib\"@\"bd9851ca476957ea4549eb19b40e7b5ade9428cc\"\n\n/-!\n# Morphisms of non-unital algebras\n\nThis file defines morphisms between two types, each of which carries:\n * an addition,\n * an additive zero,\n * a multiplication,\n * a scalar action.\n\nThe multiplications are not assumed to be associative or unital, or even to be compatible with the\nscalar actions. In a typical application, the operations will satisfy compatibility conditions\nmaking them into algebras (albeit possibly non-associative and/or non-unital) but such conditions\nare not required to make this definition.\n\nThis notion of morphism should be useful for any category of non-unital algebras. The motivating\napplication at the time it was introduced was to be able to state the adjunction property for\nmagma algebras. These are non-unital, non-associative algebras obtained by applying the\ngroup-algebra construction except where we take a type carrying just `Mul` instead of `Group`.\n\nFor a plausible future application, one could take the non-unital algebra of compactly-supported\nfunctions on a non-compact topological space. A proper map between a pair of such spaces\n(contravariantly) induces a morphism between their algebras of compactly-supported functions which\nwill be a `NonUnitalAlgHom`.\n\nTODO: add `NonUnitalAlgEquiv` when needed.\n\n## Main definitions\n\n * `NonUnitalAlgHom`\n * `AlgHom.toNonUnitalAlgHom`\n\n## Tags\n\nnon-unital, algebra, morphism\n-/\n\nset_option autoImplicit true\n\n\nuniverse u v w w₁ w₂ w₃\n\nvariable (R : Type u) (A : Type v) (B : Type w) (C : Type w₁)\n\n/-- A morphism respecting addition, multiplication, and scalar multiplication. When these arise from\nalgebra structures, this is the same as a not-necessarily-unital morphism of algebras. -/\nstructure NonUnitalAlgHom [Monoid R] [NonUnitalNonAssocSemiring A] [DistribMulAction R A]\n [NonUnitalNonAssocSemiring B] [DistribMulAction R B] extends A →+[R] B, A →ₙ* B\n#align non_unital_alg_hom NonUnitalAlgHom\n\n@[inherit_doc NonUnitalAlgHom]\ninfixr:25 \" →ₙₐ \" => NonUnitalAlgHom _\n\n@[inherit_doc]\nnotation:25 A \" →ₙₐ[\" R \"] \" B => NonUnitalAlgHom R A B\n\nattribute [nolint docBlame] NonUnitalAlgHom.toMulHom\n\n/-- `NonUnitalAlgHomClass F R A B` asserts `F` is a type of bundled algebra homomorphisms\nfrom `A` to `B`. -/\nclass NonUnitalAlgHomClass (F : Type*) (R : outParam (Type*)) (A : outParam (Type*))\n (B : outParam (Type*)) [Monoid R] [NonUnitalNonAssocSemiring A] [NonUnitalNonAssocSemiring B]\n [DistribMulAction R A] [DistribMulAction R B] extends DistribMulActionHomClass F R A B,\n MulHomClass F A B\n#align non_unital_alg_hom_class NonUnitalAlgHomClass\n\n-- Porting note: commented out, not dangerous\n-- attribute [nolint dangerousInstance] NonUnitalAlgHomClass.toMulHomClass\n\nnamespace NonUnitalAlgHomClass\n\n-- Porting note: Made following instance non-dangerous through [...] -> [...] replacement\n-- See note [lower instance priority]\ninstance (priority := 100) toNonUnitalRingHomClass {F R A B : Type*}\n [Monoid R] [NonUnitalNonAssocSemiring A] [DistribMulAction R A]\n [NonUnitalNonAssocSemiring B] [DistribMulAction R B]\n [NonUnitalAlgHomClass F R A B] : NonUnitalRingHomClass F A B :=\n { ‹NonUnitalAlgHomClass F R A B› with coe := (⇑) }\n#align non_unital_alg_hom_class.non_unital_alg_hom_class.to_non_unital_ring_hom_class NonUnitalAlgHomClass.toNonUnitalRingHomClass\n\nvariable [Semiring R] [NonUnitalNonAssocSemiring A] [Module R A]\n [NonUnitalNonAssocSemiring B] [Module R B]\n\n-- see Note [lower instance priority]\ninstance (priority := 100) {F : Type*} [NonUnitalAlgHomClass F R A B] : LinearMapClass F R A B :=\n { ‹NonUnitalAlgHomClass F R A B› with map_smulₛₗ := map_smul }\n\n/-- Turn an element of a type `F` satisfying `NonUnitalAlgHomClass F R A B` into an actual\n`NonUnitalAlgHom`. This is declared as the default coercion from `F` to `A →ₙₐ[R] B`. -/\n@[coe]\ndef toNonUnitalAlgHom {F R A B : Type*} [Monoid R] [NonUnitalNonAssocSemiring A]\n [DistribMulAction R A] [NonUnitalNonAssocSemiring B] [DistribMulAction R B]\n [NonUnitalAlgHomClass F R A B] (f : F) : A →ₙₐ[R] B :=\n { (f : A →ₙ+* B) with\n map_smul' := map_smul f }\n\ninstance {F R A B : Type*} [Monoid R] [NonUnitalNonAssocSemiring A] [DistribMulAction R A]\n [NonUnitalNonAssocSemiring B] [DistribMulAction R B] [NonUnitalAlgHomClass F R A B] :\n CoeTC F (A →ₙₐ[R] B) :=\n ⟨toNonUnitalAlgHom⟩\n\nend NonUnitalAlgHomClass\n\nnamespace NonUnitalAlgHom\n\nvariable {R A B C} [Monoid R]\n\nvariable [NonUnitalNonAssocSemiring A] [DistribMulAction R A]\n\nvariable [NonUnitalNonAssocSemiring B] [DistribMulAction R B]\n\nvariable [NonUnitalNonAssocSemiring C] [DistribMulAction R C]\n\n-- Porting note: Replaced with FunLike instance\n-- /-- see Note [function coercion] -/\n-- instance : CoeFun (A →ₙₐ[R] B) fun _ => A → B :=\n-- ⟨toFun⟩\n\ninstance : FunLike (A →ₙₐ[R] B) A fun _ => B where\n coe f := f.toFun\n coe_injective' := by rintro ⟨⟨⟨f, _⟩, _⟩, _⟩ ⟨⟨⟨g, _⟩, _⟩, _⟩ h; congr\n\n@[simp]\ntheorem toFun_eq_coe (f : A →ₙₐ[R] B) : f.toFun = ⇑f :=\n rfl\n#align non_unital_alg_hom.to_fun_eq_coe NonUnitalAlgHom.toFun_eq_coe\n\n/-- See Note [custom simps projection] -/\ndef Simps.apply (f : A →ₙₐ[R] B) : A → B := f\n\ninitialize_simps_projections NonUnitalAlgHom\n (toDistribMulActionHom_toMulActionHom_toFun → apply, -toDistribMulActionHom)\n\n@[simp]\nprotected theorem coe_coe {F : Type*} [NonUnitalAlgHomClass F R A B] (f : F) :\n ⇑(f : A →ₙₐ[R] B) = f :=\n rfl\n#align non_unital_alg_hom.coe_coe NonUnitalAlgHom.coe_coe\n\ntheorem coe_injective : @Function.Injective (A →ₙₐ[R] B) (A → B) (↑) := by\n rintro ⟨⟨⟨f, _⟩, _⟩, _⟩ ⟨⟨⟨g, _⟩, _⟩, _⟩ h; congr\n#align non_unital_alg_hom.coe_injective NonUnitalAlgHom.coe_injective\n\ninstance : NonUnitalAlgHomClass (A →ₙₐ[R] B) R A B\n where\n coe f := f.toFun\n coe_injective' := coe_injective\n map_smul f := f.map_smul'\n map_add f := f.map_add'\n map_zero f := f.map_zero'\n map_mul f := f.map_mul'\n\n@[ext]\ntheorem ext {f g : A →ₙₐ[R] B} (h : ∀ x, f x = g x) : f = g :=\n coe_injective <| funext h\n#align non_unital_alg_hom.ext NonUnitalAlgHom.ext\n\ntheorem ext_iff {f g : A →ₙₐ[R] B} : f = g ↔ ∀ x, f x = g x :=\n ⟨by\n rintro rfl x\n rfl, ext⟩\n#align non_unital_alg_hom.ext_iff NonUnitalAlgHom.ext_iff\n\ntheorem congr_fun {f g : A →ₙₐ[R] B} (h : f = g) (x : A) : f x = g x :=\n h ▸ rfl\n#align non_unital_alg_hom.congr_fun NonUnitalAlgHom.congr_fun\n\n@[simp]\ntheorem coe_mk (f : A → B) (h₁ h₂ h₃ h₄) : ⇑(⟨⟨⟨f, h₁⟩, h₂, h₃⟩, h₄⟩ : A →ₙₐ[R] B) = f :=\n rfl\n#align non_unital_alg_hom.coe_mk NonUnitalAlgHom.coe_mk\n\n@[simp]\ntheorem mk_coe (f : A →ₙₐ[R] B) (h₁ h₂ h₃ h₄) : (⟨⟨⟨f, h₁⟩, h₂, h₃⟩, h₄⟩ : A →ₙₐ[R] B) = f := by\n rfl\n#align non_unital_alg_hom.mk_coe NonUnitalAlgHom.mk_coe\n\ninstance : CoeOut (A →ₙₐ[R] B) (A →+[R] B) :=\n ⟨toDistribMulActionHom⟩\n\ninstance : CoeOut (A →ₙₐ[R] B) (A →ₙ* B) :=\n ⟨toMulHom⟩\n\n@[simp]\ntheorem toDistribMulActionHom_eq_coe (f : A →ₙₐ[R] B) : f.toDistribMulActionHom = ↑f :=\n rfl\n#align non_unital_alg_hom.to_distrib_mul_action_hom_eq_coe NonUnitalAlgHom.toDistribMulActionHom_eq_coe\n\n@[simp]\ntheorem toMulHom_eq_coe (f : A →ₙₐ[R] B) : f.toMulHom = ↑f :=\n rfl\n#align non_unital_alg_hom.to_mul_hom_eq_coe NonUnitalAlgHom.toMulHom_eq_coe\n\n@[simp, norm_cast]\ntheorem coe_to_distribMulActionHom (f : A →ₙₐ[R] B) : ⇑(f : A →+[R] B) = f :=\n rfl\n#align non_unital_alg_hom.coe_to_distrib_mul_action_hom NonUnitalAlgHom.coe_to_distribMulActionHom\n\n@[simp, norm_cast]\ntheorem coe_to_mulHom (f : A →ₙₐ[R] B) : ⇑(f : A →ₙ* B) = f :=\n rfl\n#align non_unital_alg_hom.coe_to_mul_hom NonUnitalAlgHom.coe_to_mulHom\n\ntheorem to_distribMulActionHom_injective {f g : A →ₙₐ[R] B}\n (h : (f : A →+[R] B) = (g : A →+[R] B)) : f = g := by\n ext a\n ","nextTactic":"exact DistribMulActionHom.congr_fun h a","declUpToTactic":"theorem to_distribMulActionHom_injective {f g : A →ₙₐ[R] B}\n (h : (f : A →+[R] B) = (g : A →+[R] B)) : f = g := by\n ext a\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_NonUnitalHom.212_0.9y3TORfxg2P0A5c","decl":"theorem to_distribMulActionHom_injective {f g : A →ₙₐ[R] B}\n (h : (f : A →+[R] B) = (g : A →+[R] B)) : f = g "} -{"state":"R : Type u\nA : Type v\nB : Type w\nC : Type w₁\ninst✝⁶ : Monoid R\ninst✝⁵ : NonUnitalNonAssocSemiring A\ninst✝⁴ : DistribMulAction R A\ninst✝³ : NonUnitalNonAssocSemiring B\ninst✝² : DistribMulAction R B\ninst✝¹ : NonUnitalNonAssocSemiring C\ninst✝ : DistribMulAction R C\nf g : A →ₙₐ[R] B\nh : ↑f = ↑g\n⊢ f = g","srcUpToTactic":"/-\nCopyright (c) 2021 Oliver Nash. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Oliver Nash\n-/\nimport Mathlib.Algebra.Algebra.Hom\n\n#align_import algebra.hom.non_unital_alg from \"leanprover-community/mathlib\"@\"bd9851ca476957ea4549eb19b40e7b5ade9428cc\"\n\n/-!\n# Morphisms of non-unital algebras\n\nThis file defines morphisms between two types, each of which carries:\n * an addition,\n * an additive zero,\n * a multiplication,\n * a scalar action.\n\nThe multiplications are not assumed to be associative or unital, or even to be compatible with the\nscalar actions. In a typical application, the operations will satisfy compatibility conditions\nmaking them into algebras (albeit possibly non-associative and/or non-unital) but such conditions\nare not required to make this definition.\n\nThis notion of morphism should be useful for any category of non-unital algebras. The motivating\napplication at the time it was introduced was to be able to state the adjunction property for\nmagma algebras. These are non-unital, non-associative algebras obtained by applying the\ngroup-algebra construction except where we take a type carrying just `Mul` instead of `Group`.\n\nFor a plausible future application, one could take the non-unital algebra of compactly-supported\nfunctions on a non-compact topological space. A proper map between a pair of such spaces\n(contravariantly) induces a morphism between their algebras of compactly-supported functions which\nwill be a `NonUnitalAlgHom`.\n\nTODO: add `NonUnitalAlgEquiv` when needed.\n\n## Main definitions\n\n * `NonUnitalAlgHom`\n * `AlgHom.toNonUnitalAlgHom`\n\n## Tags\n\nnon-unital, algebra, morphism\n-/\n\nset_option autoImplicit true\n\n\nuniverse u v w w₁ w₂ w₃\n\nvariable (R : Type u) (A : Type v) (B : Type w) (C : Type w₁)\n\n/-- A morphism respecting addition, multiplication, and scalar multiplication. When these arise from\nalgebra structures, this is the same as a not-necessarily-unital morphism of algebras. -/\nstructure NonUnitalAlgHom [Monoid R] [NonUnitalNonAssocSemiring A] [DistribMulAction R A]\n [NonUnitalNonAssocSemiring B] [DistribMulAction R B] extends A →+[R] B, A →ₙ* B\n#align non_unital_alg_hom NonUnitalAlgHom\n\n@[inherit_doc NonUnitalAlgHom]\ninfixr:25 \" →ₙₐ \" => NonUnitalAlgHom _\n\n@[inherit_doc]\nnotation:25 A \" →ₙₐ[\" R \"] \" B => NonUnitalAlgHom R A B\n\nattribute [nolint docBlame] NonUnitalAlgHom.toMulHom\n\n/-- `NonUnitalAlgHomClass F R A B` asserts `F` is a type of bundled algebra homomorphisms\nfrom `A` to `B`. -/\nclass NonUnitalAlgHomClass (F : Type*) (R : outParam (Type*)) (A : outParam (Type*))\n (B : outParam (Type*)) [Monoid R] [NonUnitalNonAssocSemiring A] [NonUnitalNonAssocSemiring B]\n [DistribMulAction R A] [DistribMulAction R B] extends DistribMulActionHomClass F R A B,\n MulHomClass F A B\n#align non_unital_alg_hom_class NonUnitalAlgHomClass\n\n-- Porting note: commented out, not dangerous\n-- attribute [nolint dangerousInstance] NonUnitalAlgHomClass.toMulHomClass\n\nnamespace NonUnitalAlgHomClass\n\n-- Porting note: Made following instance non-dangerous through [...] -> [...] replacement\n-- See note [lower instance priority]\ninstance (priority := 100) toNonUnitalRingHomClass {F R A B : Type*}\n [Monoid R] [NonUnitalNonAssocSemiring A] [DistribMulAction R A]\n [NonUnitalNonAssocSemiring B] [DistribMulAction R B]\n [NonUnitalAlgHomClass F R A B] : NonUnitalRingHomClass F A B :=\n { ‹NonUnitalAlgHomClass F R A B› with coe := (⇑) }\n#align non_unital_alg_hom_class.non_unital_alg_hom_class.to_non_unital_ring_hom_class NonUnitalAlgHomClass.toNonUnitalRingHomClass\n\nvariable [Semiring R] [NonUnitalNonAssocSemiring A] [Module R A]\n [NonUnitalNonAssocSemiring B] [Module R B]\n\n-- see Note [lower instance priority]\ninstance (priority := 100) {F : Type*} [NonUnitalAlgHomClass F R A B] : LinearMapClass F R A B :=\n { ‹NonUnitalAlgHomClass F R A B› with map_smulₛₗ := map_smul }\n\n/-- Turn an element of a type `F` satisfying `NonUnitalAlgHomClass F R A B` into an actual\n`NonUnitalAlgHom`. This is declared as the default coercion from `F` to `A →ₙₐ[R] B`. -/\n@[coe]\ndef toNonUnitalAlgHom {F R A B : Type*} [Monoid R] [NonUnitalNonAssocSemiring A]\n [DistribMulAction R A] [NonUnitalNonAssocSemiring B] [DistribMulAction R B]\n [NonUnitalAlgHomClass F R A B] (f : F) : A →ₙₐ[R] B :=\n { (f : A →ₙ+* B) with\n map_smul' := map_smul f }\n\ninstance {F R A B : Type*} [Monoid R] [NonUnitalNonAssocSemiring A] [DistribMulAction R A]\n [NonUnitalNonAssocSemiring B] [DistribMulAction R B] [NonUnitalAlgHomClass F R A B] :\n CoeTC F (A →ₙₐ[R] B) :=\n ⟨toNonUnitalAlgHom⟩\n\nend NonUnitalAlgHomClass\n\nnamespace NonUnitalAlgHom\n\nvariable {R A B C} [Monoid R]\n\nvariable [NonUnitalNonAssocSemiring A] [DistribMulAction R A]\n\nvariable [NonUnitalNonAssocSemiring B] [DistribMulAction R B]\n\nvariable [NonUnitalNonAssocSemiring C] [DistribMulAction R C]\n\n-- Porting note: Replaced with FunLike instance\n-- /-- see Note [function coercion] -/\n-- instance : CoeFun (A →ₙₐ[R] B) fun _ => A → B :=\n-- ⟨toFun⟩\n\ninstance : FunLike (A →ₙₐ[R] B) A fun _ => B where\n coe f := f.toFun\n coe_injective' := by rintro ⟨⟨⟨f, _⟩, _⟩, _⟩ ⟨⟨⟨g, _⟩, _⟩, _⟩ h; congr\n\n@[simp]\ntheorem toFun_eq_coe (f : A →ₙₐ[R] B) : f.toFun = ⇑f :=\n rfl\n#align non_unital_alg_hom.to_fun_eq_coe NonUnitalAlgHom.toFun_eq_coe\n\n/-- See Note [custom simps projection] -/\ndef Simps.apply (f : A →ₙₐ[R] B) : A → B := f\n\ninitialize_simps_projections NonUnitalAlgHom\n (toDistribMulActionHom_toMulActionHom_toFun → apply, -toDistribMulActionHom)\n\n@[simp]\nprotected theorem coe_coe {F : Type*} [NonUnitalAlgHomClass F R A B] (f : F) :\n ⇑(f : A →ₙₐ[R] B) = f :=\n rfl\n#align non_unital_alg_hom.coe_coe NonUnitalAlgHom.coe_coe\n\ntheorem coe_injective : @Function.Injective (A →ₙₐ[R] B) (A → B) (↑) := by\n rintro ⟨⟨⟨f, _⟩, _⟩, _⟩ ⟨⟨⟨g, _⟩, _⟩, _⟩ h; congr\n#align non_unital_alg_hom.coe_injective NonUnitalAlgHom.coe_injective\n\ninstance : NonUnitalAlgHomClass (A →ₙₐ[R] B) R A B\n where\n coe f := f.toFun\n coe_injective' := coe_injective\n map_smul f := f.map_smul'\n map_add f := f.map_add'\n map_zero f := f.map_zero'\n map_mul f := f.map_mul'\n\n@[ext]\ntheorem ext {f g : A →ₙₐ[R] B} (h : ∀ x, f x = g x) : f = g :=\n coe_injective <| funext h\n#align non_unital_alg_hom.ext NonUnitalAlgHom.ext\n\ntheorem ext_iff {f g : A →ₙₐ[R] B} : f = g ↔ ∀ x, f x = g x :=\n ⟨by\n rintro rfl x\n rfl, ext⟩\n#align non_unital_alg_hom.ext_iff NonUnitalAlgHom.ext_iff\n\ntheorem congr_fun {f g : A →ₙₐ[R] B} (h : f = g) (x : A) : f x = g x :=\n h ▸ rfl\n#align non_unital_alg_hom.congr_fun NonUnitalAlgHom.congr_fun\n\n@[simp]\ntheorem coe_mk (f : A → B) (h₁ h₂ h₃ h₄) : ⇑(⟨⟨⟨f, h₁⟩, h₂, h₃⟩, h₄⟩ : A →ₙₐ[R] B) = f :=\n rfl\n#align non_unital_alg_hom.coe_mk NonUnitalAlgHom.coe_mk\n\n@[simp]\ntheorem mk_coe (f : A →ₙₐ[R] B) (h₁ h₂ h₃ h₄) : (⟨⟨⟨f, h₁⟩, h₂, h₃⟩, h₄⟩ : A →ₙₐ[R] B) = f := by\n rfl\n#align non_unital_alg_hom.mk_coe NonUnitalAlgHom.mk_coe\n\ninstance : CoeOut (A →ₙₐ[R] B) (A →+[R] B) :=\n ⟨toDistribMulActionHom⟩\n\ninstance : CoeOut (A →ₙₐ[R] B) (A →ₙ* B) :=\n ⟨toMulHom⟩\n\n@[simp]\ntheorem toDistribMulActionHom_eq_coe (f : A →ₙₐ[R] B) : f.toDistribMulActionHom = ↑f :=\n rfl\n#align non_unital_alg_hom.to_distrib_mul_action_hom_eq_coe NonUnitalAlgHom.toDistribMulActionHom_eq_coe\n\n@[simp]\ntheorem toMulHom_eq_coe (f : A →ₙₐ[R] B) : f.toMulHom = ↑f :=\n rfl\n#align non_unital_alg_hom.to_mul_hom_eq_coe NonUnitalAlgHom.toMulHom_eq_coe\n\n@[simp, norm_cast]\ntheorem coe_to_distribMulActionHom (f : A →ₙₐ[R] B) : ⇑(f : A →+[R] B) = f :=\n rfl\n#align non_unital_alg_hom.coe_to_distrib_mul_action_hom NonUnitalAlgHom.coe_to_distribMulActionHom\n\n@[simp, norm_cast]\ntheorem coe_to_mulHom (f : A →ₙₐ[R] B) : ⇑(f : A →ₙ* B) = f :=\n rfl\n#align non_unital_alg_hom.coe_to_mul_hom NonUnitalAlgHom.coe_to_mulHom\n\ntheorem to_distribMulActionHom_injective {f g : A →ₙₐ[R] B}\n (h : (f : A →+[R] B) = (g : A →+[R] B)) : f = g := by\n ext a\n exact DistribMulActionHom.congr_fun h a\n#align non_unital_alg_hom.to_distrib_mul_action_hom_injective NonUnitalAlgHom.to_distribMulActionHom_injective\n\ntheorem to_mulHom_injective {f g : A →ₙₐ[R] B} (h : (f : A →ₙ* B) = (g : A →ₙ* B)) : f = g := by\n ","nextTactic":"ext a","declUpToTactic":"theorem to_mulHom_injective {f g : A →ₙₐ[R] B} (h : (f : A →ₙ* B) = (g : A →ₙ* B)) : f = g := by\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_NonUnitalHom.218_0.9y3TORfxg2P0A5c","decl":"theorem to_mulHom_injective {f g : A →ₙₐ[R] B} (h : (f : A →ₙ* B) = (g : A →ₙ* B)) : f = g "} -{"state":"case h\nR : Type u\nA : Type v\nB : Type w\nC : Type w₁\ninst✝⁶ : Monoid R\ninst✝⁵ : NonUnitalNonAssocSemiring A\ninst✝⁴ : DistribMulAction R A\ninst✝³ : NonUnitalNonAssocSemiring B\ninst✝² : DistribMulAction R B\ninst✝¹ : NonUnitalNonAssocSemiring C\ninst✝ : DistribMulAction R C\nf g : A →ₙₐ[R] B\nh : ↑f = ↑g\na : A\n⊢ f a = g a","srcUpToTactic":"/-\nCopyright (c) 2021 Oliver Nash. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Oliver Nash\n-/\nimport Mathlib.Algebra.Algebra.Hom\n\n#align_import algebra.hom.non_unital_alg from \"leanprover-community/mathlib\"@\"bd9851ca476957ea4549eb19b40e7b5ade9428cc\"\n\n/-!\n# Morphisms of non-unital algebras\n\nThis file defines morphisms between two types, each of which carries:\n * an addition,\n * an additive zero,\n * a multiplication,\n * a scalar action.\n\nThe multiplications are not assumed to be associative or unital, or even to be compatible with the\nscalar actions. In a typical application, the operations will satisfy compatibility conditions\nmaking them into algebras (albeit possibly non-associative and/or non-unital) but such conditions\nare not required to make this definition.\n\nThis notion of morphism should be useful for any category of non-unital algebras. The motivating\napplication at the time it was introduced was to be able to state the adjunction property for\nmagma algebras. These are non-unital, non-associative algebras obtained by applying the\ngroup-algebra construction except where we take a type carrying just `Mul` instead of `Group`.\n\nFor a plausible future application, one could take the non-unital algebra of compactly-supported\nfunctions on a non-compact topological space. A proper map between a pair of such spaces\n(contravariantly) induces a morphism between their algebras of compactly-supported functions which\nwill be a `NonUnitalAlgHom`.\n\nTODO: add `NonUnitalAlgEquiv` when needed.\n\n## Main definitions\n\n * `NonUnitalAlgHom`\n * `AlgHom.toNonUnitalAlgHom`\n\n## Tags\n\nnon-unital, algebra, morphism\n-/\n\nset_option autoImplicit true\n\n\nuniverse u v w w₁ w₂ w₃\n\nvariable (R : Type u) (A : Type v) (B : Type w) (C : Type w₁)\n\n/-- A morphism respecting addition, multiplication, and scalar multiplication. When these arise from\nalgebra structures, this is the same as a not-necessarily-unital morphism of algebras. -/\nstructure NonUnitalAlgHom [Monoid R] [NonUnitalNonAssocSemiring A] [DistribMulAction R A]\n [NonUnitalNonAssocSemiring B] [DistribMulAction R B] extends A →+[R] B, A →ₙ* B\n#align non_unital_alg_hom NonUnitalAlgHom\n\n@[inherit_doc NonUnitalAlgHom]\ninfixr:25 \" →ₙₐ \" => NonUnitalAlgHom _\n\n@[inherit_doc]\nnotation:25 A \" →ₙₐ[\" R \"] \" B => NonUnitalAlgHom R A B\n\nattribute [nolint docBlame] NonUnitalAlgHom.toMulHom\n\n/-- `NonUnitalAlgHomClass F R A B` asserts `F` is a type of bundled algebra homomorphisms\nfrom `A` to `B`. -/\nclass NonUnitalAlgHomClass (F : Type*) (R : outParam (Type*)) (A : outParam (Type*))\n (B : outParam (Type*)) [Monoid R] [NonUnitalNonAssocSemiring A] [NonUnitalNonAssocSemiring B]\n [DistribMulAction R A] [DistribMulAction R B] extends DistribMulActionHomClass F R A B,\n MulHomClass F A B\n#align non_unital_alg_hom_class NonUnitalAlgHomClass\n\n-- Porting note: commented out, not dangerous\n-- attribute [nolint dangerousInstance] NonUnitalAlgHomClass.toMulHomClass\n\nnamespace NonUnitalAlgHomClass\n\n-- Porting note: Made following instance non-dangerous through [...] -> [...] replacement\n-- See note [lower instance priority]\ninstance (priority := 100) toNonUnitalRingHomClass {F R A B : Type*}\n [Monoid R] [NonUnitalNonAssocSemiring A] [DistribMulAction R A]\n [NonUnitalNonAssocSemiring B] [DistribMulAction R B]\n [NonUnitalAlgHomClass F R A B] : NonUnitalRingHomClass F A B :=\n { ‹NonUnitalAlgHomClass F R A B› with coe := (⇑) }\n#align non_unital_alg_hom_class.non_unital_alg_hom_class.to_non_unital_ring_hom_class NonUnitalAlgHomClass.toNonUnitalRingHomClass\n\nvariable [Semiring R] [NonUnitalNonAssocSemiring A] [Module R A]\n [NonUnitalNonAssocSemiring B] [Module R B]\n\n-- see Note [lower instance priority]\ninstance (priority := 100) {F : Type*} [NonUnitalAlgHomClass F R A B] : LinearMapClass F R A B :=\n { ‹NonUnitalAlgHomClass F R A B› with map_smulₛₗ := map_smul }\n\n/-- Turn an element of a type `F` satisfying `NonUnitalAlgHomClass F R A B` into an actual\n`NonUnitalAlgHom`. This is declared as the default coercion from `F` to `A →ₙₐ[R] B`. -/\n@[coe]\ndef toNonUnitalAlgHom {F R A B : Type*} [Monoid R] [NonUnitalNonAssocSemiring A]\n [DistribMulAction R A] [NonUnitalNonAssocSemiring B] [DistribMulAction R B]\n [NonUnitalAlgHomClass F R A B] (f : F) : A →ₙₐ[R] B :=\n { (f : A →ₙ+* B) with\n map_smul' := map_smul f }\n\ninstance {F R A B : Type*} [Monoid R] [NonUnitalNonAssocSemiring A] [DistribMulAction R A]\n [NonUnitalNonAssocSemiring B] [DistribMulAction R B] [NonUnitalAlgHomClass F R A B] :\n CoeTC F (A →ₙₐ[R] B) :=\n ⟨toNonUnitalAlgHom⟩\n\nend NonUnitalAlgHomClass\n\nnamespace NonUnitalAlgHom\n\nvariable {R A B C} [Monoid R]\n\nvariable [NonUnitalNonAssocSemiring A] [DistribMulAction R A]\n\nvariable [NonUnitalNonAssocSemiring B] [DistribMulAction R B]\n\nvariable [NonUnitalNonAssocSemiring C] [DistribMulAction R C]\n\n-- Porting note: Replaced with FunLike instance\n-- /-- see Note [function coercion] -/\n-- instance : CoeFun (A →ₙₐ[R] B) fun _ => A → B :=\n-- ⟨toFun⟩\n\ninstance : FunLike (A →ₙₐ[R] B) A fun _ => B where\n coe f := f.toFun\n coe_injective' := by rintro ⟨⟨⟨f, _⟩, _⟩, _⟩ ⟨⟨⟨g, _⟩, _⟩, _⟩ h; congr\n\n@[simp]\ntheorem toFun_eq_coe (f : A →ₙₐ[R] B) : f.toFun = ⇑f :=\n rfl\n#align non_unital_alg_hom.to_fun_eq_coe NonUnitalAlgHom.toFun_eq_coe\n\n/-- See Note [custom simps projection] -/\ndef Simps.apply (f : A →ₙₐ[R] B) : A → B := f\n\ninitialize_simps_projections NonUnitalAlgHom\n (toDistribMulActionHom_toMulActionHom_toFun → apply, -toDistribMulActionHom)\n\n@[simp]\nprotected theorem coe_coe {F : Type*} [NonUnitalAlgHomClass F R A B] (f : F) :\n ⇑(f : A →ₙₐ[R] B) = f :=\n rfl\n#align non_unital_alg_hom.coe_coe NonUnitalAlgHom.coe_coe\n\ntheorem coe_injective : @Function.Injective (A →ₙₐ[R] B) (A → B) (↑) := by\n rintro ⟨⟨⟨f, _⟩, _⟩, _⟩ ⟨⟨⟨g, _⟩, _⟩, _⟩ h; congr\n#align non_unital_alg_hom.coe_injective NonUnitalAlgHom.coe_injective\n\ninstance : NonUnitalAlgHomClass (A →ₙₐ[R] B) R A B\n where\n coe f := f.toFun\n coe_injective' := coe_injective\n map_smul f := f.map_smul'\n map_add f := f.map_add'\n map_zero f := f.map_zero'\n map_mul f := f.map_mul'\n\n@[ext]\ntheorem ext {f g : A →ₙₐ[R] B} (h : ∀ x, f x = g x) : f = g :=\n coe_injective <| funext h\n#align non_unital_alg_hom.ext NonUnitalAlgHom.ext\n\ntheorem ext_iff {f g : A →ₙₐ[R] B} : f = g ↔ ∀ x, f x = g x :=\n ⟨by\n rintro rfl x\n rfl, ext⟩\n#align non_unital_alg_hom.ext_iff NonUnitalAlgHom.ext_iff\n\ntheorem congr_fun {f g : A →ₙₐ[R] B} (h : f = g) (x : A) : f x = g x :=\n h ▸ rfl\n#align non_unital_alg_hom.congr_fun NonUnitalAlgHom.congr_fun\n\n@[simp]\ntheorem coe_mk (f : A → B) (h₁ h₂ h₃ h₄) : ⇑(⟨⟨⟨f, h₁⟩, h₂, h₃⟩, h₄⟩ : A →ₙₐ[R] B) = f :=\n rfl\n#align non_unital_alg_hom.coe_mk NonUnitalAlgHom.coe_mk\n\n@[simp]\ntheorem mk_coe (f : A →ₙₐ[R] B) (h₁ h₂ h₃ h₄) : (⟨⟨⟨f, h₁⟩, h₂, h₃⟩, h₄⟩ : A →ₙₐ[R] B) = f := by\n rfl\n#align non_unital_alg_hom.mk_coe NonUnitalAlgHom.mk_coe\n\ninstance : CoeOut (A →ₙₐ[R] B) (A →+[R] B) :=\n ⟨toDistribMulActionHom⟩\n\ninstance : CoeOut (A →ₙₐ[R] B) (A →ₙ* B) :=\n ⟨toMulHom⟩\n\n@[simp]\ntheorem toDistribMulActionHom_eq_coe (f : A →ₙₐ[R] B) : f.toDistribMulActionHom = ↑f :=\n rfl\n#align non_unital_alg_hom.to_distrib_mul_action_hom_eq_coe NonUnitalAlgHom.toDistribMulActionHom_eq_coe\n\n@[simp]\ntheorem toMulHom_eq_coe (f : A →ₙₐ[R] B) : f.toMulHom = ↑f :=\n rfl\n#align non_unital_alg_hom.to_mul_hom_eq_coe NonUnitalAlgHom.toMulHom_eq_coe\n\n@[simp, norm_cast]\ntheorem coe_to_distribMulActionHom (f : A →ₙₐ[R] B) : ⇑(f : A →+[R] B) = f :=\n rfl\n#align non_unital_alg_hom.coe_to_distrib_mul_action_hom NonUnitalAlgHom.coe_to_distribMulActionHom\n\n@[simp, norm_cast]\ntheorem coe_to_mulHom (f : A →ₙₐ[R] B) : ⇑(f : A →ₙ* B) = f :=\n rfl\n#align non_unital_alg_hom.coe_to_mul_hom NonUnitalAlgHom.coe_to_mulHom\n\ntheorem to_distribMulActionHom_injective {f g : A →ₙₐ[R] B}\n (h : (f : A →+[R] B) = (g : A →+[R] B)) : f = g := by\n ext a\n exact DistribMulActionHom.congr_fun h a\n#align non_unital_alg_hom.to_distrib_mul_action_hom_injective NonUnitalAlgHom.to_distribMulActionHom_injective\n\ntheorem to_mulHom_injective {f g : A →ₙₐ[R] B} (h : (f : A →ₙ* B) = (g : A →ₙ* B)) : f = g := by\n ext a\n ","nextTactic":"exact FunLike.congr_fun h a","declUpToTactic":"theorem to_mulHom_injective {f g : A →ₙₐ[R] B} (h : (f : A →ₙ* B) = (g : A →ₙ* B)) : f = g := by\n ext a\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_NonUnitalHom.218_0.9y3TORfxg2P0A5c","decl":"theorem to_mulHom_injective {f g : A →ₙₐ[R] B} (h : (f : A →ₙ* B) = (g : A →ₙ* B)) : f = g "} -{"state":"R : Type u\nA : Type v\nB : Type w\nC : Type w₁\ninst✝⁶ : Monoid R\ninst✝⁵ : NonUnitalNonAssocSemiring A\ninst✝⁴ : DistribMulAction R A\ninst✝³ : NonUnitalNonAssocSemiring B\ninst✝² : DistribMulAction R B\ninst✝¹ : NonUnitalNonAssocSemiring C\ninst✝ : DistribMulAction R C\nf : A →ₙₐ[R] B\nh₁ : ∀ (m : R) (x : A), f (m • x) = m • f x\nh₂ : MulActionHom.toFun { toFun := ⇑f, map_smul' := h₁ } 0 = 0\nh₃ :\n ∀ (x y : A),\n MulActionHom.toFun { toFun := ⇑f, map_smul' := h₁ } (x + y) =\n MulActionHom.toFun { toFun := ⇑f, map_smul' := h₁ } x + MulActionHom.toFun { toFun := ⇑f, map_smul' := h₁ } y\nh₄ :\n ∀ (x y : A),\n MulActionHom.toFun\n { toMulActionHom := { toFun := ⇑f, map_smul' := h₁ }, map_zero' := h₂, map_add' := h₃ }.toMulActionHom (x * y) =\n MulActionHom.toFun\n { toMulActionHom := { toFun := ⇑f, map_smul' := h₁ }, map_zero' := h₂, map_add' := h₃ }.toMulActionHom x *\n MulActionHom.toFun\n { toMulActionHom := { toFun := ⇑f, map_smul' := h₁ }, map_zero' := h₂, map_add' := h₃ }.toMulActionHom y\n⊢ ↑{ toDistribMulActionHom := { toMulActionHom := { toFun := ⇑f, map_smul' := h₁ }, map_zero' := h₂, map_add' := h₃ },\n map_mul' := h₄ } =\n { toMulActionHom := { toFun := ⇑f, map_smul' := h₁ }, map_zero' := h₂, map_add' := h₃ }","srcUpToTactic":"/-\nCopyright (c) 2021 Oliver Nash. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Oliver Nash\n-/\nimport Mathlib.Algebra.Algebra.Hom\n\n#align_import algebra.hom.non_unital_alg from \"leanprover-community/mathlib\"@\"bd9851ca476957ea4549eb19b40e7b5ade9428cc\"\n\n/-!\n# Morphisms of non-unital algebras\n\nThis file defines morphisms between two types, each of which carries:\n * an addition,\n * an additive zero,\n * a multiplication,\n * a scalar action.\n\nThe multiplications are not assumed to be associative or unital, or even to be compatible with the\nscalar actions. In a typical application, the operations will satisfy compatibility conditions\nmaking them into algebras (albeit possibly non-associative and/or non-unital) but such conditions\nare not required to make this definition.\n\nThis notion of morphism should be useful for any category of non-unital algebras. The motivating\napplication at the time it was introduced was to be able to state the adjunction property for\nmagma algebras. These are non-unital, non-associative algebras obtained by applying the\ngroup-algebra construction except where we take a type carrying just `Mul` instead of `Group`.\n\nFor a plausible future application, one could take the non-unital algebra of compactly-supported\nfunctions on a non-compact topological space. A proper map between a pair of such spaces\n(contravariantly) induces a morphism between their algebras of compactly-supported functions which\nwill be a `NonUnitalAlgHom`.\n\nTODO: add `NonUnitalAlgEquiv` when needed.\n\n## Main definitions\n\n * `NonUnitalAlgHom`\n * `AlgHom.toNonUnitalAlgHom`\n\n## Tags\n\nnon-unital, algebra, morphism\n-/\n\nset_option autoImplicit true\n\n\nuniverse u v w w₁ w₂ w₃\n\nvariable (R : Type u) (A : Type v) (B : Type w) (C : Type w₁)\n\n/-- A morphism respecting addition, multiplication, and scalar multiplication. When these arise from\nalgebra structures, this is the same as a not-necessarily-unital morphism of algebras. -/\nstructure NonUnitalAlgHom [Monoid R] [NonUnitalNonAssocSemiring A] [DistribMulAction R A]\n [NonUnitalNonAssocSemiring B] [DistribMulAction R B] extends A →+[R] B, A →ₙ* B\n#align non_unital_alg_hom NonUnitalAlgHom\n\n@[inherit_doc NonUnitalAlgHom]\ninfixr:25 \" →ₙₐ \" => NonUnitalAlgHom _\n\n@[inherit_doc]\nnotation:25 A \" →ₙₐ[\" R \"] \" B => NonUnitalAlgHom R A B\n\nattribute [nolint docBlame] NonUnitalAlgHom.toMulHom\n\n/-- `NonUnitalAlgHomClass F R A B` asserts `F` is a type of bundled algebra homomorphisms\nfrom `A` to `B`. -/\nclass NonUnitalAlgHomClass (F : Type*) (R : outParam (Type*)) (A : outParam (Type*))\n (B : outParam (Type*)) [Monoid R] [NonUnitalNonAssocSemiring A] [NonUnitalNonAssocSemiring B]\n [DistribMulAction R A] [DistribMulAction R B] extends DistribMulActionHomClass F R A B,\n MulHomClass F A B\n#align non_unital_alg_hom_class NonUnitalAlgHomClass\n\n-- Porting note: commented out, not dangerous\n-- attribute [nolint dangerousInstance] NonUnitalAlgHomClass.toMulHomClass\n\nnamespace NonUnitalAlgHomClass\n\n-- Porting note: Made following instance non-dangerous through [...] -> [...] replacement\n-- See note [lower instance priority]\ninstance (priority := 100) toNonUnitalRingHomClass {F R A B : Type*}\n [Monoid R] [NonUnitalNonAssocSemiring A] [DistribMulAction R A]\n [NonUnitalNonAssocSemiring B] [DistribMulAction R B]\n [NonUnitalAlgHomClass F R A B] : NonUnitalRingHomClass F A B :=\n { ‹NonUnitalAlgHomClass F R A B› with coe := (⇑) }\n#align non_unital_alg_hom_class.non_unital_alg_hom_class.to_non_unital_ring_hom_class NonUnitalAlgHomClass.toNonUnitalRingHomClass\n\nvariable [Semiring R] [NonUnitalNonAssocSemiring A] [Module R A]\n [NonUnitalNonAssocSemiring B] [Module R B]\n\n-- see Note [lower instance priority]\ninstance (priority := 100) {F : Type*} [NonUnitalAlgHomClass F R A B] : LinearMapClass F R A B :=\n { ‹NonUnitalAlgHomClass F R A B› with map_smulₛₗ := map_smul }\n\n/-- Turn an element of a type `F` satisfying `NonUnitalAlgHomClass F R A B` into an actual\n`NonUnitalAlgHom`. This is declared as the default coercion from `F` to `A →ₙₐ[R] B`. -/\n@[coe]\ndef toNonUnitalAlgHom {F R A B : Type*} [Monoid R] [NonUnitalNonAssocSemiring A]\n [DistribMulAction R A] [NonUnitalNonAssocSemiring B] [DistribMulAction R B]\n [NonUnitalAlgHomClass F R A B] (f : F) : A →ₙₐ[R] B :=\n { (f : A →ₙ+* B) with\n map_smul' := map_smul f }\n\ninstance {F R A B : Type*} [Monoid R] [NonUnitalNonAssocSemiring A] [DistribMulAction R A]\n [NonUnitalNonAssocSemiring B] [DistribMulAction R B] [NonUnitalAlgHomClass F R A B] :\n CoeTC F (A →ₙₐ[R] B) :=\n ⟨toNonUnitalAlgHom⟩\n\nend NonUnitalAlgHomClass\n\nnamespace NonUnitalAlgHom\n\nvariable {R A B C} [Monoid R]\n\nvariable [NonUnitalNonAssocSemiring A] [DistribMulAction R A]\n\nvariable [NonUnitalNonAssocSemiring B] [DistribMulAction R B]\n\nvariable [NonUnitalNonAssocSemiring C] [DistribMulAction R C]\n\n-- Porting note: Replaced with FunLike instance\n-- /-- see Note [function coercion] -/\n-- instance : CoeFun (A →ₙₐ[R] B) fun _ => A → B :=\n-- ⟨toFun⟩\n\ninstance : FunLike (A →ₙₐ[R] B) A fun _ => B where\n coe f := f.toFun\n coe_injective' := by rintro ⟨⟨⟨f, _⟩, _⟩, _⟩ ⟨⟨⟨g, _⟩, _⟩, _⟩ h; congr\n\n@[simp]\ntheorem toFun_eq_coe (f : A →ₙₐ[R] B) : f.toFun = ⇑f :=\n rfl\n#align non_unital_alg_hom.to_fun_eq_coe NonUnitalAlgHom.toFun_eq_coe\n\n/-- See Note [custom simps projection] -/\ndef Simps.apply (f : A →ₙₐ[R] B) : A → B := f\n\ninitialize_simps_projections NonUnitalAlgHom\n (toDistribMulActionHom_toMulActionHom_toFun → apply, -toDistribMulActionHom)\n\n@[simp]\nprotected theorem coe_coe {F : Type*} [NonUnitalAlgHomClass F R A B] (f : F) :\n ⇑(f : A →ₙₐ[R] B) = f :=\n rfl\n#align non_unital_alg_hom.coe_coe NonUnitalAlgHom.coe_coe\n\ntheorem coe_injective : @Function.Injective (A →ₙₐ[R] B) (A → B) (↑) := by\n rintro ⟨⟨⟨f, _⟩, _⟩, _⟩ ⟨⟨⟨g, _⟩, _⟩, _⟩ h; congr\n#align non_unital_alg_hom.coe_injective NonUnitalAlgHom.coe_injective\n\ninstance : NonUnitalAlgHomClass (A →ₙₐ[R] B) R A B\n where\n coe f := f.toFun\n coe_injective' := coe_injective\n map_smul f := f.map_smul'\n map_add f := f.map_add'\n map_zero f := f.map_zero'\n map_mul f := f.map_mul'\n\n@[ext]\ntheorem ext {f g : A →ₙₐ[R] B} (h : ∀ x, f x = g x) : f = g :=\n coe_injective <| funext h\n#align non_unital_alg_hom.ext NonUnitalAlgHom.ext\n\ntheorem ext_iff {f g : A →ₙₐ[R] B} : f = g ↔ ∀ x, f x = g x :=\n ⟨by\n rintro rfl x\n rfl, ext⟩\n#align non_unital_alg_hom.ext_iff NonUnitalAlgHom.ext_iff\n\ntheorem congr_fun {f g : A →ₙₐ[R] B} (h : f = g) (x : A) : f x = g x :=\n h ▸ rfl\n#align non_unital_alg_hom.congr_fun NonUnitalAlgHom.congr_fun\n\n@[simp]\ntheorem coe_mk (f : A → B) (h₁ h₂ h₃ h₄) : ⇑(⟨⟨⟨f, h₁⟩, h₂, h₃⟩, h₄⟩ : A →ₙₐ[R] B) = f :=\n rfl\n#align non_unital_alg_hom.coe_mk NonUnitalAlgHom.coe_mk\n\n@[simp]\ntheorem mk_coe (f : A →ₙₐ[R] B) (h₁ h₂ h₃ h₄) : (⟨⟨⟨f, h₁⟩, h₂, h₃⟩, h₄⟩ : A →ₙₐ[R] B) = f := by\n rfl\n#align non_unital_alg_hom.mk_coe NonUnitalAlgHom.mk_coe\n\ninstance : CoeOut (A →ₙₐ[R] B) (A →+[R] B) :=\n ⟨toDistribMulActionHom⟩\n\ninstance : CoeOut (A →ₙₐ[R] B) (A →ₙ* B) :=\n ⟨toMulHom⟩\n\n@[simp]\ntheorem toDistribMulActionHom_eq_coe (f : A →ₙₐ[R] B) : f.toDistribMulActionHom = ↑f :=\n rfl\n#align non_unital_alg_hom.to_distrib_mul_action_hom_eq_coe NonUnitalAlgHom.toDistribMulActionHom_eq_coe\n\n@[simp]\ntheorem toMulHom_eq_coe (f : A →ₙₐ[R] B) : f.toMulHom = ↑f :=\n rfl\n#align non_unital_alg_hom.to_mul_hom_eq_coe NonUnitalAlgHom.toMulHom_eq_coe\n\n@[simp, norm_cast]\ntheorem coe_to_distribMulActionHom (f : A →ₙₐ[R] B) : ⇑(f : A →+[R] B) = f :=\n rfl\n#align non_unital_alg_hom.coe_to_distrib_mul_action_hom NonUnitalAlgHom.coe_to_distribMulActionHom\n\n@[simp, norm_cast]\ntheorem coe_to_mulHom (f : A →ₙₐ[R] B) : ⇑(f : A →ₙ* B) = f :=\n rfl\n#align non_unital_alg_hom.coe_to_mul_hom NonUnitalAlgHom.coe_to_mulHom\n\ntheorem to_distribMulActionHom_injective {f g : A →ₙₐ[R] B}\n (h : (f : A →+[R] B) = (g : A →+[R] B)) : f = g := by\n ext a\n exact DistribMulActionHom.congr_fun h a\n#align non_unital_alg_hom.to_distrib_mul_action_hom_injective NonUnitalAlgHom.to_distribMulActionHom_injective\n\ntheorem to_mulHom_injective {f g : A →ₙₐ[R] B} (h : (f : A →ₙ* B) = (g : A →ₙ* B)) : f = g := by\n ext a\n exact FunLike.congr_fun h a\n#align non_unital_alg_hom.to_mul_hom_injective NonUnitalAlgHom.to_mulHom_injective\n\n@[norm_cast]\ntheorem coe_distribMulActionHom_mk (f : A →ₙₐ[R] B) (h₁ h₂ h₃ h₄) :\n ((⟨⟨⟨f, h₁⟩, h₂, h₃⟩, h₄⟩ : A →ₙₐ[R] B) : A →+[R] B) = ⟨⟨f, h₁⟩, h₂, h₃⟩ := by\n ","nextTactic":"rfl","declUpToTactic":"@[norm_cast]\ntheorem coe_distribMulActionHom_mk (f : A →ₙₐ[R] B) (h₁ h₂ h₃ h₄) :\n ((⟨⟨⟨f, h₁⟩, h₂, h₃⟩, h₄⟩ : A →ₙₐ[R] B) : A →+[R] B) = ⟨⟨f, h₁⟩, h₂, h₃⟩ := by\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_NonUnitalHom.223_0.9y3TORfxg2P0A5c","decl":"@[norm_cast]\ntheorem coe_distribMulActionHom_mk (f : A →ₙₐ[R] B) (h₁ h₂ h₃ h₄) :\n ((⟨⟨⟨f, h₁⟩, h₂, h₃⟩, h₄⟩ : A →ₙₐ[R] B) : A →+[R] B) = ⟨⟨f, h₁⟩, h₂, h₃⟩ "} -{"state":"R : Type u\nA : Type v\nB : Type w\nC : Type w₁\ninst✝⁶ : Monoid R\ninst✝⁵ : NonUnitalNonAssocSemiring A\ninst✝⁴ : DistribMulAction R A\ninst✝³ : NonUnitalNonAssocSemiring B\ninst✝² : DistribMulAction R B\ninst✝¹ : NonUnitalNonAssocSemiring C\ninst✝ : DistribMulAction R C\nf : A →ₙₐ[R] B\nh₁ : ∀ (m : R) (x : A), f (m • x) = m • f x\nh₂ : MulActionHom.toFun { toFun := ⇑f, map_smul' := h₁ } 0 = 0\nh₃ :\n ∀ (x y : A),\n MulActionHom.toFun { toFun := ⇑f, map_smul' := h₁ } (x + y) =\n MulActionHom.toFun { toFun := ⇑f, map_smul' := h₁ } x + MulActionHom.toFun { toFun := ⇑f, map_smul' := h₁ } y\nh₄ :\n ∀ (x y : A),\n MulActionHom.toFun\n { toMulActionHom := { toFun := ⇑f, map_smul' := h₁ }, map_zero' := h₂, map_add' := h₃ }.toMulActionHom (x * y) =\n MulActionHom.toFun\n { toMulActionHom := { toFun := ⇑f, map_smul' := h₁ }, map_zero' := h₂, map_add' := h₃ }.toMulActionHom x *\n MulActionHom.toFun\n { toMulActionHom := { toFun := ⇑f, map_smul' := h₁ }, map_zero' := h₂, map_add' := h₃ }.toMulActionHom y\n⊢ ↑{ toDistribMulActionHom := { toMulActionHom := { toFun := ⇑f, map_smul' := h₁ }, map_zero' := h₂, map_add' := h₃ },\n map_mul' := h₄ } =\n { toFun := ⇑f, map_mul' := h₄ }","srcUpToTactic":"/-\nCopyright (c) 2021 Oliver Nash. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Oliver Nash\n-/\nimport Mathlib.Algebra.Algebra.Hom\n\n#align_import algebra.hom.non_unital_alg from \"leanprover-community/mathlib\"@\"bd9851ca476957ea4549eb19b40e7b5ade9428cc\"\n\n/-!\n# Morphisms of non-unital algebras\n\nThis file defines morphisms between two types, each of which carries:\n * an addition,\n * an additive zero,\n * a multiplication,\n * a scalar action.\n\nThe multiplications are not assumed to be associative or unital, or even to be compatible with the\nscalar actions. In a typical application, the operations will satisfy compatibility conditions\nmaking them into algebras (albeit possibly non-associative and/or non-unital) but such conditions\nare not required to make this definition.\n\nThis notion of morphism should be useful for any category of non-unital algebras. The motivating\napplication at the time it was introduced was to be able to state the adjunction property for\nmagma algebras. These are non-unital, non-associative algebras obtained by applying the\ngroup-algebra construction except where we take a type carrying just `Mul` instead of `Group`.\n\nFor a plausible future application, one could take the non-unital algebra of compactly-supported\nfunctions on a non-compact topological space. A proper map between a pair of such spaces\n(contravariantly) induces a morphism between their algebras of compactly-supported functions which\nwill be a `NonUnitalAlgHom`.\n\nTODO: add `NonUnitalAlgEquiv` when needed.\n\n## Main definitions\n\n * `NonUnitalAlgHom`\n * `AlgHom.toNonUnitalAlgHom`\n\n## Tags\n\nnon-unital, algebra, morphism\n-/\n\nset_option autoImplicit true\n\n\nuniverse u v w w₁ w₂ w₃\n\nvariable (R : Type u) (A : Type v) (B : Type w) (C : Type w₁)\n\n/-- A morphism respecting addition, multiplication, and scalar multiplication. When these arise from\nalgebra structures, this is the same as a not-necessarily-unital morphism of algebras. -/\nstructure NonUnitalAlgHom [Monoid R] [NonUnitalNonAssocSemiring A] [DistribMulAction R A]\n [NonUnitalNonAssocSemiring B] [DistribMulAction R B] extends A →+[R] B, A →ₙ* B\n#align non_unital_alg_hom NonUnitalAlgHom\n\n@[inherit_doc NonUnitalAlgHom]\ninfixr:25 \" →ₙₐ \" => NonUnitalAlgHom _\n\n@[inherit_doc]\nnotation:25 A \" →ₙₐ[\" R \"] \" B => NonUnitalAlgHom R A B\n\nattribute [nolint docBlame] NonUnitalAlgHom.toMulHom\n\n/-- `NonUnitalAlgHomClass F R A B` asserts `F` is a type of bundled algebra homomorphisms\nfrom `A` to `B`. -/\nclass NonUnitalAlgHomClass (F : Type*) (R : outParam (Type*)) (A : outParam (Type*))\n (B : outParam (Type*)) [Monoid R] [NonUnitalNonAssocSemiring A] [NonUnitalNonAssocSemiring B]\n [DistribMulAction R A] [DistribMulAction R B] extends DistribMulActionHomClass F R A B,\n MulHomClass F A B\n#align non_unital_alg_hom_class NonUnitalAlgHomClass\n\n-- Porting note: commented out, not dangerous\n-- attribute [nolint dangerousInstance] NonUnitalAlgHomClass.toMulHomClass\n\nnamespace NonUnitalAlgHomClass\n\n-- Porting note: Made following instance non-dangerous through [...] -> [...] replacement\n-- See note [lower instance priority]\ninstance (priority := 100) toNonUnitalRingHomClass {F R A B : Type*}\n [Monoid R] [NonUnitalNonAssocSemiring A] [DistribMulAction R A]\n [NonUnitalNonAssocSemiring B] [DistribMulAction R B]\n [NonUnitalAlgHomClass F R A B] : NonUnitalRingHomClass F A B :=\n { ‹NonUnitalAlgHomClass F R A B› with coe := (⇑) }\n#align non_unital_alg_hom_class.non_unital_alg_hom_class.to_non_unital_ring_hom_class NonUnitalAlgHomClass.toNonUnitalRingHomClass\n\nvariable [Semiring R] [NonUnitalNonAssocSemiring A] [Module R A]\n [NonUnitalNonAssocSemiring B] [Module R B]\n\n-- see Note [lower instance priority]\ninstance (priority := 100) {F : Type*} [NonUnitalAlgHomClass F R A B] : LinearMapClass F R A B :=\n { ‹NonUnitalAlgHomClass F R A B› with map_smulₛₗ := map_smul }\n\n/-- Turn an element of a type `F` satisfying `NonUnitalAlgHomClass F R A B` into an actual\n`NonUnitalAlgHom`. This is declared as the default coercion from `F` to `A →ₙₐ[R] B`. -/\n@[coe]\ndef toNonUnitalAlgHom {F R A B : Type*} [Monoid R] [NonUnitalNonAssocSemiring A]\n [DistribMulAction R A] [NonUnitalNonAssocSemiring B] [DistribMulAction R B]\n [NonUnitalAlgHomClass F R A B] (f : F) : A →ₙₐ[R] B :=\n { (f : A →ₙ+* B) with\n map_smul' := map_smul f }\n\ninstance {F R A B : Type*} [Monoid R] [NonUnitalNonAssocSemiring A] [DistribMulAction R A]\n [NonUnitalNonAssocSemiring B] [DistribMulAction R B] [NonUnitalAlgHomClass F R A B] :\n CoeTC F (A →ₙₐ[R] B) :=\n ⟨toNonUnitalAlgHom⟩\n\nend NonUnitalAlgHomClass\n\nnamespace NonUnitalAlgHom\n\nvariable {R A B C} [Monoid R]\n\nvariable [NonUnitalNonAssocSemiring A] [DistribMulAction R A]\n\nvariable [NonUnitalNonAssocSemiring B] [DistribMulAction R B]\n\nvariable [NonUnitalNonAssocSemiring C] [DistribMulAction R C]\n\n-- Porting note: Replaced with FunLike instance\n-- /-- see Note [function coercion] -/\n-- instance : CoeFun (A →ₙₐ[R] B) fun _ => A → B :=\n-- ⟨toFun⟩\n\ninstance : FunLike (A →ₙₐ[R] B) A fun _ => B where\n coe f := f.toFun\n coe_injective' := by rintro ⟨⟨⟨f, _⟩, _⟩, _⟩ ⟨⟨⟨g, _⟩, _⟩, _⟩ h; congr\n\n@[simp]\ntheorem toFun_eq_coe (f : A →ₙₐ[R] B) : f.toFun = ⇑f :=\n rfl\n#align non_unital_alg_hom.to_fun_eq_coe NonUnitalAlgHom.toFun_eq_coe\n\n/-- See Note [custom simps projection] -/\ndef Simps.apply (f : A →ₙₐ[R] B) : A → B := f\n\ninitialize_simps_projections NonUnitalAlgHom\n (toDistribMulActionHom_toMulActionHom_toFun → apply, -toDistribMulActionHom)\n\n@[simp]\nprotected theorem coe_coe {F : Type*} [NonUnitalAlgHomClass F R A B] (f : F) :\n ⇑(f : A →ₙₐ[R] B) = f :=\n rfl\n#align non_unital_alg_hom.coe_coe NonUnitalAlgHom.coe_coe\n\ntheorem coe_injective : @Function.Injective (A →ₙₐ[R] B) (A → B) (↑) := by\n rintro ⟨⟨⟨f, _⟩, _⟩, _⟩ ⟨⟨⟨g, _⟩, _⟩, _⟩ h; congr\n#align non_unital_alg_hom.coe_injective NonUnitalAlgHom.coe_injective\n\ninstance : NonUnitalAlgHomClass (A →ₙₐ[R] B) R A B\n where\n coe f := f.toFun\n coe_injective' := coe_injective\n map_smul f := f.map_smul'\n map_add f := f.map_add'\n map_zero f := f.map_zero'\n map_mul f := f.map_mul'\n\n@[ext]\ntheorem ext {f g : A →ₙₐ[R] B} (h : ∀ x, f x = g x) : f = g :=\n coe_injective <| funext h\n#align non_unital_alg_hom.ext NonUnitalAlgHom.ext\n\ntheorem ext_iff {f g : A →ₙₐ[R] B} : f = g ↔ ∀ x, f x = g x :=\n ⟨by\n rintro rfl x\n rfl, ext⟩\n#align non_unital_alg_hom.ext_iff NonUnitalAlgHom.ext_iff\n\ntheorem congr_fun {f g : A →ₙₐ[R] B} (h : f = g) (x : A) : f x = g x :=\n h ▸ rfl\n#align non_unital_alg_hom.congr_fun NonUnitalAlgHom.congr_fun\n\n@[simp]\ntheorem coe_mk (f : A → B) (h₁ h₂ h₃ h₄) : ⇑(⟨⟨⟨f, h₁⟩, h₂, h₃⟩, h₄⟩ : A →ₙₐ[R] B) = f :=\n rfl\n#align non_unital_alg_hom.coe_mk NonUnitalAlgHom.coe_mk\n\n@[simp]\ntheorem mk_coe (f : A →ₙₐ[R] B) (h₁ h₂ h₃ h₄) : (⟨⟨⟨f, h₁⟩, h₂, h₃⟩, h₄⟩ : A →ₙₐ[R] B) = f := by\n rfl\n#align non_unital_alg_hom.mk_coe NonUnitalAlgHom.mk_coe\n\ninstance : CoeOut (A →ₙₐ[R] B) (A →+[R] B) :=\n ⟨toDistribMulActionHom⟩\n\ninstance : CoeOut (A →ₙₐ[R] B) (A →ₙ* B) :=\n ⟨toMulHom⟩\n\n@[simp]\ntheorem toDistribMulActionHom_eq_coe (f : A →ₙₐ[R] B) : f.toDistribMulActionHom = ↑f :=\n rfl\n#align non_unital_alg_hom.to_distrib_mul_action_hom_eq_coe NonUnitalAlgHom.toDistribMulActionHom_eq_coe\n\n@[simp]\ntheorem toMulHom_eq_coe (f : A →ₙₐ[R] B) : f.toMulHom = ↑f :=\n rfl\n#align non_unital_alg_hom.to_mul_hom_eq_coe NonUnitalAlgHom.toMulHom_eq_coe\n\n@[simp, norm_cast]\ntheorem coe_to_distribMulActionHom (f : A →ₙₐ[R] B) : ⇑(f : A →+[R] B) = f :=\n rfl\n#align non_unital_alg_hom.coe_to_distrib_mul_action_hom NonUnitalAlgHom.coe_to_distribMulActionHom\n\n@[simp, norm_cast]\ntheorem coe_to_mulHom (f : A →ₙₐ[R] B) : ⇑(f : A →ₙ* B) = f :=\n rfl\n#align non_unital_alg_hom.coe_to_mul_hom NonUnitalAlgHom.coe_to_mulHom\n\ntheorem to_distribMulActionHom_injective {f g : A →ₙₐ[R] B}\n (h : (f : A →+[R] B) = (g : A →+[R] B)) : f = g := by\n ext a\n exact DistribMulActionHom.congr_fun h a\n#align non_unital_alg_hom.to_distrib_mul_action_hom_injective NonUnitalAlgHom.to_distribMulActionHom_injective\n\ntheorem to_mulHom_injective {f g : A →ₙₐ[R] B} (h : (f : A →ₙ* B) = (g : A →ₙ* B)) : f = g := by\n ext a\n exact FunLike.congr_fun h a\n#align non_unital_alg_hom.to_mul_hom_injective NonUnitalAlgHom.to_mulHom_injective\n\n@[norm_cast]\ntheorem coe_distribMulActionHom_mk (f : A →ₙₐ[R] B) (h₁ h₂ h₃ h₄) :\n ((⟨⟨⟨f, h₁⟩, h₂, h₃⟩, h₄⟩ : A →ₙₐ[R] B) : A →+[R] B) = ⟨⟨f, h₁⟩, h₂, h₃⟩ := by\n rfl\n#align non_unital_alg_hom.coe_distrib_mul_action_hom_mk NonUnitalAlgHom.coe_distribMulActionHom_mk\n\n@[norm_cast]\ntheorem coe_mulHom_mk (f : A →ₙₐ[R] B) (h₁ h₂ h₃ h₄) :\n ((⟨⟨⟨f, h₁⟩, h₂, h₃⟩, h₄⟩ : A →ₙₐ[R] B) : A →ₙ* B) = ⟨f, h₄⟩ := by\n ","nextTactic":"rfl","declUpToTactic":"@[norm_cast]\ntheorem coe_mulHom_mk (f : A →ₙₐ[R] B) (h₁ h₂ h₃ h₄) :\n ((⟨⟨⟨f, h₁⟩, h₂, h₃⟩, h₄⟩ : A →ₙₐ[R] B) : A →ₙ* B) = ⟨f, h₄⟩ := by\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_NonUnitalHom.229_0.9y3TORfxg2P0A5c","decl":"@[norm_cast]\ntheorem coe_mulHom_mk (f : A →ₙₐ[R] B) (h₁ h₂ h₃ h₄) :\n ((⟨⟨⟨f, h₁⟩, h₂, h₃⟩, h₄⟩ : A →ₙₐ[R] B) : A →ₙ* B) = ⟨f, h₄⟩ "} -{"state":"R : Type u\nA : Type v\nB : Type w\nC : Type w₁\ninst✝⁶ : Monoid R\ninst✝⁵ : NonUnitalNonAssocSemiring A\ninst✝⁴ : DistribMulAction R A\ninst✝³ : NonUnitalNonAssocSemiring B\ninst✝² : DistribMulAction R B\ninst✝¹ : NonUnitalNonAssocSemiring C\ninst✝ : DistribMulAction R C\nsrc✝ : A →+[R] B := 0\n⊢ ∀ (x y : A),\n MulActionHom.toFun\n { toMulActionHom := src✝.toMulActionHom, map_zero' := (_ : MulActionHom.toFun src✝.toMulActionHom 0 = 0),\n map_add' :=\n (_ :\n ∀ (x y : A),\n MulActionHom.toFun src✝.toMulActionHom (x + y) =\n MulActionHom.toFun src✝.toMulActionHom x +\n MulActionHom.toFun src✝.toMulActionHom y) }.toMulActionHom\n (x * y) =\n MulActionHom.toFun\n { toMulActionHom := src✝.toMulActionHom, map_zero' := (_ : MulActionHom.toFun src✝.toMulActionHom 0 = 0),\n map_add' :=\n (_ :\n ∀ (x y : A),\n MulActionHom.toFun src✝.toMulActionHom (x + y) =\n MulActionHom.toFun src✝.toMulActionHom x +\n MulActionHom.toFun src✝.toMulActionHom y) }.toMulActionHom\n x *\n MulActionHom.toFun\n { toMulActionHom := src✝.toMulActionHom, map_zero' := (_ : MulActionHom.toFun src✝.toMulActionHom 0 = 0),\n map_add' :=\n (_ :\n ∀ (x y : A),\n MulActionHom.toFun src✝.toMulActionHom (x + y) =\n MulActionHom.toFun src✝.toMulActionHom x +\n MulActionHom.toFun src✝.toMulActionHom y) }.toMulActionHom\n y","srcUpToTactic":"/-\nCopyright (c) 2021 Oliver Nash. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Oliver Nash\n-/\nimport Mathlib.Algebra.Algebra.Hom\n\n#align_import algebra.hom.non_unital_alg from \"leanprover-community/mathlib\"@\"bd9851ca476957ea4549eb19b40e7b5ade9428cc\"\n\n/-!\n# Morphisms of non-unital algebras\n\nThis file defines morphisms between two types, each of which carries:\n * an addition,\n * an additive zero,\n * a multiplication,\n * a scalar action.\n\nThe multiplications are not assumed to be associative or unital, or even to be compatible with the\nscalar actions. In a typical application, the operations will satisfy compatibility conditions\nmaking them into algebras (albeit possibly non-associative and/or non-unital) but such conditions\nare not required to make this definition.\n\nThis notion of morphism should be useful for any category of non-unital algebras. The motivating\napplication at the time it was introduced was to be able to state the adjunction property for\nmagma algebras. These are non-unital, non-associative algebras obtained by applying the\ngroup-algebra construction except where we take a type carrying just `Mul` instead of `Group`.\n\nFor a plausible future application, one could take the non-unital algebra of compactly-supported\nfunctions on a non-compact topological space. A proper map between a pair of such spaces\n(contravariantly) induces a morphism between their algebras of compactly-supported functions which\nwill be a `NonUnitalAlgHom`.\n\nTODO: add `NonUnitalAlgEquiv` when needed.\n\n## Main definitions\n\n * `NonUnitalAlgHom`\n * `AlgHom.toNonUnitalAlgHom`\n\n## Tags\n\nnon-unital, algebra, morphism\n-/\n\nset_option autoImplicit true\n\n\nuniverse u v w w₁ w₂ w₃\n\nvariable (R : Type u) (A : Type v) (B : Type w) (C : Type w₁)\n\n/-- A morphism respecting addition, multiplication, and scalar multiplication. When these arise from\nalgebra structures, this is the same as a not-necessarily-unital morphism of algebras. -/\nstructure NonUnitalAlgHom [Monoid R] [NonUnitalNonAssocSemiring A] [DistribMulAction R A]\n [NonUnitalNonAssocSemiring B] [DistribMulAction R B] extends A →+[R] B, A →ₙ* B\n#align non_unital_alg_hom NonUnitalAlgHom\n\n@[inherit_doc NonUnitalAlgHom]\ninfixr:25 \" →ₙₐ \" => NonUnitalAlgHom _\n\n@[inherit_doc]\nnotation:25 A \" →ₙₐ[\" R \"] \" B => NonUnitalAlgHom R A B\n\nattribute [nolint docBlame] NonUnitalAlgHom.toMulHom\n\n/-- `NonUnitalAlgHomClass F R A B` asserts `F` is a type of bundled algebra homomorphisms\nfrom `A` to `B`. -/\nclass NonUnitalAlgHomClass (F : Type*) (R : outParam (Type*)) (A : outParam (Type*))\n (B : outParam (Type*)) [Monoid R] [NonUnitalNonAssocSemiring A] [NonUnitalNonAssocSemiring B]\n [DistribMulAction R A] [DistribMulAction R B] extends DistribMulActionHomClass F R A B,\n MulHomClass F A B\n#align non_unital_alg_hom_class NonUnitalAlgHomClass\n\n-- Porting note: commented out, not dangerous\n-- attribute [nolint dangerousInstance] NonUnitalAlgHomClass.toMulHomClass\n\nnamespace NonUnitalAlgHomClass\n\n-- Porting note: Made following instance non-dangerous through [...] -> [...] replacement\n-- See note [lower instance priority]\ninstance (priority := 100) toNonUnitalRingHomClass {F R A B : Type*}\n [Monoid R] [NonUnitalNonAssocSemiring A] [DistribMulAction R A]\n [NonUnitalNonAssocSemiring B] [DistribMulAction R B]\n [NonUnitalAlgHomClass F R A B] : NonUnitalRingHomClass F A B :=\n { ‹NonUnitalAlgHomClass F R A B› with coe := (⇑) }\n#align non_unital_alg_hom_class.non_unital_alg_hom_class.to_non_unital_ring_hom_class NonUnitalAlgHomClass.toNonUnitalRingHomClass\n\nvariable [Semiring R] [NonUnitalNonAssocSemiring A] [Module R A]\n [NonUnitalNonAssocSemiring B] [Module R B]\n\n-- see Note [lower instance priority]\ninstance (priority := 100) {F : Type*} [NonUnitalAlgHomClass F R A B] : LinearMapClass F R A B :=\n { ‹NonUnitalAlgHomClass F R A B› with map_smulₛₗ := map_smul }\n\n/-- Turn an element of a type `F` satisfying `NonUnitalAlgHomClass F R A B` into an actual\n`NonUnitalAlgHom`. This is declared as the default coercion from `F` to `A →ₙₐ[R] B`. -/\n@[coe]\ndef toNonUnitalAlgHom {F R A B : Type*} [Monoid R] [NonUnitalNonAssocSemiring A]\n [DistribMulAction R A] [NonUnitalNonAssocSemiring B] [DistribMulAction R B]\n [NonUnitalAlgHomClass F R A B] (f : F) : A →ₙₐ[R] B :=\n { (f : A →ₙ+* B) with\n map_smul' := map_smul f }\n\ninstance {F R A B : Type*} [Monoid R] [NonUnitalNonAssocSemiring A] [DistribMulAction R A]\n [NonUnitalNonAssocSemiring B] [DistribMulAction R B] [NonUnitalAlgHomClass F R A B] :\n CoeTC F (A →ₙₐ[R] B) :=\n ⟨toNonUnitalAlgHom⟩\n\nend NonUnitalAlgHomClass\n\nnamespace NonUnitalAlgHom\n\nvariable {R A B C} [Monoid R]\n\nvariable [NonUnitalNonAssocSemiring A] [DistribMulAction R A]\n\nvariable [NonUnitalNonAssocSemiring B] [DistribMulAction R B]\n\nvariable [NonUnitalNonAssocSemiring C] [DistribMulAction R C]\n\n-- Porting note: Replaced with FunLike instance\n-- /-- see Note [function coercion] -/\n-- instance : CoeFun (A →ₙₐ[R] B) fun _ => A → B :=\n-- ⟨toFun⟩\n\ninstance : FunLike (A →ₙₐ[R] B) A fun _ => B where\n coe f := f.toFun\n coe_injective' := by rintro ⟨⟨⟨f, _⟩, _⟩, _⟩ ⟨⟨⟨g, _⟩, _⟩, _⟩ h; congr\n\n@[simp]\ntheorem toFun_eq_coe (f : A →ₙₐ[R] B) : f.toFun = ⇑f :=\n rfl\n#align non_unital_alg_hom.to_fun_eq_coe NonUnitalAlgHom.toFun_eq_coe\n\n/-- See Note [custom simps projection] -/\ndef Simps.apply (f : A →ₙₐ[R] B) : A → B := f\n\ninitialize_simps_projections NonUnitalAlgHom\n (toDistribMulActionHom_toMulActionHom_toFun → apply, -toDistribMulActionHom)\n\n@[simp]\nprotected theorem coe_coe {F : Type*} [NonUnitalAlgHomClass F R A B] (f : F) :\n ⇑(f : A →ₙₐ[R] B) = f :=\n rfl\n#align non_unital_alg_hom.coe_coe NonUnitalAlgHom.coe_coe\n\ntheorem coe_injective : @Function.Injective (A →ₙₐ[R] B) (A → B) (↑) := by\n rintro ⟨⟨⟨f, _⟩, _⟩, _⟩ ⟨⟨⟨g, _⟩, _⟩, _⟩ h; congr\n#align non_unital_alg_hom.coe_injective NonUnitalAlgHom.coe_injective\n\ninstance : NonUnitalAlgHomClass (A →ₙₐ[R] B) R A B\n where\n coe f := f.toFun\n coe_injective' := coe_injective\n map_smul f := f.map_smul'\n map_add f := f.map_add'\n map_zero f := f.map_zero'\n map_mul f := f.map_mul'\n\n@[ext]\ntheorem ext {f g : A →ₙₐ[R] B} (h : ∀ x, f x = g x) : f = g :=\n coe_injective <| funext h\n#align non_unital_alg_hom.ext NonUnitalAlgHom.ext\n\ntheorem ext_iff {f g : A →ₙₐ[R] B} : f = g ↔ ∀ x, f x = g x :=\n ⟨by\n rintro rfl x\n rfl, ext⟩\n#align non_unital_alg_hom.ext_iff NonUnitalAlgHom.ext_iff\n\ntheorem congr_fun {f g : A →ₙₐ[R] B} (h : f = g) (x : A) : f x = g x :=\n h ▸ rfl\n#align non_unital_alg_hom.congr_fun NonUnitalAlgHom.congr_fun\n\n@[simp]\ntheorem coe_mk (f : A → B) (h₁ h₂ h₃ h₄) : ⇑(⟨⟨⟨f, h₁⟩, h₂, h₃⟩, h₄⟩ : A →ₙₐ[R] B) = f :=\n rfl\n#align non_unital_alg_hom.coe_mk NonUnitalAlgHom.coe_mk\n\n@[simp]\ntheorem mk_coe (f : A →ₙₐ[R] B) (h₁ h₂ h₃ h₄) : (⟨⟨⟨f, h₁⟩, h₂, h₃⟩, h₄⟩ : A →ₙₐ[R] B) = f := by\n rfl\n#align non_unital_alg_hom.mk_coe NonUnitalAlgHom.mk_coe\n\ninstance : CoeOut (A →ₙₐ[R] B) (A →+[R] B) :=\n ⟨toDistribMulActionHom⟩\n\ninstance : CoeOut (A →ₙₐ[R] B) (A →ₙ* B) :=\n ⟨toMulHom⟩\n\n@[simp]\ntheorem toDistribMulActionHom_eq_coe (f : A →ₙₐ[R] B) : f.toDistribMulActionHom = ↑f :=\n rfl\n#align non_unital_alg_hom.to_distrib_mul_action_hom_eq_coe NonUnitalAlgHom.toDistribMulActionHom_eq_coe\n\n@[simp]\ntheorem toMulHom_eq_coe (f : A →ₙₐ[R] B) : f.toMulHom = ↑f :=\n rfl\n#align non_unital_alg_hom.to_mul_hom_eq_coe NonUnitalAlgHom.toMulHom_eq_coe\n\n@[simp, norm_cast]\ntheorem coe_to_distribMulActionHom (f : A →ₙₐ[R] B) : ⇑(f : A →+[R] B) = f :=\n rfl\n#align non_unital_alg_hom.coe_to_distrib_mul_action_hom NonUnitalAlgHom.coe_to_distribMulActionHom\n\n@[simp, norm_cast]\ntheorem coe_to_mulHom (f : A →ₙₐ[R] B) : ⇑(f : A →ₙ* B) = f :=\n rfl\n#align non_unital_alg_hom.coe_to_mul_hom NonUnitalAlgHom.coe_to_mulHom\n\ntheorem to_distribMulActionHom_injective {f g : A →ₙₐ[R] B}\n (h : (f : A →+[R] B) = (g : A →+[R] B)) : f = g := by\n ext a\n exact DistribMulActionHom.congr_fun h a\n#align non_unital_alg_hom.to_distrib_mul_action_hom_injective NonUnitalAlgHom.to_distribMulActionHom_injective\n\ntheorem to_mulHom_injective {f g : A →ₙₐ[R] B} (h : (f : A →ₙ* B) = (g : A →ₙ* B)) : f = g := by\n ext a\n exact FunLike.congr_fun h a\n#align non_unital_alg_hom.to_mul_hom_injective NonUnitalAlgHom.to_mulHom_injective\n\n@[norm_cast]\ntheorem coe_distribMulActionHom_mk (f : A →ₙₐ[R] B) (h₁ h₂ h₃ h₄) :\n ((⟨⟨⟨f, h₁⟩, h₂, h₃⟩, h₄⟩ : A →ₙₐ[R] B) : A →+[R] B) = ⟨⟨f, h₁⟩, h₂, h₃⟩ := by\n rfl\n#align non_unital_alg_hom.coe_distrib_mul_action_hom_mk NonUnitalAlgHom.coe_distribMulActionHom_mk\n\n@[norm_cast]\ntheorem coe_mulHom_mk (f : A →ₙₐ[R] B) (h₁ h₂ h₃ h₄) :\n ((⟨⟨⟨f, h₁⟩, h₂, h₃⟩, h₄⟩ : A →ₙₐ[R] B) : A →ₙ* B) = ⟨f, h₄⟩ := by\n rfl\n#align non_unital_alg_hom.coe_mul_hom_mk NonUnitalAlgHom.coe_mulHom_mk\n\n-- @[simp] -- Porting note: simp can prove this\nprotected theorem map_smul (f : A →ₙₐ[R] B) (c : R) (x : A) : f (c • x) = c • f x :=\n map_smul _ _ _\n#align non_unital_alg_hom.map_smul NonUnitalAlgHom.map_smul\n\n-- @[simp] -- Porting note: simp can prove this\nprotected theorem map_add (f : A →ₙₐ[R] B) (x y : A) : f (x + y) = f x + f y :=\n map_add _ _ _\n#align non_unital_alg_hom.map_add NonUnitalAlgHom.map_add\n\n-- @[simp] -- Porting note: simp can prove this\nprotected theorem map_mul (f : A →ₙₐ[R] B) (x y : A) : f (x * y) = f x * f y :=\n map_mul _ _ _\n#align non_unital_alg_hom.map_mul NonUnitalAlgHom.map_mul\n\n-- @[simp] -- Porting note: simp can prove this\nprotected theorem map_zero (f : A →ₙₐ[R] B) : f 0 = 0 :=\n map_zero _\n#align non_unital_alg_hom.map_zero NonUnitalAlgHom.map_zero\n\n/-- The identity map as a `NonUnitalAlgHom`. -/\nprotected def id (R A : Type*) [Monoid R] [NonUnitalNonAssocSemiring A]\n [DistribMulAction R A] : A →ₙₐ[R] A :=\n { NonUnitalRingHom.id A with\n toFun := id\n map_smul' := fun _ _ => rfl }\n\n@[simp]\ntheorem coe_id : ⇑(NonUnitalAlgHom.id R A) = id :=\n rfl\n\ninstance : Zero (A →ₙₐ[R] B) :=\n ⟨{ (0 : A →+[R] B) with map_mul' := by ","nextTactic":"simp","declUpToTactic":"instance : Zero (A →ₙₐ[R] B) :=\n ⟨{ (0 : A →+[R] B) with map_mul' := by ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_NonUnitalHom.266_0.9y3TORfxg2P0A5c","decl":"instance : Zero (A →ₙₐ[R] B) "} -{"state":"R : Type u\nA : Type v\nB : Type w\nC : Type w₁\ninst✝⁶ : Monoid R\ninst✝⁵ : NonUnitalNonAssocSemiring A\ninst✝⁴ : DistribMulAction R A\ninst✝³ : NonUnitalNonAssocSemiring B\ninst✝² : DistribMulAction R B\ninst✝¹ : NonUnitalNonAssocSemiring C\ninst✝ : DistribMulAction R C\nf : A →ₙₐ[R] B\ng : A →ₙₐ[R] C\nc : R\nx : A\n⊢ Pi.prod (⇑f) (⇑g) (c • x) = c • Pi.prod (⇑f) (⇑g) x","srcUpToTactic":"/-\nCopyright (c) 2021 Oliver Nash. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Oliver Nash\n-/\nimport Mathlib.Algebra.Algebra.Hom\n\n#align_import algebra.hom.non_unital_alg from \"leanprover-community/mathlib\"@\"bd9851ca476957ea4549eb19b40e7b5ade9428cc\"\n\n/-!\n# Morphisms of non-unital algebras\n\nThis file defines morphisms between two types, each of which carries:\n * an addition,\n * an additive zero,\n * a multiplication,\n * a scalar action.\n\nThe multiplications are not assumed to be associative or unital, or even to be compatible with the\nscalar actions. In a typical application, the operations will satisfy compatibility conditions\nmaking them into algebras (albeit possibly non-associative and/or non-unital) but such conditions\nare not required to make this definition.\n\nThis notion of morphism should be useful for any category of non-unital algebras. The motivating\napplication at the time it was introduced was to be able to state the adjunction property for\nmagma algebras. These are non-unital, non-associative algebras obtained by applying the\ngroup-algebra construction except where we take a type carrying just `Mul` instead of `Group`.\n\nFor a plausible future application, one could take the non-unital algebra of compactly-supported\nfunctions on a non-compact topological space. A proper map between a pair of such spaces\n(contravariantly) induces a morphism between their algebras of compactly-supported functions which\nwill be a `NonUnitalAlgHom`.\n\nTODO: add `NonUnitalAlgEquiv` when needed.\n\n## Main definitions\n\n * `NonUnitalAlgHom`\n * `AlgHom.toNonUnitalAlgHom`\n\n## Tags\n\nnon-unital, algebra, morphism\n-/\n\nset_option autoImplicit true\n\n\nuniverse u v w w₁ w₂ w₃\n\nvariable (R : Type u) (A : Type v) (B : Type w) (C : Type w₁)\n\n/-- A morphism respecting addition, multiplication, and scalar multiplication. When these arise from\nalgebra structures, this is the same as a not-necessarily-unital morphism of algebras. -/\nstructure NonUnitalAlgHom [Monoid R] [NonUnitalNonAssocSemiring A] [DistribMulAction R A]\n [NonUnitalNonAssocSemiring B] [DistribMulAction R B] extends A →+[R] B, A →ₙ* B\n#align non_unital_alg_hom NonUnitalAlgHom\n\n@[inherit_doc NonUnitalAlgHom]\ninfixr:25 \" →ₙₐ \" => NonUnitalAlgHom _\n\n@[inherit_doc]\nnotation:25 A \" →ₙₐ[\" R \"] \" B => NonUnitalAlgHom R A B\n\nattribute [nolint docBlame] NonUnitalAlgHom.toMulHom\n\n/-- `NonUnitalAlgHomClass F R A B` asserts `F` is a type of bundled algebra homomorphisms\nfrom `A` to `B`. -/\nclass NonUnitalAlgHomClass (F : Type*) (R : outParam (Type*)) (A : outParam (Type*))\n (B : outParam (Type*)) [Monoid R] [NonUnitalNonAssocSemiring A] [NonUnitalNonAssocSemiring B]\n [DistribMulAction R A] [DistribMulAction R B] extends DistribMulActionHomClass F R A B,\n MulHomClass F A B\n#align non_unital_alg_hom_class NonUnitalAlgHomClass\n\n-- Porting note: commented out, not dangerous\n-- attribute [nolint dangerousInstance] NonUnitalAlgHomClass.toMulHomClass\n\nnamespace NonUnitalAlgHomClass\n\n-- Porting note: Made following instance non-dangerous through [...] -> [...] replacement\n-- See note [lower instance priority]\ninstance (priority := 100) toNonUnitalRingHomClass {F R A B : Type*}\n [Monoid R] [NonUnitalNonAssocSemiring A] [DistribMulAction R A]\n [NonUnitalNonAssocSemiring B] [DistribMulAction R B]\n [NonUnitalAlgHomClass F R A B] : NonUnitalRingHomClass F A B :=\n { ‹NonUnitalAlgHomClass F R A B› with coe := (⇑) }\n#align non_unital_alg_hom_class.non_unital_alg_hom_class.to_non_unital_ring_hom_class NonUnitalAlgHomClass.toNonUnitalRingHomClass\n\nvariable [Semiring R] [NonUnitalNonAssocSemiring A] [Module R A]\n [NonUnitalNonAssocSemiring B] [Module R B]\n\n-- see Note [lower instance priority]\ninstance (priority := 100) {F : Type*} [NonUnitalAlgHomClass F R A B] : LinearMapClass F R A B :=\n { ‹NonUnitalAlgHomClass F R A B› with map_smulₛₗ := map_smul }\n\n/-- Turn an element of a type `F` satisfying `NonUnitalAlgHomClass F R A B` into an actual\n`NonUnitalAlgHom`. This is declared as the default coercion from `F` to `A →ₙₐ[R] B`. -/\n@[coe]\ndef toNonUnitalAlgHom {F R A B : Type*} [Monoid R] [NonUnitalNonAssocSemiring A]\n [DistribMulAction R A] [NonUnitalNonAssocSemiring B] [DistribMulAction R B]\n [NonUnitalAlgHomClass F R A B] (f : F) : A →ₙₐ[R] B :=\n { (f : A →ₙ+* B) with\n map_smul' := map_smul f }\n\ninstance {F R A B : Type*} [Monoid R] [NonUnitalNonAssocSemiring A] [DistribMulAction R A]\n [NonUnitalNonAssocSemiring B] [DistribMulAction R B] [NonUnitalAlgHomClass F R A B] :\n CoeTC F (A →ₙₐ[R] B) :=\n ⟨toNonUnitalAlgHom⟩\n\nend NonUnitalAlgHomClass\n\nnamespace NonUnitalAlgHom\n\nvariable {R A B C} [Monoid R]\n\nvariable [NonUnitalNonAssocSemiring A] [DistribMulAction R A]\n\nvariable [NonUnitalNonAssocSemiring B] [DistribMulAction R B]\n\nvariable [NonUnitalNonAssocSemiring C] [DistribMulAction R C]\n\n-- Porting note: Replaced with FunLike instance\n-- /-- see Note [function coercion] -/\n-- instance : CoeFun (A →ₙₐ[R] B) fun _ => A → B :=\n-- ⟨toFun⟩\n\ninstance : FunLike (A →ₙₐ[R] B) A fun _ => B where\n coe f := f.toFun\n coe_injective' := by rintro ⟨⟨⟨f, _⟩, _⟩, _⟩ ⟨⟨⟨g, _⟩, _⟩, _⟩ h; congr\n\n@[simp]\ntheorem toFun_eq_coe (f : A →ₙₐ[R] B) : f.toFun = ⇑f :=\n rfl\n#align non_unital_alg_hom.to_fun_eq_coe NonUnitalAlgHom.toFun_eq_coe\n\n/-- See Note [custom simps projection] -/\ndef Simps.apply (f : A →ₙₐ[R] B) : A → B := f\n\ninitialize_simps_projections NonUnitalAlgHom\n (toDistribMulActionHom_toMulActionHom_toFun → apply, -toDistribMulActionHom)\n\n@[simp]\nprotected theorem coe_coe {F : Type*} [NonUnitalAlgHomClass F R A B] (f : F) :\n ⇑(f : A →ₙₐ[R] B) = f :=\n rfl\n#align non_unital_alg_hom.coe_coe NonUnitalAlgHom.coe_coe\n\ntheorem coe_injective : @Function.Injective (A →ₙₐ[R] B) (A → B) (↑) := by\n rintro ⟨⟨⟨f, _⟩, _⟩, _⟩ ⟨⟨⟨g, _⟩, _⟩, _⟩ h; congr\n#align non_unital_alg_hom.coe_injective NonUnitalAlgHom.coe_injective\n\ninstance : NonUnitalAlgHomClass (A →ₙₐ[R] B) R A B\n where\n coe f := f.toFun\n coe_injective' := coe_injective\n map_smul f := f.map_smul'\n map_add f := f.map_add'\n map_zero f := f.map_zero'\n map_mul f := f.map_mul'\n\n@[ext]\ntheorem ext {f g : A →ₙₐ[R] B} (h : ∀ x, f x = g x) : f = g :=\n coe_injective <| funext h\n#align non_unital_alg_hom.ext NonUnitalAlgHom.ext\n\ntheorem ext_iff {f g : A →ₙₐ[R] B} : f = g ↔ ∀ x, f x = g x :=\n ⟨by\n rintro rfl x\n rfl, ext⟩\n#align non_unital_alg_hom.ext_iff NonUnitalAlgHom.ext_iff\n\ntheorem congr_fun {f g : A →ₙₐ[R] B} (h : f = g) (x : A) : f x = g x :=\n h ▸ rfl\n#align non_unital_alg_hom.congr_fun NonUnitalAlgHom.congr_fun\n\n@[simp]\ntheorem coe_mk (f : A → B) (h₁ h₂ h₃ h₄) : ⇑(⟨⟨⟨f, h₁⟩, h₂, h₃⟩, h₄⟩ : A →ₙₐ[R] B) = f :=\n rfl\n#align non_unital_alg_hom.coe_mk NonUnitalAlgHom.coe_mk\n\n@[simp]\ntheorem mk_coe (f : A →ₙₐ[R] B) (h₁ h₂ h₃ h₄) : (⟨⟨⟨f, h₁⟩, h₂, h₃⟩, h₄⟩ : A →ₙₐ[R] B) = f := by\n rfl\n#align non_unital_alg_hom.mk_coe NonUnitalAlgHom.mk_coe\n\ninstance : CoeOut (A →ₙₐ[R] B) (A →+[R] B) :=\n ⟨toDistribMulActionHom⟩\n\ninstance : CoeOut (A →ₙₐ[R] B) (A →ₙ* B) :=\n ⟨toMulHom⟩\n\n@[simp]\ntheorem toDistribMulActionHom_eq_coe (f : A →ₙₐ[R] B) : f.toDistribMulActionHom = ↑f :=\n rfl\n#align non_unital_alg_hom.to_distrib_mul_action_hom_eq_coe NonUnitalAlgHom.toDistribMulActionHom_eq_coe\n\n@[simp]\ntheorem toMulHom_eq_coe (f : A →ₙₐ[R] B) : f.toMulHom = ↑f :=\n rfl\n#align non_unital_alg_hom.to_mul_hom_eq_coe NonUnitalAlgHom.toMulHom_eq_coe\n\n@[simp, norm_cast]\ntheorem coe_to_distribMulActionHom (f : A →ₙₐ[R] B) : ⇑(f : A →+[R] B) = f :=\n rfl\n#align non_unital_alg_hom.coe_to_distrib_mul_action_hom NonUnitalAlgHom.coe_to_distribMulActionHom\n\n@[simp, norm_cast]\ntheorem coe_to_mulHom (f : A →ₙₐ[R] B) : ⇑(f : A →ₙ* B) = f :=\n rfl\n#align non_unital_alg_hom.coe_to_mul_hom NonUnitalAlgHom.coe_to_mulHom\n\ntheorem to_distribMulActionHom_injective {f g : A →ₙₐ[R] B}\n (h : (f : A →+[R] B) = (g : A →+[R] B)) : f = g := by\n ext a\n exact DistribMulActionHom.congr_fun h a\n#align non_unital_alg_hom.to_distrib_mul_action_hom_injective NonUnitalAlgHom.to_distribMulActionHom_injective\n\ntheorem to_mulHom_injective {f g : A →ₙₐ[R] B} (h : (f : A →ₙ* B) = (g : A →ₙ* B)) : f = g := by\n ext a\n exact FunLike.congr_fun h a\n#align non_unital_alg_hom.to_mul_hom_injective NonUnitalAlgHom.to_mulHom_injective\n\n@[norm_cast]\ntheorem coe_distribMulActionHom_mk (f : A →ₙₐ[R] B) (h₁ h₂ h₃ h₄) :\n ((⟨⟨⟨f, h₁⟩, h₂, h₃⟩, h₄⟩ : A →ₙₐ[R] B) : A →+[R] B) = ⟨⟨f, h₁⟩, h₂, h₃⟩ := by\n rfl\n#align non_unital_alg_hom.coe_distrib_mul_action_hom_mk NonUnitalAlgHom.coe_distribMulActionHom_mk\n\n@[norm_cast]\ntheorem coe_mulHom_mk (f : A →ₙₐ[R] B) (h₁ h₂ h₃ h₄) :\n ((⟨⟨⟨f, h₁⟩, h₂, h₃⟩, h₄⟩ : A →ₙₐ[R] B) : A →ₙ* B) = ⟨f, h₄⟩ := by\n rfl\n#align non_unital_alg_hom.coe_mul_hom_mk NonUnitalAlgHom.coe_mulHom_mk\n\n-- @[simp] -- Porting note: simp can prove this\nprotected theorem map_smul (f : A →ₙₐ[R] B) (c : R) (x : A) : f (c • x) = c • f x :=\n map_smul _ _ _\n#align non_unital_alg_hom.map_smul NonUnitalAlgHom.map_smul\n\n-- @[simp] -- Porting note: simp can prove this\nprotected theorem map_add (f : A →ₙₐ[R] B) (x y : A) : f (x + y) = f x + f y :=\n map_add _ _ _\n#align non_unital_alg_hom.map_add NonUnitalAlgHom.map_add\n\n-- @[simp] -- Porting note: simp can prove this\nprotected theorem map_mul (f : A →ₙₐ[R] B) (x y : A) : f (x * y) = f x * f y :=\n map_mul _ _ _\n#align non_unital_alg_hom.map_mul NonUnitalAlgHom.map_mul\n\n-- @[simp] -- Porting note: simp can prove this\nprotected theorem map_zero (f : A →ₙₐ[R] B) : f 0 = 0 :=\n map_zero _\n#align non_unital_alg_hom.map_zero NonUnitalAlgHom.map_zero\n\n/-- The identity map as a `NonUnitalAlgHom`. -/\nprotected def id (R A : Type*) [Monoid R] [NonUnitalNonAssocSemiring A]\n [DistribMulAction R A] : A →ₙₐ[R] A :=\n { NonUnitalRingHom.id A with\n toFun := id\n map_smul' := fun _ _ => rfl }\n\n@[simp]\ntheorem coe_id : ⇑(NonUnitalAlgHom.id R A) = id :=\n rfl\n\ninstance : Zero (A →ₙₐ[R] B) :=\n ⟨{ (0 : A →+[R] B) with map_mul' := by simp }⟩\n\ninstance : One (A →ₙₐ[R] A) :=\n ⟨NonUnitalAlgHom.id R A⟩\n\n@[simp]\ntheorem coe_zero : ⇑(0 : A →ₙₐ[R] B) = 0 :=\n rfl\n#align non_unital_alg_hom.coe_zero NonUnitalAlgHom.coe_zero\n\n@[simp]\ntheorem coe_one : ((1 : A →ₙₐ[R] A) : A → A) = id :=\n rfl\n#align non_unital_alg_hom.coe_one NonUnitalAlgHom.coe_one\n\ntheorem zero_apply (a : A) : (0 : A →ₙₐ[R] B) a = 0 :=\n rfl\n#align non_unital_alg_hom.zero_apply NonUnitalAlgHom.zero_apply\n\ntheorem one_apply (a : A) : (1 : A →ₙₐ[R] A) a = a :=\n rfl\n#align non_unital_alg_hom.one_apply NonUnitalAlgHom.one_apply\n\ninstance : Inhabited (A →ₙₐ[R] B) :=\n ⟨0⟩\n\n/-- The composition of morphisms is a morphism. -/\ndef comp (f : B →ₙₐ[R] C) (g : A →ₙₐ[R] B) : A →ₙₐ[R] C :=\n { (f : B →ₙ* C).comp (g : A →ₙ* B), (f : B →+[R] C).comp (g : A →+[R] B) with }\n#align non_unital_alg_hom.comp NonUnitalAlgHom.comp\n\n@[simp, norm_cast]\ntheorem coe_comp (f : B →ₙₐ[R] C) (g : A →ₙₐ[R] B) :\n ⇑(f.comp g) = (⇑f) ∘ (⇑g) :=\n rfl\n#align non_unital_alg_hom.coe_comp NonUnitalAlgHom.coe_comp\n\ntheorem comp_apply (f : B →ₙₐ[R] C) (g : A →ₙₐ[R] B) (x : A) : f.comp g x = f (g x) :=\n rfl\n#align non_unital_alg_hom.comp_apply NonUnitalAlgHom.comp_apply\n\n/-- The inverse of a bijective morphism is a morphism. -/\ndef inverse (f : A →ₙₐ[R] B) (g : B → A) (h₁ : Function.LeftInverse g f)\n (h₂ : Function.RightInverse g f) : B →ₙₐ[R] A :=\n { (f : A →ₙ* B).inverse g h₁ h₂, (f : A →+[R] B).inverse g h₁ h₂ with }\n#align non_unital_alg_hom.inverse NonUnitalAlgHom.inverse\n\n@[simp]\ntheorem coe_inverse (f : A →ₙₐ[R] B) (g : B → A) (h₁ : Function.LeftInverse g f)\n (h₂ : Function.RightInverse g f) : (inverse f g h₁ h₂ : B → A) = g :=\n rfl\n#align non_unital_alg_hom.coe_inverse NonUnitalAlgHom.coe_inverse\n\n/-! ### Operations on the product type\n\nNote that much of this is copied from [`LinearAlgebra/Prod`](../../LinearAlgebra/Prod). -/\n\n\nsection Prod\n\nvariable (R A B)\n\n/-- The first projection of a product is a non-unital alg_hom. -/\n@[simps]\ndef fst : A × B →ₙₐ[R] A where\n toFun := Prod.fst\n map_zero' := rfl\n map_add' _ _ := rfl\n map_smul' _ _ := rfl\n map_mul' _ _ := rfl\n#align non_unital_alg_hom.fst NonUnitalAlgHom.fst\n\n/-- The second projection of a product is a non-unital alg_hom. -/\n@[simps]\ndef snd : A × B →ₙₐ[R] B where\n toFun := Prod.snd\n map_zero' := rfl\n map_add' _ _ := rfl\n map_smul' _ _ := rfl\n map_mul' _ _ := rfl\n#align non_unital_alg_hom.snd NonUnitalAlgHom.snd\n\nvariable {R A B}\n\n/-- The prod of two morphisms is a morphism. -/\n@[simps]\ndef prod (f : A →ₙₐ[R] B) (g : A →ₙₐ[R] C) : A →ₙₐ[R] B × C\n where\n toFun := Pi.prod f g\n map_zero' := by simp only [Pi.prod, Prod.zero_eq_mk, map_zero]\n map_add' x y := by simp only [Pi.prod, Prod.mk_add_mk, map_add]\n map_mul' x y := by simp only [Pi.prod, Prod.mk_mul_mk, map_mul]\n map_smul' c x := by ","nextTactic":"simp only [Pi.prod, Prod.smul_mk, map_smul, RingHom.id_apply]","declUpToTactic":"/-- The prod of two morphisms is a morphism. -/\n@[simps]\ndef prod (f : A →ₙₐ[R] B) (g : A →ₙₐ[R] C) : A →ₙₐ[R] B × C\n where\n toFun := Pi.prod f g\n map_zero' := by simp only [Pi.prod, Prod.zero_eq_mk, map_zero]\n map_add' x y := by simp only [Pi.prod, Prod.mk_add_mk, map_add]\n map_mul' x y := by simp only [Pi.prod, Prod.mk_mul_mk, map_mul]\n map_smul' c x := by ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_NonUnitalHom.351_0.9y3TORfxg2P0A5c","decl":"/-- The prod of two morphisms is a morphism. -/\n@[simps]\ndef prod (f : A →ₙₐ[R] B) (g : A →ₙₐ[R] C) : A →ₙₐ[R] B × C\n where\n toFun "} -{"state":"R : Type u\nA : Type v\nB : Type w\nC : Type w₁\ninst✝⁶ : Monoid R\ninst✝⁵ : NonUnitalNonAssocSemiring A\ninst✝⁴ : DistribMulAction R A\ninst✝³ : NonUnitalNonAssocSemiring B\ninst✝² : DistribMulAction R B\ninst✝¹ : NonUnitalNonAssocSemiring C\ninst✝ : DistribMulAction R C\nf : A →ₙₐ[R] B\ng : A →ₙₐ[R] C\n⊢ MulActionHom.toFun\n { toFun := Pi.prod ⇑f ⇑g, map_smul' := (_ : ∀ (c : R) (x : A), (f (c • x), g (c • x)) = (c • f x, c • g x)) } 0 =\n 0","srcUpToTactic":"/-\nCopyright (c) 2021 Oliver Nash. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Oliver Nash\n-/\nimport Mathlib.Algebra.Algebra.Hom\n\n#align_import algebra.hom.non_unital_alg from \"leanprover-community/mathlib\"@\"bd9851ca476957ea4549eb19b40e7b5ade9428cc\"\n\n/-!\n# Morphisms of non-unital algebras\n\nThis file defines morphisms between two types, each of which carries:\n * an addition,\n * an additive zero,\n * a multiplication,\n * a scalar action.\n\nThe multiplications are not assumed to be associative or unital, or even to be compatible with the\nscalar actions. In a typical application, the operations will satisfy compatibility conditions\nmaking them into algebras (albeit possibly non-associative and/or non-unital) but such conditions\nare not required to make this definition.\n\nThis notion of morphism should be useful for any category of non-unital algebras. The motivating\napplication at the time it was introduced was to be able to state the adjunction property for\nmagma algebras. These are non-unital, non-associative algebras obtained by applying the\ngroup-algebra construction except where we take a type carrying just `Mul` instead of `Group`.\n\nFor a plausible future application, one could take the non-unital algebra of compactly-supported\nfunctions on a non-compact topological space. A proper map between a pair of such spaces\n(contravariantly) induces a morphism between their algebras of compactly-supported functions which\nwill be a `NonUnitalAlgHom`.\n\nTODO: add `NonUnitalAlgEquiv` when needed.\n\n## Main definitions\n\n * `NonUnitalAlgHom`\n * `AlgHom.toNonUnitalAlgHom`\n\n## Tags\n\nnon-unital, algebra, morphism\n-/\n\nset_option autoImplicit true\n\n\nuniverse u v w w₁ w₂ w₃\n\nvariable (R : Type u) (A : Type v) (B : Type w) (C : Type w₁)\n\n/-- A morphism respecting addition, multiplication, and scalar multiplication. When these arise from\nalgebra structures, this is the same as a not-necessarily-unital morphism of algebras. -/\nstructure NonUnitalAlgHom [Monoid R] [NonUnitalNonAssocSemiring A] [DistribMulAction R A]\n [NonUnitalNonAssocSemiring B] [DistribMulAction R B] extends A →+[R] B, A →ₙ* B\n#align non_unital_alg_hom NonUnitalAlgHom\n\n@[inherit_doc NonUnitalAlgHom]\ninfixr:25 \" →ₙₐ \" => NonUnitalAlgHom _\n\n@[inherit_doc]\nnotation:25 A \" →ₙₐ[\" R \"] \" B => NonUnitalAlgHom R A B\n\nattribute [nolint docBlame] NonUnitalAlgHom.toMulHom\n\n/-- `NonUnitalAlgHomClass F R A B` asserts `F` is a type of bundled algebra homomorphisms\nfrom `A` to `B`. -/\nclass NonUnitalAlgHomClass (F : Type*) (R : outParam (Type*)) (A : outParam (Type*))\n (B : outParam (Type*)) [Monoid R] [NonUnitalNonAssocSemiring A] [NonUnitalNonAssocSemiring B]\n [DistribMulAction R A] [DistribMulAction R B] extends DistribMulActionHomClass F R A B,\n MulHomClass F A B\n#align non_unital_alg_hom_class NonUnitalAlgHomClass\n\n-- Porting note: commented out, not dangerous\n-- attribute [nolint dangerousInstance] NonUnitalAlgHomClass.toMulHomClass\n\nnamespace NonUnitalAlgHomClass\n\n-- Porting note: Made following instance non-dangerous through [...] -> [...] replacement\n-- See note [lower instance priority]\ninstance (priority := 100) toNonUnitalRingHomClass {F R A B : Type*}\n [Monoid R] [NonUnitalNonAssocSemiring A] [DistribMulAction R A]\n [NonUnitalNonAssocSemiring B] [DistribMulAction R B]\n [NonUnitalAlgHomClass F R A B] : NonUnitalRingHomClass F A B :=\n { ‹NonUnitalAlgHomClass F R A B› with coe := (⇑) }\n#align non_unital_alg_hom_class.non_unital_alg_hom_class.to_non_unital_ring_hom_class NonUnitalAlgHomClass.toNonUnitalRingHomClass\n\nvariable [Semiring R] [NonUnitalNonAssocSemiring A] [Module R A]\n [NonUnitalNonAssocSemiring B] [Module R B]\n\n-- see Note [lower instance priority]\ninstance (priority := 100) {F : Type*} [NonUnitalAlgHomClass F R A B] : LinearMapClass F R A B :=\n { ‹NonUnitalAlgHomClass F R A B› with map_smulₛₗ := map_smul }\n\n/-- Turn an element of a type `F` satisfying `NonUnitalAlgHomClass F R A B` into an actual\n`NonUnitalAlgHom`. This is declared as the default coercion from `F` to `A →ₙₐ[R] B`. -/\n@[coe]\ndef toNonUnitalAlgHom {F R A B : Type*} [Monoid R] [NonUnitalNonAssocSemiring A]\n [DistribMulAction R A] [NonUnitalNonAssocSemiring B] [DistribMulAction R B]\n [NonUnitalAlgHomClass F R A B] (f : F) : A →ₙₐ[R] B :=\n { (f : A →ₙ+* B) with\n map_smul' := map_smul f }\n\ninstance {F R A B : Type*} [Monoid R] [NonUnitalNonAssocSemiring A] [DistribMulAction R A]\n [NonUnitalNonAssocSemiring B] [DistribMulAction R B] [NonUnitalAlgHomClass F R A B] :\n CoeTC F (A →ₙₐ[R] B) :=\n ⟨toNonUnitalAlgHom⟩\n\nend NonUnitalAlgHomClass\n\nnamespace NonUnitalAlgHom\n\nvariable {R A B C} [Monoid R]\n\nvariable [NonUnitalNonAssocSemiring A] [DistribMulAction R A]\n\nvariable [NonUnitalNonAssocSemiring B] [DistribMulAction R B]\n\nvariable [NonUnitalNonAssocSemiring C] [DistribMulAction R C]\n\n-- Porting note: Replaced with FunLike instance\n-- /-- see Note [function coercion] -/\n-- instance : CoeFun (A →ₙₐ[R] B) fun _ => A → B :=\n-- ⟨toFun⟩\n\ninstance : FunLike (A →ₙₐ[R] B) A fun _ => B where\n coe f := f.toFun\n coe_injective' := by rintro ⟨⟨⟨f, _⟩, _⟩, _⟩ ⟨⟨⟨g, _⟩, _⟩, _⟩ h; congr\n\n@[simp]\ntheorem toFun_eq_coe (f : A →ₙₐ[R] B) : f.toFun = ⇑f :=\n rfl\n#align non_unital_alg_hom.to_fun_eq_coe NonUnitalAlgHom.toFun_eq_coe\n\n/-- See Note [custom simps projection] -/\ndef Simps.apply (f : A →ₙₐ[R] B) : A → B := f\n\ninitialize_simps_projections NonUnitalAlgHom\n (toDistribMulActionHom_toMulActionHom_toFun → apply, -toDistribMulActionHom)\n\n@[simp]\nprotected theorem coe_coe {F : Type*} [NonUnitalAlgHomClass F R A B] (f : F) :\n ⇑(f : A →ₙₐ[R] B) = f :=\n rfl\n#align non_unital_alg_hom.coe_coe NonUnitalAlgHom.coe_coe\n\ntheorem coe_injective : @Function.Injective (A →ₙₐ[R] B) (A → B) (↑) := by\n rintro ⟨⟨⟨f, _⟩, _⟩, _⟩ ⟨⟨⟨g, _⟩, _⟩, _⟩ h; congr\n#align non_unital_alg_hom.coe_injective NonUnitalAlgHom.coe_injective\n\ninstance : NonUnitalAlgHomClass (A →ₙₐ[R] B) R A B\n where\n coe f := f.toFun\n coe_injective' := coe_injective\n map_smul f := f.map_smul'\n map_add f := f.map_add'\n map_zero f := f.map_zero'\n map_mul f := f.map_mul'\n\n@[ext]\ntheorem ext {f g : A →ₙₐ[R] B} (h : ∀ x, f x = g x) : f = g :=\n coe_injective <| funext h\n#align non_unital_alg_hom.ext NonUnitalAlgHom.ext\n\ntheorem ext_iff {f g : A →ₙₐ[R] B} : f = g ↔ ∀ x, f x = g x :=\n ⟨by\n rintro rfl x\n rfl, ext⟩\n#align non_unital_alg_hom.ext_iff NonUnitalAlgHom.ext_iff\n\ntheorem congr_fun {f g : A →ₙₐ[R] B} (h : f = g) (x : A) : f x = g x :=\n h ▸ rfl\n#align non_unital_alg_hom.congr_fun NonUnitalAlgHom.congr_fun\n\n@[simp]\ntheorem coe_mk (f : A → B) (h₁ h₂ h₃ h₄) : ⇑(⟨⟨⟨f, h₁⟩, h₂, h₃⟩, h₄⟩ : A →ₙₐ[R] B) = f :=\n rfl\n#align non_unital_alg_hom.coe_mk NonUnitalAlgHom.coe_mk\n\n@[simp]\ntheorem mk_coe (f : A →ₙₐ[R] B) (h₁ h₂ h₃ h₄) : (⟨⟨⟨f, h₁⟩, h₂, h₃⟩, h₄⟩ : A →ₙₐ[R] B) = f := by\n rfl\n#align non_unital_alg_hom.mk_coe NonUnitalAlgHom.mk_coe\n\ninstance : CoeOut (A →ₙₐ[R] B) (A →+[R] B) :=\n ⟨toDistribMulActionHom⟩\n\ninstance : CoeOut (A →ₙₐ[R] B) (A →ₙ* B) :=\n ⟨toMulHom⟩\n\n@[simp]\ntheorem toDistribMulActionHom_eq_coe (f : A →ₙₐ[R] B) : f.toDistribMulActionHom = ↑f :=\n rfl\n#align non_unital_alg_hom.to_distrib_mul_action_hom_eq_coe NonUnitalAlgHom.toDistribMulActionHom_eq_coe\n\n@[simp]\ntheorem toMulHom_eq_coe (f : A →ₙₐ[R] B) : f.toMulHom = ↑f :=\n rfl\n#align non_unital_alg_hom.to_mul_hom_eq_coe NonUnitalAlgHom.toMulHom_eq_coe\n\n@[simp, norm_cast]\ntheorem coe_to_distribMulActionHom (f : A →ₙₐ[R] B) : ⇑(f : A →+[R] B) = f :=\n rfl\n#align non_unital_alg_hom.coe_to_distrib_mul_action_hom NonUnitalAlgHom.coe_to_distribMulActionHom\n\n@[simp, norm_cast]\ntheorem coe_to_mulHom (f : A →ₙₐ[R] B) : ⇑(f : A →ₙ* B) = f :=\n rfl\n#align non_unital_alg_hom.coe_to_mul_hom NonUnitalAlgHom.coe_to_mulHom\n\ntheorem to_distribMulActionHom_injective {f g : A →ₙₐ[R] B}\n (h : (f : A →+[R] B) = (g : A →+[R] B)) : f = g := by\n ext a\n exact DistribMulActionHom.congr_fun h a\n#align non_unital_alg_hom.to_distrib_mul_action_hom_injective NonUnitalAlgHom.to_distribMulActionHom_injective\n\ntheorem to_mulHom_injective {f g : A →ₙₐ[R] B} (h : (f : A →ₙ* B) = (g : A →ₙ* B)) : f = g := by\n ext a\n exact FunLike.congr_fun h a\n#align non_unital_alg_hom.to_mul_hom_injective NonUnitalAlgHom.to_mulHom_injective\n\n@[norm_cast]\ntheorem coe_distribMulActionHom_mk (f : A →ₙₐ[R] B) (h₁ h₂ h₃ h₄) :\n ((⟨⟨⟨f, h₁⟩, h₂, h₃⟩, h₄⟩ : A →ₙₐ[R] B) : A →+[R] B) = ⟨⟨f, h₁⟩, h₂, h₃⟩ := by\n rfl\n#align non_unital_alg_hom.coe_distrib_mul_action_hom_mk NonUnitalAlgHom.coe_distribMulActionHom_mk\n\n@[norm_cast]\ntheorem coe_mulHom_mk (f : A →ₙₐ[R] B) (h₁ h₂ h₃ h₄) :\n ((⟨⟨⟨f, h₁⟩, h₂, h₃⟩, h₄⟩ : A →ₙₐ[R] B) : A →ₙ* B) = ⟨f, h₄⟩ := by\n rfl\n#align non_unital_alg_hom.coe_mul_hom_mk NonUnitalAlgHom.coe_mulHom_mk\n\n-- @[simp] -- Porting note: simp can prove this\nprotected theorem map_smul (f : A →ₙₐ[R] B) (c : R) (x : A) : f (c • x) = c • f x :=\n map_smul _ _ _\n#align non_unital_alg_hom.map_smul NonUnitalAlgHom.map_smul\n\n-- @[simp] -- Porting note: simp can prove this\nprotected theorem map_add (f : A →ₙₐ[R] B) (x y : A) : f (x + y) = f x + f y :=\n map_add _ _ _\n#align non_unital_alg_hom.map_add NonUnitalAlgHom.map_add\n\n-- @[simp] -- Porting note: simp can prove this\nprotected theorem map_mul (f : A →ₙₐ[R] B) (x y : A) : f (x * y) = f x * f y :=\n map_mul _ _ _\n#align non_unital_alg_hom.map_mul NonUnitalAlgHom.map_mul\n\n-- @[simp] -- Porting note: simp can prove this\nprotected theorem map_zero (f : A →ₙₐ[R] B) : f 0 = 0 :=\n map_zero _\n#align non_unital_alg_hom.map_zero NonUnitalAlgHom.map_zero\n\n/-- The identity map as a `NonUnitalAlgHom`. -/\nprotected def id (R A : Type*) [Monoid R] [NonUnitalNonAssocSemiring A]\n [DistribMulAction R A] : A →ₙₐ[R] A :=\n { NonUnitalRingHom.id A with\n toFun := id\n map_smul' := fun _ _ => rfl }\n\n@[simp]\ntheorem coe_id : ⇑(NonUnitalAlgHom.id R A) = id :=\n rfl\n\ninstance : Zero (A →ₙₐ[R] B) :=\n ⟨{ (0 : A →+[R] B) with map_mul' := by simp }⟩\n\ninstance : One (A →ₙₐ[R] A) :=\n ⟨NonUnitalAlgHom.id R A⟩\n\n@[simp]\ntheorem coe_zero : ⇑(0 : A →ₙₐ[R] B) = 0 :=\n rfl\n#align non_unital_alg_hom.coe_zero NonUnitalAlgHom.coe_zero\n\n@[simp]\ntheorem coe_one : ((1 : A →ₙₐ[R] A) : A → A) = id :=\n rfl\n#align non_unital_alg_hom.coe_one NonUnitalAlgHom.coe_one\n\ntheorem zero_apply (a : A) : (0 : A →ₙₐ[R] B) a = 0 :=\n rfl\n#align non_unital_alg_hom.zero_apply NonUnitalAlgHom.zero_apply\n\ntheorem one_apply (a : A) : (1 : A →ₙₐ[R] A) a = a :=\n rfl\n#align non_unital_alg_hom.one_apply NonUnitalAlgHom.one_apply\n\ninstance : Inhabited (A →ₙₐ[R] B) :=\n ⟨0⟩\n\n/-- The composition of morphisms is a morphism. -/\ndef comp (f : B →ₙₐ[R] C) (g : A →ₙₐ[R] B) : A →ₙₐ[R] C :=\n { (f : B →ₙ* C).comp (g : A →ₙ* B), (f : B →+[R] C).comp (g : A →+[R] B) with }\n#align non_unital_alg_hom.comp NonUnitalAlgHom.comp\n\n@[simp, norm_cast]\ntheorem coe_comp (f : B →ₙₐ[R] C) (g : A →ₙₐ[R] B) :\n ⇑(f.comp g) = (⇑f) ∘ (⇑g) :=\n rfl\n#align non_unital_alg_hom.coe_comp NonUnitalAlgHom.coe_comp\n\ntheorem comp_apply (f : B →ₙₐ[R] C) (g : A →ₙₐ[R] B) (x : A) : f.comp g x = f (g x) :=\n rfl\n#align non_unital_alg_hom.comp_apply NonUnitalAlgHom.comp_apply\n\n/-- The inverse of a bijective morphism is a morphism. -/\ndef inverse (f : A →ₙₐ[R] B) (g : B → A) (h₁ : Function.LeftInverse g f)\n (h₂ : Function.RightInverse g f) : B →ₙₐ[R] A :=\n { (f : A →ₙ* B).inverse g h₁ h₂, (f : A →+[R] B).inverse g h₁ h₂ with }\n#align non_unital_alg_hom.inverse NonUnitalAlgHom.inverse\n\n@[simp]\ntheorem coe_inverse (f : A →ₙₐ[R] B) (g : B → A) (h₁ : Function.LeftInverse g f)\n (h₂ : Function.RightInverse g f) : (inverse f g h₁ h₂ : B → A) = g :=\n rfl\n#align non_unital_alg_hom.coe_inverse NonUnitalAlgHom.coe_inverse\n\n/-! ### Operations on the product type\n\nNote that much of this is copied from [`LinearAlgebra/Prod`](../../LinearAlgebra/Prod). -/\n\n\nsection Prod\n\nvariable (R A B)\n\n/-- The first projection of a product is a non-unital alg_hom. -/\n@[simps]\ndef fst : A × B →ₙₐ[R] A where\n toFun := Prod.fst\n map_zero' := rfl\n map_add' _ _ := rfl\n map_smul' _ _ := rfl\n map_mul' _ _ := rfl\n#align non_unital_alg_hom.fst NonUnitalAlgHom.fst\n\n/-- The second projection of a product is a non-unital alg_hom. -/\n@[simps]\ndef snd : A × B →ₙₐ[R] B where\n toFun := Prod.snd\n map_zero' := rfl\n map_add' _ _ := rfl\n map_smul' _ _ := rfl\n map_mul' _ _ := rfl\n#align non_unital_alg_hom.snd NonUnitalAlgHom.snd\n\nvariable {R A B}\n\n/-- The prod of two morphisms is a morphism. -/\n@[simps]\ndef prod (f : A →ₙₐ[R] B) (g : A →ₙₐ[R] C) : A →ₙₐ[R] B × C\n where\n toFun := Pi.prod f g\n map_zero' := by ","nextTactic":"simp only [Pi.prod, Prod.zero_eq_mk, map_zero]","declUpToTactic":"/-- The prod of two morphisms is a morphism. -/\n@[simps]\ndef prod (f : A →ₙₐ[R] B) (g : A →ₙₐ[R] C) : A →ₙₐ[R] B × C\n where\n toFun := Pi.prod f g\n map_zero' := by ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_NonUnitalHom.351_0.9y3TORfxg2P0A5c","decl":"/-- The prod of two morphisms is a morphism. -/\n@[simps]\ndef prod (f : A →ₙₐ[R] B) (g : A →ₙₐ[R] C) : A →ₙₐ[R] B × C\n where\n toFun "} -{"state":"R : Type u\nA : Type v\nB : Type w\nC : Type w₁\ninst✝⁶ : Monoid R\ninst✝⁵ : NonUnitalNonAssocSemiring A\ninst✝⁴ : DistribMulAction R A\ninst✝³ : NonUnitalNonAssocSemiring B\ninst✝² : DistribMulAction R B\ninst✝¹ : NonUnitalNonAssocSemiring C\ninst✝ : DistribMulAction R C\nf : A →ₙₐ[R] B\ng : A →ₙₐ[R] C\nx y : A\n⊢ MulActionHom.toFun\n { toFun := Pi.prod ⇑f ⇑g, map_smul' := (_ : ∀ (c : R) (x : A), (f (c • x), g (c • x)) = (c • f x, c • g x)) }\n (x + y) =\n MulActionHom.toFun\n { toFun := Pi.prod ⇑f ⇑g, map_smul' := (_ : ∀ (c : R) (x : A), (f (c • x), g (c • x)) = (c • f x, c • g x)) }\n x +\n MulActionHom.toFun\n { toFun := Pi.prod ⇑f ⇑g, map_smul' := (_ : ∀ (c : R) (x : A), (f (c • x), g (c • x)) = (c • f x, c • g x)) } y","srcUpToTactic":"/-\nCopyright (c) 2021 Oliver Nash. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Oliver Nash\n-/\nimport Mathlib.Algebra.Algebra.Hom\n\n#align_import algebra.hom.non_unital_alg from \"leanprover-community/mathlib\"@\"bd9851ca476957ea4549eb19b40e7b5ade9428cc\"\n\n/-!\n# Morphisms of non-unital algebras\n\nThis file defines morphisms between two types, each of which carries:\n * an addition,\n * an additive zero,\n * a multiplication,\n * a scalar action.\n\nThe multiplications are not assumed to be associative or unital, or even to be compatible with the\nscalar actions. In a typical application, the operations will satisfy compatibility conditions\nmaking them into algebras (albeit possibly non-associative and/or non-unital) but such conditions\nare not required to make this definition.\n\nThis notion of morphism should be useful for any category of non-unital algebras. The motivating\napplication at the time it was introduced was to be able to state the adjunction property for\nmagma algebras. These are non-unital, non-associative algebras obtained by applying the\ngroup-algebra construction except where we take a type carrying just `Mul` instead of `Group`.\n\nFor a plausible future application, one could take the non-unital algebra of compactly-supported\nfunctions on a non-compact topological space. A proper map between a pair of such spaces\n(contravariantly) induces a morphism between their algebras of compactly-supported functions which\nwill be a `NonUnitalAlgHom`.\n\nTODO: add `NonUnitalAlgEquiv` when needed.\n\n## Main definitions\n\n * `NonUnitalAlgHom`\n * `AlgHom.toNonUnitalAlgHom`\n\n## Tags\n\nnon-unital, algebra, morphism\n-/\n\nset_option autoImplicit true\n\n\nuniverse u v w w₁ w₂ w₃\n\nvariable (R : Type u) (A : Type v) (B : Type w) (C : Type w₁)\n\n/-- A morphism respecting addition, multiplication, and scalar multiplication. When these arise from\nalgebra structures, this is the same as a not-necessarily-unital morphism of algebras. -/\nstructure NonUnitalAlgHom [Monoid R] [NonUnitalNonAssocSemiring A] [DistribMulAction R A]\n [NonUnitalNonAssocSemiring B] [DistribMulAction R B] extends A →+[R] B, A →ₙ* B\n#align non_unital_alg_hom NonUnitalAlgHom\n\n@[inherit_doc NonUnitalAlgHom]\ninfixr:25 \" →ₙₐ \" => NonUnitalAlgHom _\n\n@[inherit_doc]\nnotation:25 A \" →ₙₐ[\" R \"] \" B => NonUnitalAlgHom R A B\n\nattribute [nolint docBlame] NonUnitalAlgHom.toMulHom\n\n/-- `NonUnitalAlgHomClass F R A B` asserts `F` is a type of bundled algebra homomorphisms\nfrom `A` to `B`. -/\nclass NonUnitalAlgHomClass (F : Type*) (R : outParam (Type*)) (A : outParam (Type*))\n (B : outParam (Type*)) [Monoid R] [NonUnitalNonAssocSemiring A] [NonUnitalNonAssocSemiring B]\n [DistribMulAction R A] [DistribMulAction R B] extends DistribMulActionHomClass F R A B,\n MulHomClass F A B\n#align non_unital_alg_hom_class NonUnitalAlgHomClass\n\n-- Porting note: commented out, not dangerous\n-- attribute [nolint dangerousInstance] NonUnitalAlgHomClass.toMulHomClass\n\nnamespace NonUnitalAlgHomClass\n\n-- Porting note: Made following instance non-dangerous through [...] -> [...] replacement\n-- See note [lower instance priority]\ninstance (priority := 100) toNonUnitalRingHomClass {F R A B : Type*}\n [Monoid R] [NonUnitalNonAssocSemiring A] [DistribMulAction R A]\n [NonUnitalNonAssocSemiring B] [DistribMulAction R B]\n [NonUnitalAlgHomClass F R A B] : NonUnitalRingHomClass F A B :=\n { ‹NonUnitalAlgHomClass F R A B› with coe := (⇑) }\n#align non_unital_alg_hom_class.non_unital_alg_hom_class.to_non_unital_ring_hom_class NonUnitalAlgHomClass.toNonUnitalRingHomClass\n\nvariable [Semiring R] [NonUnitalNonAssocSemiring A] [Module R A]\n [NonUnitalNonAssocSemiring B] [Module R B]\n\n-- see Note [lower instance priority]\ninstance (priority := 100) {F : Type*} [NonUnitalAlgHomClass F R A B] : LinearMapClass F R A B :=\n { ‹NonUnitalAlgHomClass F R A B› with map_smulₛₗ := map_smul }\n\n/-- Turn an element of a type `F` satisfying `NonUnitalAlgHomClass F R A B` into an actual\n`NonUnitalAlgHom`. This is declared as the default coercion from `F` to `A →ₙₐ[R] B`. -/\n@[coe]\ndef toNonUnitalAlgHom {F R A B : Type*} [Monoid R] [NonUnitalNonAssocSemiring A]\n [DistribMulAction R A] [NonUnitalNonAssocSemiring B] [DistribMulAction R B]\n [NonUnitalAlgHomClass F R A B] (f : F) : A →ₙₐ[R] B :=\n { (f : A →ₙ+* B) with\n map_smul' := map_smul f }\n\ninstance {F R A B : Type*} [Monoid R] [NonUnitalNonAssocSemiring A] [DistribMulAction R A]\n [NonUnitalNonAssocSemiring B] [DistribMulAction R B] [NonUnitalAlgHomClass F R A B] :\n CoeTC F (A →ₙₐ[R] B) :=\n ⟨toNonUnitalAlgHom⟩\n\nend NonUnitalAlgHomClass\n\nnamespace NonUnitalAlgHom\n\nvariable {R A B C} [Monoid R]\n\nvariable [NonUnitalNonAssocSemiring A] [DistribMulAction R A]\n\nvariable [NonUnitalNonAssocSemiring B] [DistribMulAction R B]\n\nvariable [NonUnitalNonAssocSemiring C] [DistribMulAction R C]\n\n-- Porting note: Replaced with FunLike instance\n-- /-- see Note [function coercion] -/\n-- instance : CoeFun (A →ₙₐ[R] B) fun _ => A → B :=\n-- ⟨toFun⟩\n\ninstance : FunLike (A →ₙₐ[R] B) A fun _ => B where\n coe f := f.toFun\n coe_injective' := by rintro ⟨⟨⟨f, _⟩, _⟩, _⟩ ⟨⟨⟨g, _⟩, _⟩, _⟩ h; congr\n\n@[simp]\ntheorem toFun_eq_coe (f : A →ₙₐ[R] B) : f.toFun = ⇑f :=\n rfl\n#align non_unital_alg_hom.to_fun_eq_coe NonUnitalAlgHom.toFun_eq_coe\n\n/-- See Note [custom simps projection] -/\ndef Simps.apply (f : A →ₙₐ[R] B) : A → B := f\n\ninitialize_simps_projections NonUnitalAlgHom\n (toDistribMulActionHom_toMulActionHom_toFun → apply, -toDistribMulActionHom)\n\n@[simp]\nprotected theorem coe_coe {F : Type*} [NonUnitalAlgHomClass F R A B] (f : F) :\n ⇑(f : A →ₙₐ[R] B) = f :=\n rfl\n#align non_unital_alg_hom.coe_coe NonUnitalAlgHom.coe_coe\n\ntheorem coe_injective : @Function.Injective (A →ₙₐ[R] B) (A → B) (↑) := by\n rintro ⟨⟨⟨f, _⟩, _⟩, _⟩ ⟨⟨⟨g, _⟩, _⟩, _⟩ h; congr\n#align non_unital_alg_hom.coe_injective NonUnitalAlgHom.coe_injective\n\ninstance : NonUnitalAlgHomClass (A →ₙₐ[R] B) R A B\n where\n coe f := f.toFun\n coe_injective' := coe_injective\n map_smul f := f.map_smul'\n map_add f := f.map_add'\n map_zero f := f.map_zero'\n map_mul f := f.map_mul'\n\n@[ext]\ntheorem ext {f g : A →ₙₐ[R] B} (h : ∀ x, f x = g x) : f = g :=\n coe_injective <| funext h\n#align non_unital_alg_hom.ext NonUnitalAlgHom.ext\n\ntheorem ext_iff {f g : A →ₙₐ[R] B} : f = g ↔ ∀ x, f x = g x :=\n ⟨by\n rintro rfl x\n rfl, ext⟩\n#align non_unital_alg_hom.ext_iff NonUnitalAlgHom.ext_iff\n\ntheorem congr_fun {f g : A →ₙₐ[R] B} (h : f = g) (x : A) : f x = g x :=\n h ▸ rfl\n#align non_unital_alg_hom.congr_fun NonUnitalAlgHom.congr_fun\n\n@[simp]\ntheorem coe_mk (f : A → B) (h₁ h₂ h₃ h₄) : ⇑(⟨⟨⟨f, h₁⟩, h₂, h₃⟩, h₄⟩ : A →ₙₐ[R] B) = f :=\n rfl\n#align non_unital_alg_hom.coe_mk NonUnitalAlgHom.coe_mk\n\n@[simp]\ntheorem mk_coe (f : A →ₙₐ[R] B) (h₁ h₂ h₃ h₄) : (⟨⟨⟨f, h₁⟩, h₂, h₃⟩, h₄⟩ : A →ₙₐ[R] B) = f := by\n rfl\n#align non_unital_alg_hom.mk_coe NonUnitalAlgHom.mk_coe\n\ninstance : CoeOut (A →ₙₐ[R] B) (A →+[R] B) :=\n ⟨toDistribMulActionHom⟩\n\ninstance : CoeOut (A →ₙₐ[R] B) (A →ₙ* B) :=\n ⟨toMulHom⟩\n\n@[simp]\ntheorem toDistribMulActionHom_eq_coe (f : A →ₙₐ[R] B) : f.toDistribMulActionHom = ↑f :=\n rfl\n#align non_unital_alg_hom.to_distrib_mul_action_hom_eq_coe NonUnitalAlgHom.toDistribMulActionHom_eq_coe\n\n@[simp]\ntheorem toMulHom_eq_coe (f : A →ₙₐ[R] B) : f.toMulHom = ↑f :=\n rfl\n#align non_unital_alg_hom.to_mul_hom_eq_coe NonUnitalAlgHom.toMulHom_eq_coe\n\n@[simp, norm_cast]\ntheorem coe_to_distribMulActionHom (f : A →ₙₐ[R] B) : ⇑(f : A →+[R] B) = f :=\n rfl\n#align non_unital_alg_hom.coe_to_distrib_mul_action_hom NonUnitalAlgHom.coe_to_distribMulActionHom\n\n@[simp, norm_cast]\ntheorem coe_to_mulHom (f : A →ₙₐ[R] B) : ⇑(f : A →ₙ* B) = f :=\n rfl\n#align non_unital_alg_hom.coe_to_mul_hom NonUnitalAlgHom.coe_to_mulHom\n\ntheorem to_distribMulActionHom_injective {f g : A →ₙₐ[R] B}\n (h : (f : A →+[R] B) = (g : A →+[R] B)) : f = g := by\n ext a\n exact DistribMulActionHom.congr_fun h a\n#align non_unital_alg_hom.to_distrib_mul_action_hom_injective NonUnitalAlgHom.to_distribMulActionHom_injective\n\ntheorem to_mulHom_injective {f g : A →ₙₐ[R] B} (h : (f : A →ₙ* B) = (g : A →ₙ* B)) : f = g := by\n ext a\n exact FunLike.congr_fun h a\n#align non_unital_alg_hom.to_mul_hom_injective NonUnitalAlgHom.to_mulHom_injective\n\n@[norm_cast]\ntheorem coe_distribMulActionHom_mk (f : A →ₙₐ[R] B) (h₁ h₂ h₃ h₄) :\n ((⟨⟨⟨f, h₁⟩, h₂, h₃⟩, h₄⟩ : A →ₙₐ[R] B) : A →+[R] B) = ⟨⟨f, h₁⟩, h₂, h₃⟩ := by\n rfl\n#align non_unital_alg_hom.coe_distrib_mul_action_hom_mk NonUnitalAlgHom.coe_distribMulActionHom_mk\n\n@[norm_cast]\ntheorem coe_mulHom_mk (f : A →ₙₐ[R] B) (h₁ h₂ h₃ h₄) :\n ((⟨⟨⟨f, h₁⟩, h₂, h₃⟩, h₄⟩ : A →ₙₐ[R] B) : A →ₙ* B) = ⟨f, h₄⟩ := by\n rfl\n#align non_unital_alg_hom.coe_mul_hom_mk NonUnitalAlgHom.coe_mulHom_mk\n\n-- @[simp] -- Porting note: simp can prove this\nprotected theorem map_smul (f : A →ₙₐ[R] B) (c : R) (x : A) : f (c • x) = c • f x :=\n map_smul _ _ _\n#align non_unital_alg_hom.map_smul NonUnitalAlgHom.map_smul\n\n-- @[simp] -- Porting note: simp can prove this\nprotected theorem map_add (f : A ���ₙₐ[R] B) (x y : A) : f (x + y) = f x + f y :=\n map_add _ _ _\n#align non_unital_alg_hom.map_add NonUnitalAlgHom.map_add\n\n-- @[simp] -- Porting note: simp can prove this\nprotected theorem map_mul (f : A →ₙₐ[R] B) (x y : A) : f (x * y) = f x * f y :=\n map_mul _ _ _\n#align non_unital_alg_hom.map_mul NonUnitalAlgHom.map_mul\n\n-- @[simp] -- Porting note: simp can prove this\nprotected theorem map_zero (f : A →ₙₐ[R] B) : f 0 = 0 :=\n map_zero _\n#align non_unital_alg_hom.map_zero NonUnitalAlgHom.map_zero\n\n/-- The identity map as a `NonUnitalAlgHom`. -/\nprotected def id (R A : Type*) [Monoid R] [NonUnitalNonAssocSemiring A]\n [DistribMulAction R A] : A →ₙₐ[R] A :=\n { NonUnitalRingHom.id A with\n toFun := id\n map_smul' := fun _ _ => rfl }\n\n@[simp]\ntheorem coe_id : ⇑(NonUnitalAlgHom.id R A) = id :=\n rfl\n\ninstance : Zero (A →ₙₐ[R] B) :=\n ⟨{ (0 : A →+[R] B) with map_mul' := by simp }⟩\n\ninstance : One (A →ₙₐ[R] A) :=\n ⟨NonUnitalAlgHom.id R A⟩\n\n@[simp]\ntheorem coe_zero : ⇑(0 : A →ₙₐ[R] B) = 0 :=\n rfl\n#align non_unital_alg_hom.coe_zero NonUnitalAlgHom.coe_zero\n\n@[simp]\ntheorem coe_one : ((1 : A →ₙₐ[R] A) : A → A) = id :=\n rfl\n#align non_unital_alg_hom.coe_one NonUnitalAlgHom.coe_one\n\ntheorem zero_apply (a : A) : (0 : A →ₙₐ[R] B) a = 0 :=\n rfl\n#align non_unital_alg_hom.zero_apply NonUnitalAlgHom.zero_apply\n\ntheorem one_apply (a : A) : (1 : A →ₙₐ[R] A) a = a :=\n rfl\n#align non_unital_alg_hom.one_apply NonUnitalAlgHom.one_apply\n\ninstance : Inhabited (A →ₙₐ[R] B) :=\n ⟨0⟩\n\n/-- The composition of morphisms is a morphism. -/\ndef comp (f : B →ₙₐ[R] C) (g : A →ₙₐ[R] B) : A →ₙₐ[R] C :=\n { (f : B →ₙ* C).comp (g : A →ₙ* B), (f : B →+[R] C).comp (g : A →+[R] B) with }\n#align non_unital_alg_hom.comp NonUnitalAlgHom.comp\n\n@[simp, norm_cast]\ntheorem coe_comp (f : B →ₙₐ[R] C) (g : A →ₙₐ[R] B) :\n ⇑(f.comp g) = (⇑f) ∘ (⇑g) :=\n rfl\n#align non_unital_alg_hom.coe_comp NonUnitalAlgHom.coe_comp\n\ntheorem comp_apply (f : B →ₙₐ[R] C) (g : A →ₙₐ[R] B) (x : A) : f.comp g x = f (g x) :=\n rfl\n#align non_unital_alg_hom.comp_apply NonUnitalAlgHom.comp_apply\n\n/-- The inverse of a bijective morphism is a morphism. -/\ndef inverse (f : A →ₙₐ[R] B) (g : B → A) (h₁ : Function.LeftInverse g f)\n (h₂ : Function.RightInverse g f) : B →ₙₐ[R] A :=\n { (f : A →ₙ* B).inverse g h₁ h₂, (f : A →+[R] B).inverse g h₁ h₂ with }\n#align non_unital_alg_hom.inverse NonUnitalAlgHom.inverse\n\n@[simp]\ntheorem coe_inverse (f : A →ₙₐ[R] B) (g : B → A) (h₁ : Function.LeftInverse g f)\n (h₂ : Function.RightInverse g f) : (inverse f g h₁ h₂ : B → A) = g :=\n rfl\n#align non_unital_alg_hom.coe_inverse NonUnitalAlgHom.coe_inverse\n\n/-! ### Operations on the product type\n\nNote that much of this is copied from [`LinearAlgebra/Prod`](../../LinearAlgebra/Prod). -/\n\n\nsection Prod\n\nvariable (R A B)\n\n/-- The first projection of a product is a non-unital alg_hom. -/\n@[simps]\ndef fst : A × B →ₙₐ[R] A where\n toFun := Prod.fst\n map_zero' := rfl\n map_add' _ _ := rfl\n map_smul' _ _ := rfl\n map_mul' _ _ := rfl\n#align non_unital_alg_hom.fst NonUnitalAlgHom.fst\n\n/-- The second projection of a product is a non-unital alg_hom. -/\n@[simps]\ndef snd : A × B →ₙₐ[R] B where\n toFun := Prod.snd\n map_zero' := rfl\n map_add' _ _ := rfl\n map_smul' _ _ := rfl\n map_mul' _ _ := rfl\n#align non_unital_alg_hom.snd NonUnitalAlgHom.snd\n\nvariable {R A B}\n\n/-- The prod of two morphisms is a morphism. -/\n@[simps]\ndef prod (f : A →ₙₐ[R] B) (g : A →ₙₐ[R] C) : A →ₙₐ[R] B × C\n where\n toFun := Pi.prod f g\n map_zero' := by simp only [Pi.prod, Prod.zero_eq_mk, map_zero]\n map_add' x y := by ","nextTactic":"simp only [Pi.prod, Prod.mk_add_mk, map_add]","declUpToTactic":"/-- The prod of two morphisms is a morphism. -/\n@[simps]\ndef prod (f : A →ₙₐ[R] B) (g : A →ₙₐ[R] C) : A →ₙₐ[R] B × C\n where\n toFun := Pi.prod f g\n map_zero' := by simp only [Pi.prod, Prod.zero_eq_mk, map_zero]\n map_add' x y := by ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_NonUnitalHom.351_0.9y3TORfxg2P0A5c","decl":"/-- The prod of two morphisms is a morphism. -/\n@[simps]\ndef prod (f : A →ₙₐ[R] B) (g : A →ₙₐ[R] C) : A →ₙₐ[R] B × C\n where\n toFun "} -{"state":"R : Type u\nA : Type v\nB : Type w\nC : Type w₁\ninst✝⁶ : Monoid R\ninst✝⁵ : NonUnitalNonAssocSemiring A\ninst✝⁴ : DistribMulAction R A\ninst✝³ : NonUnitalNonAssocSemiring B\ninst✝² : DistribMulAction R B\ninst✝¹ : NonUnitalNonAssocSemiring C\ninst✝ : DistribMulAction R C\nf : A →ₙₐ[R] B\ng : A →ₙₐ[R] C\nx y : A\n⊢ MulActionHom.toFun\n {\n toMulActionHom :=\n { toFun := Pi.prod ⇑f ⇑g,\n map_smul' := (_ : ∀ (c : R) (x : A), (f (c • x), g (c • x)) = (c • f x, c • g x)) },\n map_zero' := (_ : (f 0, g 0) = (0, 0)),\n map_add' := (_ : ∀ (x y : A), (f (x + y), g (x + y)) = (f x + f y, g x + g y)) }.toMulActionHom\n (x * y) =\n MulActionHom.toFun\n {\n toMulActionHom :=\n { toFun := Pi.prod ⇑f ⇑g,\n map_smul' := (_ : ∀ (c : R) (x : A), (f (c • x), g (c • x)) = (c • f x, c • g x)) },\n map_zero' := (_ : (f 0, g 0) = (0, 0)),\n map_add' := (_ : ∀ (x y : A), (f (x + y), g (x + y)) = (f x + f y, g x + g y)) }.toMulActionHom\n x *\n MulActionHom.toFun\n {\n toMulActionHom :=\n { toFun := Pi.prod ⇑f ⇑g,\n map_smul' := (_ : ∀ (c : R) (x : A), (f (c • x), g (c • x)) = (c • f x, c • g x)) },\n map_zero' := (_ : (f 0, g 0) = (0, 0)),\n map_add' := (_ : ∀ (x y : A), (f (x + y), g (x + y)) = (f x + f y, g x + g y)) }.toMulActionHom\n y","srcUpToTactic":"/-\nCopyright (c) 2021 Oliver Nash. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Oliver Nash\n-/\nimport Mathlib.Algebra.Algebra.Hom\n\n#align_import algebra.hom.non_unital_alg from \"leanprover-community/mathlib\"@\"bd9851ca476957ea4549eb19b40e7b5ade9428cc\"\n\n/-!\n# Morphisms of non-unital algebras\n\nThis file defines morphisms between two types, each of which carries:\n * an addition,\n * an additive zero,\n * a multiplication,\n * a scalar action.\n\nThe multiplications are not assumed to be associative or unital, or even to be compatible with the\nscalar actions. In a typical application, the operations will satisfy compatibility conditions\nmaking them into algebras (albeit possibly non-associative and/or non-unital) but such conditions\nare not required to make this definition.\n\nThis notion of morphism should be useful for any category of non-unital algebras. The motivating\napplication at the time it was introduced was to be able to state the adjunction property for\nmagma algebras. These are non-unital, non-associative algebras obtained by applying the\ngroup-algebra construction except where we take a type carrying just `Mul` instead of `Group`.\n\nFor a plausible future application, one could take the non-unital algebra of compactly-supported\nfunctions on a non-compact topological space. A proper map between a pair of such spaces\n(contravariantly) induces a morphism between their algebras of compactly-supported functions which\nwill be a `NonUnitalAlgHom`.\n\nTODO: add `NonUnitalAlgEquiv` when needed.\n\n## Main definitions\n\n * `NonUnitalAlgHom`\n * `AlgHom.toNonUnitalAlgHom`\n\n## Tags\n\nnon-unital, algebra, morphism\n-/\n\nset_option autoImplicit true\n\n\nuniverse u v w w₁ w₂ w₃\n\nvariable (R : Type u) (A : Type v) (B : Type w) (C : Type w₁)\n\n/-- A morphism respecting addition, multiplication, and scalar multiplication. When these arise from\nalgebra structures, this is the same as a not-necessarily-unital morphism of algebras. -/\nstructure NonUnitalAlgHom [Monoid R] [NonUnitalNonAssocSemiring A] [DistribMulAction R A]\n [NonUnitalNonAssocSemiring B] [DistribMulAction R B] extends A →+[R] B, A →ₙ* B\n#align non_unital_alg_hom NonUnitalAlgHom\n\n@[inherit_doc NonUnitalAlgHom]\ninfixr:25 \" →ₙₐ \" => NonUnitalAlgHom _\n\n@[inherit_doc]\nnotation:25 A \" →ₙₐ[\" R \"] \" B => NonUnitalAlgHom R A B\n\nattribute [nolint docBlame] NonUnitalAlgHom.toMulHom\n\n/-- `NonUnitalAlgHomClass F R A B` asserts `F` is a type of bundled algebra homomorphisms\nfrom `A` to `B`. -/\nclass NonUnitalAlgHomClass (F : Type*) (R : outParam (Type*)) (A : outParam (Type*))\n (B : outParam (Type*)) [Monoid R] [NonUnitalNonAssocSemiring A] [NonUnitalNonAssocSemiring B]\n [DistribMulAction R A] [DistribMulAction R B] extends DistribMulActionHomClass F R A B,\n MulHomClass F A B\n#align non_unital_alg_hom_class NonUnitalAlgHomClass\n\n-- Porting note: commented out, not dangerous\n-- attribute [nolint dangerousInstance] NonUnitalAlgHomClass.toMulHomClass\n\nnamespace NonUnitalAlgHomClass\n\n-- Porting note: Made following instance non-dangerous through [...] -> [...] replacement\n-- See note [lower instance priority]\ninstance (priority := 100) toNonUnitalRingHomClass {F R A B : Type*}\n [Monoid R] [NonUnitalNonAssocSemiring A] [DistribMulAction R A]\n [NonUnitalNonAssocSemiring B] [DistribMulAction R B]\n [NonUnitalAlgHomClass F R A B] : NonUnitalRingHomClass F A B :=\n { ‹NonUnitalAlgHomClass F R A B› with coe := (⇑) }\n#align non_unital_alg_hom_class.non_unital_alg_hom_class.to_non_unital_ring_hom_class NonUnitalAlgHomClass.toNonUnitalRingHomClass\n\nvariable [Semiring R] [NonUnitalNonAssocSemiring A] [Module R A]\n [NonUnitalNonAssocSemiring B] [Module R B]\n\n-- see Note [lower instance priority]\ninstance (priority := 100) {F : Type*} [NonUnitalAlgHomClass F R A B] : LinearMapClass F R A B :=\n { ‹NonUnitalAlgHomClass F R A B› with map_smulₛₗ := map_smul }\n\n/-- Turn an element of a type `F` satisfying `NonUnitalAlgHomClass F R A B` into an actual\n`NonUnitalAlgHom`. This is declared as the default coercion from `F` to `A →ₙₐ[R] B`. -/\n@[coe]\ndef toNonUnitalAlgHom {F R A B : Type*} [Monoid R] [NonUnitalNonAssocSemiring A]\n [DistribMulAction R A] [NonUnitalNonAssocSemiring B] [DistribMulAction R B]\n [NonUnitalAlgHomClass F R A B] (f : F) : A →ₙₐ[R] B :=\n { (f : A →ₙ+* B) with\n map_smul' := map_smul f }\n\ninstance {F R A B : Type*} [Monoid R] [NonUnitalNonAssocSemiring A] [DistribMulAction R A]\n [NonUnitalNonAssocSemiring B] [DistribMulAction R B] [NonUnitalAlgHomClass F R A B] :\n CoeTC F (A →ₙₐ[R] B) :=\n ⟨toNonUnitalAlgHom⟩\n\nend NonUnitalAlgHomClass\n\nnamespace NonUnitalAlgHom\n\nvariable {R A B C} [Monoid R]\n\nvariable [NonUnitalNonAssocSemiring A] [DistribMulAction R A]\n\nvariable [NonUnitalNonAssocSemiring B] [DistribMulAction R B]\n\nvariable [NonUnitalNonAssocSemiring C] [DistribMulAction R C]\n\n-- Porting note: Replaced with FunLike instance\n-- /-- see Note [function coercion] -/\n-- instance : CoeFun (A →ₙₐ[R] B) fun _ => A → B :=\n-- ⟨toFun⟩\n\ninstance : FunLike (A →ₙₐ[R] B) A fun _ => B where\n coe f := f.toFun\n coe_injective' := by rintro ⟨⟨⟨f, _⟩, _⟩, _⟩ ⟨⟨⟨g, _⟩, _⟩, _⟩ h; congr\n\n@[simp]\ntheorem toFun_eq_coe (f : A →ₙₐ[R] B) : f.toFun = ⇑f :=\n rfl\n#align non_unital_alg_hom.to_fun_eq_coe NonUnitalAlgHom.toFun_eq_coe\n\n/-- See Note [custom simps projection] -/\ndef Simps.apply (f : A →ₙₐ[R] B) : A → B := f\n\ninitialize_simps_projections NonUnitalAlgHom\n (toDistribMulActionHom_toMulActionHom_toFun → apply, -toDistribMulActionHom)\n\n@[simp]\nprotected theorem coe_coe {F : Type*} [NonUnitalAlgHomClass F R A B] (f : F) :\n ⇑(f : A →ₙₐ[R] B) = f :=\n rfl\n#align non_unital_alg_hom.coe_coe NonUnitalAlgHom.coe_coe\n\ntheorem coe_injective : @Function.Injective (A →ₙₐ[R] B) (A → B) (↑) := by\n rintro ⟨⟨⟨f, _⟩, _⟩, _⟩ ⟨⟨⟨g, _⟩, _⟩, _⟩ h; congr\n#align non_unital_alg_hom.coe_injective NonUnitalAlgHom.coe_injective\n\ninstance : NonUnitalAlgHomClass (A →ₙₐ[R] B) R A B\n where\n coe f := f.toFun\n coe_injective' := coe_injective\n map_smul f := f.map_smul'\n map_add f := f.map_add'\n map_zero f := f.map_zero'\n map_mul f := f.map_mul'\n\n@[ext]\ntheorem ext {f g : A →ₙₐ[R] B} (h : ∀ x, f x = g x) : f = g :=\n coe_injective <| funext h\n#align non_unital_alg_hom.ext NonUnitalAlgHom.ext\n\ntheorem ext_iff {f g : A →ₙₐ[R] B} : f = g ↔ ∀ x, f x = g x :=\n ⟨by\n rintro rfl x\n rfl, ext⟩\n#align non_unital_alg_hom.ext_iff NonUnitalAlgHom.ext_iff\n\ntheorem congr_fun {f g : A →ₙₐ[R] B} (h : f = g) (x : A) : f x = g x :=\n h ▸ rfl\n#align non_unital_alg_hom.congr_fun NonUnitalAlgHom.congr_fun\n\n@[simp]\ntheorem coe_mk (f : A → B) (h₁ h₂ h₃ h₄) : ⇑(⟨⟨⟨f, h₁⟩, h₂, h₃⟩, h₄⟩ : A →ₙₐ[R] B) = f :=\n rfl\n#align non_unital_alg_hom.coe_mk NonUnitalAlgHom.coe_mk\n\n@[simp]\ntheorem mk_coe (f : A →ₙₐ[R] B) (h₁ h₂ h₃ h₄) : (⟨⟨⟨f, h₁⟩, h₂, h₃⟩, h₄⟩ : A →ₙₐ[R] B) = f := by\n rfl\n#align non_unital_alg_hom.mk_coe NonUnitalAlgHom.mk_coe\n\ninstance : CoeOut (A →ₙₐ[R] B) (A →+[R] B) :=\n ⟨toDistribMulActionHom⟩\n\ninstance : CoeOut (A →ₙₐ[R] B) (A →ₙ* B) :=\n ⟨toMulHom⟩\n\n@[simp]\ntheorem toDistribMulActionHom_eq_coe (f : A →ₙₐ[R] B) : f.toDistribMulActionHom = ↑f :=\n rfl\n#align non_unital_alg_hom.to_distrib_mul_action_hom_eq_coe NonUnitalAlgHom.toDistribMulActionHom_eq_coe\n\n@[simp]\ntheorem toMulHom_eq_coe (f : A →ₙₐ[R] B) : f.toMulHom = ↑f :=\n rfl\n#align non_unital_alg_hom.to_mul_hom_eq_coe NonUnitalAlgHom.toMulHom_eq_coe\n\n@[simp, norm_cast]\ntheorem coe_to_distribMulActionHom (f : A →ₙₐ[R] B) : ⇑(f : A →+[R] B) = f :=\n rfl\n#align non_unital_alg_hom.coe_to_distrib_mul_action_hom NonUnitalAlgHom.coe_to_distribMulActionHom\n\n@[simp, norm_cast]\ntheorem coe_to_mulHom (f : A →ₙₐ[R] B) : ⇑(f : A →ₙ* B) = f :=\n rfl\n#align non_unital_alg_hom.coe_to_mul_hom NonUnitalAlgHom.coe_to_mulHom\n\ntheorem to_distribMulActionHom_injective {f g : A →ₙₐ[R] B}\n (h : (f : A →+[R] B) = (g : A →+[R] B)) : f = g := by\n ext a\n exact DistribMulActionHom.congr_fun h a\n#align non_unital_alg_hom.to_distrib_mul_action_hom_injective NonUnitalAlgHom.to_distribMulActionHom_injective\n\ntheorem to_mulHom_injective {f g : A →ₙₐ[R] B} (h : (f : A →ₙ* B) = (g : A →ₙ* B)) : f = g := by\n ext a\n exact FunLike.congr_fun h a\n#align non_unital_alg_hom.to_mul_hom_injective NonUnitalAlgHom.to_mulHom_injective\n\n@[norm_cast]\ntheorem coe_distribMulActionHom_mk (f : A →ₙₐ[R] B) (h₁ h₂ h₃ h₄) :\n ((⟨⟨⟨f, h₁⟩, h₂, h₃⟩, h₄⟩ : A →ₙₐ[R] B) : A →+[R] B) = ⟨⟨f, h₁⟩, h₂, h₃⟩ := by\n rfl\n#align non_unital_alg_hom.coe_distrib_mul_action_hom_mk NonUnitalAlgHom.coe_distribMulActionHom_mk\n\n@[norm_cast]\ntheorem coe_mulHom_mk (f : A →ₙₐ[R] B) (h₁ h₂ h₃ h���) :\n ((⟨⟨⟨f, h₁⟩, h₂, h₃⟩, h₄⟩ : A →ₙₐ[R] B) : A →ₙ* B) = ⟨f, h₄⟩ := by\n rfl\n#align non_unital_alg_hom.coe_mul_hom_mk NonUnitalAlgHom.coe_mulHom_mk\n\n-- @[simp] -- Porting note: simp can prove this\nprotected theorem map_smul (f : A →ₙₐ[R] B) (c : R) (x : A) : f (c • x) = c • f x :=\n map_smul _ _ _\n#align non_unital_alg_hom.map_smul NonUnitalAlgHom.map_smul\n\n-- @[simp] -- Porting note: simp can prove this\nprotected theorem map_add (f : A →ₙₐ[R] B) (x y : A) : f (x + y) = f x + f y :=\n map_add _ _ _\n#align non_unital_alg_hom.map_add NonUnitalAlgHom.map_add\n\n-- @[simp] -- Porting note: simp can prove this\nprotected theorem map_mul (f : A →ₙₐ[R] B) (x y : A) : f (x * y) = f x * f y :=\n map_mul _ _ _\n#align non_unital_alg_hom.map_mul NonUnitalAlgHom.map_mul\n\n-- @[simp] -- Porting note: simp can prove this\nprotected theorem map_zero (f : A →ₙₐ[R] B) : f 0 = 0 :=\n map_zero _\n#align non_unital_alg_hom.map_zero NonUnitalAlgHom.map_zero\n\n/-- The identity map as a `NonUnitalAlgHom`. -/\nprotected def id (R A : Type*) [Monoid R] [NonUnitalNonAssocSemiring A]\n [DistribMulAction R A] : A →ₙₐ[R] A :=\n { NonUnitalRingHom.id A with\n toFun := id\n map_smul' := fun _ _ => rfl }\n\n@[simp]\ntheorem coe_id : ⇑(NonUnitalAlgHom.id R A) = id :=\n rfl\n\ninstance : Zero (A →ₙₐ[R] B) :=\n ⟨{ (0 : A →+[R] B) with map_mul' := by simp }⟩\n\ninstance : One (A →ₙₐ[R] A) :=\n ⟨NonUnitalAlgHom.id R A⟩\n\n@[simp]\ntheorem coe_zero : ⇑(0 : A →ₙₐ[R] B) = 0 :=\n rfl\n#align non_unital_alg_hom.coe_zero NonUnitalAlgHom.coe_zero\n\n@[simp]\ntheorem coe_one : ((1 : A →ₙₐ[R] A) : A → A) = id :=\n rfl\n#align non_unital_alg_hom.coe_one NonUnitalAlgHom.coe_one\n\ntheorem zero_apply (a : A) : (0 : A →ₙₐ[R] B) a = 0 :=\n rfl\n#align non_unital_alg_hom.zero_apply NonUnitalAlgHom.zero_apply\n\ntheorem one_apply (a : A) : (1 : A →ₙₐ[R] A) a = a :=\n rfl\n#align non_unital_alg_hom.one_apply NonUnitalAlgHom.one_apply\n\ninstance : Inhabited (A →ₙₐ[R] B) :=\n ⟨0⟩\n\n/-- The composition of morphisms is a morphism. -/\ndef comp (f : B →ₙₐ[R] C) (g : A →ₙₐ[R] B) : A →ₙₐ[R] C :=\n { (f : B →ₙ* C).comp (g : A →ₙ* B), (f : B →+[R] C).comp (g : A →+[R] B) with }\n#align non_unital_alg_hom.comp NonUnitalAlgHom.comp\n\n@[simp, norm_cast]\ntheorem coe_comp (f : B →ₙₐ[R] C) (g : A →ₙₐ[R] B) :\n ⇑(f.comp g) = (⇑f) ∘ (⇑g) :=\n rfl\n#align non_unital_alg_hom.coe_comp NonUnitalAlgHom.coe_comp\n\ntheorem comp_apply (f : B →ₙₐ[R] C) (g : A →ₙₐ[R] B) (x : A) : f.comp g x = f (g x) :=\n rfl\n#align non_unital_alg_hom.comp_apply NonUnitalAlgHom.comp_apply\n\n/-- The inverse of a bijective morphism is a morphism. -/\ndef inverse (f : A →ₙₐ[R] B) (g : B → A) (h₁ : Function.LeftInverse g f)\n (h₂ : Function.RightInverse g f) : B →ₙₐ[R] A :=\n { (f : A →ₙ* B).inverse g h₁ h₂, (f : A →+[R] B).inverse g h₁ h₂ with }\n#align non_unital_alg_hom.inverse NonUnitalAlgHom.inverse\n\n@[simp]\ntheorem coe_inverse (f : A →ₙₐ[R] B) (g : B → A) (h₁ : Function.LeftInverse g f)\n (h₂ : Function.RightInverse g f) : (inverse f g h₁ h₂ : B → A) = g :=\n rfl\n#align non_unital_alg_hom.coe_inverse NonUnitalAlgHom.coe_inverse\n\n/-! ### Operations on the product type\n\nNote that much of this is copied from [`LinearAlgebra/Prod`](../../LinearAlgebra/Prod). -/\n\n\nsection Prod\n\nvariable (R A B)\n\n/-- The first projection of a product is a non-unital alg_hom. -/\n@[simps]\ndef fst : A × B →ₙₐ[R] A where\n toFun := Prod.fst\n map_zero' := rfl\n map_add' _ _ := rfl\n map_smul' _ _ := rfl\n map_mul' _ _ := rfl\n#align non_unital_alg_hom.fst NonUnitalAlgHom.fst\n\n/-- The second projection of a product is a non-unital alg_hom. -/\n@[simps]\ndef snd : A × B →ₙₐ[R] B where\n toFun := Prod.snd\n map_zero' := rfl\n map_add' _ _ := rfl\n map_smul' _ _ := rfl\n map_mul' _ _ := rfl\n#align non_unital_alg_hom.snd NonUnitalAlgHom.snd\n\nvariable {R A B}\n\n/-- The prod of two morphisms is a morphism. -/\n@[simps]\ndef prod (f : A →ₙₐ[R] B) (g : A →ₙₐ[R] C) : A →ₙₐ[R] B × C\n where\n toFun := Pi.prod f g\n map_zero' := by simp only [Pi.prod, Prod.zero_eq_mk, map_zero]\n map_add' x y := by simp only [Pi.prod, Prod.mk_add_mk, map_add]\n map_mul' x y := by ","nextTactic":"simp only [Pi.prod, Prod.mk_mul_mk, map_mul]","declUpToTactic":"/-- The prod of two morphisms is a morphism. -/\n@[simps]\ndef prod (f : A →ₙₐ[R] B) (g : A →ₙₐ[R] C) : A →ₙₐ[R] B × C\n where\n toFun := Pi.prod f g\n map_zero' := by simp only [Pi.prod, Prod.zero_eq_mk, map_zero]\n map_add' x y := by simp only [Pi.prod, Prod.mk_add_mk, map_add]\n map_mul' x y := by ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_NonUnitalHom.351_0.9y3TORfxg2P0A5c","decl":"/-- The prod of two morphisms is a morphism. -/\n@[simps]\ndef prod (f : A →ₙₐ[R] B) (g : A →ₙₐ[R] C) : A →ₙₐ[R] B × C\n where\n toFun "} -{"state":"R : Type u\nA : Type v\nB : Type w\nC : Type w₁\ninst✝⁶ : Monoid R\ninst✝⁵ : NonUnitalNonAssocSemiring A\ninst✝⁴ : DistribMulAction R A\ninst✝³ : NonUnitalNonAssocSemiring B\ninst✝² : DistribMulAction R B\ninst✝¹ : NonUnitalNonAssocSemiring C\ninst✝ : DistribMulAction R C\nf : A →ₙₐ[R] B\ng : A →ₙₐ[R] C\n⊢ comp (fst R B C) (prod f g) = f","srcUpToTactic":"/-\nCopyright (c) 2021 Oliver Nash. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Oliver Nash\n-/\nimport Mathlib.Algebra.Algebra.Hom\n\n#align_import algebra.hom.non_unital_alg from \"leanprover-community/mathlib\"@\"bd9851ca476957ea4549eb19b40e7b5ade9428cc\"\n\n/-!\n# Morphisms of non-unital algebras\n\nThis file defines morphisms between two types, each of which carries:\n * an addition,\n * an additive zero,\n * a multiplication,\n * a scalar action.\n\nThe multiplications are not assumed to be associative or unital, or even to be compatible with the\nscalar actions. In a typical application, the operations will satisfy compatibility conditions\nmaking them into algebras (albeit possibly non-associative and/or non-unital) but such conditions\nare not required to make this definition.\n\nThis notion of morphism should be useful for any category of non-unital algebras. The motivating\napplication at the time it was introduced was to be able to state the adjunction property for\nmagma algebras. These are non-unital, non-associative algebras obtained by applying the\ngroup-algebra construction except where we take a type carrying just `Mul` instead of `Group`.\n\nFor a plausible future application, one could take the non-unital algebra of compactly-supported\nfunctions on a non-compact topological space. A proper map between a pair of such spaces\n(contravariantly) induces a morphism between their algebras of compactly-supported functions which\nwill be a `NonUnitalAlgHom`.\n\nTODO: add `NonUnitalAlgEquiv` when needed.\n\n## Main definitions\n\n * `NonUnitalAlgHom`\n * `AlgHom.toNonUnitalAlgHom`\n\n## Tags\n\nnon-unital, algebra, morphism\n-/\n\nset_option autoImplicit true\n\n\nuniverse u v w w₁ w₂ w₃\n\nvariable (R : Type u) (A : Type v) (B : Type w) (C : Type w₁)\n\n/-- A morphism respecting addition, multiplication, and scalar multiplication. When these arise from\nalgebra structures, this is the same as a not-necessarily-unital morphism of algebras. -/\nstructure NonUnitalAlgHom [Monoid R] [NonUnitalNonAssocSemiring A] [DistribMulAction R A]\n [NonUnitalNonAssocSemiring B] [DistribMulAction R B] extends A →+[R] B, A →ₙ* B\n#align non_unital_alg_hom NonUnitalAlgHom\n\n@[inherit_doc NonUnitalAlgHom]\ninfixr:25 \" →ₙₐ \" => NonUnitalAlgHom _\n\n@[inherit_doc]\nnotation:25 A \" →ₙₐ[\" R \"] \" B => NonUnitalAlgHom R A B\n\nattribute [nolint docBlame] NonUnitalAlgHom.toMulHom\n\n/-- `NonUnitalAlgHomClass F R A B` asserts `F` is a type of bundled algebra homomorphisms\nfrom `A` to `B`. -/\nclass NonUnitalAlgHomClass (F : Type*) (R : outParam (Type*)) (A : outParam (Type*))\n (B : outParam (Type*)) [Monoid R] [NonUnitalNonAssocSemiring A] [NonUnitalNonAssocSemiring B]\n [DistribMulAction R A] [DistribMulAction R B] extends DistribMulActionHomClass F R A B,\n MulHomClass F A B\n#align non_unital_alg_hom_class NonUnitalAlgHomClass\n\n-- Porting note: commented out, not dangerous\n-- attribute [nolint dangerousInstance] NonUnitalAlgHomClass.toMulHomClass\n\nnamespace NonUnitalAlgHomClass\n\n-- Porting note: Made following instance non-dangerous through [...] -> [...] replacement\n-- See note [lower instance priority]\ninstance (priority := 100) toNonUnitalRingHomClass {F R A B : Type*}\n [Monoid R] [NonUnitalNonAssocSemiring A] [DistribMulAction R A]\n [NonUnitalNonAssocSemiring B] [DistribMulAction R B]\n [NonUnitalAlgHomClass F R A B] : NonUnitalRingHomClass F A B :=\n { ‹NonUnitalAlgHomClass F R A B› with coe := (⇑) }\n#align non_unital_alg_hom_class.non_unital_alg_hom_class.to_non_unital_ring_hom_class NonUnitalAlgHomClass.toNonUnitalRingHomClass\n\nvariable [Semiring R] [NonUnitalNonAssocSemiring A] [Module R A]\n [NonUnitalNonAssocSemiring B] [Module R B]\n\n-- see Note [lower instance priority]\ninstance (priority := 100) {F : Type*} [NonUnitalAlgHomClass F R A B] : LinearMapClass F R A B :=\n { ‹NonUnitalAlgHomClass F R A B› with map_smulₛₗ := map_smul }\n\n/-- Turn an element of a type `F` satisfying `NonUnitalAlgHomClass F R A B` into an actual\n`NonUnitalAlgHom`. This is declared as the default coercion from `F` to `A →ₙₐ[R] B`. -/\n@[coe]\ndef toNonUnitalAlgHom {F R A B : Type*} [Monoid R] [NonUnitalNonAssocSemiring A]\n [DistribMulAction R A] [NonUnitalNonAssocSemiring B] [DistribMulAction R B]\n [NonUnitalAlgHomClass F R A B] (f : F) : A →ₙₐ[R] B :=\n { (f : A →ₙ+* B) with\n map_smul' := map_smul f }\n\ninstance {F R A B : Type*} [Monoid R] [NonUnitalNonAssocSemiring A] [DistribMulAction R A]\n [NonUnitalNonAssocSemiring B] [DistribMulAction R B] [NonUnitalAlgHomClass F R A B] :\n CoeTC F (A →ₙₐ[R] B) :=\n ⟨toNonUnitalAlgHom⟩\n\nend NonUnitalAlgHomClass\n\nnamespace NonUnitalAlgHom\n\nvariable {R A B C} [Monoid R]\n\nvariable [NonUnitalNonAssocSemiring A] [DistribMulAction R A]\n\nvariable [NonUnitalNonAssocSemiring B] [DistribMulAction R B]\n\nvariable [NonUnitalNonAssocSemiring C] [DistribMulAction R C]\n\n-- Porting note: Replaced with FunLike instance\n-- /-- see Note [function coercion] -/\n-- instance : CoeFun (A →ₙₐ[R] B) fun _ => A → B :=\n-- ⟨toFun⟩\n\ninstance : FunLike (A →ₙₐ[R] B) A fun _ => B where\n coe f := f.toFun\n coe_injective' := by rintro ⟨⟨⟨f, _⟩, _⟩, _⟩ ⟨⟨⟨g, _⟩, _⟩, _⟩ h; congr\n\n@[simp]\ntheorem toFun_eq_coe (f : A →ₙₐ[R] B) : f.toFun = ⇑f :=\n rfl\n#align non_unital_alg_hom.to_fun_eq_coe NonUnitalAlgHom.toFun_eq_coe\n\n/-- See Note [custom simps projection] -/\ndef Simps.apply (f : A →ₙₐ[R] B) : A → B := f\n\ninitialize_simps_projections NonUnitalAlgHom\n (toDistribMulActionHom_toMulActionHom_toFun → apply, -toDistribMulActionHom)\n\n@[simp]\nprotected theorem coe_coe {F : Type*} [NonUnitalAlgHomClass F R A B] (f : F) :\n ⇑(f : A →ₙₐ[R] B) = f :=\n rfl\n#align non_unital_alg_hom.coe_coe NonUnitalAlgHom.coe_coe\n\ntheorem coe_injective : @Function.Injective (A →ₙₐ[R] B) (A → B) (↑) := by\n rintro ⟨⟨⟨f, _⟩, _⟩, _⟩ ⟨⟨⟨g, _⟩, _⟩, _⟩ h; congr\n#align non_unital_alg_hom.coe_injective NonUnitalAlgHom.coe_injective\n\ninstance : NonUnitalAlgHomClass (A →ₙₐ[R] B) R A B\n where\n coe f := f.toFun\n coe_injective' := coe_injective\n map_smul f := f.map_smul'\n map_add f := f.map_add'\n map_zero f := f.map_zero'\n map_mul f := f.map_mul'\n\n@[ext]\ntheorem ext {f g : A →ₙₐ[R] B} (h : ∀ x, f x = g x) : f = g :=\n coe_injective <| funext h\n#align non_unital_alg_hom.ext NonUnitalAlgHom.ext\n\ntheorem ext_iff {f g : A →ₙₐ[R] B} : f = g ↔ ∀ x, f x = g x :=\n ⟨by\n rintro rfl x\n rfl, ext⟩\n#align non_unital_alg_hom.ext_iff NonUnitalAlgHom.ext_iff\n\ntheorem congr_fun {f g : A →ₙₐ[R] B} (h : f = g) (x : A) : f x = g x :=\n h ▸ rfl\n#align non_unital_alg_hom.congr_fun NonUnitalAlgHom.congr_fun\n\n@[simp]\ntheorem coe_mk (f : A → B) (h₁ h₂ h₃ h₄) : ⇑(⟨⟨⟨f, h₁⟩, h₂, h₃⟩, h₄⟩ : A →ₙₐ[R] B) = f :=\n rfl\n#align non_unital_alg_hom.coe_mk NonUnitalAlgHom.coe_mk\n\n@[simp]\ntheorem mk_coe (f : A →ₙₐ[R] B) (h₁ h₂ h₃ h₄) : (⟨⟨⟨f, h₁⟩, h₂, h₃⟩, h₄⟩ : A →ₙₐ[R] B) = f := by\n rfl\n#align non_unital_alg_hom.mk_coe NonUnitalAlgHom.mk_coe\n\ninstance : CoeOut (A →ₙₐ[R] B) (A →+[R] B) :=\n ⟨toDistribMulActionHom⟩\n\ninstance : CoeOut (A →ₙₐ[R] B) (A →ₙ* B) :=\n ⟨toMulHom⟩\n\n@[simp]\ntheorem toDistribMulActionHom_eq_coe (f : A →ₙₐ[R] B) : f.toDistribMulActionHom = ↑f :=\n rfl\n#align non_unital_alg_hom.to_distrib_mul_action_hom_eq_coe NonUnitalAlgHom.toDistribMulActionHom_eq_coe\n\n@[simp]\ntheorem toMulHom_eq_coe (f : A →ₙₐ[R] B) : f.toMulHom = ↑f :=\n rfl\n#align non_unital_alg_hom.to_mul_hom_eq_coe NonUnitalAlgHom.toMulHom_eq_coe\n\n@[simp, norm_cast]\ntheorem coe_to_distribMulActionHom (f : A →ₙₐ[R] B) : ⇑(f : A →+[R] B) = f :=\n rfl\n#align non_unital_alg_hom.coe_to_distrib_mul_action_hom NonUnitalAlgHom.coe_to_distribMulActionHom\n\n@[simp, norm_cast]\ntheorem coe_to_mulHom (f : A →ₙₐ[R] B) : ⇑(f : A →ₙ* B) = f :=\n rfl\n#align non_unital_alg_hom.coe_to_mul_hom NonUnitalAlgHom.coe_to_mulHom\n\ntheorem to_distribMulActionHom_injective {f g : A →ₙₐ[R] B}\n (h : (f : A →+[R] B) = (g : A →+[R] B)) : f = g := by\n ext a\n exact DistribMulActionHom.congr_fun h a\n#align non_unital_alg_hom.to_distrib_mul_action_hom_injective NonUnitalAlgHom.to_distribMulActionHom_injective\n\ntheorem to_mulHom_injective {f g : A →ₙₐ[R] B} (h : (f : A →ₙ* B) = (g : A →ₙ* B)) : f = g := by\n ext a\n exact FunLike.congr_fun h a\n#align non_unital_alg_hom.to_mul_hom_injective NonUnitalAlgHom.to_mulHom_injective\n\n@[norm_cast]\ntheorem coe_distribMulActionHom_mk (f : A →ₙₐ[R] B) (h₁ h₂ h₃ h₄) :\n ((⟨⟨⟨f, h₁⟩, h₂, h₃⟩, h₄⟩ : A →ₙₐ[R] B) : A →+[R] B) = ⟨⟨f, h₁⟩, h₂, h₃⟩ := by\n rfl\n#align non_unital_alg_hom.coe_distrib_mul_action_hom_mk NonUnitalAlgHom.coe_distribMulActionHom_mk\n\n@[norm_cast]\ntheorem coe_mulHom_mk (f : A →ₙₐ[R] B) (h₁ h₂ h₃ h₄) :\n ((⟨⟨⟨f, h₁⟩, h₂, h₃⟩, h₄⟩ : A →ₙₐ[R] B) : A →ₙ* B) = ⟨f, h₄⟩ := by\n rfl\n#align non_unital_alg_hom.coe_mul_hom_mk NonUnitalAlgHom.coe_mulHom_mk\n\n-- @[simp] -- Porting note: simp can prove this\nprotected theorem map_smul (f : A →ₙₐ[R] B) (c : R) (x : A) : f (c • x) = c • f x :=\n map_smul _ _ _\n#align non_unital_alg_hom.map_smul NonUnitalAlgHom.map_smul\n\n-- @[simp] -- Porting note: simp can prove this\nprotected theorem map_add (f : A →ₙₐ[R] B) (x y : A) : f (x + y) = f x + f y :=\n map_add _ _ _\n#align non_unital_alg_hom.map_add NonUnitalAlgHom.map_add\n\n-- @[simp] -- Porting note: simp can prove this\nprotected theorem map_mul (f : A →ₙₐ[R] B) (x y : A) : f (x * y) = f x * f y :=\n map_mul _ _ _\n#align non_unital_alg_hom.map_mul NonUnitalAlgHom.map_mul\n\n-- @[simp] -- Porting note: simp can prove this\nprotected theorem map_zero (f : A →ₙₐ[R] B) : f 0 = 0 :=\n map_zero _\n#align non_unital_alg_hom.map_zero NonUnitalAlgHom.map_zero\n\n/-- The identity map as a `NonUnitalAlgHom`. -/\nprotected def id (R A : Type*) [Monoid R] [NonUnitalNonAssocSemiring A]\n [DistribMulAction R A] : A →ₙₐ[R] A :=\n { NonUnitalRingHom.id A with\n toFun := id\n map_smul' := fun _ _ => rfl }\n\n@[simp]\ntheorem coe_id : ⇑(NonUnitalAlgHom.id R A) = id :=\n rfl\n\ninstance : Zero (A →ₙₐ[R] B) :=\n ⟨{ (0 : A →+[R] B) with map_mul' := by simp }⟩\n\ninstance : One (A →ₙₐ[R] A) :=\n ⟨NonUnitalAlgHom.id R A⟩\n\n@[simp]\ntheorem coe_zero : ⇑(0 : A →ₙₐ[R] B) = 0 :=\n rfl\n#align non_unital_alg_hom.coe_zero NonUnitalAlgHom.coe_zero\n\n@[simp]\ntheorem coe_one : ((1 : A →ₙₐ[R] A) : A → A) = id :=\n rfl\n#align non_unital_alg_hom.coe_one NonUnitalAlgHom.coe_one\n\ntheorem zero_apply (a : A) : (0 : A →ₙₐ[R] B) a = 0 :=\n rfl\n#align non_unital_alg_hom.zero_apply NonUnitalAlgHom.zero_apply\n\ntheorem one_apply (a : A) : (1 : A →ₙₐ[R] A) a = a :=\n rfl\n#align non_unital_alg_hom.one_apply NonUnitalAlgHom.one_apply\n\ninstance : Inhabited (A →ₙₐ[R] B) :=\n ⟨0⟩\n\n/-- The composition of morphisms is a morphism. -/\ndef comp (f : B →ₙₐ[R] C) (g : A →ₙₐ[R] B) : A →ₙₐ[R] C :=\n { (f : B →ₙ* C).comp (g : A →ₙ* B), (f : B →+[R] C).comp (g : A →+[R] B) with }\n#align non_unital_alg_hom.comp NonUnitalAlgHom.comp\n\n@[simp, norm_cast]\ntheorem coe_comp (f : B →ₙₐ[R] C) (g : A →ₙₐ[R] B) :\n ⇑(f.comp g) = (⇑f) ∘ (⇑g) :=\n rfl\n#align non_unital_alg_hom.coe_comp NonUnitalAlgHom.coe_comp\n\ntheorem comp_apply (f : B →ₙₐ[R] C) (g : A →ₙₐ[R] B) (x : A) : f.comp g x = f (g x) :=\n rfl\n#align non_unital_alg_hom.comp_apply NonUnitalAlgHom.comp_apply\n\n/-- The inverse of a bijective morphism is a morphism. -/\ndef inverse (f : A →ₙₐ[R] B) (g : B → A) (h₁ : Function.LeftInverse g f)\n (h₂ : Function.RightInverse g f) : B →ₙₐ[R] A :=\n { (f : A →ₙ* B).inverse g h₁ h₂, (f : A →+[R] B).inverse g h₁ h₂ with }\n#align non_unital_alg_hom.inverse NonUnitalAlgHom.inverse\n\n@[simp]\ntheorem coe_inverse (f : A →ₙₐ[R] B) (g : B → A) (h₁ : Function.LeftInverse g f)\n (h₂ : Function.RightInverse g f) : (inverse f g h₁ h₂ : B → A) = g :=\n rfl\n#align non_unital_alg_hom.coe_inverse NonUnitalAlgHom.coe_inverse\n\n/-! ### Operations on the product type\n\nNote that much of this is copied from [`LinearAlgebra/Prod`](../../LinearAlgebra/Prod). -/\n\n\nsection Prod\n\nvariable (R A B)\n\n/-- The first projection of a product is a non-unital alg_hom. -/\n@[simps]\ndef fst : A × B →ₙₐ[R] A where\n toFun := Prod.fst\n map_zero' := rfl\n map_add' _ _ := rfl\n map_smul' _ _ := rfl\n map_mul' _ _ := rfl\n#align non_unital_alg_hom.fst NonUnitalAlgHom.fst\n\n/-- The second projection of a product is a non-unital alg_hom. -/\n@[simps]\ndef snd : A × B →ₙₐ[R] B where\n toFun := Prod.snd\n map_zero' := rfl\n map_add' _ _ := rfl\n map_smul' _ _ := rfl\n map_mul' _ _ := rfl\n#align non_unital_alg_hom.snd NonUnitalAlgHom.snd\n\nvariable {R A B}\n\n/-- The prod of two morphisms is a morphism. -/\n@[simps]\ndef prod (f : A →ₙₐ[R] B) (g : A →ₙₐ[R] C) : A →ₙₐ[R] B × C\n where\n toFun := Pi.prod f g\n map_zero' := by simp only [Pi.prod, Prod.zero_eq_mk, map_zero]\n map_add' x y := by simp only [Pi.prod, Prod.mk_add_mk, map_add]\n map_mul' x y := by simp only [Pi.prod, Prod.mk_mul_mk, map_mul]\n map_smul' c x := by simp only [Pi.prod, Prod.smul_mk, map_smul, RingHom.id_apply]\n#align non_unital_alg_hom.prod NonUnitalAlgHom.prod\n\ntheorem coe_prod (f : A →ₙₐ[R] B) (g : A →ₙₐ[R] C) : ⇑(f.prod g) = Pi.prod f g :=\n rfl\n#align non_unital_alg_hom.coe_prod NonUnitalAlgHom.coe_prod\n\n@[simp]\ntheorem fst_prod (f : A →ₙₐ[R] B) (g : A →ₙₐ[R] C) : (fst R B C).comp (prod f g) = f := by\n ","nextTactic":"rfl","declUpToTactic":"@[simp]\ntheorem fst_prod (f : A →ₙₐ[R] B) (g : A →ₙₐ[R] C) : (fst R B C).comp (prod f g) = f := by\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_NonUnitalHom.366_0.9y3TORfxg2P0A5c","decl":"@[simp]\ntheorem fst_prod (f : A →ₙₐ[R] B) (g : A →ₙₐ[R] C) : (fst R B C).comp (prod f g) = f "} -{"state":"R : Type u\nA : Type v\nB : Type w\nC : Type w₁\ninst✝⁶ : Monoid R\ninst✝⁵ : NonUnitalNonAssocSemiring A\ninst✝⁴ : DistribMulAction R A\ninst✝³ : NonUnitalNonAssocSemiring B\ninst✝² : DistribMulAction R B\ninst✝¹ : NonUnitalNonAssocSemiring C\ninst✝ : DistribMulAction R C\nf : A →ₙ���[R] B\ng : A →ₙₐ[R] C\n⊢ comp (snd R B C) (prod f g) = g","srcUpToTactic":"/-\nCopyright (c) 2021 Oliver Nash. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Oliver Nash\n-/\nimport Mathlib.Algebra.Algebra.Hom\n\n#align_import algebra.hom.non_unital_alg from \"leanprover-community/mathlib\"@\"bd9851ca476957ea4549eb19b40e7b5ade9428cc\"\n\n/-!\n# Morphisms of non-unital algebras\n\nThis file defines morphisms between two types, each of which carries:\n * an addition,\n * an additive zero,\n * a multiplication,\n * a scalar action.\n\nThe multiplications are not assumed to be associative or unital, or even to be compatible with the\nscalar actions. In a typical application, the operations will satisfy compatibility conditions\nmaking them into algebras (albeit possibly non-associative and/or non-unital) but such conditions\nare not required to make this definition.\n\nThis notion of morphism should be useful for any category of non-unital algebras. The motivating\napplication at the time it was introduced was to be able to state the adjunction property for\nmagma algebras. These are non-unital, non-associative algebras obtained by applying the\ngroup-algebra construction except where we take a type carrying just `Mul` instead of `Group`.\n\nFor a plausible future application, one could take the non-unital algebra of compactly-supported\nfunctions on a non-compact topological space. A proper map between a pair of such spaces\n(contravariantly) induces a morphism between their algebras of compactly-supported functions which\nwill be a `NonUnitalAlgHom`.\n\nTODO: add `NonUnitalAlgEquiv` when needed.\n\n## Main definitions\n\n * `NonUnitalAlgHom`\n * `AlgHom.toNonUnitalAlgHom`\n\n## Tags\n\nnon-unital, algebra, morphism\n-/\n\nset_option autoImplicit true\n\n\nuniverse u v w w₁ w₂ w₃\n\nvariable (R : Type u) (A : Type v) (B : Type w) (C : Type w₁)\n\n/-- A morphism respecting addition, multiplication, and scalar multiplication. When these arise from\nalgebra structures, this is the same as a not-necessarily-unital morphism of algebras. -/\nstructure NonUnitalAlgHom [Monoid R] [NonUnitalNonAssocSemiring A] [DistribMulAction R A]\n [NonUnitalNonAssocSemiring B] [DistribMulAction R B] extends A →+[R] B, A →ₙ* B\n#align non_unital_alg_hom NonUnitalAlgHom\n\n@[inherit_doc NonUnitalAlgHom]\ninfixr:25 \" →ₙₐ \" => NonUnitalAlgHom _\n\n@[inherit_doc]\nnotation:25 A \" →ₙₐ[\" R \"] \" B => NonUnitalAlgHom R A B\n\nattribute [nolint docBlame] NonUnitalAlgHom.toMulHom\n\n/-- `NonUnitalAlgHomClass F R A B` asserts `F` is a type of bundled algebra homomorphisms\nfrom `A` to `B`. -/\nclass NonUnitalAlgHomClass (F : Type*) (R : outParam (Type*)) (A : outParam (Type*))\n (B : outParam (Type*)) [Monoid R] [NonUnitalNonAssocSemiring A] [NonUnitalNonAssocSemiring B]\n [DistribMulAction R A] [DistribMulAction R B] extends DistribMulActionHomClass F R A B,\n MulHomClass F A B\n#align non_unital_alg_hom_class NonUnitalAlgHomClass\n\n-- Porting note: commented out, not dangerous\n-- attribute [nolint dangerousInstance] NonUnitalAlgHomClass.toMulHomClass\n\nnamespace NonUnitalAlgHomClass\n\n-- Porting note: Made following instance non-dangerous through [...] -> [...] replacement\n-- See note [lower instance priority]\ninstance (priority := 100) toNonUnitalRingHomClass {F R A B : Type*}\n [Monoid R] [NonUnitalNonAssocSemiring A] [DistribMulAction R A]\n [NonUnitalNonAssocSemiring B] [DistribMulAction R B]\n [NonUnitalAlgHomClass F R A B] : NonUnitalRingHomClass F A B :=\n { ‹NonUnitalAlgHomClass F R A B› with coe := (⇑) }\n#align non_unital_alg_hom_class.non_unital_alg_hom_class.to_non_unital_ring_hom_class NonUnitalAlgHomClass.toNonUnitalRingHomClass\n\nvariable [Semiring R] [NonUnitalNonAssocSemiring A] [Module R A]\n [NonUnitalNonAssocSemiring B] [Module R B]\n\n-- see Note [lower instance priority]\ninstance (priority := 100) {F : Type*} [NonUnitalAlgHomClass F R A B] : LinearMapClass F R A B :=\n { ‹NonUnitalAlgHomClass F R A B› with map_smulₛₗ := map_smul }\n\n/-- Turn an element of a type `F` satisfying `NonUnitalAlgHomClass F R A B` into an actual\n`NonUnitalAlgHom`. This is declared as the default coercion from `F` to `A →ₙₐ[R] B`. -/\n@[coe]\ndef toNonUnitalAlgHom {F R A B : Type*} [Monoid R] [NonUnitalNonAssocSemiring A]\n [DistribMulAction R A] [NonUnitalNonAssocSemiring B] [DistribMulAction R B]\n [NonUnitalAlgHomClass F R A B] (f : F) : A →ₙₐ[R] B :=\n { (f : A →ₙ+* B) with\n map_smul' := map_smul f }\n\ninstance {F R A B : Type*} [Monoid R] [NonUnitalNonAssocSemiring A] [DistribMulAction R A]\n [NonUnitalNonAssocSemiring B] [DistribMulAction R B] [NonUnitalAlgHomClass F R A B] :\n CoeTC F (A →ₙₐ[R] B) :=\n ⟨toNonUnitalAlgHom⟩\n\nend NonUnitalAlgHomClass\n\nnamespace NonUnitalAlgHom\n\nvariable {R A B C} [Monoid R]\n\nvariable [NonUnitalNonAssocSemiring A] [DistribMulAction R A]\n\nvariable [NonUnitalNonAssocSemiring B] [DistribMulAction R B]\n\nvariable [NonUnitalNonAssocSemiring C] [DistribMulAction R C]\n\n-- Porting note: Replaced with FunLike instance\n-- /-- see Note [function coercion] -/\n-- instance : CoeFun (A →ₙₐ[R] B) fun _ => A → B :=\n-- ⟨toFun⟩\n\ninstance : FunLike (A →ₙₐ[R] B) A fun _ => B where\n coe f := f.toFun\n coe_injective' := by rintro ⟨⟨⟨f, _⟩, _⟩, _⟩ ⟨⟨⟨g, _⟩, _⟩, _⟩ h; congr\n\n@[simp]\ntheorem toFun_eq_coe (f : A →ₙₐ[R] B) : f.toFun = ⇑f :=\n rfl\n#align non_unital_alg_hom.to_fun_eq_coe NonUnitalAlgHom.toFun_eq_coe\n\n/-- See Note [custom simps projection] -/\ndef Simps.apply (f : A →ₙₐ[R] B) : A → B := f\n\ninitialize_simps_projections NonUnitalAlgHom\n (toDistribMulActionHom_toMulActionHom_toFun → apply, -toDistribMulActionHom)\n\n@[simp]\nprotected theorem coe_coe {F : Type*} [NonUnitalAlgHomClass F R A B] (f : F) :\n ⇑(f : A →ₙₐ[R] B) = f :=\n rfl\n#align non_unital_alg_hom.coe_coe NonUnitalAlgHom.coe_coe\n\ntheorem coe_injective : @Function.Injective (A →ₙₐ[R] B) (A → B) (↑) := by\n rintro ⟨⟨⟨f, _⟩, _⟩, _⟩ ⟨⟨⟨g, _⟩, _⟩, _⟩ h; congr\n#align non_unital_alg_hom.coe_injective NonUnitalAlgHom.coe_injective\n\ninstance : NonUnitalAlgHomClass (A →ₙₐ[R] B) R A B\n where\n coe f := f.toFun\n coe_injective' := coe_injective\n map_smul f := f.map_smul'\n map_add f := f.map_add'\n map_zero f := f.map_zero'\n map_mul f := f.map_mul'\n\n@[ext]\ntheorem ext {f g : A →ₙₐ[R] B} (h : ∀ x, f x = g x) : f = g :=\n coe_injective <| funext h\n#align non_unital_alg_hom.ext NonUnitalAlgHom.ext\n\ntheorem ext_iff {f g : A →ₙₐ[R] B} : f = g ↔ ∀ x, f x = g x :=\n ⟨by\n rintro rfl x\n rfl, ext⟩\n#align non_unital_alg_hom.ext_iff NonUnitalAlgHom.ext_iff\n\ntheorem congr_fun {f g : A →ₙₐ[R] B} (h : f = g) (x : A) : f x = g x :=\n h ▸ rfl\n#align non_unital_alg_hom.congr_fun NonUnitalAlgHom.congr_fun\n\n@[simp]\ntheorem coe_mk (f : A → B) (h₁ h₂ h₃ h₄) : ⇑(⟨⟨⟨f, h₁⟩, h₂, h₃⟩, h₄⟩ : A →ₙₐ[R] B) = f :=\n rfl\n#align non_unital_alg_hom.coe_mk NonUnitalAlgHom.coe_mk\n\n@[simp]\ntheorem mk_coe (f : A →ₙₐ[R] B) (h₁ h₂ h₃ h₄) : (⟨⟨⟨f, h₁⟩, h₂, h₃⟩, h₄⟩ : A →ₙₐ[R] B) = f := by\n rfl\n#align non_unital_alg_hom.mk_coe NonUnitalAlgHom.mk_coe\n\ninstance : CoeOut (A →ₙₐ[R] B) (A →+[R] B) :=\n ⟨toDistribMulActionHom⟩\n\ninstance : CoeOut (A →ₙₐ[R] B) (A →ₙ* B) :=\n ⟨toMulHom⟩\n\n@[simp]\ntheorem toDistribMulActionHom_eq_coe (f : A →ₙₐ[R] B) : f.toDistribMulActionHom = ↑f :=\n rfl\n#align non_unital_alg_hom.to_distrib_mul_action_hom_eq_coe NonUnitalAlgHom.toDistribMulActionHom_eq_coe\n\n@[simp]\ntheorem toMulHom_eq_coe (f : A →ₙₐ[R] B) : f.toMulHom = ↑f :=\n rfl\n#align non_unital_alg_hom.to_mul_hom_eq_coe NonUnitalAlgHom.toMulHom_eq_coe\n\n@[simp, norm_cast]\ntheorem coe_to_distribMulActionHom (f : A →ₙₐ[R] B) : ⇑(f : A →+[R] B) = f :=\n rfl\n#align non_unital_alg_hom.coe_to_distrib_mul_action_hom NonUnitalAlgHom.coe_to_distribMulActionHom\n\n@[simp, norm_cast]\ntheorem coe_to_mulHom (f : A →ₙₐ[R] B) : ⇑(f : A →ₙ* B) = f :=\n rfl\n#align non_unital_alg_hom.coe_to_mul_hom NonUnitalAlgHom.coe_to_mulHom\n\ntheorem to_distribMulActionHom_injective {f g : A →ₙₐ[R] B}\n (h : (f : A →+[R] B) = (g : A →+[R] B)) : f = g := by\n ext a\n exact DistribMulActionHom.congr_fun h a\n#align non_unital_alg_hom.to_distrib_mul_action_hom_injective NonUnitalAlgHom.to_distribMulActionHom_injective\n\ntheorem to_mulHom_injective {f g : A →ₙₐ[R] B} (h : (f : A →ₙ* B) = (g : A →ₙ* B)) : f = g := by\n ext a\n exact FunLike.congr_fun h a\n#align non_unital_alg_hom.to_mul_hom_injective NonUnitalAlgHom.to_mulHom_injective\n\n@[norm_cast]\ntheorem coe_distribMulActionHom_mk (f : A →ₙₐ[R] B) (h₁ h₂ h₃ h₄) :\n ((⟨⟨⟨f, h₁⟩, h₂, h₃⟩, h₄⟩ : A →ₙₐ[R] B) : A →+[R] B) = ⟨⟨f, h₁⟩, h₂, h₃⟩ := by\n rfl\n#align non_unital_alg_hom.coe_distrib_mul_action_hom_mk NonUnitalAlgHom.coe_distribMulActionHom_mk\n\n@[norm_cast]\ntheorem coe_mulHom_mk (f : A →ₙₐ[R] B) (h₁ h₂ h₃ h₄) :\n ((⟨⟨⟨f, h₁⟩, h₂, h₃⟩, h₄⟩ : A →ₙₐ[R] B) : A →ₙ* B) = ⟨f, h₄⟩ := by\n rfl\n#align non_unital_alg_hom.coe_mul_hom_mk NonUnitalAlgHom.coe_mulHom_mk\n\n-- @[simp] -- Porting note: simp can prove this\nprotected theorem map_smul (f : A →ₙₐ[R] B) (c : R) (x : A) : f (c • x) = c • f x :=\n map_smul _ _ _\n#align non_unital_alg_hom.map_smul NonUnitalAlgHom.map_smul\n\n-- @[simp] -- Porting note: simp can prove this\nprotected theorem map_add (f : A →ₙₐ[R] B) (x y : A) : f (x + y) = f x + f y :=\n map_add _ _ _\n#align non_unital_alg_hom.map_add NonUnitalAlgHom.map_add\n\n-- @[simp] -- Porting note: simp can prove this\nprotected theorem map_mul (f : A →ₙₐ[R] B) (x y : A) : f (x * y) = f x * f y :=\n map_mul _ _ _\n#align non_unital_alg_hom.map_mul NonUnitalAlgHom.map_mul\n\n-- @[simp] -- Porting note: simp can prove this\nprotected theorem map_zero (f : A →ₙₐ[R] B) : f 0 = 0 :=\n map_zero _\n#align non_unital_alg_hom.map_zero NonUnitalAlgHom.map_zero\n\n/-- The identity map as a `NonUnitalAlgHom`. -/\nprotected def id (R A : Type*) [Monoid R] [NonUnitalNonAssocSemiring A]\n [DistribMulAction R A] : A →ₙₐ[R] A :=\n { NonUnitalRingHom.id A with\n toFun := id\n map_smul' := fun _ _ => rfl }\n\n@[simp]\ntheorem coe_id : ⇑(NonUnitalAlgHom.id R A) = id :=\n rfl\n\ninstance : Zero (A →ₙₐ[R] B) :=\n ⟨{ (0 : A →+[R] B) with map_mul' := by simp }⟩\n\ninstance : One (A →ₙₐ[R] A) :=\n ⟨NonUnitalAlgHom.id R A⟩\n\n@[simp]\ntheorem coe_zero : ⇑(0 : A →ₙₐ[R] B) = 0 :=\n rfl\n#align non_unital_alg_hom.coe_zero NonUnitalAlgHom.coe_zero\n\n@[simp]\ntheorem coe_one : ((1 : A →ₙₐ[R] A) : A → A) = id :=\n rfl\n#align non_unital_alg_hom.coe_one NonUnitalAlgHom.coe_one\n\ntheorem zero_apply (a : A) : (0 : A →ₙₐ[R] B) a = 0 :=\n rfl\n#align non_unital_alg_hom.zero_apply NonUnitalAlgHom.zero_apply\n\ntheorem one_apply (a : A) : (1 : A →ₙₐ[R] A) a = a :=\n rfl\n#align non_unital_alg_hom.one_apply NonUnitalAlgHom.one_apply\n\ninstance : Inhabited (A →ₙₐ[R] B) :=\n ⟨0⟩\n\n/-- The composition of morphisms is a morphism. -/\ndef comp (f : B →ₙₐ[R] C) (g : A →ₙₐ[R] B) : A →ₙₐ[R] C :=\n { (f : B →ₙ* C).comp (g : A →ₙ* B), (f : B →+[R] C).comp (g : A →+[R] B) with }\n#align non_unital_alg_hom.comp NonUnitalAlgHom.comp\n\n@[simp, norm_cast]\ntheorem coe_comp (f : B →ₙₐ[R] C) (g : A →ₙₐ[R] B) :\n ⇑(f.comp g) = (⇑f) ∘ (⇑g) :=\n rfl\n#align non_unital_alg_hom.coe_comp NonUnitalAlgHom.coe_comp\n\ntheorem comp_apply (f : B →ₙₐ[R] C) (g : A →ₙₐ[R] B) (x : A) : f.comp g x = f (g x) :=\n rfl\n#align non_unital_alg_hom.comp_apply NonUnitalAlgHom.comp_apply\n\n/-- The inverse of a bijective morphism is a morphism. -/\ndef inverse (f : A →ₙₐ[R] B) (g : B → A) (h₁ : Function.LeftInverse g f)\n (h₂ : Function.RightInverse g f) : B →ₙₐ[R] A :=\n { (f : A →ₙ* B).inverse g h₁ h₂, (f : A →+[R] B).inverse g h₁ h₂ with }\n#align non_unital_alg_hom.inverse NonUnitalAlgHom.inverse\n\n@[simp]\ntheorem coe_inverse (f : A →ₙₐ[R] B) (g : B → A) (h₁ : Function.LeftInverse g f)\n (h₂ : Function.RightInverse g f) : (inverse f g h₁ h₂ : B → A) = g :=\n rfl\n#align non_unital_alg_hom.coe_inverse NonUnitalAlgHom.coe_inverse\n\n/-! ### Operations on the product type\n\nNote that much of this is copied from [`LinearAlgebra/Prod`](../../LinearAlgebra/Prod). -/\n\n\nsection Prod\n\nvariable (R A B)\n\n/-- The first projection of a product is a non-unital alg_hom. -/\n@[simps]\ndef fst : A × B →ₙₐ[R] A where\n toFun := Prod.fst\n map_zero' := rfl\n map_add' _ _ := rfl\n map_smul' _ _ := rfl\n map_mul' _ _ := rfl\n#align non_unital_alg_hom.fst NonUnitalAlgHom.fst\n\n/-- The second projection of a product is a non-unital alg_hom. -/\n@[simps]\ndef snd : A × B →ₙₐ[R] B where\n toFun := Prod.snd\n map_zero' := rfl\n map_add' _ _ := rfl\n map_smul' _ _ := rfl\n map_mul' _ _ := rfl\n#align non_unital_alg_hom.snd NonUnitalAlgHom.snd\n\nvariable {R A B}\n\n/-- The prod of two morphisms is a morphism. -/\n@[simps]\ndef prod (f : A →ₙₐ[R] B) (g : A →ₙₐ[R] C) : A →ₙₐ[R] B × C\n where\n toFun := Pi.prod f g\n map_zero' := by simp only [Pi.prod, Prod.zero_eq_mk, map_zero]\n map_add' x y := by simp only [Pi.prod, Prod.mk_add_mk, map_add]\n map_mul' x y := by simp only [Pi.prod, Prod.mk_mul_mk, map_mul]\n map_smul' c x := by simp only [Pi.prod, Prod.smul_mk, map_smul, RingHom.id_apply]\n#align non_unital_alg_hom.prod NonUnitalAlgHom.prod\n\ntheorem coe_prod (f : A →ₙₐ[R] B) (g : A →ₙₐ[R] C) : ⇑(f.prod g) = Pi.prod f g :=\n rfl\n#align non_unital_alg_hom.coe_prod NonUnitalAlgHom.coe_prod\n\n@[simp]\ntheorem fst_prod (f : A →ₙₐ[R] B) (g : A →ₙₐ[R] C) : (fst R B C).comp (prod f g) = f := by\n rfl\n#align non_unital_alg_hom.fst_prod NonUnitalAlgHom.fst_prod\n\n@[simp]\ntheorem snd_prod (f : A →ₙₐ[R] B) (g : A →ₙₐ[R] C) : (snd R B C).comp (prod f g) = g := by\n ","nextTactic":"rfl","declUpToTactic":"@[simp]\ntheorem snd_prod (f : A →ₙₐ[R] B) (g : A →ₙₐ[R] C) : (snd R B C).comp (prod f g) = g := by\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_NonUnitalHom.371_0.9y3TORfxg2P0A5c","decl":"@[simp]\ntheorem snd_prod (f : A →ₙₐ[R] B) (g : A →ₙₐ[R] C) : (snd R B C).comp (prod f g) = g "}