diff --git "a/Extracted/Mathlib/TacticPrediction/Mathlib_Algebra_Algebra_Bilinear.jsonl" "b/Extracted/Mathlib/TacticPrediction/Mathlib_Algebra_Algebra_Bilinear.jsonl" deleted file mode 100644--- "a/Extracted/Mathlib/TacticPrediction/Mathlib_Algebra_Algebra_Bilinear.jsonl" +++ /dev/null @@ -1,50 +0,0 @@ -{"state":"R : Type u_1\nA : Type u_2\ninst✝⁴ : CommSemiring R\ninst✝³ : NonUnitalSemiring A\ninst✝² : Module R A\ninst✝¹ : SMulCommClass R A A\ninst✝ : IsScalarTower R A A\nsrc✝ : A →ₗ[R] A →ₗ[R] A := mul R A\n⊢ MulActionHom.toFun\n { toFun := src✝.toFun,\n map_smul' :=\n (_ :\n ∀ (r : R) (x : A), AddHom.toFun src✝.toAddHom (r • x) = (RingHom.id R) r • AddHom.toFun src✝.toAddHom x) }\n 0 =\n 0","srcUpToTactic":"/-\nCopyright (c) 2018 Kenny Lau. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Kenny Lau, Yury Kudryashov\n-/\nimport Mathlib.Algebra.Algebra.Basic\nimport Mathlib.Algebra.Algebra.Equiv\nimport Mathlib.Algebra.Algebra.NonUnitalHom\nimport Mathlib.Algebra.GroupPower.IterateHom\nimport Mathlib.LinearAlgebra.TensorProduct\n\n#align_import algebra.algebra.bilinear from \"leanprover-community/mathlib\"@\"657df4339ae6ceada048c8a2980fb10e393143ec\"\n\n/-!\n# Facts about algebras involving bilinear maps and tensor products\n\nWe move a few basic statements about algebras out of `Algebra.Algebra.Basic`,\nin order to avoid importing `LinearAlgebra.BilinearMap` and\n`LinearAlgebra.TensorProduct` unnecessarily.\n-/\n\nopen TensorProduct Module\n\nnamespace LinearMap\n\nsection NonUnitalNonAssoc\n\nvariable (R A : Type*) [CommSemiring R] [NonUnitalNonAssocSemiring A] [Module R A]\n [SMulCommClass R A A] [IsScalarTower R A A]\n\n/-- The multiplication in a non-unital non-associative algebra is a bilinear map.\n\nA weaker version of this for semirings exists as `AddMonoidHom.mul`. -/\ndef mul : A →ₗ[R] A →ₗ[R] A :=\n LinearMap.mk₂ R (· * ·) add_mul smul_mul_assoc mul_add mul_smul_comm\n#align linear_map.mul LinearMap.mul\n\n/-- The multiplication map on a non-unital algebra, as an `R`-linear map from `A ⊗[R] A` to `A`. -/\nnoncomputable def mul' : A ⊗[R] A →ₗ[R] A :=\n TensorProduct.lift (mul R A)\n#align linear_map.mul' LinearMap.mul'\n\nvariable {A}\n\n/-- The multiplication on the left in a non-unital algebra is a linear map. -/\ndef mulLeft (a : A) : A →ₗ[R] A :=\n mul R A a\n#align linear_map.mul_left LinearMap.mulLeft\n\n/-- The multiplication on the right in an algebra is a linear map. -/\ndef mulRight (a : A) : A →ₗ[R] A :=\n (mul R A).flip a\n#align linear_map.mul_right LinearMap.mulRight\n\n/-- Simultaneous multiplication on the left and right is a linear map. -/\ndef mulLeftRight (ab : A × A) : A →ₗ[R] A :=\n (mulRight R ab.snd).comp (mulLeft R ab.fst)\n#align linear_map.mul_left_right LinearMap.mulLeftRight\n\n@[simp]\ntheorem mulLeft_toAddMonoidHom (a : A) : (mulLeft R a : A →+ A) = AddMonoidHom.mulLeft a :=\n rfl\n#align linear_map.mul_left_to_add_monoid_hom LinearMap.mulLeft_toAddMonoidHom\n\n@[simp]\ntheorem mulRight_toAddMonoidHom (a : A) : (mulRight R a : A →+ A) = AddMonoidHom.mulRight a :=\n rfl\n#align linear_map.mul_right_to_add_monoid_hom LinearMap.mulRight_toAddMonoidHom\n\nvariable {R}\n\n@[simp]\ntheorem mul_apply' (a b : A) : mul R A a b = a * b :=\n rfl\n#align linear_map.mul_apply' LinearMap.mul_apply'\n\n@[simp]\ntheorem mulLeft_apply (a b : A) : mulLeft R a b = a * b :=\n rfl\n#align linear_map.mul_left_apply LinearMap.mulLeft_apply\n\n@[simp]\ntheorem mulRight_apply (a b : A) : mulRight R a b = b * a :=\n rfl\n#align linear_map.mul_right_apply LinearMap.mulRight_apply\n\n@[simp]\ntheorem mulLeftRight_apply (a b x : A) : mulLeftRight R (a, b) x = a * x * b :=\n rfl\n#align linear_map.mul_left_right_apply LinearMap.mulLeftRight_apply\n\n@[simp]\ntheorem mul'_apply {a b : A} : mul' R A (a ⊗ₜ b) = a * b :=\n rfl\n#align linear_map.mul'_apply LinearMap.mul'_apply\n\n@[simp]\ntheorem mulLeft_zero_eq_zero : mulLeft R (0 : A) = 0 :=\n (mul R A).map_zero\n#align linear_map.mul_left_zero_eq_zero LinearMap.mulLeft_zero_eq_zero\n\n@[simp]\ntheorem mulRight_zero_eq_zero : mulRight R (0 : A) = 0 :=\n (mul R A).flip.map_zero\n#align linear_map.mul_right_zero_eq_zero LinearMap.mulRight_zero_eq_zero\n\nend NonUnitalNonAssoc\n\nsection NonUnital\n\nvariable (R A : Type*) [CommSemiring R] [NonUnitalSemiring A] [Module R A] [SMulCommClass R A A]\n [IsScalarTower R A A]\n\n/-- The multiplication in a non-unital algebra is a bilinear map.\n\nA weaker version of this for non-unital non-associative algebras exists as `LinearMap.mul`. -/\ndef _root_.NonUnitalAlgHom.lmul : A →ₙₐ[R] End R A :=\n { mul R A with\n map_mul' := by\n intro a b\n ext c\n exact mul_assoc a b c\n map_zero' := by\n ","nextTactic":"ext a","declUpToTactic":"/-- The multiplication in a non-unital algebra is a bilinear map.\n\nA weaker version of this for non-unital non-associative algebras exists as `LinearMap.mul`. -/\ndef _root_.NonUnitalAlgHom.lmul : A →ₙₐ[R] End R A :=\n { mul R A with\n map_mul' := by\n intro a b\n ext c\n exact mul_assoc a b c\n map_zero' := by\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Bilinear.114_0.cGBk1UxpwLhzgI8","decl":"/-- The multiplication in a non-unital algebra is a bilinear map.\n\nA weaker version of this for non-unital non-associative algebras exists as `LinearMap.mul`. -/\ndef _root_.NonUnitalAlgHom.lmul : A →ₙₐ[R] End R A "} -{"state":"case h\nR : Type u_1\nA : Type u_2\ninst✝⁴ : CommSemiring R\ninst✝³ : NonUnitalSemiring A\ninst✝² : Module R A\ninst✝¹ : SMulCommClass R A A\ninst✝ : IsScalarTower R A A\nsrc✝ : A →ₗ[R] A →ₗ[R] A := mul R A\na : A\n⊢ (MulActionHom.toFun\n { toFun := src✝.toFun,\n map_smul' :=\n (_ :\n ∀ (r : R) (x : A), AddHom.toFun src✝.toAddHom (r • x) = (RingHom.id R) r • AddHom.toFun src✝.toAddHom x) }\n 0)\n a =\n 0 a","srcUpToTactic":"/-\nCopyright (c) 2018 Kenny Lau. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Kenny Lau, Yury Kudryashov\n-/\nimport Mathlib.Algebra.Algebra.Basic\nimport Mathlib.Algebra.Algebra.Equiv\nimport Mathlib.Algebra.Algebra.NonUnitalHom\nimport Mathlib.Algebra.GroupPower.IterateHom\nimport Mathlib.LinearAlgebra.TensorProduct\n\n#align_import algebra.algebra.bilinear from \"leanprover-community/mathlib\"@\"657df4339ae6ceada048c8a2980fb10e393143ec\"\n\n/-!\n# Facts about algebras involving bilinear maps and tensor products\n\nWe move a few basic statements about algebras out of `Algebra.Algebra.Basic`,\nin order to avoid importing `LinearAlgebra.BilinearMap` and\n`LinearAlgebra.TensorProduct` unnecessarily.\n-/\n\nopen TensorProduct Module\n\nnamespace LinearMap\n\nsection NonUnitalNonAssoc\n\nvariable (R A : Type*) [CommSemiring R] [NonUnitalNonAssocSemiring A] [Module R A]\n [SMulCommClass R A A] [IsScalarTower R A A]\n\n/-- The multiplication in a non-unital non-associative algebra is a bilinear map.\n\nA weaker version of this for semirings exists as `AddMonoidHom.mul`. -/\ndef mul : A →ₗ[R] A →ₗ[R] A :=\n LinearMap.mk₂ R (· * ·) add_mul smul_mul_assoc mul_add mul_smul_comm\n#align linear_map.mul LinearMap.mul\n\n/-- The multiplication map on a non-unital algebra, as an `R`-linear map from `A ⊗[R] A` to `A`. -/\nnoncomputable def mul' : A ⊗[R] A →ₗ[R] A :=\n TensorProduct.lift (mul R A)\n#align linear_map.mul' LinearMap.mul'\n\nvariable {A}\n\n/-- The multiplication on the left in a non-unital algebra is a linear map. -/\ndef mulLeft (a : A) : A →ₗ[R] A :=\n mul R A a\n#align linear_map.mul_left LinearMap.mulLeft\n\n/-- The multiplication on the right in an algebra is a linear map. -/\ndef mulRight (a : A) : A →ₗ[R] A :=\n (mul R A).flip a\n#align linear_map.mul_right LinearMap.mulRight\n\n/-- Simultaneous multiplication on the left and right is a linear map. -/\ndef mulLeftRight (ab : A × A) : A →ₗ[R] A :=\n (mulRight R ab.snd).comp (mulLeft R ab.fst)\n#align linear_map.mul_left_right LinearMap.mulLeftRight\n\n@[simp]\ntheorem mulLeft_toAddMonoidHom (a : A) : (mulLeft R a : A →+ A) = AddMonoidHom.mulLeft a :=\n rfl\n#align linear_map.mul_left_to_add_monoid_hom LinearMap.mulLeft_toAddMonoidHom\n\n@[simp]\ntheorem mulRight_toAddMonoidHom (a : A) : (mulRight R a : A →+ A) = AddMonoidHom.mulRight a :=\n rfl\n#align linear_map.mul_right_to_add_monoid_hom LinearMap.mulRight_toAddMonoidHom\n\nvariable {R}\n\n@[simp]\ntheorem mul_apply' (a b : A) : mul R A a b = a * b :=\n rfl\n#align linear_map.mul_apply' LinearMap.mul_apply'\n\n@[simp]\ntheorem mulLeft_apply (a b : A) : mulLeft R a b = a * b :=\n rfl\n#align linear_map.mul_left_apply LinearMap.mulLeft_apply\n\n@[simp]\ntheorem mulRight_apply (a b : A) : mulRight R a b = b * a :=\n rfl\n#align linear_map.mul_right_apply LinearMap.mulRight_apply\n\n@[simp]\ntheorem mulLeftRight_apply (a b x : A) : mulLeftRight R (a, b) x = a * x * b :=\n rfl\n#align linear_map.mul_left_right_apply LinearMap.mulLeftRight_apply\n\n@[simp]\ntheorem mul'_apply {a b : A} : mul' R A (a ⊗ₜ b) = a * b :=\n rfl\n#align linear_map.mul'_apply LinearMap.mul'_apply\n\n@[simp]\ntheorem mulLeft_zero_eq_zero : mulLeft R (0 : A) = 0 :=\n (mul R A).map_zero\n#align linear_map.mul_left_zero_eq_zero LinearMap.mulLeft_zero_eq_zero\n\n@[simp]\ntheorem mulRight_zero_eq_zero : mulRight R (0 : A) = 0 :=\n (mul R A).flip.map_zero\n#align linear_map.mul_right_zero_eq_zero LinearMap.mulRight_zero_eq_zero\n\nend NonUnitalNonAssoc\n\nsection NonUnital\n\nvariable (R A : Type*) [CommSemiring R] [NonUnitalSemiring A] [Module R A] [SMulCommClass R A A]\n [IsScalarTower R A A]\n\n/-- The multiplication in a non-unital algebra is a bilinear map.\n\nA weaker version of this for non-unital non-associative algebras exists as `LinearMap.mul`. -/\ndef _root_.NonUnitalAlgHom.lmul : A →ₙₐ[R] End R A :=\n { mul R A with\n map_mul' := by\n intro a b\n ext c\n exact mul_assoc a b c\n map_zero' := by\n ext a\n ","nextTactic":"exact zero_mul a","declUpToTactic":"/-- The multiplication in a non-unital algebra is a bilinear map.\n\nA weaker version of this for non-unital non-associative algebras exists as `LinearMap.mul`. -/\ndef _root_.NonUnitalAlgHom.lmul : A →ₙₐ[R] End R A :=\n { mul R A with\n map_mul' := by\n intro a b\n ext c\n exact mul_assoc a b c\n map_zero' := by\n ext a\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Bilinear.114_0.cGBk1UxpwLhzgI8","decl":"/-- The multiplication in a non-unital algebra is a bilinear map.\n\nA weaker version of this for non-unital non-associative algebras exists as `LinearMap.mul`. -/\ndef _root_.NonUnitalAlgHom.lmul : A →ₙₐ[R] End R A "} -{"state":"R : Type u_1\nA : Type u_2\ninst✝⁴ : CommSemiring R\ninst✝³ : NonUnitalSemiring A\ninst✝² : Module R A\ninst✝¹ : SMulCommClass R A A\ninst✝ : IsScalarTower R A A\nsrc✝ : A →ₗ[R] A →ₗ[R] A := mul R A\n⊢ ∀ (x y : A),\n MulActionHom.toFun\n {\n toMulActionHom :=\n { toFun := src✝.toFun,\n map_smul' :=\n (_ :\n ∀ (r : R) (x : A),\n AddHom.toFun src✝.toAddHom (r • x) = (RingHom.id R) r • AddHom.toFun src✝.toAddHom x) },\n map_zero' :=\n (_ :\n MulActionHom.toFun\n { toFun := src✝.toFun,\n map_smul' :=\n (_ :\n ∀ (r : R) (x : A),\n AddHom.toFun src✝.toAddHom (r • x) = (RingHom.id R) r • AddHom.toFun src✝.toAddHom x) }\n 0 =\n 0),\n map_add' :=\n (_ :\n ∀ (x y : A),\n AddHom.toFun src✝.toAddHom (x + y) =\n AddHom.toFun src✝.toAddHom x + AddHom.toFun src✝.toAddHom y) }.toMulActionHom\n (x * y) =\n MulActionHom.toFun\n {\n toMulActionHom :=\n { toFun := src✝.toFun,\n map_smul' :=\n (_ :\n ∀ (r : R) (x : A),\n AddHom.toFun src✝.toAddHom (r • x) = (RingHom.id R) r • AddHom.toFun src✝.toAddHom x) },\n map_zero' :=\n (_ :\n MulActionHom.toFun\n { toFun := src✝.toFun,\n map_smul' :=\n (_ :\n ∀ (r : R) (x : A),\n AddHom.toFun src✝.toAddHom (r • x) = (RingHom.id R) r • AddHom.toFun src✝.toAddHom x) }\n 0 =\n 0),\n map_add' :=\n (_ :\n ∀ (x y : A),\n AddHom.toFun src✝.toAddHom (x + y) =\n AddHom.toFun src✝.toAddHom x + AddHom.toFun src✝.toAddHom y) }.toMulActionHom\n x *\n MulActionHom.toFun\n {\n toMulActionHom :=\n { toFun := src✝.toFun,\n map_smul' :=\n (_ :\n ∀ (r : R) (x : A),\n AddHom.toFun src✝.toAddHom (r • x) = (RingHom.id R) r • AddHom.toFun src✝.toAddHom x) },\n map_zero' :=\n (_ :\n MulActionHom.toFun\n { toFun := src✝.toFun,\n map_smul' :=\n (_ :\n ∀ (r : R) (x : A),\n AddHom.toFun src✝.toAddHom (r • x) = (RingHom.id R) r • AddHom.toFun src✝.toAddHom x) }\n 0 =\n 0),\n map_add' :=\n (_ :\n ∀ (x y : A),\n AddHom.toFun src✝.toAddHom (x + y) =\n AddHom.toFun src✝.toAddHom x + AddHom.toFun src✝.toAddHom y) }.toMulActionHom\n y","srcUpToTactic":"/-\nCopyright (c) 2018 Kenny Lau. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Kenny Lau, Yury Kudryashov\n-/\nimport Mathlib.Algebra.Algebra.Basic\nimport Mathlib.Algebra.Algebra.Equiv\nimport Mathlib.Algebra.Algebra.NonUnitalHom\nimport Mathlib.Algebra.GroupPower.IterateHom\nimport Mathlib.LinearAlgebra.TensorProduct\n\n#align_import algebra.algebra.bilinear from \"leanprover-community/mathlib\"@\"657df4339ae6ceada048c8a2980fb10e393143ec\"\n\n/-!\n# Facts about algebras involving bilinear maps and tensor products\n\nWe move a few basic statements about algebras out of `Algebra.Algebra.Basic`,\nin order to avoid importing `LinearAlgebra.BilinearMap` and\n`LinearAlgebra.TensorProduct` unnecessarily.\n-/\n\nopen TensorProduct Module\n\nnamespace LinearMap\n\nsection NonUnitalNonAssoc\n\nvariable (R A : Type*) [CommSemiring R] [NonUnitalNonAssocSemiring A] [Module R A]\n [SMulCommClass R A A] [IsScalarTower R A A]\n\n/-- The multiplication in a non-unital non-associative algebra is a bilinear map.\n\nA weaker version of this for semirings exists as `AddMonoidHom.mul`. -/\ndef mul : A →ₗ[R] A →ₗ[R] A :=\n LinearMap.mk₂ R (· * ·) add_mul smul_mul_assoc mul_add mul_smul_comm\n#align linear_map.mul LinearMap.mul\n\n/-- The multiplication map on a non-unital algebra, as an `R`-linear map from `A ⊗[R] A` to `A`. -/\nnoncomputable def mul' : A ⊗[R] A →ₗ[R] A :=\n TensorProduct.lift (mul R A)\n#align linear_map.mul' LinearMap.mul'\n\nvariable {A}\n\n/-- The multiplication on the left in a non-unital algebra is a linear map. -/\ndef mulLeft (a : A) : A →ₗ[R] A :=\n mul R A a\n#align linear_map.mul_left LinearMap.mulLeft\n\n/-- The multiplication on the right in an algebra is a linear map. -/\ndef mulRight (a : A) : A →ₗ[R] A :=\n (mul R A).flip a\n#align linear_map.mul_right LinearMap.mulRight\n\n/-- Simultaneous multiplication on the left and right is a linear map. -/\ndef mulLeftRight (ab : A × A) : A →ₗ[R] A :=\n (mulRight R ab.snd).comp (mulLeft R ab.fst)\n#align linear_map.mul_left_right LinearMap.mulLeftRight\n\n@[simp]\ntheorem mulLeft_toAddMonoidHom (a : A) : (mulLeft R a : A →+ A) = AddMonoidHom.mulLeft a :=\n rfl\n#align linear_map.mul_left_to_add_monoid_hom LinearMap.mulLeft_toAddMonoidHom\n\n@[simp]\ntheorem mulRight_toAddMonoidHom (a : A) : (mulRight R a : A →+ A) = AddMonoidHom.mulRight a :=\n rfl\n#align linear_map.mul_right_to_add_monoid_hom LinearMap.mulRight_toAddMonoidHom\n\nvariable {R}\n\n@[simp]\ntheorem mul_apply' (a b : A) : mul R A a b = a * b :=\n rfl\n#align linear_map.mul_apply' LinearMap.mul_apply'\n\n@[simp]\ntheorem mulLeft_apply (a b : A) : mulLeft R a b = a * b :=\n rfl\n#align linear_map.mul_left_apply LinearMap.mulLeft_apply\n\n@[simp]\ntheorem mulRight_apply (a b : A) : mulRight R a b = b * a :=\n rfl\n#align linear_map.mul_right_apply LinearMap.mulRight_apply\n\n@[simp]\ntheorem mulLeftRight_apply (a b x : A) : mulLeftRight R (a, b) x = a * x * b :=\n rfl\n#align linear_map.mul_left_right_apply LinearMap.mulLeftRight_apply\n\n@[simp]\ntheorem mul'_apply {a b : A} : mul' R A (a ⊗ₜ b) = a * b :=\n rfl\n#align linear_map.mul'_apply LinearMap.mul'_apply\n\n@[simp]\ntheorem mulLeft_zero_eq_zero : mulLeft R (0 : A) = 0 :=\n (mul R A).map_zero\n#align linear_map.mul_left_zero_eq_zero LinearMap.mulLeft_zero_eq_zero\n\n@[simp]\ntheorem mulRight_zero_eq_zero : mulRight R (0 : A) = 0 :=\n (mul R A).flip.map_zero\n#align linear_map.mul_right_zero_eq_zero LinearMap.mulRight_zero_eq_zero\n\nend NonUnitalNonAssoc\n\nsection NonUnital\n\nvariable (R A : Type*) [CommSemiring R] [NonUnitalSemiring A] [Module R A] [SMulCommClass R A A]\n [IsScalarTower R A A]\n\n/-- The multiplication in a non-unital algebra is a bilinear map.\n\nA weaker version of this for non-unital non-associative algebras exists as `LinearMap.mul`. -/\ndef _root_.NonUnitalAlgHom.lmul : A →ₙₐ[R] End R A :=\n { mul R A with\n map_mul' := by\n ","nextTactic":"intro a b","declUpToTactic":"/-- The multiplication in a non-unital algebra is a bilinear map.\n\nA weaker version of this for non-unital non-associative algebras exists as `LinearMap.mul`. -/\ndef _root_.NonUnitalAlgHom.lmul : A →ₙₐ[R] End R A :=\n { mul R A with\n map_mul' := by\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Bilinear.114_0.cGBk1UxpwLhzgI8","decl":"/-- The multiplication in a non-unital algebra is a bilinear map.\n\nA weaker version of this for non-unital non-associative algebras exists as `LinearMap.mul`. -/\ndef _root_.NonUnitalAlgHom.lmul : A →ₙₐ[R] End R A "} -{"state":"R : Type u_1\nA : Type u_2\ninst✝⁴ : CommSemiring R\ninst✝³ : NonUnitalSemiring A\ninst✝² : Module R A\ninst✝¹ : SMulCommClass R A A\ninst✝ : IsScalarTower R A A\nsrc✝ : A →ₗ[R] A →ₗ[R] A := mul R A\na b : A\n⊢ MulActionHom.toFun\n {\n toMulActionHom :=\n { toFun := src✝.toFun,\n map_smul' :=\n (_ :\n ∀ (r : R) (x : A),\n AddHom.toFun src✝.toAddHom (r • x) = (RingHom.id R) r • AddHom.toFun src✝.toAddHom x) },\n map_zero' :=\n (_ :\n MulActionHom.toFun\n { toFun := src✝.toFun,\n map_smul' :=\n (_ :\n ∀ (r : R) (x : A),\n AddHom.toFun src✝.toAddHom (r • x) = (RingHom.id R) r • AddHom.toFun src✝.toAddHom x) }\n 0 =\n 0),\n map_add' :=\n (_ :\n ∀ (x y : A),\n AddHom.toFun src✝.toAddHom (x + y) =\n AddHom.toFun src✝.toAddHom x + AddHom.toFun src✝.toAddHom y) }.toMulActionHom\n (a * b) =\n MulActionHom.toFun\n {\n toMulActionHom :=\n { toFun := src✝.toFun,\n map_smul' :=\n (_ :\n ∀ (r : R) (x : A),\n AddHom.toFun src✝.toAddHom (r • x) = (RingHom.id R) r • AddHom.toFun src✝.toAddHom x) },\n map_zero' :=\n (_ :\n MulActionHom.toFun\n { toFun := src✝.toFun,\n map_smul' :=\n (_ :\n ∀ (r : R) (x : A),\n AddHom.toFun src✝.toAddHom (r • x) = (RingHom.id R) r • AddHom.toFun src✝.toAddHom x) }\n 0 =\n 0),\n map_add' :=\n (_ :\n ∀ (x y : A),\n AddHom.toFun src✝.toAddHom (x + y) =\n AddHom.toFun src✝.toAddHom x + AddHom.toFun src✝.toAddHom y) }.toMulActionHom\n a *\n MulActionHom.toFun\n {\n toMulActionHom :=\n { toFun := src✝.toFun,\n map_smul' :=\n (_ :\n ∀ (r : R) (x : A),\n AddHom.toFun src✝.toAddHom (r • x) = (RingHom.id R) r • AddHom.toFun src✝.toAddHom x) },\n map_zero' :=\n (_ :\n MulActionHom.toFun\n { toFun := src✝.toFun,\n map_smul' :=\n (_ :\n ∀ (r : R) (x : A),\n AddHom.toFun src✝.toAddHom (r • x) = (RingHom.id R) r • AddHom.toFun src✝.toAddHom x) }\n 0 =\n 0),\n map_add' :=\n (_ :\n ∀ (x y : A),\n AddHom.toFun src✝.toAddHom (x + y) =\n AddHom.toFun src✝.toAddHom x + AddHom.toFun src✝.toAddHom y) }.toMulActionHom\n b","srcUpToTactic":"/-\nCopyright (c) 2018 Kenny Lau. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Kenny Lau, Yury Kudryashov\n-/\nimport Mathlib.Algebra.Algebra.Basic\nimport Mathlib.Algebra.Algebra.Equiv\nimport Mathlib.Algebra.Algebra.NonUnitalHom\nimport Mathlib.Algebra.GroupPower.IterateHom\nimport Mathlib.LinearAlgebra.TensorProduct\n\n#align_import algebra.algebra.bilinear from \"leanprover-community/mathlib\"@\"657df4339ae6ceada048c8a2980fb10e393143ec\"\n\n/-!\n# Facts about algebras involving bilinear maps and tensor products\n\nWe move a few basic statements about algebras out of `Algebra.Algebra.Basic`,\nin order to avoid importing `LinearAlgebra.BilinearMap` and\n`LinearAlgebra.TensorProduct` unnecessarily.\n-/\n\nopen TensorProduct Module\n\nnamespace LinearMap\n\nsection NonUnitalNonAssoc\n\nvariable (R A : Type*) [CommSemiring R] [NonUnitalNonAssocSemiring A] [Module R A]\n [SMulCommClass R A A] [IsScalarTower R A A]\n\n/-- The multiplication in a non-unital non-associative algebra is a bilinear map.\n\nA weaker version of this for semirings exists as `AddMonoidHom.mul`. -/\ndef mul : A →ₗ[R] A →ₗ[R] A :=\n LinearMap.mk₂ R (· * ·) add_mul smul_mul_assoc mul_add mul_smul_comm\n#align linear_map.mul LinearMap.mul\n\n/-- The multiplication map on a non-unital algebra, as an `R`-linear map from `A ⊗[R] A` to `A`. -/\nnoncomputable def mul' : A ⊗[R] A →ₗ[R] A :=\n TensorProduct.lift (mul R A)\n#align linear_map.mul' LinearMap.mul'\n\nvariable {A}\n\n/-- The multiplication on the left in a non-unital algebra is a linear map. -/\ndef mulLeft (a : A) : A →ₗ[R] A :=\n mul R A a\n#align linear_map.mul_left LinearMap.mulLeft\n\n/-- The multiplication on the right in an algebra is a linear map. -/\ndef mulRight (a : A) : A →ₗ[R] A :=\n (mul R A).flip a\n#align linear_map.mul_right LinearMap.mulRight\n\n/-- Simultaneous multiplication on the left and right is a linear map. -/\ndef mulLeftRight (ab : A × A) : A →ₗ[R] A :=\n (mulRight R ab.snd).comp (mulLeft R ab.fst)\n#align linear_map.mul_left_right LinearMap.mulLeftRight\n\n@[simp]\ntheorem mulLeft_toAddMonoidHom (a : A) : (mulLeft R a : A →+ A) = AddMonoidHom.mulLeft a :=\n rfl\n#align linear_map.mul_left_to_add_monoid_hom LinearMap.mulLeft_toAddMonoidHom\n\n@[simp]\ntheorem mulRight_toAddMonoidHom (a : A) : (mulRight R a : A →+ A) = AddMonoidHom.mulRight a :=\n rfl\n#align linear_map.mul_right_to_add_monoid_hom LinearMap.mulRight_toAddMonoidHom\n\nvariable {R}\n\n@[simp]\ntheorem mul_apply' (a b : A) : mul R A a b = a * b :=\n rfl\n#align linear_map.mul_apply' LinearMap.mul_apply'\n\n@[simp]\ntheorem mulLeft_apply (a b : A) : mulLeft R a b = a * b :=\n rfl\n#align linear_map.mul_left_apply LinearMap.mulLeft_apply\n\n@[simp]\ntheorem mulRight_apply (a b : A) : mulRight R a b = b * a :=\n rfl\n#align linear_map.mul_right_apply LinearMap.mulRight_apply\n\n@[simp]\ntheorem mulLeftRight_apply (a b x : A) : mulLeftRight R (a, b) x = a * x * b :=\n rfl\n#align linear_map.mul_left_right_apply LinearMap.mulLeftRight_apply\n\n@[simp]\ntheorem mul'_apply {a b : A} : mul' R A (a ⊗ₜ b) = a * b :=\n rfl\n#align linear_map.mul'_apply LinearMap.mul'_apply\n\n@[simp]\ntheorem mulLeft_zero_eq_zero : mulLeft R (0 : A) = 0 :=\n (mul R A).map_zero\n#align linear_map.mul_left_zero_eq_zero LinearMap.mulLeft_zero_eq_zero\n\n@[simp]\ntheorem mulRight_zero_eq_zero : mulRight R (0 : A) = 0 :=\n (mul R A).flip.map_zero\n#align linear_map.mul_right_zero_eq_zero LinearMap.mulRight_zero_eq_zero\n\nend NonUnitalNonAssoc\n\nsection NonUnital\n\nvariable (R A : Type*) [CommSemiring R] [NonUnitalSemiring A] [Module R A] [SMulCommClass R A A]\n [IsScalarTower R A A]\n\n/-- The multiplication in a non-unital algebra is a bilinear map.\n\nA weaker version of this for non-unital non-associative algebras exists as `LinearMap.mul`. -/\ndef _root_.NonUnitalAlgHom.lmul : A →ₙₐ[R] End R A :=\n { mul R A with\n map_mul' := by\n intro a b\n ","nextTactic":"ext c","declUpToTactic":"/-- The multiplication in a non-unital algebra is a bilinear map.\n\nA weaker version of this for non-unital non-associative algebras exists as `LinearMap.mul`. -/\ndef _root_.NonUnitalAlgHom.lmul : A →ₙₐ[R] End R A :=\n { mul R A with\n map_mul' := by\n intro a b\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Bilinear.114_0.cGBk1UxpwLhzgI8","decl":"/-- The multiplication in a non-unital algebra is a bilinear map.\n\nA weaker version of this for non-unital non-associative algebras exists as `LinearMap.mul`. -/\ndef _root_.NonUnitalAlgHom.lmul : A →ₙₐ[R] End R A "} -{"state":"case h\nR : Type u_1\nA : Type u_2\ninst✝⁴ : CommSemiring R\ninst✝³ : NonUnitalSemiring A\ninst✝² : Module R A\ninst✝¹ : SMulCommClass R A A\ninst✝ : IsScalarTower R A A\nsrc✝ : A →ₗ[R] A →ₗ[R] A := mul R A\na b c : A\n⊢ (MulActionHom.toFun\n {\n toMulActionHom :=\n { toFun := src✝.toFun,\n map_smul' :=\n (_ :\n ∀ (r : R) (x : A),\n AddHom.toFun src✝.toAddHom (r • x) = (RingHom.id R) r • AddHom.toFun src✝.toAddHom x) },\n map_zero' :=\n (_ :\n MulActionHom.toFun\n { toFun := src✝.toFun,\n map_smul' :=\n (_ :\n ∀ (r : R) (x : A),\n AddHom.toFun src✝.toAddHom (r • x) = (RingHom.id R) r • AddHom.toFun src✝.toAddHom x) }\n 0 =\n 0),\n map_add' :=\n (_ :\n ∀ (x y : A),\n AddHom.toFun src✝.toAddHom (x + y) =\n AddHom.toFun src✝.toAddHom x + AddHom.toFun src✝.toAddHom y) }.toMulActionHom\n (a * b))\n c =\n (MulActionHom.toFun\n {\n toMulActionHom :=\n { toFun := src✝.toFun,\n map_smul' :=\n (_ :\n ∀ (r : R) (x : A),\n AddHom.toFun src✝.toAddHom (r • x) = (RingHom.id R) r • AddHom.toFun src✝.toAddHom x) },\n map_zero' :=\n (_ :\n MulActionHom.toFun\n { toFun := src✝.toFun,\n map_smul' :=\n (_ :\n ∀ (r : R) (x : A),\n AddHom.toFun src✝.toAddHom (r • x) = (RingHom.id R) r • AddHom.toFun src✝.toAddHom x) }\n 0 =\n 0),\n map_add' :=\n (_ :\n ∀ (x y : A),\n AddHom.toFun src✝.toAddHom (x + y) =\n AddHom.toFun src✝.toAddHom x + AddHom.toFun src✝.toAddHom y) }.toMulActionHom\n a *\n MulActionHom.toFun\n {\n toMulActionHom :=\n { toFun := src✝.toFun,\n map_smul' :=\n (_ :\n ∀ (r : R) (x : A),\n AddHom.toFun src✝.toAddHom (r • x) = (RingHom.id R) r • AddHom.toFun src✝.toAddHom x) },\n map_zero' :=\n (_ :\n MulActionHom.toFun\n { toFun := src✝.toFun,\n map_smul' :=\n (_ :\n ∀ (r : R) (x : A),\n AddHom.toFun src✝.toAddHom (r • x) = (RingHom.id R) r • AddHom.toFun src✝.toAddHom x) }\n 0 =\n 0),\n map_add' :=\n (_ :\n ∀ (x y : A),\n AddHom.toFun src✝.toAddHom (x + y) =\n AddHom.toFun src✝.toAddHom x + AddHom.toFun src✝.toAddHom y) }.toMulActionHom\n b)\n c","srcUpToTactic":"/-\nCopyright (c) 2018 Kenny Lau. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Kenny Lau, Yury Kudryashov\n-/\nimport Mathlib.Algebra.Algebra.Basic\nimport Mathlib.Algebra.Algebra.Equiv\nimport Mathlib.Algebra.Algebra.NonUnitalHom\nimport Mathlib.Algebra.GroupPower.IterateHom\nimport Mathlib.LinearAlgebra.TensorProduct\n\n#align_import algebra.algebra.bilinear from \"leanprover-community/mathlib\"@\"657df4339ae6ceada048c8a2980fb10e393143ec\"\n\n/-!\n# Facts about algebras involving bilinear maps and tensor products\n\nWe move a few basic statements about algebras out of `Algebra.Algebra.Basic`,\nin order to avoid importing `LinearAlgebra.BilinearMap` and\n`LinearAlgebra.TensorProduct` unnecessarily.\n-/\n\nopen TensorProduct Module\n\nnamespace LinearMap\n\nsection NonUnitalNonAssoc\n\nvariable (R A : Type*) [CommSemiring R] [NonUnitalNonAssocSemiring A] [Module R A]\n [SMulCommClass R A A] [IsScalarTower R A A]\n\n/-- The multiplication in a non-unital non-associative algebra is a bilinear map.\n\nA weaker version of this for semirings exists as `AddMonoidHom.mul`. -/\ndef mul : A →ₗ[R] A →ₗ[R] A :=\n LinearMap.mk₂ R (· * ·) add_mul smul_mul_assoc mul_add mul_smul_comm\n#align linear_map.mul LinearMap.mul\n\n/-- The multiplication map on a non-unital algebra, as an `R`-linear map from `A ⊗[R] A` to `A`. -/\nnoncomputable def mul' : A ⊗[R] A →ₗ[R] A :=\n TensorProduct.lift (mul R A)\n#align linear_map.mul' LinearMap.mul'\n\nvariable {A}\n\n/-- The multiplication on the left in a non-unital algebra is a linear map. -/\ndef mulLeft (a : A) : A →ₗ[R] A :=\n mul R A a\n#align linear_map.mul_left LinearMap.mulLeft\n\n/-- The multiplication on the right in an algebra is a linear map. -/\ndef mulRight (a : A) : A →ₗ[R] A :=\n (mul R A).flip a\n#align linear_map.mul_right LinearMap.mulRight\n\n/-- Simultaneous multiplication on the left and right is a linear map. -/\ndef mulLeftRight (ab : A × A) : A →ₗ[R] A :=\n (mulRight R ab.snd).comp (mulLeft R ab.fst)\n#align linear_map.mul_left_right LinearMap.mulLeftRight\n\n@[simp]\ntheorem mulLeft_toAddMonoidHom (a : A) : (mulLeft R a : A →+ A) = AddMonoidHom.mulLeft a :=\n rfl\n#align linear_map.mul_left_to_add_monoid_hom LinearMap.mulLeft_toAddMonoidHom\n\n@[simp]\ntheorem mulRight_toAddMonoidHom (a : A) : (mulRight R a : A →+ A) = AddMonoidHom.mulRight a :=\n rfl\n#align linear_map.mul_right_to_add_monoid_hom LinearMap.mulRight_toAddMonoidHom\n\nvariable {R}\n\n@[simp]\ntheorem mul_apply' (a b : A) : mul R A a b = a * b :=\n rfl\n#align linear_map.mul_apply' LinearMap.mul_apply'\n\n@[simp]\ntheorem mulLeft_apply (a b : A) : mulLeft R a b = a * b :=\n rfl\n#align linear_map.mul_left_apply LinearMap.mulLeft_apply\n\n@[simp]\ntheorem mulRight_apply (a b : A) : mulRight R a b = b * a :=\n rfl\n#align linear_map.mul_right_apply LinearMap.mulRight_apply\n\n@[simp]\ntheorem mulLeftRight_apply (a b x : A) : mulLeftRight R (a, b) x = a * x * b :=\n rfl\n#align linear_map.mul_left_right_apply LinearMap.mulLeftRight_apply\n\n@[simp]\ntheorem mul'_apply {a b : A} : mul' R A (a ⊗ₜ b) = a * b :=\n rfl\n#align linear_map.mul'_apply LinearMap.mul'_apply\n\n@[simp]\ntheorem mulLeft_zero_eq_zero : mulLeft R (0 : A) = 0 :=\n (mul R A).map_zero\n#align linear_map.mul_left_zero_eq_zero LinearMap.mulLeft_zero_eq_zero\n\n@[simp]\ntheorem mulRight_zero_eq_zero : mulRight R (0 : A) = 0 :=\n (mul R A).flip.map_zero\n#align linear_map.mul_right_zero_eq_zero LinearMap.mulRight_zero_eq_zero\n\nend NonUnitalNonAssoc\n\nsection NonUnital\n\nvariable (R A : Type*) [CommSemiring R] [NonUnitalSemiring A] [Module R A] [SMulCommClass R A A]\n [IsScalarTower R A A]\n\n/-- The multiplication in a non-unital algebra is a bilinear map.\n\nA weaker version of this for non-unital non-associative algebras exists as `LinearMap.mul`. -/\ndef _root_.NonUnitalAlgHom.lmul : A →ₙₐ[R] End R A :=\n { mul R A with\n map_mul' := by\n intro a b\n ext c\n ","nextTactic":"exact mul_assoc a b c","declUpToTactic":"/-- The multiplication in a non-unital algebra is a bilinear map.\n\nA weaker version of this for non-unital non-associative algebras exists as `LinearMap.mul`. -/\ndef _root_.NonUnitalAlgHom.lmul : A →ₙₐ[R] End R A :=\n { mul R A with\n map_mul' := by\n intro a b\n ext c\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Bilinear.114_0.cGBk1UxpwLhzgI8","decl":"/-- The multiplication in a non-unital algebra is a bilinear map.\n\nA weaker version of this for non-unital non-associative algebras exists as `LinearMap.mul`. -/\ndef _root_.NonUnitalAlgHom.lmul : A →ₙₐ[R] End R A "} -{"state":"R : Type u_1\nA : Type u_2\ninst✝⁴ : CommSemiring R\ninst✝³ : NonUnitalSemiring A\ninst✝² : Module R A\ninst✝¹ : SMulCommClass R A A\ninst✝ : IsScalarTower R A A\na b : A\n⊢ Commute (mulLeft R a) (mulRight R b)","srcUpToTactic":"/-\nCopyright (c) 2018 Kenny Lau. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Kenny Lau, Yury Kudryashov\n-/\nimport Mathlib.Algebra.Algebra.Basic\nimport Mathlib.Algebra.Algebra.Equiv\nimport Mathlib.Algebra.Algebra.NonUnitalHom\nimport Mathlib.Algebra.GroupPower.IterateHom\nimport Mathlib.LinearAlgebra.TensorProduct\n\n#align_import algebra.algebra.bilinear from \"leanprover-community/mathlib\"@\"657df4339ae6ceada048c8a2980fb10e393143ec\"\n\n/-!\n# Facts about algebras involving bilinear maps and tensor products\n\nWe move a few basic statements about algebras out of `Algebra.Algebra.Basic`,\nin order to avoid importing `LinearAlgebra.BilinearMap` and\n`LinearAlgebra.TensorProduct` unnecessarily.\n-/\n\nopen TensorProduct Module\n\nnamespace LinearMap\n\nsection NonUnitalNonAssoc\n\nvariable (R A : Type*) [CommSemiring R] [NonUnitalNonAssocSemiring A] [Module R A]\n [SMulCommClass R A A] [IsScalarTower R A A]\n\n/-- The multiplication in a non-unital non-associative algebra is a bilinear map.\n\nA weaker version of this for semirings exists as `AddMonoidHom.mul`. -/\ndef mul : A →ₗ[R] A →ₗ[R] A :=\n LinearMap.mk₂ R (· * ·) add_mul smul_mul_assoc mul_add mul_smul_comm\n#align linear_map.mul LinearMap.mul\n\n/-- The multiplication map on a non-unital algebra, as an `R`-linear map from `A ⊗[R] A` to `A`. -/\nnoncomputable def mul' : A ⊗[R] A →ₗ[R] A :=\n TensorProduct.lift (mul R A)\n#align linear_map.mul' LinearMap.mul'\n\nvariable {A}\n\n/-- The multiplication on the left in a non-unital algebra is a linear map. -/\ndef mulLeft (a : A) : A →ₗ[R] A :=\n mul R A a\n#align linear_map.mul_left LinearMap.mulLeft\n\n/-- The multiplication on the right in an algebra is a linear map. -/\ndef mulRight (a : A) : A →ₗ[R] A :=\n (mul R A).flip a\n#align linear_map.mul_right LinearMap.mulRight\n\n/-- Simultaneous multiplication on the left and right is a linear map. -/\ndef mulLeftRight (ab : A × A) : A →ₗ[R] A :=\n (mulRight R ab.snd).comp (mulLeft R ab.fst)\n#align linear_map.mul_left_right LinearMap.mulLeftRight\n\n@[simp]\ntheorem mulLeft_toAddMonoidHom (a : A) : (mulLeft R a : A →+ A) = AddMonoidHom.mulLeft a :=\n rfl\n#align linear_map.mul_left_to_add_monoid_hom LinearMap.mulLeft_toAddMonoidHom\n\n@[simp]\ntheorem mulRight_toAddMonoidHom (a : A) : (mulRight R a : A →+ A) = AddMonoidHom.mulRight a :=\n rfl\n#align linear_map.mul_right_to_add_monoid_hom LinearMap.mulRight_toAddMonoidHom\n\nvariable {R}\n\n@[simp]\ntheorem mul_apply' (a b : A) : mul R A a b = a * b :=\n rfl\n#align linear_map.mul_apply' LinearMap.mul_apply'\n\n@[simp]\ntheorem mulLeft_apply (a b : A) : mulLeft R a b = a * b :=\n rfl\n#align linear_map.mul_left_apply LinearMap.mulLeft_apply\n\n@[simp]\ntheorem mulRight_apply (a b : A) : mulRight R a b = b * a :=\n rfl\n#align linear_map.mul_right_apply LinearMap.mulRight_apply\n\n@[simp]\ntheorem mulLeftRight_apply (a b x : A) : mulLeftRight R (a, b) x = a * x * b :=\n rfl\n#align linear_map.mul_left_right_apply LinearMap.mulLeftRight_apply\n\n@[simp]\ntheorem mul'_apply {a b : A} : mul' R A (a ⊗ₜ b) = a * b :=\n rfl\n#align linear_map.mul'_apply LinearMap.mul'_apply\n\n@[simp]\ntheorem mulLeft_zero_eq_zero : mulLeft R (0 : A) = 0 :=\n (mul R A).map_zero\n#align linear_map.mul_left_zero_eq_zero LinearMap.mulLeft_zero_eq_zero\n\n@[simp]\ntheorem mulRight_zero_eq_zero : mulRight R (0 : A) = 0 :=\n (mul R A).flip.map_zero\n#align linear_map.mul_right_zero_eq_zero LinearMap.mulRight_zero_eq_zero\n\nend NonUnitalNonAssoc\n\nsection NonUnital\n\nvariable (R A : Type*) [CommSemiring R] [NonUnitalSemiring A] [Module R A] [SMulCommClass R A A]\n [IsScalarTower R A A]\n\n/-- The multiplication in a non-unital algebra is a bilinear map.\n\nA weaker version of this for non-unital non-associative algebras exists as `LinearMap.mul`. -/\ndef _root_.NonUnitalAlgHom.lmul : A →ₙₐ[R] End R A :=\n { mul R A with\n map_mul' := by\n intro a b\n ext c\n exact mul_assoc a b c\n map_zero' := by\n ext a\n exact zero_mul a }\n#align non_unital_alg_hom.lmul NonUnitalAlgHom.lmul\n\nvariable {R A}\n\n@[simp]\ntheorem _root_.NonUnitalAlgHom.coe_lmul_eq_mul : ⇑(NonUnitalAlgHom.lmul R A) = mul R A :=\n rfl\n#align non_unital_alg_hom.coe_lmul_eq_mul NonUnitalAlgHom.coe_lmul_eq_mul\n\ntheorem commute_mulLeft_right (a b : A) : Commute (mulLeft R a) (mulRight R b) := by\n ","nextTactic":"ext c","declUpToTactic":"theorem commute_mulLeft_right (a b : A) : Commute (mulLeft R a) (mulRight R b) := by\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Bilinear.135_0.cGBk1UxpwLhzgI8","decl":"theorem commute_mulLeft_right (a b : A) : Commute (mulLeft R a) (mulRight R b) "} -{"state":"case h\nR : Type u_1\nA : Type u_2\ninst✝⁴ : CommSemiring R\ninst✝³ : NonUnitalSemiring A\ninst✝² : Module R A\ninst✝¹ : SMulCommClass R A A\ninst✝ : IsScalarTower R A A\na b c : A\n⊢ (mulLeft R a * mulRight R b) c = (mulRight R b * mulLeft R a) c","srcUpToTactic":"/-\nCopyright (c) 2018 Kenny Lau. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Kenny Lau, Yury Kudryashov\n-/\nimport Mathlib.Algebra.Algebra.Basic\nimport Mathlib.Algebra.Algebra.Equiv\nimport Mathlib.Algebra.Algebra.NonUnitalHom\nimport Mathlib.Algebra.GroupPower.IterateHom\nimport Mathlib.LinearAlgebra.TensorProduct\n\n#align_import algebra.algebra.bilinear from \"leanprover-community/mathlib\"@\"657df4339ae6ceada048c8a2980fb10e393143ec\"\n\n/-!\n# Facts about algebras involving bilinear maps and tensor products\n\nWe move a few basic statements about algebras out of `Algebra.Algebra.Basic`,\nin order to avoid importing `LinearAlgebra.BilinearMap` and\n`LinearAlgebra.TensorProduct` unnecessarily.\n-/\n\nopen TensorProduct Module\n\nnamespace LinearMap\n\nsection NonUnitalNonAssoc\n\nvariable (R A : Type*) [CommSemiring R] [NonUnitalNonAssocSemiring A] [Module R A]\n [SMulCommClass R A A] [IsScalarTower R A A]\n\n/-- The multiplication in a non-unital non-associative algebra is a bilinear map.\n\nA weaker version of this for semirings exists as `AddMonoidHom.mul`. -/\ndef mul : A →ₗ[R] A →ₗ[R] A :=\n LinearMap.mk₂ R (· * ·) add_mul smul_mul_assoc mul_add mul_smul_comm\n#align linear_map.mul LinearMap.mul\n\n/-- The multiplication map on a non-unital algebra, as an `R`-linear map from `A ⊗[R] A` to `A`. -/\nnoncomputable def mul' : A ⊗[R] A →ₗ[R] A :=\n TensorProduct.lift (mul R A)\n#align linear_map.mul' LinearMap.mul'\n\nvariable {A}\n\n/-- The multiplication on the left in a non-unital algebra is a linear map. -/\ndef mulLeft (a : A) : A →ₗ[R] A :=\n mul R A a\n#align linear_map.mul_left LinearMap.mulLeft\n\n/-- The multiplication on the right in an algebra is a linear map. -/\ndef mulRight (a : A) : A →ₗ[R] A :=\n (mul R A).flip a\n#align linear_map.mul_right LinearMap.mulRight\n\n/-- Simultaneous multiplication on the left and right is a linear map. -/\ndef mulLeftRight (ab : A × A) : A →ₗ[R] A :=\n (mulRight R ab.snd).comp (mulLeft R ab.fst)\n#align linear_map.mul_left_right LinearMap.mulLeftRight\n\n@[simp]\ntheorem mulLeft_toAddMonoidHom (a : A) : (mulLeft R a : A →+ A) = AddMonoidHom.mulLeft a :=\n rfl\n#align linear_map.mul_left_to_add_monoid_hom LinearMap.mulLeft_toAddMonoidHom\n\n@[simp]\ntheorem mulRight_toAddMonoidHom (a : A) : (mulRight R a : A →+ A) = AddMonoidHom.mulRight a :=\n rfl\n#align linear_map.mul_right_to_add_monoid_hom LinearMap.mulRight_toAddMonoidHom\n\nvariable {R}\n\n@[simp]\ntheorem mul_apply' (a b : A) : mul R A a b = a * b :=\n rfl\n#align linear_map.mul_apply' LinearMap.mul_apply'\n\n@[simp]\ntheorem mulLeft_apply (a b : A) : mulLeft R a b = a * b :=\n rfl\n#align linear_map.mul_left_apply LinearMap.mulLeft_apply\n\n@[simp]\ntheorem mulRight_apply (a b : A) : mulRight R a b = b * a :=\n rfl\n#align linear_map.mul_right_apply LinearMap.mulRight_apply\n\n@[simp]\ntheorem mulLeftRight_apply (a b x : A) : mulLeftRight R (a, b) x = a * x * b :=\n rfl\n#align linear_map.mul_left_right_apply LinearMap.mulLeftRight_apply\n\n@[simp]\ntheorem mul'_apply {a b : A} : mul' R A (a ⊗ₜ b) = a * b :=\n rfl\n#align linear_map.mul'_apply LinearMap.mul'_apply\n\n@[simp]\ntheorem mulLeft_zero_eq_zero : mulLeft R (0 : A) = 0 :=\n (mul R A).map_zero\n#align linear_map.mul_left_zero_eq_zero LinearMap.mulLeft_zero_eq_zero\n\n@[simp]\ntheorem mulRight_zero_eq_zero : mulRight R (0 : A) = 0 :=\n (mul R A).flip.map_zero\n#align linear_map.mul_right_zero_eq_zero LinearMap.mulRight_zero_eq_zero\n\nend NonUnitalNonAssoc\n\nsection NonUnital\n\nvariable (R A : Type*) [CommSemiring R] [NonUnitalSemiring A] [Module R A] [SMulCommClass R A A]\n [IsScalarTower R A A]\n\n/-- The multiplication in a non-unital algebra is a bilinear map.\n\nA weaker version of this for non-unital non-associative algebras exists as `LinearMap.mul`. -/\ndef _root_.NonUnitalAlgHom.lmul : A →ₙₐ[R] End R A :=\n { mul R A with\n map_mul' := by\n intro a b\n ext c\n exact mul_assoc a b c\n map_zero' := by\n ext a\n exact zero_mul a }\n#align non_unital_alg_hom.lmul NonUnitalAlgHom.lmul\n\nvariable {R A}\n\n@[simp]\ntheorem _root_.NonUnitalAlgHom.coe_lmul_eq_mul : ⇑(NonUnitalAlgHom.lmul R A) = mul R A :=\n rfl\n#align non_unital_alg_hom.coe_lmul_eq_mul NonUnitalAlgHom.coe_lmul_eq_mul\n\ntheorem commute_mulLeft_right (a b : A) : Commute (mulLeft R a) (mulRight R b) := by\n ext c\n ","nextTactic":"exact (mul_assoc a c b).symm","declUpToTactic":"theorem commute_mulLeft_right (a b : A) : Commute (mulLeft R a) (mulRight R b) := by\n ext c\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Bilinear.135_0.cGBk1UxpwLhzgI8","decl":"theorem commute_mulLeft_right (a b : A) : Commute (mulLeft R a) (mulRight R b) "} -{"state":"R : Type u_1\nA : Type u_2\ninst✝⁴ : CommSemiring R\ninst✝³ : NonUnitalSemiring A\ninst✝² : Module R A\ninst✝¹ : SMulCommClass R A A\ninst✝ : IsScalarTower R A A\na b : A\n⊢ mulLeft R (a * b) = mulLeft R a ∘ₗ mulLeft R b","srcUpToTactic":"/-\nCopyright (c) 2018 Kenny Lau. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Kenny Lau, Yury Kudryashov\n-/\nimport Mathlib.Algebra.Algebra.Basic\nimport Mathlib.Algebra.Algebra.Equiv\nimport Mathlib.Algebra.Algebra.NonUnitalHom\nimport Mathlib.Algebra.GroupPower.IterateHom\nimport Mathlib.LinearAlgebra.TensorProduct\n\n#align_import algebra.algebra.bilinear from \"leanprover-community/mathlib\"@\"657df4339ae6ceada048c8a2980fb10e393143ec\"\n\n/-!\n# Facts about algebras involving bilinear maps and tensor products\n\nWe move a few basic statements about algebras out of `Algebra.Algebra.Basic`,\nin order to avoid importing `LinearAlgebra.BilinearMap` and\n`LinearAlgebra.TensorProduct` unnecessarily.\n-/\n\nopen TensorProduct Module\n\nnamespace LinearMap\n\nsection NonUnitalNonAssoc\n\nvariable (R A : Type*) [CommSemiring R] [NonUnitalNonAssocSemiring A] [Module R A]\n [SMulCommClass R A A] [IsScalarTower R A A]\n\n/-- The multiplication in a non-unital non-associative algebra is a bilinear map.\n\nA weaker version of this for semirings exists as `AddMonoidHom.mul`. -/\ndef mul : A →ₗ[R] A →ₗ[R] A :=\n LinearMap.mk₂ R (· * ·) add_mul smul_mul_assoc mul_add mul_smul_comm\n#align linear_map.mul LinearMap.mul\n\n/-- The multiplication map on a non-unital algebra, as an `R`-linear map from `A ⊗[R] A` to `A`. -/\nnoncomputable def mul' : A ⊗[R] A →ₗ[R] A :=\n TensorProduct.lift (mul R A)\n#align linear_map.mul' LinearMap.mul'\n\nvariable {A}\n\n/-- The multiplication on the left in a non-unital algebra is a linear map. -/\ndef mulLeft (a : A) : A →ₗ[R] A :=\n mul R A a\n#align linear_map.mul_left LinearMap.mulLeft\n\n/-- The multiplication on the right in an algebra is a linear map. -/\ndef mulRight (a : A) : A →ₗ[R] A :=\n (mul R A).flip a\n#align linear_map.mul_right LinearMap.mulRight\n\n/-- Simultaneous multiplication on the left and right is a linear map. -/\ndef mulLeftRight (ab : A × A) : A →ₗ[R] A :=\n (mulRight R ab.snd).comp (mulLeft R ab.fst)\n#align linear_map.mul_left_right LinearMap.mulLeftRight\n\n@[simp]\ntheorem mulLeft_toAddMonoidHom (a : A) : (mulLeft R a : A →+ A) = AddMonoidHom.mulLeft a :=\n rfl\n#align linear_map.mul_left_to_add_monoid_hom LinearMap.mulLeft_toAddMonoidHom\n\n@[simp]\ntheorem mulRight_toAddMonoidHom (a : A) : (mulRight R a : A →+ A) = AddMonoidHom.mulRight a :=\n rfl\n#align linear_map.mul_right_to_add_monoid_hom LinearMap.mulRight_toAddMonoidHom\n\nvariable {R}\n\n@[simp]\ntheorem mul_apply' (a b : A) : mul R A a b = a * b :=\n rfl\n#align linear_map.mul_apply' LinearMap.mul_apply'\n\n@[simp]\ntheorem mulLeft_apply (a b : A) : mulLeft R a b = a * b :=\n rfl\n#align linear_map.mul_left_apply LinearMap.mulLeft_apply\n\n@[simp]\ntheorem mulRight_apply (a b : A) : mulRight R a b = b * a :=\n rfl\n#align linear_map.mul_right_apply LinearMap.mulRight_apply\n\n@[simp]\ntheorem mulLeftRight_apply (a b x : A) : mulLeftRight R (a, b) x = a * x * b :=\n rfl\n#align linear_map.mul_left_right_apply LinearMap.mulLeftRight_apply\n\n@[simp]\ntheorem mul'_apply {a b : A} : mul' R A (a ⊗ₜ b) = a * b :=\n rfl\n#align linear_map.mul'_apply LinearMap.mul'_apply\n\n@[simp]\ntheorem mulLeft_zero_eq_zero : mulLeft R (0 : A) = 0 :=\n (mul R A).map_zero\n#align linear_map.mul_left_zero_eq_zero LinearMap.mulLeft_zero_eq_zero\n\n@[simp]\ntheorem mulRight_zero_eq_zero : mulRight R (0 : A) = 0 :=\n (mul R A).flip.map_zero\n#align linear_map.mul_right_zero_eq_zero LinearMap.mulRight_zero_eq_zero\n\nend NonUnitalNonAssoc\n\nsection NonUnital\n\nvariable (R A : Type*) [CommSemiring R] [NonUnitalSemiring A] [Module R A] [SMulCommClass R A A]\n [IsScalarTower R A A]\n\n/-- The multiplication in a non-unital algebra is a bilinear map.\n\nA weaker version of this for non-unital non-associative algebras exists as `LinearMap.mul`. -/\ndef _root_.NonUnitalAlgHom.lmul : A →ₙₐ[R] End R A :=\n { mul R A with\n map_mul' := by\n intro a b\n ext c\n exact mul_assoc a b c\n map_zero' := by\n ext a\n exact zero_mul a }\n#align non_unital_alg_hom.lmul NonUnitalAlgHom.lmul\n\nvariable {R A}\n\n@[simp]\ntheorem _root_.NonUnitalAlgHom.coe_lmul_eq_mul : ⇑(NonUnitalAlgHom.lmul R A) = mul R A :=\n rfl\n#align non_unital_alg_hom.coe_lmul_eq_mul NonUnitalAlgHom.coe_lmul_eq_mul\n\ntheorem commute_mulLeft_right (a b : A) : Commute (mulLeft R a) (mulRight R b) := by\n ext c\n exact (mul_assoc a c b).symm\n#align linear_map.commute_mul_left_right LinearMap.commute_mulLeft_right\n\n@[simp]\ntheorem mulLeft_mul (a b : A) : mulLeft R (a * b) = (mulLeft R a).comp (mulLeft R b) := by\n ","nextTactic":"ext","declUpToTactic":"@[simp]\ntheorem mulLeft_mul (a b : A) : mulLeft R (a * b) = (mulLeft R a).comp (mulLeft R b) := by\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Bilinear.140_0.cGBk1UxpwLhzgI8","decl":"@[simp]\ntheorem mulLeft_mul (a b : A) : mulLeft R (a * b) = (mulLeft R a).comp (mulLeft R b) "} -{"state":"case h\nR : Type u_1\nA : Type u_2\ninst✝⁴ : CommSemiring R\ninst✝³ : NonUnitalSemiring A\ninst✝² : Module R A\ninst✝¹ : SMulCommClass R A A\ninst✝ : IsScalarTower R A A\na b x✝ : A\n⊢ (mulLeft R (a * b)) x✝ = (mulLeft R a ∘ₗ mulLeft R b) x✝","srcUpToTactic":"/-\nCopyright (c) 2018 Kenny Lau. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Kenny Lau, Yury Kudryashov\n-/\nimport Mathlib.Algebra.Algebra.Basic\nimport Mathlib.Algebra.Algebra.Equiv\nimport Mathlib.Algebra.Algebra.NonUnitalHom\nimport Mathlib.Algebra.GroupPower.IterateHom\nimport Mathlib.LinearAlgebra.TensorProduct\n\n#align_import algebra.algebra.bilinear from \"leanprover-community/mathlib\"@\"657df4339ae6ceada048c8a2980fb10e393143ec\"\n\n/-!\n# Facts about algebras involving bilinear maps and tensor products\n\nWe move a few basic statements about algebras out of `Algebra.Algebra.Basic`,\nin order to avoid importing `LinearAlgebra.BilinearMap` and\n`LinearAlgebra.TensorProduct` unnecessarily.\n-/\n\nopen TensorProduct Module\n\nnamespace LinearMap\n\nsection NonUnitalNonAssoc\n\nvariable (R A : Type*) [CommSemiring R] [NonUnitalNonAssocSemiring A] [Module R A]\n [SMulCommClass R A A] [IsScalarTower R A A]\n\n/-- The multiplication in a non-unital non-associative algebra is a bilinear map.\n\nA weaker version of this for semirings exists as `AddMonoidHom.mul`. -/\ndef mul : A →ₗ[R] A →ₗ[R] A :=\n LinearMap.mk₂ R (· * ·) add_mul smul_mul_assoc mul_add mul_smul_comm\n#align linear_map.mul LinearMap.mul\n\n/-- The multiplication map on a non-unital algebra, as an `R`-linear map from `A ⊗[R] A` to `A`. -/\nnoncomputable def mul' : A ⊗[R] A →ₗ[R] A :=\n TensorProduct.lift (mul R A)\n#align linear_map.mul' LinearMap.mul'\n\nvariable {A}\n\n/-- The multiplication on the left in a non-unital algebra is a linear map. -/\ndef mulLeft (a : A) : A →ₗ[R] A :=\n mul R A a\n#align linear_map.mul_left LinearMap.mulLeft\n\n/-- The multiplication on the right in an algebra is a linear map. -/\ndef mulRight (a : A) : A →ₗ[R] A :=\n (mul R A).flip a\n#align linear_map.mul_right LinearMap.mulRight\n\n/-- Simultaneous multiplication on the left and right is a linear map. -/\ndef mulLeftRight (ab : A × A) : A →ₗ[R] A :=\n (mulRight R ab.snd).comp (mulLeft R ab.fst)\n#align linear_map.mul_left_right LinearMap.mulLeftRight\n\n@[simp]\ntheorem mulLeft_toAddMonoidHom (a : A) : (mulLeft R a : A →+ A) = AddMonoidHom.mulLeft a :=\n rfl\n#align linear_map.mul_left_to_add_monoid_hom LinearMap.mulLeft_toAddMonoidHom\n\n@[simp]\ntheorem mulRight_toAddMonoidHom (a : A) : (mulRight R a : A →+ A) = AddMonoidHom.mulRight a :=\n rfl\n#align linear_map.mul_right_to_add_monoid_hom LinearMap.mulRight_toAddMonoidHom\n\nvariable {R}\n\n@[simp]\ntheorem mul_apply' (a b : A) : mul R A a b = a * b :=\n rfl\n#align linear_map.mul_apply' LinearMap.mul_apply'\n\n@[simp]\ntheorem mulLeft_apply (a b : A) : mulLeft R a b = a * b :=\n rfl\n#align linear_map.mul_left_apply LinearMap.mulLeft_apply\n\n@[simp]\ntheorem mulRight_apply (a b : A) : mulRight R a b = b * a :=\n rfl\n#align linear_map.mul_right_apply LinearMap.mulRight_apply\n\n@[simp]\ntheorem mulLeftRight_apply (a b x : A) : mulLeftRight R (a, b) x = a * x * b :=\n rfl\n#align linear_map.mul_left_right_apply LinearMap.mulLeftRight_apply\n\n@[simp]\ntheorem mul'_apply {a b : A} : mul' R A (a ⊗ₜ b) = a * b :=\n rfl\n#align linear_map.mul'_apply LinearMap.mul'_apply\n\n@[simp]\ntheorem mulLeft_zero_eq_zero : mulLeft R (0 : A) = 0 :=\n (mul R A).map_zero\n#align linear_map.mul_left_zero_eq_zero LinearMap.mulLeft_zero_eq_zero\n\n@[simp]\ntheorem mulRight_zero_eq_zero : mulRight R (0 : A) = 0 :=\n (mul R A).flip.map_zero\n#align linear_map.mul_right_zero_eq_zero LinearMap.mulRight_zero_eq_zero\n\nend NonUnitalNonAssoc\n\nsection NonUnital\n\nvariable (R A : Type*) [CommSemiring R] [NonUnitalSemiring A] [Module R A] [SMulCommClass R A A]\n [IsScalarTower R A A]\n\n/-- The multiplication in a non-unital algebra is a bilinear map.\n\nA weaker version of this for non-unital non-associative algebras exists as `LinearMap.mul`. -/\ndef _root_.NonUnitalAlgHom.lmul : A →ₙₐ[R] End R A :=\n { mul R A with\n map_mul' := by\n intro a b\n ext c\n exact mul_assoc a b c\n map_zero' := by\n ext a\n exact zero_mul a }\n#align non_unital_alg_hom.lmul NonUnitalAlgHom.lmul\n\nvariable {R A}\n\n@[simp]\ntheorem _root_.NonUnitalAlgHom.coe_lmul_eq_mul : ⇑(NonUnitalAlgHom.lmul R A) = mul R A :=\n rfl\n#align non_unital_alg_hom.coe_lmul_eq_mul NonUnitalAlgHom.coe_lmul_eq_mul\n\ntheorem commute_mulLeft_right (a b : A) : Commute (mulLeft R a) (mulRight R b) := by\n ext c\n exact (mul_assoc a c b).symm\n#align linear_map.commute_mul_left_right LinearMap.commute_mulLeft_right\n\n@[simp]\ntheorem mulLeft_mul (a b : A) : mulLeft R (a * b) = (mulLeft R a).comp (mulLeft R b) := by\n ext\n ","nextTactic":"simp only [mulLeft_apply, comp_apply, mul_assoc]","declUpToTactic":"@[simp]\ntheorem mulLeft_mul (a b : A) : mulLeft R (a * b) = (mulLeft R a).comp (mulLeft R b) := by\n ext\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Bilinear.140_0.cGBk1UxpwLhzgI8","decl":"@[simp]\ntheorem mulLeft_mul (a b : A) : mulLeft R (a * b) = (mulLeft R a).comp (mulLeft R b) "} -{"state":"R : Type u_1\nA : Type u_2\ninst✝⁴ : CommSemiring R\ninst✝³ : NonUnitalSemiring A\ninst✝² : Module R A\ninst✝¹ : SMulCommClass R A A\ninst✝ : IsScalarTower R A A\na b : A\n⊢ mulRight R (a * b) = mulRight R b ∘ₗ mulRight R a","srcUpToTactic":"/-\nCopyright (c) 2018 Kenny Lau. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Kenny Lau, Yury Kudryashov\n-/\nimport Mathlib.Algebra.Algebra.Basic\nimport Mathlib.Algebra.Algebra.Equiv\nimport Mathlib.Algebra.Algebra.NonUnitalHom\nimport Mathlib.Algebra.GroupPower.IterateHom\nimport Mathlib.LinearAlgebra.TensorProduct\n\n#align_import algebra.algebra.bilinear from \"leanprover-community/mathlib\"@\"657df4339ae6ceada048c8a2980fb10e393143ec\"\n\n/-!\n# Facts about algebras involving bilinear maps and tensor products\n\nWe move a few basic statements about algebras out of `Algebra.Algebra.Basic`,\nin order to avoid importing `LinearAlgebra.BilinearMap` and\n`LinearAlgebra.TensorProduct` unnecessarily.\n-/\n\nopen TensorProduct Module\n\nnamespace LinearMap\n\nsection NonUnitalNonAssoc\n\nvariable (R A : Type*) [CommSemiring R] [NonUnitalNonAssocSemiring A] [Module R A]\n [SMulCommClass R A A] [IsScalarTower R A A]\n\n/-- The multiplication in a non-unital non-associative algebra is a bilinear map.\n\nA weaker version of this for semirings exists as `AddMonoidHom.mul`. -/\ndef mul : A →ₗ[R] A →ₗ[R] A :=\n LinearMap.mk₂ R (· * ·) add_mul smul_mul_assoc mul_add mul_smul_comm\n#align linear_map.mul LinearMap.mul\n\n/-- The multiplication map on a non-unital algebra, as an `R`-linear map from `A ⊗[R] A` to `A`. -/\nnoncomputable def mul' : A ⊗[R] A →ₗ[R] A :=\n TensorProduct.lift (mul R A)\n#align linear_map.mul' LinearMap.mul'\n\nvariable {A}\n\n/-- The multiplication on the left in a non-unital algebra is a linear map. -/\ndef mulLeft (a : A) : A →ₗ[R] A :=\n mul R A a\n#align linear_map.mul_left LinearMap.mulLeft\n\n/-- The multiplication on the right in an algebra is a linear map. -/\ndef mulRight (a : A) : A →ₗ[R] A :=\n (mul R A).flip a\n#align linear_map.mul_right LinearMap.mulRight\n\n/-- Simultaneous multiplication on the left and right is a linear map. -/\ndef mulLeftRight (ab : A × A) : A →ₗ[R] A :=\n (mulRight R ab.snd).comp (mulLeft R ab.fst)\n#align linear_map.mul_left_right LinearMap.mulLeftRight\n\n@[simp]\ntheorem mulLeft_toAddMonoidHom (a : A) : (mulLeft R a : A →+ A) = AddMonoidHom.mulLeft a :=\n rfl\n#align linear_map.mul_left_to_add_monoid_hom LinearMap.mulLeft_toAddMonoidHom\n\n@[simp]\ntheorem mulRight_toAddMonoidHom (a : A) : (mulRight R a : A →+ A) = AddMonoidHom.mulRight a :=\n rfl\n#align linear_map.mul_right_to_add_monoid_hom LinearMap.mulRight_toAddMonoidHom\n\nvariable {R}\n\n@[simp]\ntheorem mul_apply' (a b : A) : mul R A a b = a * b :=\n rfl\n#align linear_map.mul_apply' LinearMap.mul_apply'\n\n@[simp]\ntheorem mulLeft_apply (a b : A) : mulLeft R a b = a * b :=\n rfl\n#align linear_map.mul_left_apply LinearMap.mulLeft_apply\n\n@[simp]\ntheorem mulRight_apply (a b : A) : mulRight R a b = b * a :=\n rfl\n#align linear_map.mul_right_apply LinearMap.mulRight_apply\n\n@[simp]\ntheorem mulLeftRight_apply (a b x : A) : mulLeftRight R (a, b) x = a * x * b :=\n rfl\n#align linear_map.mul_left_right_apply LinearMap.mulLeftRight_apply\n\n@[simp]\ntheorem mul'_apply {a b : A} : mul' R A (a ⊗ₜ b) = a * b :=\n rfl\n#align linear_map.mul'_apply LinearMap.mul'_apply\n\n@[simp]\ntheorem mulLeft_zero_eq_zero : mulLeft R (0 : A) = 0 :=\n (mul R A).map_zero\n#align linear_map.mul_left_zero_eq_zero LinearMap.mulLeft_zero_eq_zero\n\n@[simp]\ntheorem mulRight_zero_eq_zero : mulRight R (0 : A) = 0 :=\n (mul R A).flip.map_zero\n#align linear_map.mul_right_zero_eq_zero LinearMap.mulRight_zero_eq_zero\n\nend NonUnitalNonAssoc\n\nsection NonUnital\n\nvariable (R A : Type*) [CommSemiring R] [NonUnitalSemiring A] [Module R A] [SMulCommClass R A A]\n [IsScalarTower R A A]\n\n/-- The multiplication in a non-unital algebra is a bilinear map.\n\nA weaker version of this for non-unital non-associative algebras exists as `LinearMap.mul`. -/\ndef _root_.NonUnitalAlgHom.lmul : A →ₙₐ[R] End R A :=\n { mul R A with\n map_mul' := by\n intro a b\n ext c\n exact mul_assoc a b c\n map_zero' := by\n ext a\n exact zero_mul a }\n#align non_unital_alg_hom.lmul NonUnitalAlgHom.lmul\n\nvariable {R A}\n\n@[simp]\ntheorem _root_.NonUnitalAlgHom.coe_lmul_eq_mul : ⇑(NonUnitalAlgHom.lmul R A) = mul R A :=\n rfl\n#align non_unital_alg_hom.coe_lmul_eq_mul NonUnitalAlgHom.coe_lmul_eq_mul\n\ntheorem commute_mulLeft_right (a b : A) : Commute (mulLeft R a) (mulRight R b) := by\n ext c\n exact (mul_assoc a c b).symm\n#align linear_map.commute_mul_left_right LinearMap.commute_mulLeft_right\n\n@[simp]\ntheorem mulLeft_mul (a b : A) : mulLeft R (a * b) = (mulLeft R a).comp (mulLeft R b) := by\n ext\n simp only [mulLeft_apply, comp_apply, mul_assoc]\n#align linear_map.mul_left_mul LinearMap.mulLeft_mul\n\n@[simp]\ntheorem mulRight_mul (a b : A) : mulRight R (a * b) = (mulRight R b).comp (mulRight R a) := by\n ","nextTactic":"ext","declUpToTactic":"@[simp]\ntheorem mulRight_mul (a b : A) : mulRight R (a * b) = (mulRight R b).comp (mulRight R a) := by\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Bilinear.146_0.cGBk1UxpwLhzgI8","decl":"@[simp]\ntheorem mulRight_mul (a b : A) : mulRight R (a * b) = (mulRight R b).comp (mulRight R a) "} -{"state":"case h\nR : Type u_1\nA : Type u_2\ninst✝⁴ : CommSemiring R\ninst✝³ : NonUnitalSemiring A\ninst✝² : Module R A\ninst✝¹ : SMulCommClass R A A\ninst✝ : IsScalarTower R A A\na b x✝ : A\n⊢ (mulRight R (a * b)) x✝ = (mulRight R b ∘ₗ mulRight R a) x✝","srcUpToTactic":"/-\nCopyright (c) 2018 Kenny Lau. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Kenny Lau, Yury Kudryashov\n-/\nimport Mathlib.Algebra.Algebra.Basic\nimport Mathlib.Algebra.Algebra.Equiv\nimport Mathlib.Algebra.Algebra.NonUnitalHom\nimport Mathlib.Algebra.GroupPower.IterateHom\nimport Mathlib.LinearAlgebra.TensorProduct\n\n#align_import algebra.algebra.bilinear from \"leanprover-community/mathlib\"@\"657df4339ae6ceada048c8a2980fb10e393143ec\"\n\n/-!\n# Facts about algebras involving bilinear maps and tensor products\n\nWe move a few basic statements about algebras out of `Algebra.Algebra.Basic`,\nin order to avoid importing `LinearAlgebra.BilinearMap` and\n`LinearAlgebra.TensorProduct` unnecessarily.\n-/\n\nopen TensorProduct Module\n\nnamespace LinearMap\n\nsection NonUnitalNonAssoc\n\nvariable (R A : Type*) [CommSemiring R] [NonUnitalNonAssocSemiring A] [Module R A]\n [SMulCommClass R A A] [IsScalarTower R A A]\n\n/-- The multiplication in a non-unital non-associative algebra is a bilinear map.\n\nA weaker version of this for semirings exists as `AddMonoidHom.mul`. -/\ndef mul : A →ₗ[R] A →ₗ[R] A :=\n LinearMap.mk₂ R (· * ·) add_mul smul_mul_assoc mul_add mul_smul_comm\n#align linear_map.mul LinearMap.mul\n\n/-- The multiplication map on a non-unital algebra, as an `R`-linear map from `A ⊗[R] A` to `A`. -/\nnoncomputable def mul' : A ⊗[R] A →ₗ[R] A :=\n TensorProduct.lift (mul R A)\n#align linear_map.mul' LinearMap.mul'\n\nvariable {A}\n\n/-- The multiplication on the left in a non-unital algebra is a linear map. -/\ndef mulLeft (a : A) : A →ₗ[R] A :=\n mul R A a\n#align linear_map.mul_left LinearMap.mulLeft\n\n/-- The multiplication on the right in an algebra is a linear map. -/\ndef mulRight (a : A) : A →ₗ[R] A :=\n (mul R A).flip a\n#align linear_map.mul_right LinearMap.mulRight\n\n/-- Simultaneous multiplication on the left and right is a linear map. -/\ndef mulLeftRight (ab : A × A) : A →ₗ[R] A :=\n (mulRight R ab.snd).comp (mulLeft R ab.fst)\n#align linear_map.mul_left_right LinearMap.mulLeftRight\n\n@[simp]\ntheorem mulLeft_toAddMonoidHom (a : A) : (mulLeft R a : A →+ A) = AddMonoidHom.mulLeft a :=\n rfl\n#align linear_map.mul_left_to_add_monoid_hom LinearMap.mulLeft_toAddMonoidHom\n\n@[simp]\ntheorem mulRight_toAddMonoidHom (a : A) : (mulRight R a : A →+ A) = AddMonoidHom.mulRight a :=\n rfl\n#align linear_map.mul_right_to_add_monoid_hom LinearMap.mulRight_toAddMonoidHom\n\nvariable {R}\n\n@[simp]\ntheorem mul_apply' (a b : A) : mul R A a b = a * b :=\n rfl\n#align linear_map.mul_apply' LinearMap.mul_apply'\n\n@[simp]\ntheorem mulLeft_apply (a b : A) : mulLeft R a b = a * b :=\n rfl\n#align linear_map.mul_left_apply LinearMap.mulLeft_apply\n\n@[simp]\ntheorem mulRight_apply (a b : A) : mulRight R a b = b * a :=\n rfl\n#align linear_map.mul_right_apply LinearMap.mulRight_apply\n\n@[simp]\ntheorem mulLeftRight_apply (a b x : A) : mulLeftRight R (a, b) x = a * x * b :=\n rfl\n#align linear_map.mul_left_right_apply LinearMap.mulLeftRight_apply\n\n@[simp]\ntheorem mul'_apply {a b : A} : mul' R A (a ⊗ₜ b) = a * b :=\n rfl\n#align linear_map.mul'_apply LinearMap.mul'_apply\n\n@[simp]\ntheorem mulLeft_zero_eq_zero : mulLeft R (0 : A) = 0 :=\n (mul R A).map_zero\n#align linear_map.mul_left_zero_eq_zero LinearMap.mulLeft_zero_eq_zero\n\n@[simp]\ntheorem mulRight_zero_eq_zero : mulRight R (0 : A) = 0 :=\n (mul R A).flip.map_zero\n#align linear_map.mul_right_zero_eq_zero LinearMap.mulRight_zero_eq_zero\n\nend NonUnitalNonAssoc\n\nsection NonUnital\n\nvariable (R A : Type*) [CommSemiring R] [NonUnitalSemiring A] [Module R A] [SMulCommClass R A A]\n [IsScalarTower R A A]\n\n/-- The multiplication in a non-unital algebra is a bilinear map.\n\nA weaker version of this for non-unital non-associative algebras exists as `LinearMap.mul`. -/\ndef _root_.NonUnitalAlgHom.lmul : A →ₙₐ[R] End R A :=\n { mul R A with\n map_mul' := by\n intro a b\n ext c\n exact mul_assoc a b c\n map_zero' := by\n ext a\n exact zero_mul a }\n#align non_unital_alg_hom.lmul NonUnitalAlgHom.lmul\n\nvariable {R A}\n\n@[simp]\ntheorem _root_.NonUnitalAlgHom.coe_lmul_eq_mul : ⇑(NonUnitalAlgHom.lmul R A) = mul R A :=\n rfl\n#align non_unital_alg_hom.coe_lmul_eq_mul NonUnitalAlgHom.coe_lmul_eq_mul\n\ntheorem commute_mulLeft_right (a b : A) : Commute (mulLeft R a) (mulRight R b) := by\n ext c\n exact (mul_assoc a c b).symm\n#align linear_map.commute_mul_left_right LinearMap.commute_mulLeft_right\n\n@[simp]\ntheorem mulLeft_mul (a b : A) : mulLeft R (a * b) = (mulLeft R a).comp (mulLeft R b) := by\n ext\n simp only [mulLeft_apply, comp_apply, mul_assoc]\n#align linear_map.mul_left_mul LinearMap.mulLeft_mul\n\n@[simp]\ntheorem mulRight_mul (a b : A) : mulRight R (a * b) = (mulRight R b).comp (mulRight R a) := by\n ext\n ","nextTactic":"simp only [mulRight_apply, comp_apply, mul_assoc]","declUpToTactic":"@[simp]\ntheorem mulRight_mul (a b : A) : mulRight R (a * b) = (mulRight R b).comp (mulRight R a) := by\n ext\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Bilinear.146_0.cGBk1UxpwLhzgI8","decl":"@[simp]\ntheorem mulRight_mul (a b : A) : mulRight R (a * b) = (mulRight R b).comp (mulRight R a) "} -{"state":"R : Type u_1\nA : Type u_2\nB : Type u_3\ninst✝⁴ : CommSemiring R\ninst✝³ : Semiring A\ninst✝² : Semiring B\ninst✝¹ : Algebra R A\ninst✝ : Algebra R B\nsrc✝ : A →ₗ[R] A →ₗ[R] A := mul R A\n⊢ AddHom.toFun src✝.toAddHom 1 = 1","srcUpToTactic":"/-\nCopyright (c) 2018 Kenny Lau. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Kenny Lau, Yury Kudryashov\n-/\nimport Mathlib.Algebra.Algebra.Basic\nimport Mathlib.Algebra.Algebra.Equiv\nimport Mathlib.Algebra.Algebra.NonUnitalHom\nimport Mathlib.Algebra.GroupPower.IterateHom\nimport Mathlib.LinearAlgebra.TensorProduct\n\n#align_import algebra.algebra.bilinear from \"leanprover-community/mathlib\"@\"657df4339ae6ceada048c8a2980fb10e393143ec\"\n\n/-!\n# Facts about algebras involving bilinear maps and tensor products\n\nWe move a few basic statements about algebras out of `Algebra.Algebra.Basic`,\nin order to avoid importing `LinearAlgebra.BilinearMap` and\n`LinearAlgebra.TensorProduct` unnecessarily.\n-/\n\nopen TensorProduct Module\n\nnamespace LinearMap\n\nsection NonUnitalNonAssoc\n\nvariable (R A : Type*) [CommSemiring R] [NonUnitalNonAssocSemiring A] [Module R A]\n [SMulCommClass R A A] [IsScalarTower R A A]\n\n/-- The multiplication in a non-unital non-associative algebra is a bilinear map.\n\nA weaker version of this for semirings exists as `AddMonoidHom.mul`. -/\ndef mul : A →ₗ[R] A →ₗ[R] A :=\n LinearMap.mk₂ R (· * ·) add_mul smul_mul_assoc mul_add mul_smul_comm\n#align linear_map.mul LinearMap.mul\n\n/-- The multiplication map on a non-unital algebra, as an `R`-linear map from `A ⊗[R] A` to `A`. -/\nnoncomputable def mul' : A ⊗[R] A →ₗ[R] A :=\n TensorProduct.lift (mul R A)\n#align linear_map.mul' LinearMap.mul'\n\nvariable {A}\n\n/-- The multiplication on the left in a non-unital algebra is a linear map. -/\ndef mulLeft (a : A) : A →ₗ[R] A :=\n mul R A a\n#align linear_map.mul_left LinearMap.mulLeft\n\n/-- The multiplication on the right in an algebra is a linear map. -/\ndef mulRight (a : A) : A →ₗ[R] A :=\n (mul R A).flip a\n#align linear_map.mul_right LinearMap.mulRight\n\n/-- Simultaneous multiplication on the left and right is a linear map. -/\ndef mulLeftRight (ab : A × A) : A →ₗ[R] A :=\n (mulRight R ab.snd).comp (mulLeft R ab.fst)\n#align linear_map.mul_left_right LinearMap.mulLeftRight\n\n@[simp]\ntheorem mulLeft_toAddMonoidHom (a : A) : (mulLeft R a : A →+ A) = AddMonoidHom.mulLeft a :=\n rfl\n#align linear_map.mul_left_to_add_monoid_hom LinearMap.mulLeft_toAddMonoidHom\n\n@[simp]\ntheorem mulRight_toAddMonoidHom (a : A) : (mulRight R a : A →+ A) = AddMonoidHom.mulRight a :=\n rfl\n#align linear_map.mul_right_to_add_monoid_hom LinearMap.mulRight_toAddMonoidHom\n\nvariable {R}\n\n@[simp]\ntheorem mul_apply' (a b : A) : mul R A a b = a * b :=\n rfl\n#align linear_map.mul_apply' LinearMap.mul_apply'\n\n@[simp]\ntheorem mulLeft_apply (a b : A) : mulLeft R a b = a * b :=\n rfl\n#align linear_map.mul_left_apply LinearMap.mulLeft_apply\n\n@[simp]\ntheorem mulRight_apply (a b : A) : mulRight R a b = b * a :=\n rfl\n#align linear_map.mul_right_apply LinearMap.mulRight_apply\n\n@[simp]\ntheorem mulLeftRight_apply (a b x : A) : mulLeftRight R (a, b) x = a * x * b :=\n rfl\n#align linear_map.mul_left_right_apply LinearMap.mulLeftRight_apply\n\n@[simp]\ntheorem mul'_apply {a b : A} : mul' R A (a ⊗ₜ b) = a * b :=\n rfl\n#align linear_map.mul'_apply LinearMap.mul'_apply\n\n@[simp]\ntheorem mulLeft_zero_eq_zero : mulLeft R (0 : A) = 0 :=\n (mul R A).map_zero\n#align linear_map.mul_left_zero_eq_zero LinearMap.mulLeft_zero_eq_zero\n\n@[simp]\ntheorem mulRight_zero_eq_zero : mulRight R (0 : A) = 0 :=\n (mul R A).flip.map_zero\n#align linear_map.mul_right_zero_eq_zero LinearMap.mulRight_zero_eq_zero\n\nend NonUnitalNonAssoc\n\nsection NonUnital\n\nvariable (R A : Type*) [CommSemiring R] [NonUnitalSemiring A] [Module R A] [SMulCommClass R A A]\n [IsScalarTower R A A]\n\n/-- The multiplication in a non-unital algebra is a bilinear map.\n\nA weaker version of this for non-unital non-associative algebras exists as `LinearMap.mul`. -/\ndef _root_.NonUnitalAlgHom.lmul : A →ₙₐ[R] End R A :=\n { mul R A with\n map_mul' := by\n intro a b\n ext c\n exact mul_assoc a b c\n map_zero' := by\n ext a\n exact zero_mul a }\n#align non_unital_alg_hom.lmul NonUnitalAlgHom.lmul\n\nvariable {R A}\n\n@[simp]\ntheorem _root_.NonUnitalAlgHom.coe_lmul_eq_mul : ⇑(NonUnitalAlgHom.lmul R A) = mul R A :=\n rfl\n#align non_unital_alg_hom.coe_lmul_eq_mul NonUnitalAlgHom.coe_lmul_eq_mul\n\ntheorem commute_mulLeft_right (a b : A) : Commute (mulLeft R a) (mulRight R b) := by\n ext c\n exact (mul_assoc a c b).symm\n#align linear_map.commute_mul_left_right LinearMap.commute_mulLeft_right\n\n@[simp]\ntheorem mulLeft_mul (a b : A) : mulLeft R (a * b) = (mulLeft R a).comp (mulLeft R b) := by\n ext\n simp only [mulLeft_apply, comp_apply, mul_assoc]\n#align linear_map.mul_left_mul LinearMap.mulLeft_mul\n\n@[simp]\ntheorem mulRight_mul (a b : A) : mulRight R (a * b) = (mulRight R b).comp (mulRight R a) := by\n ext\n simp only [mulRight_apply, comp_apply, mul_assoc]\n#align linear_map.mul_right_mul LinearMap.mulRight_mul\n\nend NonUnital\n\nsection Semiring\n\nvariable (R A B : Type*) [CommSemiring R] [Semiring A] [Semiring B] [Algebra R A] [Algebra R B]\n\nvariable {R A B} in\n/-- A `LinearMap` preserves multiplication if pre- and post- composition with `LinearMap.mul` are\nequivalent. By converting the statement into an equality of `LinearMap`s, this lemma allows various\nspecialized `ext` lemmas about `→ₗ[R]` to then be applied.\n\nThis is the `LinearMap` version of `AddMonoidHom.map_mul_iff`. -/\ntheorem map_mul_iff (f : A →ₗ[R] B) :\n (∀ x y, f (x * y) = f x * f y) ↔\n (LinearMap.mul R A).compr₂ f = (LinearMap.mul R B ∘ₗ f).compl₂ f :=\n Iff.symm LinearMap.ext_iff₂\n\n/-- The multiplication in an algebra is an algebra homomorphism into the endomorphisms on\nthe algebra.\n\nA weaker version of this for non-unital algebras exists as `NonUnitalAlgHom.mul`. -/\ndef _root_.Algebra.lmul : A →ₐ[R] End R A :=\n { LinearMap.mul R A with\n map_one' := by\n ","nextTactic":"ext a","declUpToTactic":"/-- The multiplication in an algebra is an algebra homomorphism into the endomorphisms on\nthe algebra.\n\nA weaker version of this for non-unital algebras exists as `NonUnitalAlgHom.mul`. -/\ndef _root_.Algebra.lmul : A →ₐ[R] End R A :=\n { LinearMap.mul R A with\n map_one' := by\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Bilinear.169_0.cGBk1UxpwLhzgI8","decl":"/-- The multiplication in an algebra is an algebra homomorphism into the endomorphisms on\nthe algebra.\n\nA weaker version of this for non-unital algebras exists as `NonUnitalAlgHom.mul`. -/\ndef _root_.Algebra.lmul : A →ₐ[R] End R A "} -{"state":"case h\nR : Type u_1\nA : Type u_2\nB : Type u_3\ninst✝⁴ : CommSemiring R\ninst✝³ : Semiring A\ninst✝² : Semiring B\ninst✝¹ : Algebra R A\ninst✝ : Algebra R B\nsrc✝ : A →ₗ[R] A →ₗ[R] A := mul R A\na : A\n⊢ (AddHom.toFun src✝.toAddHom 1) a = 1 a","srcUpToTactic":"/-\nCopyright (c) 2018 Kenny Lau. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Kenny Lau, Yury Kudryashov\n-/\nimport Mathlib.Algebra.Algebra.Basic\nimport Mathlib.Algebra.Algebra.Equiv\nimport Mathlib.Algebra.Algebra.NonUnitalHom\nimport Mathlib.Algebra.GroupPower.IterateHom\nimport Mathlib.LinearAlgebra.TensorProduct\n\n#align_import algebra.algebra.bilinear from \"leanprover-community/mathlib\"@\"657df4339ae6ceada048c8a2980fb10e393143ec\"\n\n/-!\n# Facts about algebras involving bilinear maps and tensor products\n\nWe move a few basic statements about algebras out of `Algebra.Algebra.Basic`,\nin order to avoid importing `LinearAlgebra.BilinearMap` and\n`LinearAlgebra.TensorProduct` unnecessarily.\n-/\n\nopen TensorProduct Module\n\nnamespace LinearMap\n\nsection NonUnitalNonAssoc\n\nvariable (R A : Type*) [CommSemiring R] [NonUnitalNonAssocSemiring A] [Module R A]\n [SMulCommClass R A A] [IsScalarTower R A A]\n\n/-- The multiplication in a non-unital non-associative algebra is a bilinear map.\n\nA weaker version of this for semirings exists as `AddMonoidHom.mul`. -/\ndef mul : A →ₗ[R] A →ₗ[R] A :=\n LinearMap.mk₂ R (· * ·) add_mul smul_mul_assoc mul_add mul_smul_comm\n#align linear_map.mul LinearMap.mul\n\n/-- The multiplication map on a non-unital algebra, as an `R`-linear map from `A ⊗[R] A` to `A`. -/\nnoncomputable def mul' : A ⊗[R] A →ₗ[R] A :=\n TensorProduct.lift (mul R A)\n#align linear_map.mul' LinearMap.mul'\n\nvariable {A}\n\n/-- The multiplication on the left in a non-unital algebra is a linear map. -/\ndef mulLeft (a : A) : A →ₗ[R] A :=\n mul R A a\n#align linear_map.mul_left LinearMap.mulLeft\n\n/-- The multiplication on the right in an algebra is a linear map. -/\ndef mulRight (a : A) : A →ₗ[R] A :=\n (mul R A).flip a\n#align linear_map.mul_right LinearMap.mulRight\n\n/-- Simultaneous multiplication on the left and right is a linear map. -/\ndef mulLeftRight (ab : A × A) : A →ₗ[R] A :=\n (mulRight R ab.snd).comp (mulLeft R ab.fst)\n#align linear_map.mul_left_right LinearMap.mulLeftRight\n\n@[simp]\ntheorem mulLeft_toAddMonoidHom (a : A) : (mulLeft R a : A →+ A) = AddMonoidHom.mulLeft a :=\n rfl\n#align linear_map.mul_left_to_add_monoid_hom LinearMap.mulLeft_toAddMonoidHom\n\n@[simp]\ntheorem mulRight_toAddMonoidHom (a : A) : (mulRight R a : A →+ A) = AddMonoidHom.mulRight a :=\n rfl\n#align linear_map.mul_right_to_add_monoid_hom LinearMap.mulRight_toAddMonoidHom\n\nvariable {R}\n\n@[simp]\ntheorem mul_apply' (a b : A) : mul R A a b = a * b :=\n rfl\n#align linear_map.mul_apply' LinearMap.mul_apply'\n\n@[simp]\ntheorem mulLeft_apply (a b : A) : mulLeft R a b = a * b :=\n rfl\n#align linear_map.mul_left_apply LinearMap.mulLeft_apply\n\n@[simp]\ntheorem mulRight_apply (a b : A) : mulRight R a b = b * a :=\n rfl\n#align linear_map.mul_right_apply LinearMap.mulRight_apply\n\n@[simp]\ntheorem mulLeftRight_apply (a b x : A) : mulLeftRight R (a, b) x = a * x * b :=\n rfl\n#align linear_map.mul_left_right_apply LinearMap.mulLeftRight_apply\n\n@[simp]\ntheorem mul'_apply {a b : A} : mul' R A (a ⊗ₜ b) = a * b :=\n rfl\n#align linear_map.mul'_apply LinearMap.mul'_apply\n\n@[simp]\ntheorem mulLeft_zero_eq_zero : mulLeft R (0 : A) = 0 :=\n (mul R A).map_zero\n#align linear_map.mul_left_zero_eq_zero LinearMap.mulLeft_zero_eq_zero\n\n@[simp]\ntheorem mulRight_zero_eq_zero : mulRight R (0 : A) = 0 :=\n (mul R A).flip.map_zero\n#align linear_map.mul_right_zero_eq_zero LinearMap.mulRight_zero_eq_zero\n\nend NonUnitalNonAssoc\n\nsection NonUnital\n\nvariable (R A : Type*) [CommSemiring R] [NonUnitalSemiring A] [Module R A] [SMulCommClass R A A]\n [IsScalarTower R A A]\n\n/-- The multiplication in a non-unital algebra is a bilinear map.\n\nA weaker version of this for non-unital non-associative algebras exists as `LinearMap.mul`. -/\ndef _root_.NonUnitalAlgHom.lmul : A →ₙₐ[R] End R A :=\n { mul R A with\n map_mul' := by\n intro a b\n ext c\n exact mul_assoc a b c\n map_zero' := by\n ext a\n exact zero_mul a }\n#align non_unital_alg_hom.lmul NonUnitalAlgHom.lmul\n\nvariable {R A}\n\n@[simp]\ntheorem _root_.NonUnitalAlgHom.coe_lmul_eq_mul : ⇑(NonUnitalAlgHom.lmul R A) = mul R A :=\n rfl\n#align non_unital_alg_hom.coe_lmul_eq_mul NonUnitalAlgHom.coe_lmul_eq_mul\n\ntheorem commute_mulLeft_right (a b : A) : Commute (mulLeft R a) (mulRight R b) := by\n ext c\n exact (mul_assoc a c b).symm\n#align linear_map.commute_mul_left_right LinearMap.commute_mulLeft_right\n\n@[simp]\ntheorem mulLeft_mul (a b : A) : mulLeft R (a * b) = (mulLeft R a).comp (mulLeft R b) := by\n ext\n simp only [mulLeft_apply, comp_apply, mul_assoc]\n#align linear_map.mul_left_mul LinearMap.mulLeft_mul\n\n@[simp]\ntheorem mulRight_mul (a b : A) : mulRight R (a * b) = (mulRight R b).comp (mulRight R a) := by\n ext\n simp only [mulRight_apply, comp_apply, mul_assoc]\n#align linear_map.mul_right_mul LinearMap.mulRight_mul\n\nend NonUnital\n\nsection Semiring\n\nvariable (R A B : Type*) [CommSemiring R] [Semiring A] [Semiring B] [Algebra R A] [Algebra R B]\n\nvariable {R A B} in\n/-- A `LinearMap` preserves multiplication if pre- and post- composition with `LinearMap.mul` are\nequivalent. By converting the statement into an equality of `LinearMap`s, this lemma allows various\nspecialized `ext` lemmas about `→ₗ[R]` to then be applied.\n\nThis is the `LinearMap` version of `AddMonoidHom.map_mul_iff`. -/\ntheorem map_mul_iff (f : A →ₗ[R] B) :\n (∀ x y, f (x * y) = f x * f y) ↔\n (LinearMap.mul R A).compr₂ f = (LinearMap.mul R B ∘ₗ f).compl₂ f :=\n Iff.symm LinearMap.ext_iff₂\n\n/-- The multiplication in an algebra is an algebra homomorphism into the endomorphisms on\nthe algebra.\n\nA weaker version of this for non-unital algebras exists as `NonUnitalAlgHom.mul`. -/\ndef _root_.Algebra.lmul : A →ₐ[R] End R A :=\n { LinearMap.mul R A with\n map_one' := by\n ext a\n ","nextTactic":"exact one_mul a","declUpToTactic":"/-- The multiplication in an algebra is an algebra homomorphism into the endomorphisms on\nthe algebra.\n\nA weaker version of this for non-unital algebras exists as `NonUnitalAlgHom.mul`. -/\ndef _root_.Algebra.lmul : A →ₐ[R] End R A :=\n { LinearMap.mul R A with\n map_one' := by\n ext a\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Bilinear.169_0.cGBk1UxpwLhzgI8","decl":"/-- The multiplication in an algebra is an algebra homomorphism into the endomorphisms on\nthe algebra.\n\nA weaker version of this for non-unital algebras exists as `NonUnitalAlgHom.mul`. -/\ndef _root_.Algebra.lmul : A →ₐ[R] End R A "} -{"state":"R : Type u_1\nA : Type u_2\nB : Type u_3\ninst✝⁴ : CommSemiring R\ninst✝³ : Semiring A\ninst✝² : Semiring B\ninst✝¹ : Algebra R A\ninst✝ : Algebra R B\nsrc✝ : A →ₗ[R] A →ₗ[R] A := mul R A\n⊢ ∀ (x y : A),\n OneHom.toFun { toFun := src✝.toFun, map_one' := (_ : AddHom.toFun src✝.toAddHom 1 = 1) } (x * y) =\n OneHom.toFun { toFun := src✝.toFun, map_one' := (_ : AddHom.toFun src✝.toAddHom 1 = 1) } x *\n OneHom.toFun { toFun := src✝.toFun, map_one' := (_ : AddHom.toFun src✝.toAddHom 1 = 1) } y","srcUpToTactic":"/-\nCopyright (c) 2018 Kenny Lau. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Kenny Lau, Yury Kudryashov\n-/\nimport Mathlib.Algebra.Algebra.Basic\nimport Mathlib.Algebra.Algebra.Equiv\nimport Mathlib.Algebra.Algebra.NonUnitalHom\nimport Mathlib.Algebra.GroupPower.IterateHom\nimport Mathlib.LinearAlgebra.TensorProduct\n\n#align_import algebra.algebra.bilinear from \"leanprover-community/mathlib\"@\"657df4339ae6ceada048c8a2980fb10e393143ec\"\n\n/-!\n# Facts about algebras involving bilinear maps and tensor products\n\nWe move a few basic statements about algebras out of `Algebra.Algebra.Basic`,\nin order to avoid importing `LinearAlgebra.BilinearMap` and\n`LinearAlgebra.TensorProduct` unnecessarily.\n-/\n\nopen TensorProduct Module\n\nnamespace LinearMap\n\nsection NonUnitalNonAssoc\n\nvariable (R A : Type*) [CommSemiring R] [NonUnitalNonAssocSemiring A] [Module R A]\n [SMulCommClass R A A] [IsScalarTower R A A]\n\n/-- The multiplication in a non-unital non-associative algebra is a bilinear map.\n\nA weaker version of this for semirings exists as `AddMonoidHom.mul`. -/\ndef mul : A →ₗ[R] A →ₗ[R] A :=\n LinearMap.mk₂ R (· * ·) add_mul smul_mul_assoc mul_add mul_smul_comm\n#align linear_map.mul LinearMap.mul\n\n/-- The multiplication map on a non-unital algebra, as an `R`-linear map from `A ⊗[R] A` to `A`. -/\nnoncomputable def mul' : A ⊗[R] A →ₗ[R] A :=\n TensorProduct.lift (mul R A)\n#align linear_map.mul' LinearMap.mul'\n\nvariable {A}\n\n/-- The multiplication on the left in a non-unital algebra is a linear map. -/\ndef mulLeft (a : A) : A →ₗ[R] A :=\n mul R A a\n#align linear_map.mul_left LinearMap.mulLeft\n\n/-- The multiplication on the right in an algebra is a linear map. -/\ndef mulRight (a : A) : A →ₗ[R] A :=\n (mul R A).flip a\n#align linear_map.mul_right LinearMap.mulRight\n\n/-- Simultaneous multiplication on the left and right is a linear map. -/\ndef mulLeftRight (ab : A × A) : A →ₗ[R] A :=\n (mulRight R ab.snd).comp (mulLeft R ab.fst)\n#align linear_map.mul_left_right LinearMap.mulLeftRight\n\n@[simp]\ntheorem mulLeft_toAddMonoidHom (a : A) : (mulLeft R a : A →+ A) = AddMonoidHom.mulLeft a :=\n rfl\n#align linear_map.mul_left_to_add_monoid_hom LinearMap.mulLeft_toAddMonoidHom\n\n@[simp]\ntheorem mulRight_toAddMonoidHom (a : A) : (mulRight R a : A →+ A) = AddMonoidHom.mulRight a :=\n rfl\n#align linear_map.mul_right_to_add_monoid_hom LinearMap.mulRight_toAddMonoidHom\n\nvariable {R}\n\n@[simp]\ntheorem mul_apply' (a b : A) : mul R A a b = a * b :=\n rfl\n#align linear_map.mul_apply' LinearMap.mul_apply'\n\n@[simp]\ntheorem mulLeft_apply (a b : A) : mulLeft R a b = a * b :=\n rfl\n#align linear_map.mul_left_apply LinearMap.mulLeft_apply\n\n@[simp]\ntheorem mulRight_apply (a b : A) : mulRight R a b = b * a :=\n rfl\n#align linear_map.mul_right_apply LinearMap.mulRight_apply\n\n@[simp]\ntheorem mulLeftRight_apply (a b x : A) : mulLeftRight R (a, b) x = a * x * b :=\n rfl\n#align linear_map.mul_left_right_apply LinearMap.mulLeftRight_apply\n\n@[simp]\ntheorem mul'_apply {a b : A} : mul' R A (a ⊗ₜ b) = a * b :=\n rfl\n#align linear_map.mul'_apply LinearMap.mul'_apply\n\n@[simp]\ntheorem mulLeft_zero_eq_zero : mulLeft R (0 : A) = 0 :=\n (mul R A).map_zero\n#align linear_map.mul_left_zero_eq_zero LinearMap.mulLeft_zero_eq_zero\n\n@[simp]\ntheorem mulRight_zero_eq_zero : mulRight R (0 : A) = 0 :=\n (mul R A).flip.map_zero\n#align linear_map.mul_right_zero_eq_zero LinearMap.mulRight_zero_eq_zero\n\nend NonUnitalNonAssoc\n\nsection NonUnital\n\nvariable (R A : Type*) [CommSemiring R] [NonUnitalSemiring A] [Module R A] [SMulCommClass R A A]\n [IsScalarTower R A A]\n\n/-- The multiplication in a non-unital algebra is a bilinear map.\n\nA weaker version of this for non-unital non-associative algebras exists as `LinearMap.mul`. -/\ndef _root_.NonUnitalAlgHom.lmul : A →ₙₐ[R] End R A :=\n { mul R A with\n map_mul' := by\n intro a b\n ext c\n exact mul_assoc a b c\n map_zero' := by\n ext a\n exact zero_mul a }\n#align non_unital_alg_hom.lmul NonUnitalAlgHom.lmul\n\nvariable {R A}\n\n@[simp]\ntheorem _root_.NonUnitalAlgHom.coe_lmul_eq_mul : ⇑(NonUnitalAlgHom.lmul R A) = mul R A :=\n rfl\n#align non_unital_alg_hom.coe_lmul_eq_mul NonUnitalAlgHom.coe_lmul_eq_mul\n\ntheorem commute_mulLeft_right (a b : A) : Commute (mulLeft R a) (mulRight R b) := by\n ext c\n exact (mul_assoc a c b).symm\n#align linear_map.commute_mul_left_right LinearMap.commute_mulLeft_right\n\n@[simp]\ntheorem mulLeft_mul (a b : A) : mulLeft R (a * b) = (mulLeft R a).comp (mulLeft R b) := by\n ext\n simp only [mulLeft_apply, comp_apply, mul_assoc]\n#align linear_map.mul_left_mul LinearMap.mulLeft_mul\n\n@[simp]\ntheorem mulRight_mul (a b : A) : mulRight R (a * b) = (mulRight R b).comp (mulRight R a) := by\n ext\n simp only [mulRight_apply, comp_apply, mul_assoc]\n#align linear_map.mul_right_mul LinearMap.mulRight_mul\n\nend NonUnital\n\nsection Semiring\n\nvariable (R A B : Type*) [CommSemiring R] [Semiring A] [Semiring B] [Algebra R A] [Algebra R B]\n\nvariable {R A B} in\n/-- A `LinearMap` preserves multiplication if pre- and post- composition with `LinearMap.mul` are\nequivalent. By converting the statement into an equality of `LinearMap`s, this lemma allows various\nspecialized `ext` lemmas about `→ₗ[R]` to then be applied.\n\nThis is the `LinearMap` version of `AddMonoidHom.map_mul_iff`. -/\ntheorem map_mul_iff (f : A →ₗ[R] B) :\n (∀ x y, f (x * y) = f x * f y) ↔\n (LinearMap.mul R A).compr₂ f = (LinearMap.mul R B ∘ₗ f).compl₂ f :=\n Iff.symm LinearMap.ext_iff₂\n\n/-- The multiplication in an algebra is an algebra homomorphism into the endomorphisms on\nthe algebra.\n\nA weaker version of this for non-unital algebras exists as `NonUnitalAlgHom.mul`. -/\ndef _root_.Algebra.lmul : A →ₐ[R] End R A :=\n { LinearMap.mul R A with\n map_one' := by\n ext a\n exact one_mul a\n map_mul' := by\n ","nextTactic":"intro a b","declUpToTactic":"/-- The multiplication in an algebra is an algebra homomorphism into the endomorphisms on\nthe algebra.\n\nA weaker version of this for non-unital algebras exists as `NonUnitalAlgHom.mul`. -/\ndef _root_.Algebra.lmul : A →ₐ[R] End R A :=\n { LinearMap.mul R A with\n map_one' := by\n ext a\n exact one_mul a\n map_mul' := by\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Bilinear.169_0.cGBk1UxpwLhzgI8","decl":"/-- The multiplication in an algebra is an algebra homomorphism into the endomorphisms on\nthe algebra.\n\nA weaker version of this for non-unital algebras exists as `NonUnitalAlgHom.mul`. -/\ndef _root_.Algebra.lmul : A →ₐ[R] End R A "} -{"state":"R : Type u_1\nA : Type u_2\nB : Type u_3\ninst✝⁴ : CommSemiring R\ninst✝³ : Semiring A\ninst✝² : Semiring B\ninst✝¹ : Algebra R A\ninst✝ : Algebra R B\nsrc✝ : A →ₗ[R] A →ₗ[R] A := mul R A\na b : A\n⊢ OneHom.toFun { toFun := src✝.toFun, map_one' := (_ : AddHom.toFun src✝.toAddHom 1 = 1) } (a * b) =\n OneHom.toFun { toFun := src✝.toFun, map_one' := (_ : AddHom.toFun src✝.toAddHom 1 = 1) } a *\n OneHom.toFun { toFun := src✝.toFun, map_one' := (_ : AddHom.toFun src✝.toAddHom 1 = 1) } b","srcUpToTactic":"/-\nCopyright (c) 2018 Kenny Lau. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Kenny Lau, Yury Kudryashov\n-/\nimport Mathlib.Algebra.Algebra.Basic\nimport Mathlib.Algebra.Algebra.Equiv\nimport Mathlib.Algebra.Algebra.NonUnitalHom\nimport Mathlib.Algebra.GroupPower.IterateHom\nimport Mathlib.LinearAlgebra.TensorProduct\n\n#align_import algebra.algebra.bilinear from \"leanprover-community/mathlib\"@\"657df4339ae6ceada048c8a2980fb10e393143ec\"\n\n/-!\n# Facts about algebras involving bilinear maps and tensor products\n\nWe move a few basic statements about algebras out of `Algebra.Algebra.Basic`,\nin order to avoid importing `LinearAlgebra.BilinearMap` and\n`LinearAlgebra.TensorProduct` unnecessarily.\n-/\n\nopen TensorProduct Module\n\nnamespace LinearMap\n\nsection NonUnitalNonAssoc\n\nvariable (R A : Type*) [CommSemiring R] [NonUnitalNonAssocSemiring A] [Module R A]\n [SMulCommClass R A A] [IsScalarTower R A A]\n\n/-- The multiplication in a non-unital non-associative algebra is a bilinear map.\n\nA weaker version of this for semirings exists as `AddMonoidHom.mul`. -/\ndef mul : A →ₗ[R] A →ₗ[R] A :=\n LinearMap.mk₂ R (· * ·) add_mul smul_mul_assoc mul_add mul_smul_comm\n#align linear_map.mul LinearMap.mul\n\n/-- The multiplication map on a non-unital algebra, as an `R`-linear map from `A ⊗[R] A` to `A`. -/\nnoncomputable def mul' : A ⊗[R] A →ₗ[R] A :=\n TensorProduct.lift (mul R A)\n#align linear_map.mul' LinearMap.mul'\n\nvariable {A}\n\n/-- The multiplication on the left in a non-unital algebra is a linear map. -/\ndef mulLeft (a : A) : A →ₗ[R] A :=\n mul R A a\n#align linear_map.mul_left LinearMap.mulLeft\n\n/-- The multiplication on the right in an algebra is a linear map. -/\ndef mulRight (a : A) : A →ₗ[R] A :=\n (mul R A).flip a\n#align linear_map.mul_right LinearMap.mulRight\n\n/-- Simultaneous multiplication on the left and right is a linear map. -/\ndef mulLeftRight (ab : A × A) : A →ₗ[R] A :=\n (mulRight R ab.snd).comp (mulLeft R ab.fst)\n#align linear_map.mul_left_right LinearMap.mulLeftRight\n\n@[simp]\ntheorem mulLeft_toAddMonoidHom (a : A) : (mulLeft R a : A →+ A) = AddMonoidHom.mulLeft a :=\n rfl\n#align linear_map.mul_left_to_add_monoid_hom LinearMap.mulLeft_toAddMonoidHom\n\n@[simp]\ntheorem mulRight_toAddMonoidHom (a : A) : (mulRight R a : A →+ A) = AddMonoidHom.mulRight a :=\n rfl\n#align linear_map.mul_right_to_add_monoid_hom LinearMap.mulRight_toAddMonoidHom\n\nvariable {R}\n\n@[simp]\ntheorem mul_apply' (a b : A) : mul R A a b = a * b :=\n rfl\n#align linear_map.mul_apply' LinearMap.mul_apply'\n\n@[simp]\ntheorem mulLeft_apply (a b : A) : mulLeft R a b = a * b :=\n rfl\n#align linear_map.mul_left_apply LinearMap.mulLeft_apply\n\n@[simp]\ntheorem mulRight_apply (a b : A) : mulRight R a b = b * a :=\n rfl\n#align linear_map.mul_right_apply LinearMap.mulRight_apply\n\n@[simp]\ntheorem mulLeftRight_apply (a b x : A) : mulLeftRight R (a, b) x = a * x * b :=\n rfl\n#align linear_map.mul_left_right_apply LinearMap.mulLeftRight_apply\n\n@[simp]\ntheorem mul'_apply {a b : A} : mul' R A (a ⊗ₜ b) = a * b :=\n rfl\n#align linear_map.mul'_apply LinearMap.mul'_apply\n\n@[simp]\ntheorem mulLeft_zero_eq_zero : mulLeft R (0 : A) = 0 :=\n (mul R A).map_zero\n#align linear_map.mul_left_zero_eq_zero LinearMap.mulLeft_zero_eq_zero\n\n@[simp]\ntheorem mulRight_zero_eq_zero : mulRight R (0 : A) = 0 :=\n (mul R A).flip.map_zero\n#align linear_map.mul_right_zero_eq_zero LinearMap.mulRight_zero_eq_zero\n\nend NonUnitalNonAssoc\n\nsection NonUnital\n\nvariable (R A : Type*) [CommSemiring R] [NonUnitalSemiring A] [Module R A] [SMulCommClass R A A]\n [IsScalarTower R A A]\n\n/-- The multiplication in a non-unital algebra is a bilinear map.\n\nA weaker version of this for non-unital non-associative algebras exists as `LinearMap.mul`. -/\ndef _root_.NonUnitalAlgHom.lmul : A →ₙₐ[R] End R A :=\n { mul R A with\n map_mul' := by\n intro a b\n ext c\n exact mul_assoc a b c\n map_zero' := by\n ext a\n exact zero_mul a }\n#align non_unital_alg_hom.lmul NonUnitalAlgHom.lmul\n\nvariable {R A}\n\n@[simp]\ntheorem _root_.NonUnitalAlgHom.coe_lmul_eq_mul : ⇑(NonUnitalAlgHom.lmul R A) = mul R A :=\n rfl\n#align non_unital_alg_hom.coe_lmul_eq_mul NonUnitalAlgHom.coe_lmul_eq_mul\n\ntheorem commute_mulLeft_right (a b : A) : Commute (mulLeft R a) (mulRight R b) := by\n ext c\n exact (mul_assoc a c b).symm\n#align linear_map.commute_mul_left_right LinearMap.commute_mulLeft_right\n\n@[simp]\ntheorem mulLeft_mul (a b : A) : mulLeft R (a * b) = (mulLeft R a).comp (mulLeft R b) := by\n ext\n simp only [mulLeft_apply, comp_apply, mul_assoc]\n#align linear_map.mul_left_mul LinearMap.mulLeft_mul\n\n@[simp]\ntheorem mulRight_mul (a b : A) : mulRight R (a * b) = (mulRight R b).comp (mulRight R a) := by\n ext\n simp only [mulRight_apply, comp_apply, mul_assoc]\n#align linear_map.mul_right_mul LinearMap.mulRight_mul\n\nend NonUnital\n\nsection Semiring\n\nvariable (R A B : Type*) [CommSemiring R] [Semiring A] [Semiring B] [Algebra R A] [Algebra R B]\n\nvariable {R A B} in\n/-- A `LinearMap` preserves multiplication if pre- and post- composition with `LinearMap.mul` are\nequivalent. By converting the statement into an equality of `LinearMap`s, this lemma allows various\nspecialized `ext` lemmas about `→ₗ[R]` to then be applied.\n\nThis is the `LinearMap` version of `AddMonoidHom.map_mul_iff`. -/\ntheorem map_mul_iff (f : A →ₗ[R] B) :\n (∀ x y, f (x * y) = f x * f y) ↔\n (LinearMap.mul R A).compr₂ f = (LinearMap.mul R B ∘ₗ f).compl₂ f :=\n Iff.symm LinearMap.ext_iff₂\n\n/-- The multiplication in an algebra is an algebra homomorphism into the endomorphisms on\nthe algebra.\n\nA weaker version of this for non-unital algebras exists as `NonUnitalAlgHom.mul`. -/\ndef _root_.Algebra.lmul : A →ₐ[R] End R A :=\n { LinearMap.mul R A with\n map_one' := by\n ext a\n exact one_mul a\n map_mul' := by\n intro a b\n ","nextTactic":"ext c","declUpToTactic":"/-- The multiplication in an algebra is an algebra homomorphism into the endomorphisms on\nthe algebra.\n\nA weaker version of this for non-unital algebras exists as `NonUnitalAlgHom.mul`. -/\ndef _root_.Algebra.lmul : A →ₐ[R] End R A :=\n { LinearMap.mul R A with\n map_one' := by\n ext a\n exact one_mul a\n map_mul' := by\n intro a b\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Bilinear.169_0.cGBk1UxpwLhzgI8","decl":"/-- The multiplication in an algebra is an algebra homomorphism into the endomorphisms on\nthe algebra.\n\nA weaker version of this for non-unital algebras exists as `NonUnitalAlgHom.mul`. -/\ndef _root_.Algebra.lmul : A →ₐ[R] End R A "} -{"state":"case h\nR : Type u_1\nA : Type u_2\nB : Type u_3\ninst✝⁴ : CommSemiring R\ninst✝³ : Semiring A\ninst✝² : Semiring B\ninst✝¹ : Algebra R A\ninst✝ : Algebra R B\nsrc✝ : A →ₗ[R] A →ₗ[R] A := mul R A\na b c : A\n⊢ (OneHom.toFun { toFun := src✝.toFun, map_one' := (_ : AddHom.toFun src✝.toAddHom 1 = 1) } (a * b)) c =\n (OneHom.toFun { toFun := src✝.toFun, map_one' := (_ : AddHom.toFun src✝.toAddHom 1 = 1) } a *\n OneHom.toFun { toFun := src✝.toFun, map_one' := (_ : AddHom.toFun src✝.toAddHom 1 = 1) } b)\n c","srcUpToTactic":"/-\nCopyright (c) 2018 Kenny Lau. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Kenny Lau, Yury Kudryashov\n-/\nimport Mathlib.Algebra.Algebra.Basic\nimport Mathlib.Algebra.Algebra.Equiv\nimport Mathlib.Algebra.Algebra.NonUnitalHom\nimport Mathlib.Algebra.GroupPower.IterateHom\nimport Mathlib.LinearAlgebra.TensorProduct\n\n#align_import algebra.algebra.bilinear from \"leanprover-community/mathlib\"@\"657df4339ae6ceada048c8a2980fb10e393143ec\"\n\n/-!\n# Facts about algebras involving bilinear maps and tensor products\n\nWe move a few basic statements about algebras out of `Algebra.Algebra.Basic`,\nin order to avoid importing `LinearAlgebra.BilinearMap` and\n`LinearAlgebra.TensorProduct` unnecessarily.\n-/\n\nopen TensorProduct Module\n\nnamespace LinearMap\n\nsection NonUnitalNonAssoc\n\nvariable (R A : Type*) [CommSemiring R] [NonUnitalNonAssocSemiring A] [Module R A]\n [SMulCommClass R A A] [IsScalarTower R A A]\n\n/-- The multiplication in a non-unital non-associative algebra is a bilinear map.\n\nA weaker version of this for semirings exists as `AddMonoidHom.mul`. -/\ndef mul : A →ₗ[R] A →ₗ[R] A :=\n LinearMap.mk₂ R (· * ·) add_mul smul_mul_assoc mul_add mul_smul_comm\n#align linear_map.mul LinearMap.mul\n\n/-- The multiplication map on a non-unital algebra, as an `R`-linear map from `A ⊗[R] A` to `A`. -/\nnoncomputable def mul' : A ⊗[R] A →ₗ[R] A :=\n TensorProduct.lift (mul R A)\n#align linear_map.mul' LinearMap.mul'\n\nvariable {A}\n\n/-- The multiplication on the left in a non-unital algebra is a linear map. -/\ndef mulLeft (a : A) : A →ₗ[R] A :=\n mul R A a\n#align linear_map.mul_left LinearMap.mulLeft\n\n/-- The multiplication on the right in an algebra is a linear map. -/\ndef mulRight (a : A) : A →ₗ[R] A :=\n (mul R A).flip a\n#align linear_map.mul_right LinearMap.mulRight\n\n/-- Simultaneous multiplication on the left and right is a linear map. -/\ndef mulLeftRight (ab : A × A) : A →ₗ[R] A :=\n (mulRight R ab.snd).comp (mulLeft R ab.fst)\n#align linear_map.mul_left_right LinearMap.mulLeftRight\n\n@[simp]\ntheorem mulLeft_toAddMonoidHom (a : A) : (mulLeft R a : A →+ A) = AddMonoidHom.mulLeft a :=\n rfl\n#align linear_map.mul_left_to_add_monoid_hom LinearMap.mulLeft_toAddMonoidHom\n\n@[simp]\ntheorem mulRight_toAddMonoidHom (a : A) : (mulRight R a : A →+ A) = AddMonoidHom.mulRight a :=\n rfl\n#align linear_map.mul_right_to_add_monoid_hom LinearMap.mulRight_toAddMonoidHom\n\nvariable {R}\n\n@[simp]\ntheorem mul_apply' (a b : A) : mul R A a b = a * b :=\n rfl\n#align linear_map.mul_apply' LinearMap.mul_apply'\n\n@[simp]\ntheorem mulLeft_apply (a b : A) : mulLeft R a b = a * b :=\n rfl\n#align linear_map.mul_left_apply LinearMap.mulLeft_apply\n\n@[simp]\ntheorem mulRight_apply (a b : A) : mulRight R a b = b * a :=\n rfl\n#align linear_map.mul_right_apply LinearMap.mulRight_apply\n\n@[simp]\ntheorem mulLeftRight_apply (a b x : A) : mulLeftRight R (a, b) x = a * x * b :=\n rfl\n#align linear_map.mul_left_right_apply LinearMap.mulLeftRight_apply\n\n@[simp]\ntheorem mul'_apply {a b : A} : mul' R A (a ⊗ₜ b) = a * b :=\n rfl\n#align linear_map.mul'_apply LinearMap.mul'_apply\n\n@[simp]\ntheorem mulLeft_zero_eq_zero : mulLeft R (0 : A) = 0 :=\n (mul R A).map_zero\n#align linear_map.mul_left_zero_eq_zero LinearMap.mulLeft_zero_eq_zero\n\n@[simp]\ntheorem mulRight_zero_eq_zero : mulRight R (0 : A) = 0 :=\n (mul R A).flip.map_zero\n#align linear_map.mul_right_zero_eq_zero LinearMap.mulRight_zero_eq_zero\n\nend NonUnitalNonAssoc\n\nsection NonUnital\n\nvariable (R A : Type*) [CommSemiring R] [NonUnitalSemiring A] [Module R A] [SMulCommClass R A A]\n [IsScalarTower R A A]\n\n/-- The multiplication in a non-unital algebra is a bilinear map.\n\nA weaker version of this for non-unital non-associative algebras exists as `LinearMap.mul`. -/\ndef _root_.NonUnitalAlgHom.lmul : A →ₙₐ[R] End R A :=\n { mul R A with\n map_mul' := by\n intro a b\n ext c\n exact mul_assoc a b c\n map_zero' := by\n ext a\n exact zero_mul a }\n#align non_unital_alg_hom.lmul NonUnitalAlgHom.lmul\n\nvariable {R A}\n\n@[simp]\ntheorem _root_.NonUnitalAlgHom.coe_lmul_eq_mul : ⇑(NonUnitalAlgHom.lmul R A) = mul R A :=\n rfl\n#align non_unital_alg_hom.coe_lmul_eq_mul NonUnitalAlgHom.coe_lmul_eq_mul\n\ntheorem commute_mulLeft_right (a b : A) : Commute (mulLeft R a) (mulRight R b) := by\n ext c\n exact (mul_assoc a c b).symm\n#align linear_map.commute_mul_left_right LinearMap.commute_mulLeft_right\n\n@[simp]\ntheorem mulLeft_mul (a b : A) : mulLeft R (a * b) = (mulLeft R a).comp (mulLeft R b) := by\n ext\n simp only [mulLeft_apply, comp_apply, mul_assoc]\n#align linear_map.mul_left_mul LinearMap.mulLeft_mul\n\n@[simp]\ntheorem mulRight_mul (a b : A) : mulRight R (a * b) = (mulRight R b).comp (mulRight R a) := by\n ext\n simp only [mulRight_apply, comp_apply, mul_assoc]\n#align linear_map.mul_right_mul LinearMap.mulRight_mul\n\nend NonUnital\n\nsection Semiring\n\nvariable (R A B : Type*) [CommSemiring R] [Semiring A] [Semiring B] [Algebra R A] [Algebra R B]\n\nvariable {R A B} in\n/-- A `LinearMap` preserves multiplication if pre- and post- composition with `LinearMap.mul` are\nequivalent. By converting the statement into an equality of `LinearMap`s, this lemma allows various\nspecialized `ext` lemmas about `→ₗ[R]` to then be applied.\n\nThis is the `LinearMap` version of `AddMonoidHom.map_mul_iff`. -/\ntheorem map_mul_iff (f : A →ₗ[R] B) :\n (∀ x y, f (x * y) = f x * f y) ↔\n (LinearMap.mul R A).compr₂ f = (LinearMap.mul R B ∘ₗ f).compl₂ f :=\n Iff.symm LinearMap.ext_iff₂\n\n/-- The multiplication in an algebra is an algebra homomorphism into the endomorphisms on\nthe algebra.\n\nA weaker version of this for non-unital algebras exists as `NonUnitalAlgHom.mul`. -/\ndef _root_.Algebra.lmul : A →ₐ[R] End R A :=\n { LinearMap.mul R A with\n map_one' := by\n ext a\n exact one_mul a\n map_mul' := by\n intro a b\n ext c\n ","nextTactic":"exact mul_assoc a b c","declUpToTactic":"/-- The multiplication in an algebra is an algebra homomorphism into the endomorphisms on\nthe algebra.\n\nA weaker version of this for non-unital algebras exists as `NonUnitalAlgHom.mul`. -/\ndef _root_.Algebra.lmul : A →ₐ[R] End R A :=\n { LinearMap.mul R A with\n map_one' := by\n ext a\n exact one_mul a\n map_mul' := by\n intro a b\n ext c\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Bilinear.169_0.cGBk1UxpwLhzgI8","decl":"/-- The multiplication in an algebra is an algebra homomorphism into the endomorphisms on\nthe algebra.\n\nA weaker version of this for non-unital algebras exists as `NonUnitalAlgHom.mul`. -/\ndef _root_.Algebra.lmul : A →ₐ[R] End R A "} -{"state":"R : Type u_1\nA : Type u_2\nB : Type u_3\ninst✝⁴ : CommSemiring R\ninst✝³ : Semiring A\ninst✝² : Semiring B\ninst✝¹ : Algebra R A\ninst✝ : Algebra R B\nsrc✝ : A →ₗ[R] A →ₗ[R] A := mul R A\n⊢ OneHom.toFun\n (↑{ toOneHom := { toFun := src✝.toFun, map_one' := (_ : AddHom.toFun src✝.toAddHom 1 = 1) },\n map_mul' :=\n (_ :\n ∀ (a b : A),\n OneHom.toFun { toFun := src✝.toFun, map_one' := (_ : AddHom.toFun src✝.toAddHom 1 = 1) } (a * b) =\n OneHom.toFun { toFun := src✝.toFun, map_one' := (_ : AddHom.toFun src✝.toAddHom 1 = 1) } a *\n OneHom.toFun { toFun := src✝.toFun, map_one' := (_ : AddHom.toFun src✝.toAddHom 1 = 1) } b) })\n 0 =\n 0","srcUpToTactic":"/-\nCopyright (c) 2018 Kenny Lau. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Kenny Lau, Yury Kudryashov\n-/\nimport Mathlib.Algebra.Algebra.Basic\nimport Mathlib.Algebra.Algebra.Equiv\nimport Mathlib.Algebra.Algebra.NonUnitalHom\nimport Mathlib.Algebra.GroupPower.IterateHom\nimport Mathlib.LinearAlgebra.TensorProduct\n\n#align_import algebra.algebra.bilinear from \"leanprover-community/mathlib\"@\"657df4339ae6ceada048c8a2980fb10e393143ec\"\n\n/-!\n# Facts about algebras involving bilinear maps and tensor products\n\nWe move a few basic statements about algebras out of `Algebra.Algebra.Basic`,\nin order to avoid importing `LinearAlgebra.BilinearMap` and\n`LinearAlgebra.TensorProduct` unnecessarily.\n-/\n\nopen TensorProduct Module\n\nnamespace LinearMap\n\nsection NonUnitalNonAssoc\n\nvariable (R A : Type*) [CommSemiring R] [NonUnitalNonAssocSemiring A] [Module R A]\n [SMulCommClass R A A] [IsScalarTower R A A]\n\n/-- The multiplication in a non-unital non-associative algebra is a bilinear map.\n\nA weaker version of this for semirings exists as `AddMonoidHom.mul`. -/\ndef mul : A →ₗ[R] A →ₗ[R] A :=\n LinearMap.mk₂ R (· * ·) add_mul smul_mul_assoc mul_add mul_smul_comm\n#align linear_map.mul LinearMap.mul\n\n/-- The multiplication map on a non-unital algebra, as an `R`-linear map from `A ⊗[R] A` to `A`. -/\nnoncomputable def mul' : A ⊗[R] A →ₗ[R] A :=\n TensorProduct.lift (mul R A)\n#align linear_map.mul' LinearMap.mul'\n\nvariable {A}\n\n/-- The multiplication on the left in a non-unital algebra is a linear map. -/\ndef mulLeft (a : A) : A →ₗ[R] A :=\n mul R A a\n#align linear_map.mul_left LinearMap.mulLeft\n\n/-- The multiplication on the right in an algebra is a linear map. -/\ndef mulRight (a : A) : A →ₗ[R] A :=\n (mul R A).flip a\n#align linear_map.mul_right LinearMap.mulRight\n\n/-- Simultaneous multiplication on the left and right is a linear map. -/\ndef mulLeftRight (ab : A × A) : A →ₗ[R] A :=\n (mulRight R ab.snd).comp (mulLeft R ab.fst)\n#align linear_map.mul_left_right LinearMap.mulLeftRight\n\n@[simp]\ntheorem mulLeft_toAddMonoidHom (a : A) : (mulLeft R a : A →+ A) = AddMonoidHom.mulLeft a :=\n rfl\n#align linear_map.mul_left_to_add_monoid_hom LinearMap.mulLeft_toAddMonoidHom\n\n@[simp]\ntheorem mulRight_toAddMonoidHom (a : A) : (mulRight R a : A →+ A) = AddMonoidHom.mulRight a :=\n rfl\n#align linear_map.mul_right_to_add_monoid_hom LinearMap.mulRight_toAddMonoidHom\n\nvariable {R}\n\n@[simp]\ntheorem mul_apply' (a b : A) : mul R A a b = a * b :=\n rfl\n#align linear_map.mul_apply' LinearMap.mul_apply'\n\n@[simp]\ntheorem mulLeft_apply (a b : A) : mulLeft R a b = a * b :=\n rfl\n#align linear_map.mul_left_apply LinearMap.mulLeft_apply\n\n@[simp]\ntheorem mulRight_apply (a b : A) : mulRight R a b = b * a :=\n rfl\n#align linear_map.mul_right_apply LinearMap.mulRight_apply\n\n@[simp]\ntheorem mulLeftRight_apply (a b x : A) : mulLeftRight R (a, b) x = a * x * b :=\n rfl\n#align linear_map.mul_left_right_apply LinearMap.mulLeftRight_apply\n\n@[simp]\ntheorem mul'_apply {a b : A} : mul' R A (a ⊗ₜ b) = a * b :=\n rfl\n#align linear_map.mul'_apply LinearMap.mul'_apply\n\n@[simp]\ntheorem mulLeft_zero_eq_zero : mulLeft R (0 : A) = 0 :=\n (mul R A).map_zero\n#align linear_map.mul_left_zero_eq_zero LinearMap.mulLeft_zero_eq_zero\n\n@[simp]\ntheorem mulRight_zero_eq_zero : mulRight R (0 : A) = 0 :=\n (mul R A).flip.map_zero\n#align linear_map.mul_right_zero_eq_zero LinearMap.mulRight_zero_eq_zero\n\nend NonUnitalNonAssoc\n\nsection NonUnital\n\nvariable (R A : Type*) [CommSemiring R] [NonUnitalSemiring A] [Module R A] [SMulCommClass R A A]\n [IsScalarTower R A A]\n\n/-- The multiplication in a non-unital algebra is a bilinear map.\n\nA weaker version of this for non-unital non-associative algebras exists as `LinearMap.mul`. -/\ndef _root_.NonUnitalAlgHom.lmul : A →ₙₐ[R] End R A :=\n { mul R A with\n map_mul' := by\n intro a b\n ext c\n exact mul_assoc a b c\n map_zero' := by\n ext a\n exact zero_mul a }\n#align non_unital_alg_hom.lmul NonUnitalAlgHom.lmul\n\nvariable {R A}\n\n@[simp]\ntheorem _root_.NonUnitalAlgHom.coe_lmul_eq_mul : ⇑(NonUnitalAlgHom.lmul R A) = mul R A :=\n rfl\n#align non_unital_alg_hom.coe_lmul_eq_mul NonUnitalAlgHom.coe_lmul_eq_mul\n\ntheorem commute_mulLeft_right (a b : A) : Commute (mulLeft R a) (mulRight R b) := by\n ext c\n exact (mul_assoc a c b).symm\n#align linear_map.commute_mul_left_right LinearMap.commute_mulLeft_right\n\n@[simp]\ntheorem mulLeft_mul (a b : A) : mulLeft R (a * b) = (mulLeft R a).comp (mulLeft R b) := by\n ext\n simp only [mulLeft_apply, comp_apply, mul_assoc]\n#align linear_map.mul_left_mul LinearMap.mulLeft_mul\n\n@[simp]\ntheorem mulRight_mul (a b : A) : mulRight R (a * b) = (mulRight R b).comp (mulRight R a) := by\n ext\n simp only [mulRight_apply, comp_apply, mul_assoc]\n#align linear_map.mul_right_mul LinearMap.mulRight_mul\n\nend NonUnital\n\nsection Semiring\n\nvariable (R A B : Type*) [CommSemiring R] [Semiring A] [Semiring B] [Algebra R A] [Algebra R B]\n\nvariable {R A B} in\n/-- A `LinearMap` preserves multiplication if pre- and post- composition with `LinearMap.mul` are\nequivalent. By converting the statement into an equality of `LinearMap`s, this lemma allows various\nspecialized `ext` lemmas about `→ₗ[R]` to then be applied.\n\nThis is the `LinearMap` version of `AddMonoidHom.map_mul_iff`. -/\ntheorem map_mul_iff (f : A →ₗ[R] B) :\n (∀ x y, f (x * y) = f x * f y) ↔\n (LinearMap.mul R A).compr₂ f = (LinearMap.mul R B ∘ₗ f).compl₂ f :=\n Iff.symm LinearMap.ext_iff₂\n\n/-- The multiplication in an algebra is an algebra homomorphism into the endomorphisms on\nthe algebra.\n\nA weaker version of this for non-unital algebras exists as `NonUnitalAlgHom.mul`. -/\ndef _root_.Algebra.lmul : A →ₐ[R] End R A :=\n { LinearMap.mul R A with\n map_one' := by\n ext a\n exact one_mul a\n map_mul' := by\n intro a b\n ext c\n exact mul_assoc a b c\n map_zero' := by\n ","nextTactic":"ext a","declUpToTactic":"/-- The multiplication in an algebra is an algebra homomorphism into the endomorphisms on\nthe algebra.\n\nA weaker version of this for non-unital algebras exists as `NonUnitalAlgHom.mul`. -/\ndef _root_.Algebra.lmul : A →ₐ[R] End R A :=\n { LinearMap.mul R A with\n map_one' := by\n ext a\n exact one_mul a\n map_mul' := by\n intro a b\n ext c\n exact mul_assoc a b c\n map_zero' := by\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Bilinear.169_0.cGBk1UxpwLhzgI8","decl":"/-- The multiplication in an algebra is an algebra homomorphism into the endomorphisms on\nthe algebra.\n\nA weaker version of this for non-unital algebras exists as `NonUnitalAlgHom.mul`. -/\ndef _root_.Algebra.lmul : A →ₐ[R] End R A "} -{"state":"case h\nR : Type u_1\nA : Type u_2\nB : Type u_3\ninst✝⁴ : CommSemiring R\ninst✝³ : Semiring A\ninst✝² : Semiring B\ninst✝¹ : Algebra R A\ninst✝ : Algebra R B\nsrc✝ : A →ₗ[R] A →ₗ[R] A := mul R A\na : A\n⊢ (OneHom.toFun\n (↑{ toOneHom := { toFun := src✝.toFun, map_one' := (_ : AddHom.toFun src✝.toAddHom 1 = 1) },\n map_mul' :=\n (_ :\n ∀ (a b : A),\n OneHom.toFun { toFun := src✝.toFun, map_one' := (_ : AddHom.toFun src✝.toAddHom 1 = 1) } (a * b) =\n OneHom.toFun { toFun := src✝.toFun, map_one' := (_ : AddHom.toFun src✝.toAddHom 1 = 1) } a *\n OneHom.toFun { toFun := src✝.toFun, map_one' := (_ : AddHom.toFun src✝.toAddHom 1 = 1) } b) })\n 0)\n a =\n 0 a","srcUpToTactic":"/-\nCopyright (c) 2018 Kenny Lau. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Kenny Lau, Yury Kudryashov\n-/\nimport Mathlib.Algebra.Algebra.Basic\nimport Mathlib.Algebra.Algebra.Equiv\nimport Mathlib.Algebra.Algebra.NonUnitalHom\nimport Mathlib.Algebra.GroupPower.IterateHom\nimport Mathlib.LinearAlgebra.TensorProduct\n\n#align_import algebra.algebra.bilinear from \"leanprover-community/mathlib\"@\"657df4339ae6ceada048c8a2980fb10e393143ec\"\n\n/-!\n# Facts about algebras involving bilinear maps and tensor products\n\nWe move a few basic statements about algebras out of `Algebra.Algebra.Basic`,\nin order to avoid importing `LinearAlgebra.BilinearMap` and\n`LinearAlgebra.TensorProduct` unnecessarily.\n-/\n\nopen TensorProduct Module\n\nnamespace LinearMap\n\nsection NonUnitalNonAssoc\n\nvariable (R A : Type*) [CommSemiring R] [NonUnitalNonAssocSemiring A] [Module R A]\n [SMulCommClass R A A] [IsScalarTower R A A]\n\n/-- The multiplication in a non-unital non-associative algebra is a bilinear map.\n\nA weaker version of this for semirings exists as `AddMonoidHom.mul`. -/\ndef mul : A →ₗ[R] A →ₗ[R] A :=\n LinearMap.mk₂ R (· * ·) add_mul smul_mul_assoc mul_add mul_smul_comm\n#align linear_map.mul LinearMap.mul\n\n/-- The multiplication map on a non-unital algebra, as an `R`-linear map from `A ⊗[R] A` to `A`. -/\nnoncomputable def mul' : A ⊗[R] A →ₗ[R] A :=\n TensorProduct.lift (mul R A)\n#align linear_map.mul' LinearMap.mul'\n\nvariable {A}\n\n/-- The multiplication on the left in a non-unital algebra is a linear map. -/\ndef mulLeft (a : A) : A →ₗ[R] A :=\n mul R A a\n#align linear_map.mul_left LinearMap.mulLeft\n\n/-- The multiplication on the right in an algebra is a linear map. -/\ndef mulRight (a : A) : A →ₗ[R] A :=\n (mul R A).flip a\n#align linear_map.mul_right LinearMap.mulRight\n\n/-- Simultaneous multiplication on the left and right is a linear map. -/\ndef mulLeftRight (ab : A × A) : A →ₗ[R] A :=\n (mulRight R ab.snd).comp (mulLeft R ab.fst)\n#align linear_map.mul_left_right LinearMap.mulLeftRight\n\n@[simp]\ntheorem mulLeft_toAddMonoidHom (a : A) : (mulLeft R a : A →+ A) = AddMonoidHom.mulLeft a :=\n rfl\n#align linear_map.mul_left_to_add_monoid_hom LinearMap.mulLeft_toAddMonoidHom\n\n@[simp]\ntheorem mulRight_toAddMonoidHom (a : A) : (mulRight R a : A →+ A) = AddMonoidHom.mulRight a :=\n rfl\n#align linear_map.mul_right_to_add_monoid_hom LinearMap.mulRight_toAddMonoidHom\n\nvariable {R}\n\n@[simp]\ntheorem mul_apply' (a b : A) : mul R A a b = a * b :=\n rfl\n#align linear_map.mul_apply' LinearMap.mul_apply'\n\n@[simp]\ntheorem mulLeft_apply (a b : A) : mulLeft R a b = a * b :=\n rfl\n#align linear_map.mul_left_apply LinearMap.mulLeft_apply\n\n@[simp]\ntheorem mulRight_apply (a b : A) : mulRight R a b = b * a :=\n rfl\n#align linear_map.mul_right_apply LinearMap.mulRight_apply\n\n@[simp]\ntheorem mulLeftRight_apply (a b x : A) : mulLeftRight R (a, b) x = a * x * b :=\n rfl\n#align linear_map.mul_left_right_apply LinearMap.mulLeftRight_apply\n\n@[simp]\ntheorem mul'_apply {a b : A} : mul' R A (a ⊗ₜ b) = a * b :=\n rfl\n#align linear_map.mul'_apply LinearMap.mul'_apply\n\n@[simp]\ntheorem mulLeft_zero_eq_zero : mulLeft R (0 : A) = 0 :=\n (mul R A).map_zero\n#align linear_map.mul_left_zero_eq_zero LinearMap.mulLeft_zero_eq_zero\n\n@[simp]\ntheorem mulRight_zero_eq_zero : mulRight R (0 : A) = 0 :=\n (mul R A).flip.map_zero\n#align linear_map.mul_right_zero_eq_zero LinearMap.mulRight_zero_eq_zero\n\nend NonUnitalNonAssoc\n\nsection NonUnital\n\nvariable (R A : Type*) [CommSemiring R] [NonUnitalSemiring A] [Module R A] [SMulCommClass R A A]\n [IsScalarTower R A A]\n\n/-- The multiplication in a non-unital algebra is a bilinear map.\n\nA weaker version of this for non-unital non-associative algebras exists as `LinearMap.mul`. -/\ndef _root_.NonUnitalAlgHom.lmul : A →ₙₐ[R] End R A :=\n { mul R A with\n map_mul' := by\n intro a b\n ext c\n exact mul_assoc a b c\n map_zero' := by\n ext a\n exact zero_mul a }\n#align non_unital_alg_hom.lmul NonUnitalAlgHom.lmul\n\nvariable {R A}\n\n@[simp]\ntheorem _root_.NonUnitalAlgHom.coe_lmul_eq_mul : ⇑(NonUnitalAlgHom.lmul R A) = mul R A :=\n rfl\n#align non_unital_alg_hom.coe_lmul_eq_mul NonUnitalAlgHom.coe_lmul_eq_mul\n\ntheorem commute_mulLeft_right (a b : A) : Commute (mulLeft R a) (mulRight R b) := by\n ext c\n exact (mul_assoc a c b).symm\n#align linear_map.commute_mul_left_right LinearMap.commute_mulLeft_right\n\n@[simp]\ntheorem mulLeft_mul (a b : A) : mulLeft R (a * b) = (mulLeft R a).comp (mulLeft R b) := by\n ext\n simp only [mulLeft_apply, comp_apply, mul_assoc]\n#align linear_map.mul_left_mul LinearMap.mulLeft_mul\n\n@[simp]\ntheorem mulRight_mul (a b : A) : mulRight R (a * b) = (mulRight R b).comp (mulRight R a) := by\n ext\n simp only [mulRight_apply, comp_apply, mul_assoc]\n#align linear_map.mul_right_mul LinearMap.mulRight_mul\n\nend NonUnital\n\nsection Semiring\n\nvariable (R A B : Type*) [CommSemiring R] [Semiring A] [Semiring B] [Algebra R A] [Algebra R B]\n\nvariable {R A B} in\n/-- A `LinearMap` preserves multiplication if pre- and post- composition with `LinearMap.mul` are\nequivalent. By converting the statement into an equality of `LinearMap`s, this lemma allows various\nspecialized `ext` lemmas about `→ₗ[R]` to then be applied.\n\nThis is the `LinearMap` version of `AddMonoidHom.map_mul_iff`. -/\ntheorem map_mul_iff (f : A →ₗ[R] B) :\n (∀ x y, f (x * y) = f x * f y) ↔\n (LinearMap.mul R A).compr₂ f = (LinearMap.mul R B ∘ₗ f).compl₂ f :=\n Iff.symm LinearMap.ext_iff₂\n\n/-- The multiplication in an algebra is an algebra homomorphism into the endomorphisms on\nthe algebra.\n\nA weaker version of this for non-unital algebras exists as `NonUnitalAlgHom.mul`. -/\ndef _root_.Algebra.lmul : A →ₐ[R] End R A :=\n { LinearMap.mul R A with\n map_one' := by\n ext a\n exact one_mul a\n map_mul' := by\n intro a b\n ext c\n exact mul_assoc a b c\n map_zero' := by\n ext a\n ","nextTactic":"exact zero_mul a","declUpToTactic":"/-- The multiplication in an algebra is an algebra homomorphism into the endomorphisms on\nthe algebra.\n\nA weaker version of this for non-unital algebras exists as `NonUnitalAlgHom.mul`. -/\ndef _root_.Algebra.lmul : A →ₐ[R] End R A :=\n { LinearMap.mul R A with\n map_one' := by\n ext a\n exact one_mul a\n map_mul' := by\n intro a b\n ext c\n exact mul_assoc a b c\n map_zero' := by\n ext a\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Bilinear.169_0.cGBk1UxpwLhzgI8","decl":"/-- The multiplication in an algebra is an algebra homomorphism into the endomorphisms on\nthe algebra.\n\nA weaker version of this for non-unital algebras exists as `NonUnitalAlgHom.mul`. -/\ndef _root_.Algebra.lmul : A →ₐ[R] End R A "} -{"state":"R : Type u_1\nA : Type u_2\nB : Type u_3\ninst✝⁴ : CommSemiring R\ninst✝³ : Semiring A\ninst✝² : Semiring B\ninst✝¹ : Algebra R A\ninst✝ : Algebra R B\nsrc✝ : A →ₗ[R] A →ₗ[R] A := mul R A\n⊢ ∀ (r : R),\n OneHom.toFun\n (↑↑{\n toMonoidHom :=\n { toOneHom := { toFun := src✝.toFun, map_one' := (_ : AddHom.toFun src✝.toAddHom 1 = 1) },\n map_mul' :=\n (_ :\n ∀ (a b : A),\n OneHom.toFun { toFun := src✝.toFun, map_one' := (_ : AddHom.toFun src✝.toAddHom 1 = 1) }\n (a * b) =\n OneHom.toFun { toFun := src✝.toFun, map_one' := (_ : AddHom.toFun src✝.toAddHom 1 = 1) } a *\n OneHom.toFun { toFun := src✝.toFun, map_one' := (_ : AddHom.toFun src✝.toAddHom 1 = 1) }\n b) },\n map_zero' :=\n (_ :\n OneHom.toFun\n (↑{ toOneHom := { toFun := src✝.toFun, map_one' := (_ : AddHom.toFun src✝.toAddHom 1 = 1) },\n map_mul' :=\n (_ :\n ∀ (a b : A),\n OneHom.toFun { toFun := src✝.toFun, map_one' := (_ : AddHom.toFun src✝.toAddHom 1 = 1) }\n (a * b) =\n OneHom.toFun\n { toFun := src✝.toFun, map_one' := (_ : AddHom.toFun src✝.toAddHom 1 = 1) } a *\n OneHom.toFun\n { toFun := src✝.toFun, map_one' := (_ : AddHom.toFun src✝.toAddHom 1 = 1) } b) })\n 0 =\n 0),\n map_add' :=\n (_ :\n ∀ (x y : A),\n AddHom.toFun src✝.toAddHom (x + y) = AddHom.toFun src✝.toAddHom x + AddHom.toFun src✝.toAddHom y) })\n ((algebraMap R A) r) =\n (algebraMap R (End R A)) r","srcUpToTactic":"/-\nCopyright (c) 2018 Kenny Lau. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Kenny Lau, Yury Kudryashov\n-/\nimport Mathlib.Algebra.Algebra.Basic\nimport Mathlib.Algebra.Algebra.Equiv\nimport Mathlib.Algebra.Algebra.NonUnitalHom\nimport Mathlib.Algebra.GroupPower.IterateHom\nimport Mathlib.LinearAlgebra.TensorProduct\n\n#align_import algebra.algebra.bilinear from \"leanprover-community/mathlib\"@\"657df4339ae6ceada048c8a2980fb10e393143ec\"\n\n/-!\n# Facts about algebras involving bilinear maps and tensor products\n\nWe move a few basic statements about algebras out of `Algebra.Algebra.Basic`,\nin order to avoid importing `LinearAlgebra.BilinearMap` and\n`LinearAlgebra.TensorProduct` unnecessarily.\n-/\n\nopen TensorProduct Module\n\nnamespace LinearMap\n\nsection NonUnitalNonAssoc\n\nvariable (R A : Type*) [CommSemiring R] [NonUnitalNonAssocSemiring A] [Module R A]\n [SMulCommClass R A A] [IsScalarTower R A A]\n\n/-- The multiplication in a non-unital non-associative algebra is a bilinear map.\n\nA weaker version of this for semirings exists as `AddMonoidHom.mul`. -/\ndef mul : A →ₗ[R] A →ₗ[R] A :=\n LinearMap.mk₂ R (· * ·) add_mul smul_mul_assoc mul_add mul_smul_comm\n#align linear_map.mul LinearMap.mul\n\n/-- The multiplication map on a non-unital algebra, as an `R`-linear map from `A ⊗[R] A` to `A`. -/\nnoncomputable def mul' : A ⊗[R] A →ₗ[R] A :=\n TensorProduct.lift (mul R A)\n#align linear_map.mul' LinearMap.mul'\n\nvariable {A}\n\n/-- The multiplication on the left in a non-unital algebra is a linear map. -/\ndef mulLeft (a : A) : A →ₗ[R] A :=\n mul R A a\n#align linear_map.mul_left LinearMap.mulLeft\n\n/-- The multiplication on the right in an algebra is a linear map. -/\ndef mulRight (a : A) : A →ₗ[R] A :=\n (mul R A).flip a\n#align linear_map.mul_right LinearMap.mulRight\n\n/-- Simultaneous multiplication on the left and right is a linear map. -/\ndef mulLeftRight (ab : A × A) : A →ₗ[R] A :=\n (mulRight R ab.snd).comp (mulLeft R ab.fst)\n#align linear_map.mul_left_right LinearMap.mulLeftRight\n\n@[simp]\ntheorem mulLeft_toAddMonoidHom (a : A) : (mulLeft R a : A →+ A) = AddMonoidHom.mulLeft a :=\n rfl\n#align linear_map.mul_left_to_add_monoid_hom LinearMap.mulLeft_toAddMonoidHom\n\n@[simp]\ntheorem mulRight_toAddMonoidHom (a : A) : (mulRight R a : A →+ A) = AddMonoidHom.mulRight a :=\n rfl\n#align linear_map.mul_right_to_add_monoid_hom LinearMap.mulRight_toAddMonoidHom\n\nvariable {R}\n\n@[simp]\ntheorem mul_apply' (a b : A) : mul R A a b = a * b :=\n rfl\n#align linear_map.mul_apply' LinearMap.mul_apply'\n\n@[simp]\ntheorem mulLeft_apply (a b : A) : mulLeft R a b = a * b :=\n rfl\n#align linear_map.mul_left_apply LinearMap.mulLeft_apply\n\n@[simp]\ntheorem mulRight_apply (a b : A) : mulRight R a b = b * a :=\n rfl\n#align linear_map.mul_right_apply LinearMap.mulRight_apply\n\n@[simp]\ntheorem mulLeftRight_apply (a b x : A) : mulLeftRight R (a, b) x = a * x * b :=\n rfl\n#align linear_map.mul_left_right_apply LinearMap.mulLeftRight_apply\n\n@[simp]\ntheorem mul'_apply {a b : A} : mul' R A (a ⊗ₜ b) = a * b :=\n rfl\n#align linear_map.mul'_apply LinearMap.mul'_apply\n\n@[simp]\ntheorem mulLeft_zero_eq_zero : mulLeft R (0 : A) = 0 :=\n (mul R A).map_zero\n#align linear_map.mul_left_zero_eq_zero LinearMap.mulLeft_zero_eq_zero\n\n@[simp]\ntheorem mulRight_zero_eq_zero : mulRight R (0 : A) = 0 :=\n (mul R A).flip.map_zero\n#align linear_map.mul_right_zero_eq_zero LinearMap.mulRight_zero_eq_zero\n\nend NonUnitalNonAssoc\n\nsection NonUnital\n\nvariable (R A : Type*) [CommSemiring R] [NonUnitalSemiring A] [Module R A] [SMulCommClass R A A]\n [IsScalarTower R A A]\n\n/-- The multiplication in a non-unital algebra is a bilinear map.\n\nA weaker version of this for non-unital non-associative algebras exists as `LinearMap.mul`. -/\ndef _root_.NonUnitalAlgHom.lmul : A →ₙₐ[R] End R A :=\n { mul R A with\n map_mul' := by\n intro a b\n ext c\n exact mul_assoc a b c\n map_zero' := by\n ext a\n exact zero_mul a }\n#align non_unital_alg_hom.lmul NonUnitalAlgHom.lmul\n\nvariable {R A}\n\n@[simp]\ntheorem _root_.NonUnitalAlgHom.coe_lmul_eq_mul : ⇑(NonUnitalAlgHom.lmul R A) = mul R A :=\n rfl\n#align non_unital_alg_hom.coe_lmul_eq_mul NonUnitalAlgHom.coe_lmul_eq_mul\n\ntheorem commute_mulLeft_right (a b : A) : Commute (mulLeft R a) (mulRight R b) := by\n ext c\n exact (mul_assoc a c b).symm\n#align linear_map.commute_mul_left_right LinearMap.commute_mulLeft_right\n\n@[simp]\ntheorem mulLeft_mul (a b : A) : mulLeft R (a * b) = (mulLeft R a).comp (mulLeft R b) := by\n ext\n simp only [mulLeft_apply, comp_apply, mul_assoc]\n#align linear_map.mul_left_mul LinearMap.mulLeft_mul\n\n@[simp]\ntheorem mulRight_mul (a b : A) : mulRight R (a * b) = (mulRight R b).comp (mulRight R a) := by\n ext\n simp only [mulRight_apply, comp_apply, mul_assoc]\n#align linear_map.mul_right_mul LinearMap.mulRight_mul\n\nend NonUnital\n\nsection Semiring\n\nvariable (R A B : Type*) [CommSemiring R] [Semiring A] [Semiring B] [Algebra R A] [Algebra R B]\n\nvariable {R A B} in\n/-- A `LinearMap` preserves multiplication if pre- and post- composition with `LinearMap.mul` are\nequivalent. By converting the statement into an equality of `LinearMap`s, this lemma allows various\nspecialized `ext` lemmas about `→ₗ[R]` to then be applied.\n\nThis is the `LinearMap` version of `AddMonoidHom.map_mul_iff`. -/\ntheorem map_mul_iff (f : A →ₗ[R] B) :\n (∀ x y, f (x * y) = f x * f y) ↔\n (LinearMap.mul R A).compr₂ f = (LinearMap.mul R B ∘ₗ f).compl₂ f :=\n Iff.symm LinearMap.ext_iff₂\n\n/-- The multiplication in an algebra is an algebra homomorphism into the endomorphisms on\nthe algebra.\n\nA weaker version of this for non-unital algebras exists as `NonUnitalAlgHom.mul`. -/\ndef _root_.Algebra.lmul : A →ₐ[R] End R A :=\n { LinearMap.mul R A with\n map_one' := by\n ext a\n exact one_mul a\n map_mul' := by\n intro a b\n ext c\n exact mul_assoc a b c\n map_zero' := by\n ext a\n exact zero_mul a\n commutes' := by\n ","nextTactic":"intro r","declUpToTactic":"/-- The multiplication in an algebra is an algebra homomorphism into the endomorphisms on\nthe algebra.\n\nA weaker version of this for non-unital algebras exists as `NonUnitalAlgHom.mul`. -/\ndef _root_.Algebra.lmul : A →ₐ[R] End R A :=\n { LinearMap.mul R A with\n map_one' := by\n ext a\n exact one_mul a\n map_mul' := by\n intro a b\n ext c\n exact mul_assoc a b c\n map_zero' := by\n ext a\n exact zero_mul a\n commutes' := by\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Bilinear.169_0.cGBk1UxpwLhzgI8","decl":"/-- The multiplication in an algebra is an algebra homomorphism into the endomorphisms on\nthe algebra.\n\nA weaker version of this for non-unital algebras exists as `NonUnitalAlgHom.mul`. -/\ndef _root_.Algebra.lmul : A →ₐ[R] End R A "} -{"state":"R : Type u_1\nA : Type u_2\nB : Type u_3\ninst✝⁴ : CommSemiring R\ninst✝³ : Semiring A\ninst✝² : Semiring B\ninst✝¹ : Algebra R A\ninst✝ : Algebra R B\nsrc✝ : A →ₗ[R] A →ₗ[R] A := mul R A\nr : R\n⊢ OneHom.toFun\n (↑↑{\n toMonoidHom :=\n { toOneHom := { toFun := src✝.toFun, map_one' := (_ : AddHom.toFun src✝.toAddHom 1 = 1) },\n map_mul' :=\n (_ :\n ∀ (a b : A),\n OneHom.toFun { toFun := src✝.toFun, map_one' := (_ : AddHom.toFun src✝.toAddHom 1 = 1) } (a * b) =\n OneHom.toFun { toFun := src✝.toFun, map_one' := (_ : AddHom.toFun src✝.toAddHom 1 = 1) } a *\n OneHom.toFun { toFun := src✝.toFun, map_one' := (_ : AddHom.toFun src✝.toAddHom 1 = 1) } b) },\n map_zero' :=\n (_ :\n OneHom.toFun\n (↑{ toOneHom := { toFun := src✝.toFun, map_one' := (_ : AddHom.toFun src✝.toAddHom 1 = 1) },\n map_mul' :=\n (_ :\n ∀ (a b : A),\n OneHom.toFun { toFun := src✝.toFun, map_one' := (_ : AddHom.toFun src✝.toAddHom 1 = 1) }\n (a * b) =\n OneHom.toFun { toFun := src✝.toFun, map_one' := (_ : AddHom.toFun src✝.toAddHom 1 = 1) }\n a *\n OneHom.toFun\n { toFun := src✝.toFun, map_one' := (_ : AddHom.toFun src✝.toAddHom 1 = 1) } b) })\n 0 =\n 0),\n map_add' :=\n (_ :\n ∀ (x y : A),\n AddHom.toFun src✝.toAddHom (x + y) = AddHom.toFun src✝.toAddHom x + AddHom.toFun src✝.toAddHom y) })\n ((algebraMap R A) r) =\n (algebraMap R (End R A)) r","srcUpToTactic":"/-\nCopyright (c) 2018 Kenny Lau. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Kenny Lau, Yury Kudryashov\n-/\nimport Mathlib.Algebra.Algebra.Basic\nimport Mathlib.Algebra.Algebra.Equiv\nimport Mathlib.Algebra.Algebra.NonUnitalHom\nimport Mathlib.Algebra.GroupPower.IterateHom\nimport Mathlib.LinearAlgebra.TensorProduct\n\n#align_import algebra.algebra.bilinear from \"leanprover-community/mathlib\"@\"657df4339ae6ceada048c8a2980fb10e393143ec\"\n\n/-!\n# Facts about algebras involving bilinear maps and tensor products\n\nWe move a few basic statements about algebras out of `Algebra.Algebra.Basic`,\nin order to avoid importing `LinearAlgebra.BilinearMap` and\n`LinearAlgebra.TensorProduct` unnecessarily.\n-/\n\nopen TensorProduct Module\n\nnamespace LinearMap\n\nsection NonUnitalNonAssoc\n\nvariable (R A : Type*) [CommSemiring R] [NonUnitalNonAssocSemiring A] [Module R A]\n [SMulCommClass R A A] [IsScalarTower R A A]\n\n/-- The multiplication in a non-unital non-associative algebra is a bilinear map.\n\nA weaker version of this for semirings exists as `AddMonoidHom.mul`. -/\ndef mul : A →ₗ[R] A →ₗ[R] A :=\n LinearMap.mk₂ R (· * ·) add_mul smul_mul_assoc mul_add mul_smul_comm\n#align linear_map.mul LinearMap.mul\n\n/-- The multiplication map on a non-unital algebra, as an `R`-linear map from `A ⊗[R] A` to `A`. -/\nnoncomputable def mul' : A ⊗[R] A →ₗ[R] A :=\n TensorProduct.lift (mul R A)\n#align linear_map.mul' LinearMap.mul'\n\nvariable {A}\n\n/-- The multiplication on the left in a non-unital algebra is a linear map. -/\ndef mulLeft (a : A) : A →ₗ[R] A :=\n mul R A a\n#align linear_map.mul_left LinearMap.mulLeft\n\n/-- The multiplication on the right in an algebra is a linear map. -/\ndef mulRight (a : A) : A →ₗ[R] A :=\n (mul R A).flip a\n#align linear_map.mul_right LinearMap.mulRight\n\n/-- Simultaneous multiplication on the left and right is a linear map. -/\ndef mulLeftRight (ab : A × A) : A →ₗ[R] A :=\n (mulRight R ab.snd).comp (mulLeft R ab.fst)\n#align linear_map.mul_left_right LinearMap.mulLeftRight\n\n@[simp]\ntheorem mulLeft_toAddMonoidHom (a : A) : (mulLeft R a : A →+ A) = AddMonoidHom.mulLeft a :=\n rfl\n#align linear_map.mul_left_to_add_monoid_hom LinearMap.mulLeft_toAddMonoidHom\n\n@[simp]\ntheorem mulRight_toAddMonoidHom (a : A) : (mulRight R a : A →+ A) = AddMonoidHom.mulRight a :=\n rfl\n#align linear_map.mul_right_to_add_monoid_hom LinearMap.mulRight_toAddMonoidHom\n\nvariable {R}\n\n@[simp]\ntheorem mul_apply' (a b : A) : mul R A a b = a * b :=\n rfl\n#align linear_map.mul_apply' LinearMap.mul_apply'\n\n@[simp]\ntheorem mulLeft_apply (a b : A) : mulLeft R a b = a * b :=\n rfl\n#align linear_map.mul_left_apply LinearMap.mulLeft_apply\n\n@[simp]\ntheorem mulRight_apply (a b : A) : mulRight R a b = b * a :=\n rfl\n#align linear_map.mul_right_apply LinearMap.mulRight_apply\n\n@[simp]\ntheorem mulLeftRight_apply (a b x : A) : mulLeftRight R (a, b) x = a * x * b :=\n rfl\n#align linear_map.mul_left_right_apply LinearMap.mulLeftRight_apply\n\n@[simp]\ntheorem mul'_apply {a b : A} : mul' R A (a ⊗ₜ b) = a * b :=\n rfl\n#align linear_map.mul'_apply LinearMap.mul'_apply\n\n@[simp]\ntheorem mulLeft_zero_eq_zero : mulLeft R (0 : A) = 0 :=\n (mul R A).map_zero\n#align linear_map.mul_left_zero_eq_zero LinearMap.mulLeft_zero_eq_zero\n\n@[simp]\ntheorem mulRight_zero_eq_zero : mulRight R (0 : A) = 0 :=\n (mul R A).flip.map_zero\n#align linear_map.mul_right_zero_eq_zero LinearMap.mulRight_zero_eq_zero\n\nend NonUnitalNonAssoc\n\nsection NonUnital\n\nvariable (R A : Type*) [CommSemiring R] [NonUnitalSemiring A] [Module R A] [SMulCommClass R A A]\n [IsScalarTower R A A]\n\n/-- The multiplication in a non-unital algebra is a bilinear map.\n\nA weaker version of this for non-unital non-associative algebras exists as `LinearMap.mul`. -/\ndef _root_.NonUnitalAlgHom.lmul : A →ₙₐ[R] End R A :=\n { mul R A with\n map_mul' := by\n intro a b\n ext c\n exact mul_assoc a b c\n map_zero' := by\n ext a\n exact zero_mul a }\n#align non_unital_alg_hom.lmul NonUnitalAlgHom.lmul\n\nvariable {R A}\n\n@[simp]\ntheorem _root_.NonUnitalAlgHom.coe_lmul_eq_mul : ⇑(NonUnitalAlgHom.lmul R A) = mul R A :=\n rfl\n#align non_unital_alg_hom.coe_lmul_eq_mul NonUnitalAlgHom.coe_lmul_eq_mul\n\ntheorem commute_mulLeft_right (a b : A) : Commute (mulLeft R a) (mulRight R b) := by\n ext c\n exact (mul_assoc a c b).symm\n#align linear_map.commute_mul_left_right LinearMap.commute_mulLeft_right\n\n@[simp]\ntheorem mulLeft_mul (a b : A) : mulLeft R (a * b) = (mulLeft R a).comp (mulLeft R b) := by\n ext\n simp only [mulLeft_apply, comp_apply, mul_assoc]\n#align linear_map.mul_left_mul LinearMap.mulLeft_mul\n\n@[simp]\ntheorem mulRight_mul (a b : A) : mulRight R (a * b) = (mulRight R b).comp (mulRight R a) := by\n ext\n simp only [mulRight_apply, comp_apply, mul_assoc]\n#align linear_map.mul_right_mul LinearMap.mulRight_mul\n\nend NonUnital\n\nsection Semiring\n\nvariable (R A B : Type*) [CommSemiring R] [Semiring A] [Semiring B] [Algebra R A] [Algebra R B]\n\nvariable {R A B} in\n/-- A `LinearMap` preserves multiplication if pre- and post- composition with `LinearMap.mul` are\nequivalent. By converting the statement into an equality of `LinearMap`s, this lemma allows various\nspecialized `ext` lemmas about `→ₗ[R]` to then be applied.\n\nThis is the `LinearMap` version of `AddMonoidHom.map_mul_iff`. -/\ntheorem map_mul_iff (f : A →ₗ[R] B) :\n (∀ x y, f (x * y) = f x * f y) ↔\n (LinearMap.mul R A).compr₂ f = (LinearMap.mul R B ∘ₗ f).compl₂ f :=\n Iff.symm LinearMap.ext_iff₂\n\n/-- The multiplication in an algebra is an algebra homomorphism into the endomorphisms on\nthe algebra.\n\nA weaker version of this for non-unital algebras exists as `NonUnitalAlgHom.mul`. -/\ndef _root_.Algebra.lmul : A →ₐ[R] End R A :=\n { LinearMap.mul R A with\n map_one' := by\n ext a\n exact one_mul a\n map_mul' := by\n intro a b\n ext c\n exact mul_assoc a b c\n map_zero' := by\n ext a\n exact zero_mul a\n commutes' := by\n intro r\n ","nextTactic":"ext a","declUpToTactic":"/-- The multiplication in an algebra is an algebra homomorphism into the endomorphisms on\nthe algebra.\n\nA weaker version of this for non-unital algebras exists as `NonUnitalAlgHom.mul`. -/\ndef _root_.Algebra.lmul : A →ₐ[R] End R A :=\n { LinearMap.mul R A with\n map_one' := by\n ext a\n exact one_mul a\n map_mul' := by\n intro a b\n ext c\n exact mul_assoc a b c\n map_zero' := by\n ext a\n exact zero_mul a\n commutes' := by\n intro r\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Bilinear.169_0.cGBk1UxpwLhzgI8","decl":"/-- The multiplication in an algebra is an algebra homomorphism into the endomorphisms on\nthe algebra.\n\nA weaker version of this for non-unital algebras exists as `NonUnitalAlgHom.mul`. -/\ndef _root_.Algebra.lmul : A →ₐ[R] End R A "} -{"state":"case h\nR : Type u_1\nA : Type u_2\nB : Type u_3\ninst✝⁴ : CommSemiring R\ninst✝³ : Semiring A\ninst✝² : Semiring B\ninst✝¹ : Algebra R A\ninst✝ : Algebra R B\nsrc✝ : A →ₗ[R] A →ₗ[R] A := mul R A\nr : R\na : A\n⊢ (OneHom.toFun\n (↑↑{\n toMonoidHom :=\n { toOneHom := { toFun := src✝.toFun, map_one' := (_ : AddHom.toFun src✝.toAddHom 1 = 1) },\n map_mul' :=\n (_ :\n ∀ (a b : A),\n OneHom.toFun { toFun := src✝.toFun, map_one' := (_ : AddHom.toFun src✝.toAddHom 1 = 1) }\n (a * b) =\n OneHom.toFun { toFun := src✝.toFun, map_one' := (_ : AddHom.toFun src✝.toAddHom 1 = 1) } a *\n OneHom.toFun { toFun := src✝.toFun, map_one' := (_ : AddHom.toFun src✝.toAddHom 1 = 1) }\n b) },\n map_zero' :=\n (_ :\n OneHom.toFun\n (↑{ toOneHom := { toFun := src✝.toFun, map_one' := (_ : AddHom.toFun src✝.toAddHom 1 = 1) },\n map_mul' :=\n (_ :\n ∀ (a b : A),\n OneHom.toFun { toFun := src✝.toFun, map_one' := (_ : AddHom.toFun src✝.toAddHom 1 = 1) }\n (a * b) =\n OneHom.toFun\n { toFun := src✝.toFun, map_one' := (_ : AddHom.toFun src✝.toAddHom 1 = 1) } a *\n OneHom.toFun\n { toFun := src✝.toFun, map_one' := (_ : AddHom.toFun src✝.toAddHom 1 = 1) } b) })\n 0 =\n 0),\n map_add' :=\n (_ :\n ∀ (x y : A),\n AddHom.toFun src✝.toAddHom (x + y) = AddHom.toFun src✝.toAddHom x + AddHom.toFun src✝.toAddHom y) })\n ((algebraMap R A) r))\n a =\n ((algebraMap R (End R A)) r) a","srcUpToTactic":"/-\nCopyright (c) 2018 Kenny Lau. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Kenny Lau, Yury Kudryashov\n-/\nimport Mathlib.Algebra.Algebra.Basic\nimport Mathlib.Algebra.Algebra.Equiv\nimport Mathlib.Algebra.Algebra.NonUnitalHom\nimport Mathlib.Algebra.GroupPower.IterateHom\nimport Mathlib.LinearAlgebra.TensorProduct\n\n#align_import algebra.algebra.bilinear from \"leanprover-community/mathlib\"@\"657df4339ae6ceada048c8a2980fb10e393143ec\"\n\n/-!\n# Facts about algebras involving bilinear maps and tensor products\n\nWe move a few basic statements about algebras out of `Algebra.Algebra.Basic`,\nin order to avoid importing `LinearAlgebra.BilinearMap` and\n`LinearAlgebra.TensorProduct` unnecessarily.\n-/\n\nopen TensorProduct Module\n\nnamespace LinearMap\n\nsection NonUnitalNonAssoc\n\nvariable (R A : Type*) [CommSemiring R] [NonUnitalNonAssocSemiring A] [Module R A]\n [SMulCommClass R A A] [IsScalarTower R A A]\n\n/-- The multiplication in a non-unital non-associative algebra is a bilinear map.\n\nA weaker version of this for semirings exists as `AddMonoidHom.mul`. -/\ndef mul : A →ₗ[R] A →ₗ[R] A :=\n LinearMap.mk₂ R (· * ·) add_mul smul_mul_assoc mul_add mul_smul_comm\n#align linear_map.mul LinearMap.mul\n\n/-- The multiplication map on a non-unital algebra, as an `R`-linear map from `A ⊗[R] A` to `A`. -/\nnoncomputable def mul' : A ⊗[R] A →ₗ[R] A :=\n TensorProduct.lift (mul R A)\n#align linear_map.mul' LinearMap.mul'\n\nvariable {A}\n\n/-- The multiplication on the left in a non-unital algebra is a linear map. -/\ndef mulLeft (a : A) : A →ₗ[R] A :=\n mul R A a\n#align linear_map.mul_left LinearMap.mulLeft\n\n/-- The multiplication on the right in an algebra is a linear map. -/\ndef mulRight (a : A) : A →ₗ[R] A :=\n (mul R A).flip a\n#align linear_map.mul_right LinearMap.mulRight\n\n/-- Simultaneous multiplication on the left and right is a linear map. -/\ndef mulLeftRight (ab : A × A) : A →ₗ[R] A :=\n (mulRight R ab.snd).comp (mulLeft R ab.fst)\n#align linear_map.mul_left_right LinearMap.mulLeftRight\n\n@[simp]\ntheorem mulLeft_toAddMonoidHom (a : A) : (mulLeft R a : A →+ A) = AddMonoidHom.mulLeft a :=\n rfl\n#align linear_map.mul_left_to_add_monoid_hom LinearMap.mulLeft_toAddMonoidHom\n\n@[simp]\ntheorem mulRight_toAddMonoidHom (a : A) : (mulRight R a : A →+ A) = AddMonoidHom.mulRight a :=\n rfl\n#align linear_map.mul_right_to_add_monoid_hom LinearMap.mulRight_toAddMonoidHom\n\nvariable {R}\n\n@[simp]\ntheorem mul_apply' (a b : A) : mul R A a b = a * b :=\n rfl\n#align linear_map.mul_apply' LinearMap.mul_apply'\n\n@[simp]\ntheorem mulLeft_apply (a b : A) : mulLeft R a b = a * b :=\n rfl\n#align linear_map.mul_left_apply LinearMap.mulLeft_apply\n\n@[simp]\ntheorem mulRight_apply (a b : A) : mulRight R a b = b * a :=\n rfl\n#align linear_map.mul_right_apply LinearMap.mulRight_apply\n\n@[simp]\ntheorem mulLeftRight_apply (a b x : A) : mulLeftRight R (a, b) x = a * x * b :=\n rfl\n#align linear_map.mul_left_right_apply LinearMap.mulLeftRight_apply\n\n@[simp]\ntheorem mul'_apply {a b : A} : mul' R A (a ⊗ₜ b) = a * b :=\n rfl\n#align linear_map.mul'_apply LinearMap.mul'_apply\n\n@[simp]\ntheorem mulLeft_zero_eq_zero : mulLeft R (0 : A) = 0 :=\n (mul R A).map_zero\n#align linear_map.mul_left_zero_eq_zero LinearMap.mulLeft_zero_eq_zero\n\n@[simp]\ntheorem mulRight_zero_eq_zero : mulRight R (0 : A) = 0 :=\n (mul R A).flip.map_zero\n#align linear_map.mul_right_zero_eq_zero LinearMap.mulRight_zero_eq_zero\n\nend NonUnitalNonAssoc\n\nsection NonUnital\n\nvariable (R A : Type*) [CommSemiring R] [NonUnitalSemiring A] [Module R A] [SMulCommClass R A A]\n [IsScalarTower R A A]\n\n/-- The multiplication in a non-unital algebra is a bilinear map.\n\nA weaker version of this for non-unital non-associative algebras exists as `LinearMap.mul`. -/\ndef _root_.NonUnitalAlgHom.lmul : A →ₙₐ[R] End R A :=\n { mul R A with\n map_mul' := by\n intro a b\n ext c\n exact mul_assoc a b c\n map_zero' := by\n ext a\n exact zero_mul a }\n#align non_unital_alg_hom.lmul NonUnitalAlgHom.lmul\n\nvariable {R A}\n\n@[simp]\ntheorem _root_.NonUnitalAlgHom.coe_lmul_eq_mul : ⇑(NonUnitalAlgHom.lmul R A) = mul R A :=\n rfl\n#align non_unital_alg_hom.coe_lmul_eq_mul NonUnitalAlgHom.coe_lmul_eq_mul\n\ntheorem commute_mulLeft_right (a b : A) : Commute (mulLeft R a) (mulRight R b) := by\n ext c\n exact (mul_assoc a c b).symm\n#align linear_map.commute_mul_left_right LinearMap.commute_mulLeft_right\n\n@[simp]\ntheorem mulLeft_mul (a b : A) : mulLeft R (a * b) = (mulLeft R a).comp (mulLeft R b) := by\n ext\n simp only [mulLeft_apply, comp_apply, mul_assoc]\n#align linear_map.mul_left_mul LinearMap.mulLeft_mul\n\n@[simp]\ntheorem mulRight_mul (a b : A) : mulRight R (a * b) = (mulRight R b).comp (mulRight R a) := by\n ext\n simp only [mulRight_apply, comp_apply, mul_assoc]\n#align linear_map.mul_right_mul LinearMap.mulRight_mul\n\nend NonUnital\n\nsection Semiring\n\nvariable (R A B : Type*) [CommSemiring R] [Semiring A] [Semiring B] [Algebra R A] [Algebra R B]\n\nvariable {R A B} in\n/-- A `LinearMap` preserves multiplication if pre- and post- composition with `LinearMap.mul` are\nequivalent. By converting the statement into an equality of `LinearMap`s, this lemma allows various\nspecialized `ext` lemmas about `→ₗ[R]` to then be applied.\n\nThis is the `LinearMap` version of `AddMonoidHom.map_mul_iff`. -/\ntheorem map_mul_iff (f : A →ₗ[R] B) :\n (∀ x y, f (x * y) = f x * f y) ↔\n (LinearMap.mul R A).compr₂ f = (LinearMap.mul R B ∘ₗ f).compl₂ f :=\n Iff.symm LinearMap.ext_iff₂\n\n/-- The multiplication in an algebra is an algebra homomorphism into the endomorphisms on\nthe algebra.\n\nA weaker version of this for non-unital algebras exists as `NonUnitalAlgHom.mul`. -/\ndef _root_.Algebra.lmul : A →ₐ[R] End R A :=\n { LinearMap.mul R A with\n map_one' := by\n ext a\n exact one_mul a\n map_mul' := by\n intro a b\n ext c\n exact mul_assoc a b c\n map_zero' := by\n ext a\n exact zero_mul a\n commutes' := by\n intro r\n ext a\n ","nextTactic":"exact (Algebra.smul_def r a).symm","declUpToTactic":"/-- The multiplication in an algebra is an algebra homomorphism into the endomorphisms on\nthe algebra.\n\nA weaker version of this for non-unital algebras exists as `NonUnitalAlgHom.mul`. -/\ndef _root_.Algebra.lmul : A →ₐ[R] End R A :=\n { LinearMap.mul R A with\n map_one' := by\n ext a\n exact one_mul a\n map_mul' := by\n intro a b\n ext c\n exact mul_assoc a b c\n map_zero' := by\n ext a\n exact zero_mul a\n commutes' := by\n intro r\n ext a\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Bilinear.169_0.cGBk1UxpwLhzgI8","decl":"/-- The multiplication in an algebra is an algebra homomorphism into the endomorphisms on\nthe algebra.\n\nA weaker version of this for non-unital algebras exists as `NonUnitalAlgHom.mul`. -/\ndef _root_.Algebra.lmul : A →ₐ[R] End R A "} -{"state":"R : Type u_1\nA : Type u_2\nB : Type u_3\ninst✝⁴ : CommSemiring R\ninst✝³ : Semiring A\ninst✝² : Semiring B\ninst✝¹ : Algebra R A\ninst✝ : Algebra R B\na₁ a₂ : A\nh : (Algebra.lmul R A) a₁ = (Algebra.lmul R A) a₂\n⊢ a₁ = a₂","srcUpToTactic":"/-\nCopyright (c) 2018 Kenny Lau. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Kenny Lau, Yury Kudryashov\n-/\nimport Mathlib.Algebra.Algebra.Basic\nimport Mathlib.Algebra.Algebra.Equiv\nimport Mathlib.Algebra.Algebra.NonUnitalHom\nimport Mathlib.Algebra.GroupPower.IterateHom\nimport Mathlib.LinearAlgebra.TensorProduct\n\n#align_import algebra.algebra.bilinear from \"leanprover-community/mathlib\"@\"657df4339ae6ceada048c8a2980fb10e393143ec\"\n\n/-!\n# Facts about algebras involving bilinear maps and tensor products\n\nWe move a few basic statements about algebras out of `Algebra.Algebra.Basic`,\nin order to avoid importing `LinearAlgebra.BilinearMap` and\n`LinearAlgebra.TensorProduct` unnecessarily.\n-/\n\nopen TensorProduct Module\n\nnamespace LinearMap\n\nsection NonUnitalNonAssoc\n\nvariable (R A : Type*) [CommSemiring R] [NonUnitalNonAssocSemiring A] [Module R A]\n [SMulCommClass R A A] [IsScalarTower R A A]\n\n/-- The multiplication in a non-unital non-associative algebra is a bilinear map.\n\nA weaker version of this for semirings exists as `AddMonoidHom.mul`. -/\ndef mul : A →ₗ[R] A →ₗ[R] A :=\n LinearMap.mk₂ R (· * ·) add_mul smul_mul_assoc mul_add mul_smul_comm\n#align linear_map.mul LinearMap.mul\n\n/-- The multiplication map on a non-unital algebra, as an `R`-linear map from `A ⊗[R] A` to `A`. -/\nnoncomputable def mul' : A ⊗[R] A →ₗ[R] A :=\n TensorProduct.lift (mul R A)\n#align linear_map.mul' LinearMap.mul'\n\nvariable {A}\n\n/-- The multiplication on the left in a non-unital algebra is a linear map. -/\ndef mulLeft (a : A) : A →ₗ[R] A :=\n mul R A a\n#align linear_map.mul_left LinearMap.mulLeft\n\n/-- The multiplication on the right in an algebra is a linear map. -/\ndef mulRight (a : A) : A →ₗ[R] A :=\n (mul R A).flip a\n#align linear_map.mul_right LinearMap.mulRight\n\n/-- Simultaneous multiplication on the left and right is a linear map. -/\ndef mulLeftRight (ab : A × A) : A →ₗ[R] A :=\n (mulRight R ab.snd).comp (mulLeft R ab.fst)\n#align linear_map.mul_left_right LinearMap.mulLeftRight\n\n@[simp]\ntheorem mulLeft_toAddMonoidHom (a : A) : (mulLeft R a : A →+ A) = AddMonoidHom.mulLeft a :=\n rfl\n#align linear_map.mul_left_to_add_monoid_hom LinearMap.mulLeft_toAddMonoidHom\n\n@[simp]\ntheorem mulRight_toAddMonoidHom (a : A) : (mulRight R a : A →+ A) = AddMonoidHom.mulRight a :=\n rfl\n#align linear_map.mul_right_to_add_monoid_hom LinearMap.mulRight_toAddMonoidHom\n\nvariable {R}\n\n@[simp]\ntheorem mul_apply' (a b : A) : mul R A a b = a * b :=\n rfl\n#align linear_map.mul_apply' LinearMap.mul_apply'\n\n@[simp]\ntheorem mulLeft_apply (a b : A) : mulLeft R a b = a * b :=\n rfl\n#align linear_map.mul_left_apply LinearMap.mulLeft_apply\n\n@[simp]\ntheorem mulRight_apply (a b : A) : mulRight R a b = b * a :=\n rfl\n#align linear_map.mul_right_apply LinearMap.mulRight_apply\n\n@[simp]\ntheorem mulLeftRight_apply (a b x : A) : mulLeftRight R (a, b) x = a * x * b :=\n rfl\n#align linear_map.mul_left_right_apply LinearMap.mulLeftRight_apply\n\n@[simp]\ntheorem mul'_apply {a b : A} : mul' R A (a ⊗ₜ b) = a * b :=\n rfl\n#align linear_map.mul'_apply LinearMap.mul'_apply\n\n@[simp]\ntheorem mulLeft_zero_eq_zero : mulLeft R (0 : A) = 0 :=\n (mul R A).map_zero\n#align linear_map.mul_left_zero_eq_zero LinearMap.mulLeft_zero_eq_zero\n\n@[simp]\ntheorem mulRight_zero_eq_zero : mulRight R (0 : A) = 0 :=\n (mul R A).flip.map_zero\n#align linear_map.mul_right_zero_eq_zero LinearMap.mulRight_zero_eq_zero\n\nend NonUnitalNonAssoc\n\nsection NonUnital\n\nvariable (R A : Type*) [CommSemiring R] [NonUnitalSemiring A] [Module R A] [SMulCommClass R A A]\n [IsScalarTower R A A]\n\n/-- The multiplication in a non-unital algebra is a bilinear map.\n\nA weaker version of this for non-unital non-associative algebras exists as `LinearMap.mul`. -/\ndef _root_.NonUnitalAlgHom.lmul : A →ₙₐ[R] End R A :=\n { mul R A with\n map_mul' := by\n intro a b\n ext c\n exact mul_assoc a b c\n map_zero' := by\n ext a\n exact zero_mul a }\n#align non_unital_alg_hom.lmul NonUnitalAlgHom.lmul\n\nvariable {R A}\n\n@[simp]\ntheorem _root_.NonUnitalAlgHom.coe_lmul_eq_mul : ⇑(NonUnitalAlgHom.lmul R A) = mul R A :=\n rfl\n#align non_unital_alg_hom.coe_lmul_eq_mul NonUnitalAlgHom.coe_lmul_eq_mul\n\ntheorem commute_mulLeft_right (a b : A) : Commute (mulLeft R a) (mulRight R b) := by\n ext c\n exact (mul_assoc a c b).symm\n#align linear_map.commute_mul_left_right LinearMap.commute_mulLeft_right\n\n@[simp]\ntheorem mulLeft_mul (a b : A) : mulLeft R (a * b) = (mulLeft R a).comp (mulLeft R b) := by\n ext\n simp only [mulLeft_apply, comp_apply, mul_assoc]\n#align linear_map.mul_left_mul LinearMap.mulLeft_mul\n\n@[simp]\ntheorem mulRight_mul (a b : A) : mulRight R (a * b) = (mulRight R b).comp (mulRight R a) := by\n ext\n simp only [mulRight_apply, comp_apply, mul_assoc]\n#align linear_map.mul_right_mul LinearMap.mulRight_mul\n\nend NonUnital\n\nsection Semiring\n\nvariable (R A B : Type*) [CommSemiring R] [Semiring A] [Semiring B] [Algebra R A] [Algebra R B]\n\nvariable {R A B} in\n/-- A `LinearMap` preserves multiplication if pre- and post- composition with `LinearMap.mul` are\nequivalent. By converting the statement into an equality of `LinearMap`s, this lemma allows various\nspecialized `ext` lemmas about `→ₗ[R]` to then be applied.\n\nThis is the `LinearMap` version of `AddMonoidHom.map_mul_iff`. -/\ntheorem map_mul_iff (f : A →ₗ[R] B) :\n (∀ x y, f (x * y) = f x * f y) ↔\n (LinearMap.mul R A).compr₂ f = (LinearMap.mul R B ∘ₗ f).compl₂ f :=\n Iff.symm LinearMap.ext_iff₂\n\n/-- The multiplication in an algebra is an algebra homomorphism into the endomorphisms on\nthe algebra.\n\nA weaker version of this for non-unital algebras exists as `NonUnitalAlgHom.mul`. -/\ndef _root_.Algebra.lmul : A →ₐ[R] End R A :=\n { LinearMap.mul R A with\n map_one' := by\n ext a\n exact one_mul a\n map_mul' := by\n intro a b\n ext c\n exact mul_assoc a b c\n map_zero' := by\n ext a\n exact zero_mul a\n commutes' := by\n intro r\n ext a\n exact (Algebra.smul_def r a).symm }\n#align algebra.lmul Algebra.lmul\n\nvariable {R A}\n\n@[simp]\ntheorem _root_.Algebra.coe_lmul_eq_mul : ⇑(Algebra.lmul R A) = mul R A :=\n rfl\n#align algebra.coe_lmul_eq_mul Algebra.coe_lmul_eq_mul\n\ntheorem _root_.Algebra.lmul_injective : Function.Injective (Algebra.lmul R A) :=\n fun a₁ a₂ h ↦ by ","nextTactic":"simpa using FunLike.congr_fun h 1","declUpToTactic":"theorem _root_.Algebra.lmul_injective : Function.Injective (Algebra.lmul R A) :=\n fun a₁ a₂ h ↦ by ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Bilinear.198_0.cGBk1UxpwLhzgI8","decl":"theorem _root_.Algebra.lmul_injective : Function.Injective (Algebra.lmul R A) "} -{"state":"R : Type u_1\nA : Type u_2\nB : Type u_3\ninst✝⁴ : CommSemiring R\ninst✝³ : Semiring A\ninst✝² : Semiring B\ninst✝¹ : Algebra R A\ninst✝ : Algebra R B\na : A\n⊢ mulLeft R a = 0 ↔ a = 0","srcUpToTactic":"/-\nCopyright (c) 2018 Kenny Lau. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Kenny Lau, Yury Kudryashov\n-/\nimport Mathlib.Algebra.Algebra.Basic\nimport Mathlib.Algebra.Algebra.Equiv\nimport Mathlib.Algebra.Algebra.NonUnitalHom\nimport Mathlib.Algebra.GroupPower.IterateHom\nimport Mathlib.LinearAlgebra.TensorProduct\n\n#align_import algebra.algebra.bilinear from \"leanprover-community/mathlib\"@\"657df4339ae6ceada048c8a2980fb10e393143ec\"\n\n/-!\n# Facts about algebras involving bilinear maps and tensor products\n\nWe move a few basic statements about algebras out of `Algebra.Algebra.Basic`,\nin order to avoid importing `LinearAlgebra.BilinearMap` and\n`LinearAlgebra.TensorProduct` unnecessarily.\n-/\n\nopen TensorProduct Module\n\nnamespace LinearMap\n\nsection NonUnitalNonAssoc\n\nvariable (R A : Type*) [CommSemiring R] [NonUnitalNonAssocSemiring A] [Module R A]\n [SMulCommClass R A A] [IsScalarTower R A A]\n\n/-- The multiplication in a non-unital non-associative algebra is a bilinear map.\n\nA weaker version of this for semirings exists as `AddMonoidHom.mul`. -/\ndef mul : A →ₗ[R] A →ₗ[R] A :=\n LinearMap.mk₂ R (· * ·) add_mul smul_mul_assoc mul_add mul_smul_comm\n#align linear_map.mul LinearMap.mul\n\n/-- The multiplication map on a non-unital algebra, as an `R`-linear map from `A ⊗[R] A` to `A`. -/\nnoncomputable def mul' : A ⊗[R] A →ₗ[R] A :=\n TensorProduct.lift (mul R A)\n#align linear_map.mul' LinearMap.mul'\n\nvariable {A}\n\n/-- The multiplication on the left in a non-unital algebra is a linear map. -/\ndef mulLeft (a : A) : A →ₗ[R] A :=\n mul R A a\n#align linear_map.mul_left LinearMap.mulLeft\n\n/-- The multiplication on the right in an algebra is a linear map. -/\ndef mulRight (a : A) : A →ₗ[R] A :=\n (mul R A).flip a\n#align linear_map.mul_right LinearMap.mulRight\n\n/-- Simultaneous multiplication on the left and right is a linear map. -/\ndef mulLeftRight (ab : A × A) : A →ₗ[R] A :=\n (mulRight R ab.snd).comp (mulLeft R ab.fst)\n#align linear_map.mul_left_right LinearMap.mulLeftRight\n\n@[simp]\ntheorem mulLeft_toAddMonoidHom (a : A) : (mulLeft R a : A →+ A) = AddMonoidHom.mulLeft a :=\n rfl\n#align linear_map.mul_left_to_add_monoid_hom LinearMap.mulLeft_toAddMonoidHom\n\n@[simp]\ntheorem mulRight_toAddMonoidHom (a : A) : (mulRight R a : A →+ A) = AddMonoidHom.mulRight a :=\n rfl\n#align linear_map.mul_right_to_add_monoid_hom LinearMap.mulRight_toAddMonoidHom\n\nvariable {R}\n\n@[simp]\ntheorem mul_apply' (a b : A) : mul R A a b = a * b :=\n rfl\n#align linear_map.mul_apply' LinearMap.mul_apply'\n\n@[simp]\ntheorem mulLeft_apply (a b : A) : mulLeft R a b = a * b :=\n rfl\n#align linear_map.mul_left_apply LinearMap.mulLeft_apply\n\n@[simp]\ntheorem mulRight_apply (a b : A) : mulRight R a b = b * a :=\n rfl\n#align linear_map.mul_right_apply LinearMap.mulRight_apply\n\n@[simp]\ntheorem mulLeftRight_apply (a b x : A) : mulLeftRight R (a, b) x = a * x * b :=\n rfl\n#align linear_map.mul_left_right_apply LinearMap.mulLeftRight_apply\n\n@[simp]\ntheorem mul'_apply {a b : A} : mul' R A (a ⊗ₜ b) = a * b :=\n rfl\n#align linear_map.mul'_apply LinearMap.mul'_apply\n\n@[simp]\ntheorem mulLeft_zero_eq_zero : mulLeft R (0 : A) = 0 :=\n (mul R A).map_zero\n#align linear_map.mul_left_zero_eq_zero LinearMap.mulLeft_zero_eq_zero\n\n@[simp]\ntheorem mulRight_zero_eq_zero : mulRight R (0 : A) = 0 :=\n (mul R A).flip.map_zero\n#align linear_map.mul_right_zero_eq_zero LinearMap.mulRight_zero_eq_zero\n\nend NonUnitalNonAssoc\n\nsection NonUnital\n\nvariable (R A : Type*) [CommSemiring R] [NonUnitalSemiring A] [Module R A] [SMulCommClass R A A]\n [IsScalarTower R A A]\n\n/-- The multiplication in a non-unital algebra is a bilinear map.\n\nA weaker version of this for non-unital non-associative algebras exists as `LinearMap.mul`. -/\ndef _root_.NonUnitalAlgHom.lmul : A →ₙₐ[R] End R A :=\n { mul R A with\n map_mul' := by\n intro a b\n ext c\n exact mul_assoc a b c\n map_zero' := by\n ext a\n exact zero_mul a }\n#align non_unital_alg_hom.lmul NonUnitalAlgHom.lmul\n\nvariable {R A}\n\n@[simp]\ntheorem _root_.NonUnitalAlgHom.coe_lmul_eq_mul : ⇑(NonUnitalAlgHom.lmul R A) = mul R A :=\n rfl\n#align non_unital_alg_hom.coe_lmul_eq_mul NonUnitalAlgHom.coe_lmul_eq_mul\n\ntheorem commute_mulLeft_right (a b : A) : Commute (mulLeft R a) (mulRight R b) := by\n ext c\n exact (mul_assoc a c b).symm\n#align linear_map.commute_mul_left_right LinearMap.commute_mulLeft_right\n\n@[simp]\ntheorem mulLeft_mul (a b : A) : mulLeft R (a * b) = (mulLeft R a).comp (mulLeft R b) := by\n ext\n simp only [mulLeft_apply, comp_apply, mul_assoc]\n#align linear_map.mul_left_mul LinearMap.mulLeft_mul\n\n@[simp]\ntheorem mulRight_mul (a b : A) : mulRight R (a * b) = (mulRight R b).comp (mulRight R a) := by\n ext\n simp only [mulRight_apply, comp_apply, mul_assoc]\n#align linear_map.mul_right_mul LinearMap.mulRight_mul\n\nend NonUnital\n\nsection Semiring\n\nvariable (R A B : Type*) [CommSemiring R] [Semiring A] [Semiring B] [Algebra R A] [Algebra R B]\n\nvariable {R A B} in\n/-- A `LinearMap` preserves multiplication if pre- and post- composition with `LinearMap.mul` are\nequivalent. By converting the statement into an equality of `LinearMap`s, this lemma allows various\nspecialized `ext` lemmas about `→ₗ[R]` to then be applied.\n\nThis is the `LinearMap` version of `AddMonoidHom.map_mul_iff`. -/\ntheorem map_mul_iff (f : A →ₗ[R] B) :\n (∀ x y, f (x * y) = f x * f y) ↔\n (LinearMap.mul R A).compr₂ f = (LinearMap.mul R B ∘ₗ f).compl₂ f :=\n Iff.symm LinearMap.ext_iff₂\n\n/-- The multiplication in an algebra is an algebra homomorphism into the endomorphisms on\nthe algebra.\n\nA weaker version of this for non-unital algebras exists as `NonUnitalAlgHom.mul`. -/\ndef _root_.Algebra.lmul : A →ₐ[R] End R A :=\n { LinearMap.mul R A with\n map_one' := by\n ext a\n exact one_mul a\n map_mul' := by\n intro a b\n ext c\n exact mul_assoc a b c\n map_zero' := by\n ext a\n exact zero_mul a\n commutes' := by\n intro r\n ext a\n exact (Algebra.smul_def r a).symm }\n#align algebra.lmul Algebra.lmul\n\nvariable {R A}\n\n@[simp]\ntheorem _root_.Algebra.coe_lmul_eq_mul : ⇑(Algebra.lmul R A) = mul R A :=\n rfl\n#align algebra.coe_lmul_eq_mul Algebra.coe_lmul_eq_mul\n\ntheorem _root_.Algebra.lmul_injective : Function.Injective (Algebra.lmul R A) :=\n fun a₁ a₂ h ↦ by simpa using FunLike.congr_fun h 1\n\n@[simp]\ntheorem mulLeft_eq_zero_iff (a : A) : mulLeft R a = 0 ↔ a = 0 := by\n ","nextTactic":"constructor","declUpToTactic":"@[simp]\ntheorem mulLeft_eq_zero_iff (a : A) : mulLeft R a = 0 ↔ a = 0 := by\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Bilinear.201_0.cGBk1UxpwLhzgI8","decl":"@[simp]\ntheorem mulLeft_eq_zero_iff (a : A) : mulLeft R a = 0 ↔ a = 0 "} -{"state":"case mp\nR : Type u_1\nA : Type u_2\nB : Type u_3\ninst✝⁴ : CommSemiring R\ninst✝³ : Semiring A\ninst✝² : Semiring B\ninst✝¹ : Algebra R A\ninst✝ : Algebra R B\na : A\n⊢ mulLeft R a = 0 → a = 0","srcUpToTactic":"/-\nCopyright (c) 2018 Kenny Lau. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Kenny Lau, Yury Kudryashov\n-/\nimport Mathlib.Algebra.Algebra.Basic\nimport Mathlib.Algebra.Algebra.Equiv\nimport Mathlib.Algebra.Algebra.NonUnitalHom\nimport Mathlib.Algebra.GroupPower.IterateHom\nimport Mathlib.LinearAlgebra.TensorProduct\n\n#align_import algebra.algebra.bilinear from \"leanprover-community/mathlib\"@\"657df4339ae6ceada048c8a2980fb10e393143ec\"\n\n/-!\n# Facts about algebras involving bilinear maps and tensor products\n\nWe move a few basic statements about algebras out of `Algebra.Algebra.Basic`,\nin order to avoid importing `LinearAlgebra.BilinearMap` and\n`LinearAlgebra.TensorProduct` unnecessarily.\n-/\n\nopen TensorProduct Module\n\nnamespace LinearMap\n\nsection NonUnitalNonAssoc\n\nvariable (R A : Type*) [CommSemiring R] [NonUnitalNonAssocSemiring A] [Module R A]\n [SMulCommClass R A A] [IsScalarTower R A A]\n\n/-- The multiplication in a non-unital non-associative algebra is a bilinear map.\n\nA weaker version of this for semirings exists as `AddMonoidHom.mul`. -/\ndef mul : A →ₗ[R] A →ₗ[R] A :=\n LinearMap.mk₂ R (· * ·) add_mul smul_mul_assoc mul_add mul_smul_comm\n#align linear_map.mul LinearMap.mul\n\n/-- The multiplication map on a non-unital algebra, as an `R`-linear map from `A ⊗[R] A` to `A`. -/\nnoncomputable def mul' : A ⊗[R] A →ₗ[R] A :=\n TensorProduct.lift (mul R A)\n#align linear_map.mul' LinearMap.mul'\n\nvariable {A}\n\n/-- The multiplication on the left in a non-unital algebra is a linear map. -/\ndef mulLeft (a : A) : A →ₗ[R] A :=\n mul R A a\n#align linear_map.mul_left LinearMap.mulLeft\n\n/-- The multiplication on the right in an algebra is a linear map. -/\ndef mulRight (a : A) : A →ₗ[R] A :=\n (mul R A).flip a\n#align linear_map.mul_right LinearMap.mulRight\n\n/-- Simultaneous multiplication on the left and right is a linear map. -/\ndef mulLeftRight (ab : A × A) : A →ₗ[R] A :=\n (mulRight R ab.snd).comp (mulLeft R ab.fst)\n#align linear_map.mul_left_right LinearMap.mulLeftRight\n\n@[simp]\ntheorem mulLeft_toAddMonoidHom (a : A) : (mulLeft R a : A →+ A) = AddMonoidHom.mulLeft a :=\n rfl\n#align linear_map.mul_left_to_add_monoid_hom LinearMap.mulLeft_toAddMonoidHom\n\n@[simp]\ntheorem mulRight_toAddMonoidHom (a : A) : (mulRight R a : A →+ A) = AddMonoidHom.mulRight a :=\n rfl\n#align linear_map.mul_right_to_add_monoid_hom LinearMap.mulRight_toAddMonoidHom\n\nvariable {R}\n\n@[simp]\ntheorem mul_apply' (a b : A) : mul R A a b = a * b :=\n rfl\n#align linear_map.mul_apply' LinearMap.mul_apply'\n\n@[simp]\ntheorem mulLeft_apply (a b : A) : mulLeft R a b = a * b :=\n rfl\n#align linear_map.mul_left_apply LinearMap.mulLeft_apply\n\n@[simp]\ntheorem mulRight_apply (a b : A) : mulRight R a b = b * a :=\n rfl\n#align linear_map.mul_right_apply LinearMap.mulRight_apply\n\n@[simp]\ntheorem mulLeftRight_apply (a b x : A) : mulLeftRight R (a, b) x = a * x * b :=\n rfl\n#align linear_map.mul_left_right_apply LinearMap.mulLeftRight_apply\n\n@[simp]\ntheorem mul'_apply {a b : A} : mul' R A (a ⊗ₜ b) = a * b :=\n rfl\n#align linear_map.mul'_apply LinearMap.mul'_apply\n\n@[simp]\ntheorem mulLeft_zero_eq_zero : mulLeft R (0 : A) = 0 :=\n (mul R A).map_zero\n#align linear_map.mul_left_zero_eq_zero LinearMap.mulLeft_zero_eq_zero\n\n@[simp]\ntheorem mulRight_zero_eq_zero : mulRight R (0 : A) = 0 :=\n (mul R A).flip.map_zero\n#align linear_map.mul_right_zero_eq_zero LinearMap.mulRight_zero_eq_zero\n\nend NonUnitalNonAssoc\n\nsection NonUnital\n\nvariable (R A : Type*) [CommSemiring R] [NonUnitalSemiring A] [Module R A] [SMulCommClass R A A]\n [IsScalarTower R A A]\n\n/-- The multiplication in a non-unital algebra is a bilinear map.\n\nA weaker version of this for non-unital non-associative algebras exists as `LinearMap.mul`. -/\ndef _root_.NonUnitalAlgHom.lmul : A →ₙₐ[R] End R A :=\n { mul R A with\n map_mul' := by\n intro a b\n ext c\n exact mul_assoc a b c\n map_zero' := by\n ext a\n exact zero_mul a }\n#align non_unital_alg_hom.lmul NonUnitalAlgHom.lmul\n\nvariable {R A}\n\n@[simp]\ntheorem _root_.NonUnitalAlgHom.coe_lmul_eq_mul : ⇑(NonUnitalAlgHom.lmul R A) = mul R A :=\n rfl\n#align non_unital_alg_hom.coe_lmul_eq_mul NonUnitalAlgHom.coe_lmul_eq_mul\n\ntheorem commute_mulLeft_right (a b : A) : Commute (mulLeft R a) (mulRight R b) := by\n ext c\n exact (mul_assoc a c b).symm\n#align linear_map.commute_mul_left_right LinearMap.commute_mulLeft_right\n\n@[simp]\ntheorem mulLeft_mul (a b : A) : mulLeft R (a * b) = (mulLeft R a).comp (mulLeft R b) := by\n ext\n simp only [mulLeft_apply, comp_apply, mul_assoc]\n#align linear_map.mul_left_mul LinearMap.mulLeft_mul\n\n@[simp]\ntheorem mulRight_mul (a b : A) : mulRight R (a * b) = (mulRight R b).comp (mulRight R a) := by\n ext\n simp only [mulRight_apply, comp_apply, mul_assoc]\n#align linear_map.mul_right_mul LinearMap.mulRight_mul\n\nend NonUnital\n\nsection Semiring\n\nvariable (R A B : Type*) [CommSemiring R] [Semiring A] [Semiring B] [Algebra R A] [Algebra R B]\n\nvariable {R A B} in\n/-- A `LinearMap` preserves multiplication if pre- and post- composition with `LinearMap.mul` are\nequivalent. By converting the statement into an equality of `LinearMap`s, this lemma allows various\nspecialized `ext` lemmas about `→ₗ[R]` to then be applied.\n\nThis is the `LinearMap` version of `AddMonoidHom.map_mul_iff`. -/\ntheorem map_mul_iff (f : A →ₗ[R] B) :\n (∀ x y, f (x * y) = f x * f y) ↔\n (LinearMap.mul R A).compr₂ f = (LinearMap.mul R B ∘ₗ f).compl₂ f :=\n Iff.symm LinearMap.ext_iff₂\n\n/-- The multiplication in an algebra is an algebra homomorphism into the endomorphisms on\nthe algebra.\n\nA weaker version of this for non-unital algebras exists as `NonUnitalAlgHom.mul`. -/\ndef _root_.Algebra.lmul : A →ₐ[R] End R A :=\n { LinearMap.mul R A with\n map_one' := by\n ext a\n exact one_mul a\n map_mul' := by\n intro a b\n ext c\n exact mul_assoc a b c\n map_zero' := by\n ext a\n exact zero_mul a\n commutes' := by\n intro r\n ext a\n exact (Algebra.smul_def r a).symm }\n#align algebra.lmul Algebra.lmul\n\nvariable {R A}\n\n@[simp]\ntheorem _root_.Algebra.coe_lmul_eq_mul : ⇑(Algebra.lmul R A) = mul R A :=\n rfl\n#align algebra.coe_lmul_eq_mul Algebra.coe_lmul_eq_mul\n\ntheorem _root_.Algebra.lmul_injective : Function.Injective (Algebra.lmul R A) :=\n fun a₁ a₂ h ↦ by simpa using FunLike.congr_fun h 1\n\n@[simp]\ntheorem mulLeft_eq_zero_iff (a : A) : mulLeft R a = 0 ↔ a = 0 := by\n constructor <;> ","nextTactic":"intro h","declUpToTactic":"@[simp]\ntheorem mulLeft_eq_zero_iff (a : A) : mulLeft R a = 0 ↔ a = 0 := by\n constructor <;> ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Bilinear.201_0.cGBk1UxpwLhzgI8","decl":"@[simp]\ntheorem mulLeft_eq_zero_iff (a : A) : mulLeft R a = 0 ↔ a = 0 "} -{"state":"case mpr\nR : Type u_1\nA : Type u_2\nB : Type u_3\ninst✝⁴ : CommSemiring R\ninst✝³ : Semiring A\ninst✝² : Semiring B\ninst✝¹ : Algebra R A\ninst✝ : Algebra R B\na : A\n⊢ a = 0 → mulLeft R a = 0","srcUpToTactic":"/-\nCopyright (c) 2018 Kenny Lau. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Kenny Lau, Yury Kudryashov\n-/\nimport Mathlib.Algebra.Algebra.Basic\nimport Mathlib.Algebra.Algebra.Equiv\nimport Mathlib.Algebra.Algebra.NonUnitalHom\nimport Mathlib.Algebra.GroupPower.IterateHom\nimport Mathlib.LinearAlgebra.TensorProduct\n\n#align_import algebra.algebra.bilinear from \"leanprover-community/mathlib\"@\"657df4339ae6ceada048c8a2980fb10e393143ec\"\n\n/-!\n# Facts about algebras involving bilinear maps and tensor products\n\nWe move a few basic statements about algebras out of `Algebra.Algebra.Basic`,\nin order to avoid importing `LinearAlgebra.BilinearMap` and\n`LinearAlgebra.TensorProduct` unnecessarily.\n-/\n\nopen TensorProduct Module\n\nnamespace LinearMap\n\nsection NonUnitalNonAssoc\n\nvariable (R A : Type*) [CommSemiring R] [NonUnitalNonAssocSemiring A] [Module R A]\n [SMulCommClass R A A] [IsScalarTower R A A]\n\n/-- The multiplication in a non-unital non-associative algebra is a bilinear map.\n\nA weaker version of this for semirings exists as `AddMonoidHom.mul`. -/\ndef mul : A →ₗ[R] A →ₗ[R] A :=\n LinearMap.mk₂ R (· * ·) add_mul smul_mul_assoc mul_add mul_smul_comm\n#align linear_map.mul LinearMap.mul\n\n/-- The multiplication map on a non-unital algebra, as an `R`-linear map from `A ⊗[R] A` to `A`. -/\nnoncomputable def mul' : A ⊗[R] A →ₗ[R] A :=\n TensorProduct.lift (mul R A)\n#align linear_map.mul' LinearMap.mul'\n\nvariable {A}\n\n/-- The multiplication on the left in a non-unital algebra is a linear map. -/\ndef mulLeft (a : A) : A →ₗ[R] A :=\n mul R A a\n#align linear_map.mul_left LinearMap.mulLeft\n\n/-- The multiplication on the right in an algebra is a linear map. -/\ndef mulRight (a : A) : A →ₗ[R] A :=\n (mul R A).flip a\n#align linear_map.mul_right LinearMap.mulRight\n\n/-- Simultaneous multiplication on the left and right is a linear map. -/\ndef mulLeftRight (ab : A × A) : A →ₗ[R] A :=\n (mulRight R ab.snd).comp (mulLeft R ab.fst)\n#align linear_map.mul_left_right LinearMap.mulLeftRight\n\n@[simp]\ntheorem mulLeft_toAddMonoidHom (a : A) : (mulLeft R a : A →+ A) = AddMonoidHom.mulLeft a :=\n rfl\n#align linear_map.mul_left_to_add_monoid_hom LinearMap.mulLeft_toAddMonoidHom\n\n@[simp]\ntheorem mulRight_toAddMonoidHom (a : A) : (mulRight R a : A →+ A) = AddMonoidHom.mulRight a :=\n rfl\n#align linear_map.mul_right_to_add_monoid_hom LinearMap.mulRight_toAddMonoidHom\n\nvariable {R}\n\n@[simp]\ntheorem mul_apply' (a b : A) : mul R A a b = a * b :=\n rfl\n#align linear_map.mul_apply' LinearMap.mul_apply'\n\n@[simp]\ntheorem mulLeft_apply (a b : A) : mulLeft R a b = a * b :=\n rfl\n#align linear_map.mul_left_apply LinearMap.mulLeft_apply\n\n@[simp]\ntheorem mulRight_apply (a b : A) : mulRight R a b = b * a :=\n rfl\n#align linear_map.mul_right_apply LinearMap.mulRight_apply\n\n@[simp]\ntheorem mulLeftRight_apply (a b x : A) : mulLeftRight R (a, b) x = a * x * b :=\n rfl\n#align linear_map.mul_left_right_apply LinearMap.mulLeftRight_apply\n\n@[simp]\ntheorem mul'_apply {a b : A} : mul' R A (a ⊗ₜ b) = a * b :=\n rfl\n#align linear_map.mul'_apply LinearMap.mul'_apply\n\n@[simp]\ntheorem mulLeft_zero_eq_zero : mulLeft R (0 : A) = 0 :=\n (mul R A).map_zero\n#align linear_map.mul_left_zero_eq_zero LinearMap.mulLeft_zero_eq_zero\n\n@[simp]\ntheorem mulRight_zero_eq_zero : mulRight R (0 : A) = 0 :=\n (mul R A).flip.map_zero\n#align linear_map.mul_right_zero_eq_zero LinearMap.mulRight_zero_eq_zero\n\nend NonUnitalNonAssoc\n\nsection NonUnital\n\nvariable (R A : Type*) [CommSemiring R] [NonUnitalSemiring A] [Module R A] [SMulCommClass R A A]\n [IsScalarTower R A A]\n\n/-- The multiplication in a non-unital algebra is a bilinear map.\n\nA weaker version of this for non-unital non-associative algebras exists as `LinearMap.mul`. -/\ndef _root_.NonUnitalAlgHom.lmul : A →ₙₐ[R] End R A :=\n { mul R A with\n map_mul' := by\n intro a b\n ext c\n exact mul_assoc a b c\n map_zero' := by\n ext a\n exact zero_mul a }\n#align non_unital_alg_hom.lmul NonUnitalAlgHom.lmul\n\nvariable {R A}\n\n@[simp]\ntheorem _root_.NonUnitalAlgHom.coe_lmul_eq_mul : ⇑(NonUnitalAlgHom.lmul R A) = mul R A :=\n rfl\n#align non_unital_alg_hom.coe_lmul_eq_mul NonUnitalAlgHom.coe_lmul_eq_mul\n\ntheorem commute_mulLeft_right (a b : A) : Commute (mulLeft R a) (mulRight R b) := by\n ext c\n exact (mul_assoc a c b).symm\n#align linear_map.commute_mul_left_right LinearMap.commute_mulLeft_right\n\n@[simp]\ntheorem mulLeft_mul (a b : A) : mulLeft R (a * b) = (mulLeft R a).comp (mulLeft R b) := by\n ext\n simp only [mulLeft_apply, comp_apply, mul_assoc]\n#align linear_map.mul_left_mul LinearMap.mulLeft_mul\n\n@[simp]\ntheorem mulRight_mul (a b : A) : mulRight R (a * b) = (mulRight R b).comp (mulRight R a) := by\n ext\n simp only [mulRight_apply, comp_apply, mul_assoc]\n#align linear_map.mul_right_mul LinearMap.mulRight_mul\n\nend NonUnital\n\nsection Semiring\n\nvariable (R A B : Type*) [CommSemiring R] [Semiring A] [Semiring B] [Algebra R A] [Algebra R B]\n\nvariable {R A B} in\n/-- A `LinearMap` preserves multiplication if pre- and post- composition with `LinearMap.mul` are\nequivalent. By converting the statement into an equality of `LinearMap`s, this lemma allows various\nspecialized `ext` lemmas about `→ₗ[R]` to then be applied.\n\nThis is the `LinearMap` version of `AddMonoidHom.map_mul_iff`. -/\ntheorem map_mul_iff (f : A →ₗ[R] B) :\n (∀ x y, f (x * y) = f x * f y) ↔\n (LinearMap.mul R A).compr₂ f = (LinearMap.mul R B ∘ₗ f).compl₂ f :=\n Iff.symm LinearMap.ext_iff₂\n\n/-- The multiplication in an algebra is an algebra homomorphism into the endomorphisms on\nthe algebra.\n\nA weaker version of this for non-unital algebras exists as `NonUnitalAlgHom.mul`. -/\ndef _root_.Algebra.lmul : A →ₐ[R] End R A :=\n { LinearMap.mul R A with\n map_one' := by\n ext a\n exact one_mul a\n map_mul' := by\n intro a b\n ext c\n exact mul_assoc a b c\n map_zero' := by\n ext a\n exact zero_mul a\n commutes' := by\n intro r\n ext a\n exact (Algebra.smul_def r a).symm }\n#align algebra.lmul Algebra.lmul\n\nvariable {R A}\n\n@[simp]\ntheorem _root_.Algebra.coe_lmul_eq_mul : ⇑(Algebra.lmul R A) = mul R A :=\n rfl\n#align algebra.coe_lmul_eq_mul Algebra.coe_lmul_eq_mul\n\ntheorem _root_.Algebra.lmul_injective : Function.Injective (Algebra.lmul R A) :=\n fun a₁ a₂ h ↦ by simpa using FunLike.congr_fun h 1\n\n@[simp]\ntheorem mulLeft_eq_zero_iff (a : A) : mulLeft R a = 0 ↔ a = 0 := by\n constructor <;> ","nextTactic":"intro h","declUpToTactic":"@[simp]\ntheorem mulLeft_eq_zero_iff (a : A) : mulLeft R a = 0 ↔ a = 0 := by\n constructor <;> ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Bilinear.201_0.cGBk1UxpwLhzgI8","decl":"@[simp]\ntheorem mulLeft_eq_zero_iff (a : A) : mulLeft R a = 0 ↔ a = 0 "} -{"state":"case mp\nR : Type u_1\nA : Type u_2\nB : Type u_3\ninst✝⁴ : CommSemiring R\ninst✝³ : Semiring A\ninst✝² : Semiring B\ninst✝¹ : Algebra R A\ninst✝ : Algebra R B\na : A\nh : mulLeft R a = 0\n⊢ a = 0","srcUpToTactic":"/-\nCopyright (c) 2018 Kenny Lau. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Kenny Lau, Yury Kudryashov\n-/\nimport Mathlib.Algebra.Algebra.Basic\nimport Mathlib.Algebra.Algebra.Equiv\nimport Mathlib.Algebra.Algebra.NonUnitalHom\nimport Mathlib.Algebra.GroupPower.IterateHom\nimport Mathlib.LinearAlgebra.TensorProduct\n\n#align_import algebra.algebra.bilinear from \"leanprover-community/mathlib\"@\"657df4339ae6ceada048c8a2980fb10e393143ec\"\n\n/-!\n# Facts about algebras involving bilinear maps and tensor products\n\nWe move a few basic statements about algebras out of `Algebra.Algebra.Basic`,\nin order to avoid importing `LinearAlgebra.BilinearMap` and\n`LinearAlgebra.TensorProduct` unnecessarily.\n-/\n\nopen TensorProduct Module\n\nnamespace LinearMap\n\nsection NonUnitalNonAssoc\n\nvariable (R A : Type*) [CommSemiring R] [NonUnitalNonAssocSemiring A] [Module R A]\n [SMulCommClass R A A] [IsScalarTower R A A]\n\n/-- The multiplication in a non-unital non-associative algebra is a bilinear map.\n\nA weaker version of this for semirings exists as `AddMonoidHom.mul`. -/\ndef mul : A →ₗ[R] A →ₗ[R] A :=\n LinearMap.mk₂ R (· * ·) add_mul smul_mul_assoc mul_add mul_smul_comm\n#align linear_map.mul LinearMap.mul\n\n/-- The multiplication map on a non-unital algebra, as an `R`-linear map from `A ⊗[R] A` to `A`. -/\nnoncomputable def mul' : A ⊗[R] A →ₗ[R] A :=\n TensorProduct.lift (mul R A)\n#align linear_map.mul' LinearMap.mul'\n\nvariable {A}\n\n/-- The multiplication on the left in a non-unital algebra is a linear map. -/\ndef mulLeft (a : A) : A →ₗ[R] A :=\n mul R A a\n#align linear_map.mul_left LinearMap.mulLeft\n\n/-- The multiplication on the right in an algebra is a linear map. -/\ndef mulRight (a : A) : A →ₗ[R] A :=\n (mul R A).flip a\n#align linear_map.mul_right LinearMap.mulRight\n\n/-- Simultaneous multiplication on the left and right is a linear map. -/\ndef mulLeftRight (ab : A × A) : A →ₗ[R] A :=\n (mulRight R ab.snd).comp (mulLeft R ab.fst)\n#align linear_map.mul_left_right LinearMap.mulLeftRight\n\n@[simp]\ntheorem mulLeft_toAddMonoidHom (a : A) : (mulLeft R a : A →+ A) = AddMonoidHom.mulLeft a :=\n rfl\n#align linear_map.mul_left_to_add_monoid_hom LinearMap.mulLeft_toAddMonoidHom\n\n@[simp]\ntheorem mulRight_toAddMonoidHom (a : A) : (mulRight R a : A →+ A) = AddMonoidHom.mulRight a :=\n rfl\n#align linear_map.mul_right_to_add_monoid_hom LinearMap.mulRight_toAddMonoidHom\n\nvariable {R}\n\n@[simp]\ntheorem mul_apply' (a b : A) : mul R A a b = a * b :=\n rfl\n#align linear_map.mul_apply' LinearMap.mul_apply'\n\n@[simp]\ntheorem mulLeft_apply (a b : A) : mulLeft R a b = a * b :=\n rfl\n#align linear_map.mul_left_apply LinearMap.mulLeft_apply\n\n@[simp]\ntheorem mulRight_apply (a b : A) : mulRight R a b = b * a :=\n rfl\n#align linear_map.mul_right_apply LinearMap.mulRight_apply\n\n@[simp]\ntheorem mulLeftRight_apply (a b x : A) : mulLeftRight R (a, b) x = a * x * b :=\n rfl\n#align linear_map.mul_left_right_apply LinearMap.mulLeftRight_apply\n\n@[simp]\ntheorem mul'_apply {a b : A} : mul' R A (a ⊗ₜ b) = a * b :=\n rfl\n#align linear_map.mul'_apply LinearMap.mul'_apply\n\n@[simp]\ntheorem mulLeft_zero_eq_zero : mulLeft R (0 : A) = 0 :=\n (mul R A).map_zero\n#align linear_map.mul_left_zero_eq_zero LinearMap.mulLeft_zero_eq_zero\n\n@[simp]\ntheorem mulRight_zero_eq_zero : mulRight R (0 : A) = 0 :=\n (mul R A).flip.map_zero\n#align linear_map.mul_right_zero_eq_zero LinearMap.mulRight_zero_eq_zero\n\nend NonUnitalNonAssoc\n\nsection NonUnital\n\nvariable (R A : Type*) [CommSemiring R] [NonUnitalSemiring A] [Module R A] [SMulCommClass R A A]\n [IsScalarTower R A A]\n\n/-- The multiplication in a non-unital algebra is a bilinear map.\n\nA weaker version of this for non-unital non-associative algebras exists as `LinearMap.mul`. -/\ndef _root_.NonUnitalAlgHom.lmul : A →ₙₐ[R] End R A :=\n { mul R A with\n map_mul' := by\n intro a b\n ext c\n exact mul_assoc a b c\n map_zero' := by\n ext a\n exact zero_mul a }\n#align non_unital_alg_hom.lmul NonUnitalAlgHom.lmul\n\nvariable {R A}\n\n@[simp]\ntheorem _root_.NonUnitalAlgHom.coe_lmul_eq_mul : ⇑(NonUnitalAlgHom.lmul R A) = mul R A :=\n rfl\n#align non_unital_alg_hom.coe_lmul_eq_mul NonUnitalAlgHom.coe_lmul_eq_mul\n\ntheorem commute_mulLeft_right (a b : A) : Commute (mulLeft R a) (mulRight R b) := by\n ext c\n exact (mul_assoc a c b).symm\n#align linear_map.commute_mul_left_right LinearMap.commute_mulLeft_right\n\n@[simp]\ntheorem mulLeft_mul (a b : A) : mulLeft R (a * b) = (mulLeft R a).comp (mulLeft R b) := by\n ext\n simp only [mulLeft_apply, comp_apply, mul_assoc]\n#align linear_map.mul_left_mul LinearMap.mulLeft_mul\n\n@[simp]\ntheorem mulRight_mul (a b : A) : mulRight R (a * b) = (mulRight R b).comp (mulRight R a) := by\n ext\n simp only [mulRight_apply, comp_apply, mul_assoc]\n#align linear_map.mul_right_mul LinearMap.mulRight_mul\n\nend NonUnital\n\nsection Semiring\n\nvariable (R A B : Type*) [CommSemiring R] [Semiring A] [Semiring B] [Algebra R A] [Algebra R B]\n\nvariable {R A B} in\n/-- A `LinearMap` preserves multiplication if pre- and post- composition with `LinearMap.mul` are\nequivalent. By converting the statement into an equality of `LinearMap`s, this lemma allows various\nspecialized `ext` lemmas about `→ₗ[R]` to then be applied.\n\nThis is the `LinearMap` version of `AddMonoidHom.map_mul_iff`. -/\ntheorem map_mul_iff (f : A →ₗ[R] B) :\n (∀ x y, f (x * y) = f x * f y) ↔\n (LinearMap.mul R A).compr₂ f = (LinearMap.mul R B ∘ₗ f).compl₂ f :=\n Iff.symm LinearMap.ext_iff₂\n\n/-- The multiplication in an algebra is an algebra homomorphism into the endomorphisms on\nthe algebra.\n\nA weaker version of this for non-unital algebras exists as `NonUnitalAlgHom.mul`. -/\ndef _root_.Algebra.lmul : A →ₐ[R] End R A :=\n { LinearMap.mul R A with\n map_one' := by\n ext a\n exact one_mul a\n map_mul' := by\n intro a b\n ext c\n exact mul_assoc a b c\n map_zero' := by\n ext a\n exact zero_mul a\n commutes' := by\n intro r\n ext a\n exact (Algebra.smul_def r a).symm }\n#align algebra.lmul Algebra.lmul\n\nvariable {R A}\n\n@[simp]\ntheorem _root_.Algebra.coe_lmul_eq_mul : ⇑(Algebra.lmul R A) = mul R A :=\n rfl\n#align algebra.coe_lmul_eq_mul Algebra.coe_lmul_eq_mul\n\ntheorem _root_.Algebra.lmul_injective : Function.Injective (Algebra.lmul R A) :=\n fun a₁ a₂ h ↦ by simpa using FunLike.congr_fun h 1\n\n@[simp]\ntheorem mulLeft_eq_zero_iff (a : A) : mulLeft R a = 0 ↔ a = 0 := by\n constructor <;> intro h\n -- porting note: had to supply `R` explicitly in `@mulLeft_apply` below\n · ","nextTactic":"rw [← mul_one a, ← @mulLeft_apply R _ _ _ _ _ _ a 1, h, LinearMap.zero_apply]","declUpToTactic":"@[simp]\ntheorem mulLeft_eq_zero_iff (a : A) : mulLeft R a = 0 ↔ a = 0 := by\n constructor <;> intro h\n -- porting note: had to supply `R` explicitly in `@mulLeft_apply` below\n · ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Bilinear.201_0.cGBk1UxpwLhzgI8","decl":"@[simp]\ntheorem mulLeft_eq_zero_iff (a : A) : mulLeft R a = 0 ↔ a = 0 "} -{"state":"case mpr\nR : Type u_1\nA : Type u_2\nB : Type u_3\ninst✝⁴ : CommSemiring R\ninst✝³ : Semiring A\ninst✝² : Semiring B\ninst✝¹ : Algebra R A\ninst✝ : Algebra R B\na : A\nh : a = 0\n⊢ mulLeft R a = 0","srcUpToTactic":"/-\nCopyright (c) 2018 Kenny Lau. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Kenny Lau, Yury Kudryashov\n-/\nimport Mathlib.Algebra.Algebra.Basic\nimport Mathlib.Algebra.Algebra.Equiv\nimport Mathlib.Algebra.Algebra.NonUnitalHom\nimport Mathlib.Algebra.GroupPower.IterateHom\nimport Mathlib.LinearAlgebra.TensorProduct\n\n#align_import algebra.algebra.bilinear from \"leanprover-community/mathlib\"@\"657df4339ae6ceada048c8a2980fb10e393143ec\"\n\n/-!\n# Facts about algebras involving bilinear maps and tensor products\n\nWe move a few basic statements about algebras out of `Algebra.Algebra.Basic`,\nin order to avoid importing `LinearAlgebra.BilinearMap` and\n`LinearAlgebra.TensorProduct` unnecessarily.\n-/\n\nopen TensorProduct Module\n\nnamespace LinearMap\n\nsection NonUnitalNonAssoc\n\nvariable (R A : Type*) [CommSemiring R] [NonUnitalNonAssocSemiring A] [Module R A]\n [SMulCommClass R A A] [IsScalarTower R A A]\n\n/-- The multiplication in a non-unital non-associative algebra is a bilinear map.\n\nA weaker version of this for semirings exists as `AddMonoidHom.mul`. -/\ndef mul : A →ₗ[R] A →ₗ[R] A :=\n LinearMap.mk₂ R (· * ·) add_mul smul_mul_assoc mul_add mul_smul_comm\n#align linear_map.mul LinearMap.mul\n\n/-- The multiplication map on a non-unital algebra, as an `R`-linear map from `A ⊗[R] A` to `A`. -/\nnoncomputable def mul' : A ⊗[R] A →ₗ[R] A :=\n TensorProduct.lift (mul R A)\n#align linear_map.mul' LinearMap.mul'\n\nvariable {A}\n\n/-- The multiplication on the left in a non-unital algebra is a linear map. -/\ndef mulLeft (a : A) : A →ₗ[R] A :=\n mul R A a\n#align linear_map.mul_left LinearMap.mulLeft\n\n/-- The multiplication on the right in an algebra is a linear map. -/\ndef mulRight (a : A) : A →ₗ[R] A :=\n (mul R A).flip a\n#align linear_map.mul_right LinearMap.mulRight\n\n/-- Simultaneous multiplication on the left and right is a linear map. -/\ndef mulLeftRight (ab : A × A) : A →ₗ[R] A :=\n (mulRight R ab.snd).comp (mulLeft R ab.fst)\n#align linear_map.mul_left_right LinearMap.mulLeftRight\n\n@[simp]\ntheorem mulLeft_toAddMonoidHom (a : A) : (mulLeft R a : A →+ A) = AddMonoidHom.mulLeft a :=\n rfl\n#align linear_map.mul_left_to_add_monoid_hom LinearMap.mulLeft_toAddMonoidHom\n\n@[simp]\ntheorem mulRight_toAddMonoidHom (a : A) : (mulRight R a : A →+ A) = AddMonoidHom.mulRight a :=\n rfl\n#align linear_map.mul_right_to_add_monoid_hom LinearMap.mulRight_toAddMonoidHom\n\nvariable {R}\n\n@[simp]\ntheorem mul_apply' (a b : A) : mul R A a b = a * b :=\n rfl\n#align linear_map.mul_apply' LinearMap.mul_apply'\n\n@[simp]\ntheorem mulLeft_apply (a b : A) : mulLeft R a b = a * b :=\n rfl\n#align linear_map.mul_left_apply LinearMap.mulLeft_apply\n\n@[simp]\ntheorem mulRight_apply (a b : A) : mulRight R a b = b * a :=\n rfl\n#align linear_map.mul_right_apply LinearMap.mulRight_apply\n\n@[simp]\ntheorem mulLeftRight_apply (a b x : A) : mulLeftRight R (a, b) x = a * x * b :=\n rfl\n#align linear_map.mul_left_right_apply LinearMap.mulLeftRight_apply\n\n@[simp]\ntheorem mul'_apply {a b : A} : mul' R A (a ⊗ₜ b) = a * b :=\n rfl\n#align linear_map.mul'_apply LinearMap.mul'_apply\n\n@[simp]\ntheorem mulLeft_zero_eq_zero : mulLeft R (0 : A) = 0 :=\n (mul R A).map_zero\n#align linear_map.mul_left_zero_eq_zero LinearMap.mulLeft_zero_eq_zero\n\n@[simp]\ntheorem mulRight_zero_eq_zero : mulRight R (0 : A) = 0 :=\n (mul R A).flip.map_zero\n#align linear_map.mul_right_zero_eq_zero LinearMap.mulRight_zero_eq_zero\n\nend NonUnitalNonAssoc\n\nsection NonUnital\n\nvariable (R A : Type*) [CommSemiring R] [NonUnitalSemiring A] [Module R A] [SMulCommClass R A A]\n [IsScalarTower R A A]\n\n/-- The multiplication in a non-unital algebra is a bilinear map.\n\nA weaker version of this for non-unital non-associative algebras exists as `LinearMap.mul`. -/\ndef _root_.NonUnitalAlgHom.lmul : A →ₙₐ[R] End R A :=\n { mul R A with\n map_mul' := by\n intro a b\n ext c\n exact mul_assoc a b c\n map_zero' := by\n ext a\n exact zero_mul a }\n#align non_unital_alg_hom.lmul NonUnitalAlgHom.lmul\n\nvariable {R A}\n\n@[simp]\ntheorem _root_.NonUnitalAlgHom.coe_lmul_eq_mul : ⇑(NonUnitalAlgHom.lmul R A) = mul R A :=\n rfl\n#align non_unital_alg_hom.coe_lmul_eq_mul NonUnitalAlgHom.coe_lmul_eq_mul\n\ntheorem commute_mulLeft_right (a b : A) : Commute (mulLeft R a) (mulRight R b) := by\n ext c\n exact (mul_assoc a c b).symm\n#align linear_map.commute_mul_left_right LinearMap.commute_mulLeft_right\n\n@[simp]\ntheorem mulLeft_mul (a b : A) : mulLeft R (a * b) = (mulLeft R a).comp (mulLeft R b) := by\n ext\n simp only [mulLeft_apply, comp_apply, mul_assoc]\n#align linear_map.mul_left_mul LinearMap.mulLeft_mul\n\n@[simp]\ntheorem mulRight_mul (a b : A) : mulRight R (a * b) = (mulRight R b).comp (mulRight R a) := by\n ext\n simp only [mulRight_apply, comp_apply, mul_assoc]\n#align linear_map.mul_right_mul LinearMap.mulRight_mul\n\nend NonUnital\n\nsection Semiring\n\nvariable (R A B : Type*) [CommSemiring R] [Semiring A] [Semiring B] [Algebra R A] [Algebra R B]\n\nvariable {R A B} in\n/-- A `LinearMap` preserves multiplication if pre- and post- composition with `LinearMap.mul` are\nequivalent. By converting the statement into an equality of `LinearMap`s, this lemma allows various\nspecialized `ext` lemmas about `→ₗ[R]` to then be applied.\n\nThis is the `LinearMap` version of `AddMonoidHom.map_mul_iff`. -/\ntheorem map_mul_iff (f : A →ₗ[R] B) :\n (∀ x y, f (x * y) = f x * f y) ↔\n (LinearMap.mul R A).compr₂ f = (LinearMap.mul R B ∘ₗ f).compl₂ f :=\n Iff.symm LinearMap.ext_iff₂\n\n/-- The multiplication in an algebra is an algebra homomorphism into the endomorphisms on\nthe algebra.\n\nA weaker version of this for non-unital algebras exists as `NonUnitalAlgHom.mul`. -/\ndef _root_.Algebra.lmul : A →ₐ[R] End R A :=\n { LinearMap.mul R A with\n map_one' := by\n ext a\n exact one_mul a\n map_mul' := by\n intro a b\n ext c\n exact mul_assoc a b c\n map_zero' := by\n ext a\n exact zero_mul a\n commutes' := by\n intro r\n ext a\n exact (Algebra.smul_def r a).symm }\n#align algebra.lmul Algebra.lmul\n\nvariable {R A}\n\n@[simp]\ntheorem _root_.Algebra.coe_lmul_eq_mul : ⇑(Algebra.lmul R A) = mul R A :=\n rfl\n#align algebra.coe_lmul_eq_mul Algebra.coe_lmul_eq_mul\n\ntheorem _root_.Algebra.lmul_injective : Function.Injective (Algebra.lmul R A) :=\n fun a₁ a₂ h ↦ by simpa using FunLike.congr_fun h 1\n\n@[simp]\ntheorem mulLeft_eq_zero_iff (a : A) : mulLeft R a = 0 ↔ a = 0 := by\n constructor <;> intro h\n -- porting note: had to supply `R` explicitly in `@mulLeft_apply` below\n · rw [← mul_one a, ← @mulLeft_apply R _ _ _ _ _ _ a 1, h, LinearMap.zero_apply]\n · ","nextTactic":"rw [h]","declUpToTactic":"@[simp]\ntheorem mulLeft_eq_zero_iff (a : A) : mulLeft R a = 0 ↔ a = 0 := by\n constructor <;> intro h\n -- porting note: had to supply `R` explicitly in `@mulLeft_apply` below\n · rw [← mul_one a, ← @mulLeft_apply R _ _ _ _ _ _ a 1, h, LinearMap.zero_apply]\n · ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Bilinear.201_0.cGBk1UxpwLhzgI8","decl":"@[simp]\ntheorem mulLeft_eq_zero_iff (a : A) : mulLeft R a = 0 ↔ a = 0 "} -{"state":"case mpr\nR : Type u_1\nA : Type u_2\nB : Type u_3\ninst✝⁴ : CommSemiring R\ninst✝³ : Semiring A\ninst✝² : Semiring B\ninst✝¹ : Algebra R A\ninst✝ : Algebra R B\na : A\nh : a = 0\n⊢ mulLeft R 0 = 0","srcUpToTactic":"/-\nCopyright (c) 2018 Kenny Lau. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Kenny Lau, Yury Kudryashov\n-/\nimport Mathlib.Algebra.Algebra.Basic\nimport Mathlib.Algebra.Algebra.Equiv\nimport Mathlib.Algebra.Algebra.NonUnitalHom\nimport Mathlib.Algebra.GroupPower.IterateHom\nimport Mathlib.LinearAlgebra.TensorProduct\n\n#align_import algebra.algebra.bilinear from \"leanprover-community/mathlib\"@\"657df4339ae6ceada048c8a2980fb10e393143ec\"\n\n/-!\n# Facts about algebras involving bilinear maps and tensor products\n\nWe move a few basic statements about algebras out of `Algebra.Algebra.Basic`,\nin order to avoid importing `LinearAlgebra.BilinearMap` and\n`LinearAlgebra.TensorProduct` unnecessarily.\n-/\n\nopen TensorProduct Module\n\nnamespace LinearMap\n\nsection NonUnitalNonAssoc\n\nvariable (R A : Type*) [CommSemiring R] [NonUnitalNonAssocSemiring A] [Module R A]\n [SMulCommClass R A A] [IsScalarTower R A A]\n\n/-- The multiplication in a non-unital non-associative algebra is a bilinear map.\n\nA weaker version of this for semirings exists as `AddMonoidHom.mul`. -/\ndef mul : A →ₗ[R] A →ₗ[R] A :=\n LinearMap.mk₂ R (· * ·) add_mul smul_mul_assoc mul_add mul_smul_comm\n#align linear_map.mul LinearMap.mul\n\n/-- The multiplication map on a non-unital algebra, as an `R`-linear map from `A ⊗[R] A` to `A`. -/\nnoncomputable def mul' : A ⊗[R] A →ₗ[R] A :=\n TensorProduct.lift (mul R A)\n#align linear_map.mul' LinearMap.mul'\n\nvariable {A}\n\n/-- The multiplication on the left in a non-unital algebra is a linear map. -/\ndef mulLeft (a : A) : A →ₗ[R] A :=\n mul R A a\n#align linear_map.mul_left LinearMap.mulLeft\n\n/-- The multiplication on the right in an algebra is a linear map. -/\ndef mulRight (a : A) : A →ₗ[R] A :=\n (mul R A).flip a\n#align linear_map.mul_right LinearMap.mulRight\n\n/-- Simultaneous multiplication on the left and right is a linear map. -/\ndef mulLeftRight (ab : A × A) : A →ₗ[R] A :=\n (mulRight R ab.snd).comp (mulLeft R ab.fst)\n#align linear_map.mul_left_right LinearMap.mulLeftRight\n\n@[simp]\ntheorem mulLeft_toAddMonoidHom (a : A) : (mulLeft R a : A →+ A) = AddMonoidHom.mulLeft a :=\n rfl\n#align linear_map.mul_left_to_add_monoid_hom LinearMap.mulLeft_toAddMonoidHom\n\n@[simp]\ntheorem mulRight_toAddMonoidHom (a : A) : (mulRight R a : A →+ A) = AddMonoidHom.mulRight a :=\n rfl\n#align linear_map.mul_right_to_add_monoid_hom LinearMap.mulRight_toAddMonoidHom\n\nvariable {R}\n\n@[simp]\ntheorem mul_apply' (a b : A) : mul R A a b = a * b :=\n rfl\n#align linear_map.mul_apply' LinearMap.mul_apply'\n\n@[simp]\ntheorem mulLeft_apply (a b : A) : mulLeft R a b = a * b :=\n rfl\n#align linear_map.mul_left_apply LinearMap.mulLeft_apply\n\n@[simp]\ntheorem mulRight_apply (a b : A) : mulRight R a b = b * a :=\n rfl\n#align linear_map.mul_right_apply LinearMap.mulRight_apply\n\n@[simp]\ntheorem mulLeftRight_apply (a b x : A) : mulLeftRight R (a, b) x = a * x * b :=\n rfl\n#align linear_map.mul_left_right_apply LinearMap.mulLeftRight_apply\n\n@[simp]\ntheorem mul'_apply {a b : A} : mul' R A (a ⊗ₜ b) = a * b :=\n rfl\n#align linear_map.mul'_apply LinearMap.mul'_apply\n\n@[simp]\ntheorem mulLeft_zero_eq_zero : mulLeft R (0 : A) = 0 :=\n (mul R A).map_zero\n#align linear_map.mul_left_zero_eq_zero LinearMap.mulLeft_zero_eq_zero\n\n@[simp]\ntheorem mulRight_zero_eq_zero : mulRight R (0 : A) = 0 :=\n (mul R A).flip.map_zero\n#align linear_map.mul_right_zero_eq_zero LinearMap.mulRight_zero_eq_zero\n\nend NonUnitalNonAssoc\n\nsection NonUnital\n\nvariable (R A : Type*) [CommSemiring R] [NonUnitalSemiring A] [Module R A] [SMulCommClass R A A]\n [IsScalarTower R A A]\n\n/-- The multiplication in a non-unital algebra is a bilinear map.\n\nA weaker version of this for non-unital non-associative algebras exists as `LinearMap.mul`. -/\ndef _root_.NonUnitalAlgHom.lmul : A →ₙₐ[R] End R A :=\n { mul R A with\n map_mul' := by\n intro a b\n ext c\n exact mul_assoc a b c\n map_zero' := by\n ext a\n exact zero_mul a }\n#align non_unital_alg_hom.lmul NonUnitalAlgHom.lmul\n\nvariable {R A}\n\n@[simp]\ntheorem _root_.NonUnitalAlgHom.coe_lmul_eq_mul : ⇑(NonUnitalAlgHom.lmul R A) = mul R A :=\n rfl\n#align non_unital_alg_hom.coe_lmul_eq_mul NonUnitalAlgHom.coe_lmul_eq_mul\n\ntheorem commute_mulLeft_right (a b : A) : Commute (mulLeft R a) (mulRight R b) := by\n ext c\n exact (mul_assoc a c b).symm\n#align linear_map.commute_mul_left_right LinearMap.commute_mulLeft_right\n\n@[simp]\ntheorem mulLeft_mul (a b : A) : mulLeft R (a * b) = (mulLeft R a).comp (mulLeft R b) := by\n ext\n simp only [mulLeft_apply, comp_apply, mul_assoc]\n#align linear_map.mul_left_mul LinearMap.mulLeft_mul\n\n@[simp]\ntheorem mulRight_mul (a b : A) : mulRight R (a * b) = (mulRight R b).comp (mulRight R a) := by\n ext\n simp only [mulRight_apply, comp_apply, mul_assoc]\n#align linear_map.mul_right_mul LinearMap.mulRight_mul\n\nend NonUnital\n\nsection Semiring\n\nvariable (R A B : Type*) [CommSemiring R] [Semiring A] [Semiring B] [Algebra R A] [Algebra R B]\n\nvariable {R A B} in\n/-- A `LinearMap` preserves multiplication if pre- and post- composition with `LinearMap.mul` are\nequivalent. By converting the statement into an equality of `LinearMap`s, this lemma allows various\nspecialized `ext` lemmas about `→ₗ[R]` to then be applied.\n\nThis is the `LinearMap` version of `AddMonoidHom.map_mul_iff`. -/\ntheorem map_mul_iff (f : A →ₗ[R] B) :\n (∀ x y, f (x * y) = f x * f y) ↔\n (LinearMap.mul R A).compr₂ f = (LinearMap.mul R B ∘ₗ f).compl₂ f :=\n Iff.symm LinearMap.ext_iff₂\n\n/-- The multiplication in an algebra is an algebra homomorphism into the endomorphisms on\nthe algebra.\n\nA weaker version of this for non-unital algebras exists as `NonUnitalAlgHom.mul`. -/\ndef _root_.Algebra.lmul : A →ₐ[R] End R A :=\n { LinearMap.mul R A with\n map_one' := by\n ext a\n exact one_mul a\n map_mul' := by\n intro a b\n ext c\n exact mul_assoc a b c\n map_zero' := by\n ext a\n exact zero_mul a\n commutes' := by\n intro r\n ext a\n exact (Algebra.smul_def r a).symm }\n#align algebra.lmul Algebra.lmul\n\nvariable {R A}\n\n@[simp]\ntheorem _root_.Algebra.coe_lmul_eq_mul : ⇑(Algebra.lmul R A) = mul R A :=\n rfl\n#align algebra.coe_lmul_eq_mul Algebra.coe_lmul_eq_mul\n\ntheorem _root_.Algebra.lmul_injective : Function.Injective (Algebra.lmul R A) :=\n fun a₁ a₂ h ↦ by simpa using FunLike.congr_fun h 1\n\n@[simp]\ntheorem mulLeft_eq_zero_iff (a : A) : mulLeft R a = 0 ↔ a = 0 := by\n constructor <;> intro h\n -- porting note: had to supply `R` explicitly in `@mulLeft_apply` below\n · rw [← mul_one a, ← @mulLeft_apply R _ _ _ _ _ _ a 1, h, LinearMap.zero_apply]\n · rw [h]\n ","nextTactic":"exact mulLeft_zero_eq_zero","declUpToTactic":"@[simp]\ntheorem mulLeft_eq_zero_iff (a : A) : mulLeft R a = 0 ↔ a = 0 := by\n constructor <;> intro h\n -- porting note: had to supply `R` explicitly in `@mulLeft_apply` below\n · rw [← mul_one a, ← @mulLeft_apply R _ _ _ _ _ _ a 1, h, LinearMap.zero_apply]\n · rw [h]\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Bilinear.201_0.cGBk1UxpwLhzgI8","decl":"@[simp]\ntheorem mulLeft_eq_zero_iff (a : A) : mulLeft R a = 0 ↔ a = 0 "} -{"state":"R : Type u_1\nA : Type u_2\nB : Type u_3\ninst✝⁴ : CommSemiring R\ninst✝³ : Semiring A\ninst✝² : Semiring B\ninst✝¹ : Algebra R A\ninst✝ : Algebra R B\na : A\n⊢ mulRight R a = 0 ↔ a = 0","srcUpToTactic":"/-\nCopyright (c) 2018 Kenny Lau. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Kenny Lau, Yury Kudryashov\n-/\nimport Mathlib.Algebra.Algebra.Basic\nimport Mathlib.Algebra.Algebra.Equiv\nimport Mathlib.Algebra.Algebra.NonUnitalHom\nimport Mathlib.Algebra.GroupPower.IterateHom\nimport Mathlib.LinearAlgebra.TensorProduct\n\n#align_import algebra.algebra.bilinear from \"leanprover-community/mathlib\"@\"657df4339ae6ceada048c8a2980fb10e393143ec\"\n\n/-!\n# Facts about algebras involving bilinear maps and tensor products\n\nWe move a few basic statements about algebras out of `Algebra.Algebra.Basic`,\nin order to avoid importing `LinearAlgebra.BilinearMap` and\n`LinearAlgebra.TensorProduct` unnecessarily.\n-/\n\nopen TensorProduct Module\n\nnamespace LinearMap\n\nsection NonUnitalNonAssoc\n\nvariable (R A : Type*) [CommSemiring R] [NonUnitalNonAssocSemiring A] [Module R A]\n [SMulCommClass R A A] [IsScalarTower R A A]\n\n/-- The multiplication in a non-unital non-associative algebra is a bilinear map.\n\nA weaker version of this for semirings exists as `AddMonoidHom.mul`. -/\ndef mul : A →ₗ[R] A →ₗ[R] A :=\n LinearMap.mk₂ R (· * ·) add_mul smul_mul_assoc mul_add mul_smul_comm\n#align linear_map.mul LinearMap.mul\n\n/-- The multiplication map on a non-unital algebra, as an `R`-linear map from `A ⊗[R] A` to `A`. -/\nnoncomputable def mul' : A ⊗[R] A →ₗ[R] A :=\n TensorProduct.lift (mul R A)\n#align linear_map.mul' LinearMap.mul'\n\nvariable {A}\n\n/-- The multiplication on the left in a non-unital algebra is a linear map. -/\ndef mulLeft (a : A) : A →ₗ[R] A :=\n mul R A a\n#align linear_map.mul_left LinearMap.mulLeft\n\n/-- The multiplication on the right in an algebra is a linear map. -/\ndef mulRight (a : A) : A →ₗ[R] A :=\n (mul R A).flip a\n#align linear_map.mul_right LinearMap.mulRight\n\n/-- Simultaneous multiplication on the left and right is a linear map. -/\ndef mulLeftRight (ab : A × A) : A →ₗ[R] A :=\n (mulRight R ab.snd).comp (mulLeft R ab.fst)\n#align linear_map.mul_left_right LinearMap.mulLeftRight\n\n@[simp]\ntheorem mulLeft_toAddMonoidHom (a : A) : (mulLeft R a : A →+ A) = AddMonoidHom.mulLeft a :=\n rfl\n#align linear_map.mul_left_to_add_monoid_hom LinearMap.mulLeft_toAddMonoidHom\n\n@[simp]\ntheorem mulRight_toAddMonoidHom (a : A) : (mulRight R a : A →+ A) = AddMonoidHom.mulRight a :=\n rfl\n#align linear_map.mul_right_to_add_monoid_hom LinearMap.mulRight_toAddMonoidHom\n\nvariable {R}\n\n@[simp]\ntheorem mul_apply' (a b : A) : mul R A a b = a * b :=\n rfl\n#align linear_map.mul_apply' LinearMap.mul_apply'\n\n@[simp]\ntheorem mulLeft_apply (a b : A) : mulLeft R a b = a * b :=\n rfl\n#align linear_map.mul_left_apply LinearMap.mulLeft_apply\n\n@[simp]\ntheorem mulRight_apply (a b : A) : mulRight R a b = b * a :=\n rfl\n#align linear_map.mul_right_apply LinearMap.mulRight_apply\n\n@[simp]\ntheorem mulLeftRight_apply (a b x : A) : mulLeftRight R (a, b) x = a * x * b :=\n rfl\n#align linear_map.mul_left_right_apply LinearMap.mulLeftRight_apply\n\n@[simp]\ntheorem mul'_apply {a b : A} : mul' R A (a ⊗ₜ b) = a * b :=\n rfl\n#align linear_map.mul'_apply LinearMap.mul'_apply\n\n@[simp]\ntheorem mulLeft_zero_eq_zero : mulLeft R (0 : A) = 0 :=\n (mul R A).map_zero\n#align linear_map.mul_left_zero_eq_zero LinearMap.mulLeft_zero_eq_zero\n\n@[simp]\ntheorem mulRight_zero_eq_zero : mulRight R (0 : A) = 0 :=\n (mul R A).flip.map_zero\n#align linear_map.mul_right_zero_eq_zero LinearMap.mulRight_zero_eq_zero\n\nend NonUnitalNonAssoc\n\nsection NonUnital\n\nvariable (R A : Type*) [CommSemiring R] [NonUnitalSemiring A] [Module R A] [SMulCommClass R A A]\n [IsScalarTower R A A]\n\n/-- The multiplication in a non-unital algebra is a bilinear map.\n\nA weaker version of this for non-unital non-associative algebras exists as `LinearMap.mul`. -/\ndef _root_.NonUnitalAlgHom.lmul : A →ₙₐ[R] End R A :=\n { mul R A with\n map_mul' := by\n intro a b\n ext c\n exact mul_assoc a b c\n map_zero' := by\n ext a\n exact zero_mul a }\n#align non_unital_alg_hom.lmul NonUnitalAlgHom.lmul\n\nvariable {R A}\n\n@[simp]\ntheorem _root_.NonUnitalAlgHom.coe_lmul_eq_mul : ⇑(NonUnitalAlgHom.lmul R A) = mul R A :=\n rfl\n#align non_unital_alg_hom.coe_lmul_eq_mul NonUnitalAlgHom.coe_lmul_eq_mul\n\ntheorem commute_mulLeft_right (a b : A) : Commute (mulLeft R a) (mulRight R b) := by\n ext c\n exact (mul_assoc a c b).symm\n#align linear_map.commute_mul_left_right LinearMap.commute_mulLeft_right\n\n@[simp]\ntheorem mulLeft_mul (a b : A) : mulLeft R (a * b) = (mulLeft R a).comp (mulLeft R b) := by\n ext\n simp only [mulLeft_apply, comp_apply, mul_assoc]\n#align linear_map.mul_left_mul LinearMap.mulLeft_mul\n\n@[simp]\ntheorem mulRight_mul (a b : A) : mulRight R (a * b) = (mulRight R b).comp (mulRight R a) := by\n ext\n simp only [mulRight_apply, comp_apply, mul_assoc]\n#align linear_map.mul_right_mul LinearMap.mulRight_mul\n\nend NonUnital\n\nsection Semiring\n\nvariable (R A B : Type*) [CommSemiring R] [Semiring A] [Semiring B] [Algebra R A] [Algebra R B]\n\nvariable {R A B} in\n/-- A `LinearMap` preserves multiplication if pre- and post- composition with `LinearMap.mul` are\nequivalent. By converting the statement into an equality of `LinearMap`s, this lemma allows various\nspecialized `ext` lemmas about `→ₗ[R]` to then be applied.\n\nThis is the `LinearMap` version of `AddMonoidHom.map_mul_iff`. -/\ntheorem map_mul_iff (f : A →ₗ[R] B) :\n (∀ x y, f (x * y) = f x * f y) ↔\n (LinearMap.mul R A).compr₂ f = (LinearMap.mul R B ∘ₗ f).compl₂ f :=\n Iff.symm LinearMap.ext_iff₂\n\n/-- The multiplication in an algebra is an algebra homomorphism into the endomorphisms on\nthe algebra.\n\nA weaker version of this for non-unital algebras exists as `NonUnitalAlgHom.mul`. -/\ndef _root_.Algebra.lmul : A →ₐ[R] End R A :=\n { LinearMap.mul R A with\n map_one' := by\n ext a\n exact one_mul a\n map_mul' := by\n intro a b\n ext c\n exact mul_assoc a b c\n map_zero' := by\n ext a\n exact zero_mul a\n commutes' := by\n intro r\n ext a\n exact (Algebra.smul_def r a).symm }\n#align algebra.lmul Algebra.lmul\n\nvariable {R A}\n\n@[simp]\ntheorem _root_.Algebra.coe_lmul_eq_mul : ⇑(Algebra.lmul R A) = mul R A :=\n rfl\n#align algebra.coe_lmul_eq_mul Algebra.coe_lmul_eq_mul\n\ntheorem _root_.Algebra.lmul_injective : Function.Injective (Algebra.lmul R A) :=\n fun a₁ a₂ h ↦ by simpa using FunLike.congr_fun h 1\n\n@[simp]\ntheorem mulLeft_eq_zero_iff (a : A) : mulLeft R a = 0 ↔ a = 0 := by\n constructor <;> intro h\n -- porting note: had to supply `R` explicitly in `@mulLeft_apply` below\n · rw [← mul_one a, ← @mulLeft_apply R _ _ _ _ _ _ a 1, h, LinearMap.zero_apply]\n · rw [h]\n exact mulLeft_zero_eq_zero\n#align linear_map.mul_left_eq_zero_iff LinearMap.mulLeft_eq_zero_iff\n\n@[simp]\ntheorem mulRight_eq_zero_iff (a : A) : mulRight R a = 0 ↔ a = 0 := by\n ","nextTactic":"constructor","declUpToTactic":"@[simp]\ntheorem mulRight_eq_zero_iff (a : A) : mulRight R a = 0 ↔ a = 0 := by\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Bilinear.210_0.cGBk1UxpwLhzgI8","decl":"@[simp]\ntheorem mulRight_eq_zero_iff (a : A) : mulRight R a = 0 ↔ a = 0 "} -{"state":"case mp\nR : Type u_1\nA : Type u_2\nB : Type u_3\ninst✝⁴ : CommSemiring R\ninst✝³ : Semiring A\ninst✝² : Semiring B\ninst✝¹ : Algebra R A\ninst✝ : Algebra R B\na : A\n⊢ mulRight R a = 0 → a = 0","srcUpToTactic":"/-\nCopyright (c) 2018 Kenny Lau. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Kenny Lau, Yury Kudryashov\n-/\nimport Mathlib.Algebra.Algebra.Basic\nimport Mathlib.Algebra.Algebra.Equiv\nimport Mathlib.Algebra.Algebra.NonUnitalHom\nimport Mathlib.Algebra.GroupPower.IterateHom\nimport Mathlib.LinearAlgebra.TensorProduct\n\n#align_import algebra.algebra.bilinear from \"leanprover-community/mathlib\"@\"657df4339ae6ceada048c8a2980fb10e393143ec\"\n\n/-!\n# Facts about algebras involving bilinear maps and tensor products\n\nWe move a few basic statements about algebras out of `Algebra.Algebra.Basic`,\nin order to avoid importing `LinearAlgebra.BilinearMap` and\n`LinearAlgebra.TensorProduct` unnecessarily.\n-/\n\nopen TensorProduct Module\n\nnamespace LinearMap\n\nsection NonUnitalNonAssoc\n\nvariable (R A : Type*) [CommSemiring R] [NonUnitalNonAssocSemiring A] [Module R A]\n [SMulCommClass R A A] [IsScalarTower R A A]\n\n/-- The multiplication in a non-unital non-associative algebra is a bilinear map.\n\nA weaker version of this for semirings exists as `AddMonoidHom.mul`. -/\ndef mul : A →ₗ[R] A →ₗ[R] A :=\n LinearMap.mk₂ R (· * ·) add_mul smul_mul_assoc mul_add mul_smul_comm\n#align linear_map.mul LinearMap.mul\n\n/-- The multiplication map on a non-unital algebra, as an `R`-linear map from `A ⊗[R] A` to `A`. -/\nnoncomputable def mul' : A ⊗[R] A →ₗ[R] A :=\n TensorProduct.lift (mul R A)\n#align linear_map.mul' LinearMap.mul'\n\nvariable {A}\n\n/-- The multiplication on the left in a non-unital algebra is a linear map. -/\ndef mulLeft (a : A) : A →ₗ[R] A :=\n mul R A a\n#align linear_map.mul_left LinearMap.mulLeft\n\n/-- The multiplication on the right in an algebra is a linear map. -/\ndef mulRight (a : A) : A →ₗ[R] A :=\n (mul R A).flip a\n#align linear_map.mul_right LinearMap.mulRight\n\n/-- Simultaneous multiplication on the left and right is a linear map. -/\ndef mulLeftRight (ab : A × A) : A →ₗ[R] A :=\n (mulRight R ab.snd).comp (mulLeft R ab.fst)\n#align linear_map.mul_left_right LinearMap.mulLeftRight\n\n@[simp]\ntheorem mulLeft_toAddMonoidHom (a : A) : (mulLeft R a : A →+ A) = AddMonoidHom.mulLeft a :=\n rfl\n#align linear_map.mul_left_to_add_monoid_hom LinearMap.mulLeft_toAddMonoidHom\n\n@[simp]\ntheorem mulRight_toAddMonoidHom (a : A) : (mulRight R a : A →+ A) = AddMonoidHom.mulRight a :=\n rfl\n#align linear_map.mul_right_to_add_monoid_hom LinearMap.mulRight_toAddMonoidHom\n\nvariable {R}\n\n@[simp]\ntheorem mul_apply' (a b : A) : mul R A a b = a * b :=\n rfl\n#align linear_map.mul_apply' LinearMap.mul_apply'\n\n@[simp]\ntheorem mulLeft_apply (a b : A) : mulLeft R a b = a * b :=\n rfl\n#align linear_map.mul_left_apply LinearMap.mulLeft_apply\n\n@[simp]\ntheorem mulRight_apply (a b : A) : mulRight R a b = b * a :=\n rfl\n#align linear_map.mul_right_apply LinearMap.mulRight_apply\n\n@[simp]\ntheorem mulLeftRight_apply (a b x : A) : mulLeftRight R (a, b) x = a * x * b :=\n rfl\n#align linear_map.mul_left_right_apply LinearMap.mulLeftRight_apply\n\n@[simp]\ntheorem mul'_apply {a b : A} : mul' R A (a ⊗ₜ b) = a * b :=\n rfl\n#align linear_map.mul'_apply LinearMap.mul'_apply\n\n@[simp]\ntheorem mulLeft_zero_eq_zero : mulLeft R (0 : A) = 0 :=\n (mul R A).map_zero\n#align linear_map.mul_left_zero_eq_zero LinearMap.mulLeft_zero_eq_zero\n\n@[simp]\ntheorem mulRight_zero_eq_zero : mulRight R (0 : A) = 0 :=\n (mul R A).flip.map_zero\n#align linear_map.mul_right_zero_eq_zero LinearMap.mulRight_zero_eq_zero\n\nend NonUnitalNonAssoc\n\nsection NonUnital\n\nvariable (R A : Type*) [CommSemiring R] [NonUnitalSemiring A] [Module R A] [SMulCommClass R A A]\n [IsScalarTower R A A]\n\n/-- The multiplication in a non-unital algebra is a bilinear map.\n\nA weaker version of this for non-unital non-associative algebras exists as `LinearMap.mul`. -/\ndef _root_.NonUnitalAlgHom.lmul : A →ₙₐ[R] End R A :=\n { mul R A with\n map_mul' := by\n intro a b\n ext c\n exact mul_assoc a b c\n map_zero' := by\n ext a\n exact zero_mul a }\n#align non_unital_alg_hom.lmul NonUnitalAlgHom.lmul\n\nvariable {R A}\n\n@[simp]\ntheorem _root_.NonUnitalAlgHom.coe_lmul_eq_mul : ⇑(NonUnitalAlgHom.lmul R A) = mul R A :=\n rfl\n#align non_unital_alg_hom.coe_lmul_eq_mul NonUnitalAlgHom.coe_lmul_eq_mul\n\ntheorem commute_mulLeft_right (a b : A) : Commute (mulLeft R a) (mulRight R b) := by\n ext c\n exact (mul_assoc a c b).symm\n#align linear_map.commute_mul_left_right LinearMap.commute_mulLeft_right\n\n@[simp]\ntheorem mulLeft_mul (a b : A) : mulLeft R (a * b) = (mulLeft R a).comp (mulLeft R b) := by\n ext\n simp only [mulLeft_apply, comp_apply, mul_assoc]\n#align linear_map.mul_left_mul LinearMap.mulLeft_mul\n\n@[simp]\ntheorem mulRight_mul (a b : A) : mulRight R (a * b) = (mulRight R b).comp (mulRight R a) := by\n ext\n simp only [mulRight_apply, comp_apply, mul_assoc]\n#align linear_map.mul_right_mul LinearMap.mulRight_mul\n\nend NonUnital\n\nsection Semiring\n\nvariable (R A B : Type*) [CommSemiring R] [Semiring A] [Semiring B] [Algebra R A] [Algebra R B]\n\nvariable {R A B} in\n/-- A `LinearMap` preserves multiplication if pre- and post- composition with `LinearMap.mul` are\nequivalent. By converting the statement into an equality of `LinearMap`s, this lemma allows various\nspecialized `ext` lemmas about `→ₗ[R]` to then be applied.\n\nThis is the `LinearMap` version of `AddMonoidHom.map_mul_iff`. -/\ntheorem map_mul_iff (f : A →ₗ[R] B) :\n (∀ x y, f (x * y) = f x * f y) ↔\n (LinearMap.mul R A).compr₂ f = (LinearMap.mul R B ∘ₗ f).compl₂ f :=\n Iff.symm LinearMap.ext_iff₂\n\n/-- The multiplication in an algebra is an algebra homomorphism into the endomorphisms on\nthe algebra.\n\nA weaker version of this for non-unital algebras exists as `NonUnitalAlgHom.mul`. -/\ndef _root_.Algebra.lmul : A →ₐ[R] End R A :=\n { LinearMap.mul R A with\n map_one' := by\n ext a\n exact one_mul a\n map_mul' := by\n intro a b\n ext c\n exact mul_assoc a b c\n map_zero' := by\n ext a\n exact zero_mul a\n commutes' := by\n intro r\n ext a\n exact (Algebra.smul_def r a).symm }\n#align algebra.lmul Algebra.lmul\n\nvariable {R A}\n\n@[simp]\ntheorem _root_.Algebra.coe_lmul_eq_mul : ⇑(Algebra.lmul R A) = mul R A :=\n rfl\n#align algebra.coe_lmul_eq_mul Algebra.coe_lmul_eq_mul\n\ntheorem _root_.Algebra.lmul_injective : Function.Injective (Algebra.lmul R A) :=\n fun a₁ a₂ h ↦ by simpa using FunLike.congr_fun h 1\n\n@[simp]\ntheorem mulLeft_eq_zero_iff (a : A) : mulLeft R a = 0 ↔ a = 0 := by\n constructor <;> intro h\n -- porting note: had to supply `R` explicitly in `@mulLeft_apply` below\n · rw [← mul_one a, ← @mulLeft_apply R _ _ _ _ _ _ a 1, h, LinearMap.zero_apply]\n · rw [h]\n exact mulLeft_zero_eq_zero\n#align linear_map.mul_left_eq_zero_iff LinearMap.mulLeft_eq_zero_iff\n\n@[simp]\ntheorem mulRight_eq_zero_iff (a : A) : mulRight R a = 0 ↔ a = 0 := by\n constructor <;> ","nextTactic":"intro h","declUpToTactic":"@[simp]\ntheorem mulRight_eq_zero_iff (a : A) : mulRight R a = 0 ↔ a = 0 := by\n constructor <;> ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Bilinear.210_0.cGBk1UxpwLhzgI8","decl":"@[simp]\ntheorem mulRight_eq_zero_iff (a : A) : mulRight R a = 0 ↔ a = 0 "} -{"state":"case mpr\nR : Type u_1\nA : Type u_2\nB : Type u_3\ninst✝⁴ : CommSemiring R\ninst✝³ : Semiring A\ninst✝² : Semiring B\ninst✝¹ : Algebra R A\ninst✝ : Algebra R B\na : A\n⊢ a = 0 → mulRight R a = 0","srcUpToTactic":"/-\nCopyright (c) 2018 Kenny Lau. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Kenny Lau, Yury Kudryashov\n-/\nimport Mathlib.Algebra.Algebra.Basic\nimport Mathlib.Algebra.Algebra.Equiv\nimport Mathlib.Algebra.Algebra.NonUnitalHom\nimport Mathlib.Algebra.GroupPower.IterateHom\nimport Mathlib.LinearAlgebra.TensorProduct\n\n#align_import algebra.algebra.bilinear from \"leanprover-community/mathlib\"@\"657df4339ae6ceada048c8a2980fb10e393143ec\"\n\n/-!\n# Facts about algebras involving bilinear maps and tensor products\n\nWe move a few basic statements about algebras out of `Algebra.Algebra.Basic`,\nin order to avoid importing `LinearAlgebra.BilinearMap` and\n`LinearAlgebra.TensorProduct` unnecessarily.\n-/\n\nopen TensorProduct Module\n\nnamespace LinearMap\n\nsection NonUnitalNonAssoc\n\nvariable (R A : Type*) [CommSemiring R] [NonUnitalNonAssocSemiring A] [Module R A]\n [SMulCommClass R A A] [IsScalarTower R A A]\n\n/-- The multiplication in a non-unital non-associative algebra is a bilinear map.\n\nA weaker version of this for semirings exists as `AddMonoidHom.mul`. -/\ndef mul : A →ₗ[R] A →ₗ[R] A :=\n LinearMap.mk₂ R (· * ·) add_mul smul_mul_assoc mul_add mul_smul_comm\n#align linear_map.mul LinearMap.mul\n\n/-- The multiplication map on a non-unital algebra, as an `R`-linear map from `A ⊗[R] A` to `A`. -/\nnoncomputable def mul' : A ⊗[R] A →ₗ[R] A :=\n TensorProduct.lift (mul R A)\n#align linear_map.mul' LinearMap.mul'\n\nvariable {A}\n\n/-- The multiplication on the left in a non-unital algebra is a linear map. -/\ndef mulLeft (a : A) : A →ₗ[R] A :=\n mul R A a\n#align linear_map.mul_left LinearMap.mulLeft\n\n/-- The multiplication on the right in an algebra is a linear map. -/\ndef mulRight (a : A) : A →ₗ[R] A :=\n (mul R A).flip a\n#align linear_map.mul_right LinearMap.mulRight\n\n/-- Simultaneous multiplication on the left and right is a linear map. -/\ndef mulLeftRight (ab : A × A) : A →ₗ[R] A :=\n (mulRight R ab.snd).comp (mulLeft R ab.fst)\n#align linear_map.mul_left_right LinearMap.mulLeftRight\n\n@[simp]\ntheorem mulLeft_toAddMonoidHom (a : A) : (mulLeft R a : A →+ A) = AddMonoidHom.mulLeft a :=\n rfl\n#align linear_map.mul_left_to_add_monoid_hom LinearMap.mulLeft_toAddMonoidHom\n\n@[simp]\ntheorem mulRight_toAddMonoidHom (a : A) : (mulRight R a : A →+ A) = AddMonoidHom.mulRight a :=\n rfl\n#align linear_map.mul_right_to_add_monoid_hom LinearMap.mulRight_toAddMonoidHom\n\nvariable {R}\n\n@[simp]\ntheorem mul_apply' (a b : A) : mul R A a b = a * b :=\n rfl\n#align linear_map.mul_apply' LinearMap.mul_apply'\n\n@[simp]\ntheorem mulLeft_apply (a b : A) : mulLeft R a b = a * b :=\n rfl\n#align linear_map.mul_left_apply LinearMap.mulLeft_apply\n\n@[simp]\ntheorem mulRight_apply (a b : A) : mulRight R a b = b * a :=\n rfl\n#align linear_map.mul_right_apply LinearMap.mulRight_apply\n\n@[simp]\ntheorem mulLeftRight_apply (a b x : A) : mulLeftRight R (a, b) x = a * x * b :=\n rfl\n#align linear_map.mul_left_right_apply LinearMap.mulLeftRight_apply\n\n@[simp]\ntheorem mul'_apply {a b : A} : mul' R A (a ⊗ₜ b) = a * b :=\n rfl\n#align linear_map.mul'_apply LinearMap.mul'_apply\n\n@[simp]\ntheorem mulLeft_zero_eq_zero : mulLeft R (0 : A) = 0 :=\n (mul R A).map_zero\n#align linear_map.mul_left_zero_eq_zero LinearMap.mulLeft_zero_eq_zero\n\n@[simp]\ntheorem mulRight_zero_eq_zero : mulRight R (0 : A) = 0 :=\n (mul R A).flip.map_zero\n#align linear_map.mul_right_zero_eq_zero LinearMap.mulRight_zero_eq_zero\n\nend NonUnitalNonAssoc\n\nsection NonUnital\n\nvariable (R A : Type*) [CommSemiring R] [NonUnitalSemiring A] [Module R A] [SMulCommClass R A A]\n [IsScalarTower R A A]\n\n/-- The multiplication in a non-unital algebra is a bilinear map.\n\nA weaker version of this for non-unital non-associative algebras exists as `LinearMap.mul`. -/\ndef _root_.NonUnitalAlgHom.lmul : A →ₙₐ[R] End R A :=\n { mul R A with\n map_mul' := by\n intro a b\n ext c\n exact mul_assoc a b c\n map_zero' := by\n ext a\n exact zero_mul a }\n#align non_unital_alg_hom.lmul NonUnitalAlgHom.lmul\n\nvariable {R A}\n\n@[simp]\ntheorem _root_.NonUnitalAlgHom.coe_lmul_eq_mul : ⇑(NonUnitalAlgHom.lmul R A) = mul R A :=\n rfl\n#align non_unital_alg_hom.coe_lmul_eq_mul NonUnitalAlgHom.coe_lmul_eq_mul\n\ntheorem commute_mulLeft_right (a b : A) : Commute (mulLeft R a) (mulRight R b) := by\n ext c\n exact (mul_assoc a c b).symm\n#align linear_map.commute_mul_left_right LinearMap.commute_mulLeft_right\n\n@[simp]\ntheorem mulLeft_mul (a b : A) : mulLeft R (a * b) = (mulLeft R a).comp (mulLeft R b) := by\n ext\n simp only [mulLeft_apply, comp_apply, mul_assoc]\n#align linear_map.mul_left_mul LinearMap.mulLeft_mul\n\n@[simp]\ntheorem mulRight_mul (a b : A) : mulRight R (a * b) = (mulRight R b).comp (mulRight R a) := by\n ext\n simp only [mulRight_apply, comp_apply, mul_assoc]\n#align linear_map.mul_right_mul LinearMap.mulRight_mul\n\nend NonUnital\n\nsection Semiring\n\nvariable (R A B : Type*) [CommSemiring R] [Semiring A] [Semiring B] [Algebra R A] [Algebra R B]\n\nvariable {R A B} in\n/-- A `LinearMap` preserves multiplication if pre- and post- composition with `LinearMap.mul` are\nequivalent. By converting the statement into an equality of `LinearMap`s, this lemma allows various\nspecialized `ext` lemmas about `→ₗ[R]` to then be applied.\n\nThis is the `LinearMap` version of `AddMonoidHom.map_mul_iff`. -/\ntheorem map_mul_iff (f : A →ₗ[R] B) :\n (∀ x y, f (x * y) = f x * f y) ↔\n (LinearMap.mul R A).compr₂ f = (LinearMap.mul R B ∘ₗ f).compl₂ f :=\n Iff.symm LinearMap.ext_iff₂\n\n/-- The multiplication in an algebra is an algebra homomorphism into the endomorphisms on\nthe algebra.\n\nA weaker version of this for non-unital algebras exists as `NonUnitalAlgHom.mul`. -/\ndef _root_.Algebra.lmul : A →ₐ[R] End R A :=\n { LinearMap.mul R A with\n map_one' := by\n ext a\n exact one_mul a\n map_mul' := by\n intro a b\n ext c\n exact mul_assoc a b c\n map_zero' := by\n ext a\n exact zero_mul a\n commutes' := by\n intro r\n ext a\n exact (Algebra.smul_def r a).symm }\n#align algebra.lmul Algebra.lmul\n\nvariable {R A}\n\n@[simp]\ntheorem _root_.Algebra.coe_lmul_eq_mul : ⇑(Algebra.lmul R A) = mul R A :=\n rfl\n#align algebra.coe_lmul_eq_mul Algebra.coe_lmul_eq_mul\n\ntheorem _root_.Algebra.lmul_injective : Function.Injective (Algebra.lmul R A) :=\n fun a₁ a₂ h ↦ by simpa using FunLike.congr_fun h 1\n\n@[simp]\ntheorem mulLeft_eq_zero_iff (a : A) : mulLeft R a = 0 ↔ a = 0 := by\n constructor <;> intro h\n -- porting note: had to supply `R` explicitly in `@mulLeft_apply` below\n · rw [← mul_one a, ← @mulLeft_apply R _ _ _ _ _ _ a 1, h, LinearMap.zero_apply]\n · rw [h]\n exact mulLeft_zero_eq_zero\n#align linear_map.mul_left_eq_zero_iff LinearMap.mulLeft_eq_zero_iff\n\n@[simp]\ntheorem mulRight_eq_zero_iff (a : A) : mulRight R a = 0 ↔ a = 0 := by\n constructor <;> ","nextTactic":"intro h","declUpToTactic":"@[simp]\ntheorem mulRight_eq_zero_iff (a : A) : mulRight R a = 0 ↔ a = 0 := by\n constructor <;> ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Bilinear.210_0.cGBk1UxpwLhzgI8","decl":"@[simp]\ntheorem mulRight_eq_zero_iff (a : A) : mulRight R a = 0 ↔ a = 0 "} -{"state":"case mp\nR : Type u_1\nA : Type u_2\nB : Type u_3\ninst✝⁴ : CommSemiring R\ninst✝³ : Semiring A\ninst✝² : Semiring B\ninst✝¹ : Algebra R A\ninst✝ : Algebra R B\na : A\nh : mulRight R a = 0\n⊢ a = 0","srcUpToTactic":"/-\nCopyright (c) 2018 Kenny Lau. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Kenny Lau, Yury Kudryashov\n-/\nimport Mathlib.Algebra.Algebra.Basic\nimport Mathlib.Algebra.Algebra.Equiv\nimport Mathlib.Algebra.Algebra.NonUnitalHom\nimport Mathlib.Algebra.GroupPower.IterateHom\nimport Mathlib.LinearAlgebra.TensorProduct\n\n#align_import algebra.algebra.bilinear from \"leanprover-community/mathlib\"@\"657df4339ae6ceada048c8a2980fb10e393143ec\"\n\n/-!\n# Facts about algebras involving bilinear maps and tensor products\n\nWe move a few basic statements about algebras out of `Algebra.Algebra.Basic`,\nin order to avoid importing `LinearAlgebra.BilinearMap` and\n`LinearAlgebra.TensorProduct` unnecessarily.\n-/\n\nopen TensorProduct Module\n\nnamespace LinearMap\n\nsection NonUnitalNonAssoc\n\nvariable (R A : Type*) [CommSemiring R] [NonUnitalNonAssocSemiring A] [Module R A]\n [SMulCommClass R A A] [IsScalarTower R A A]\n\n/-- The multiplication in a non-unital non-associative algebra is a bilinear map.\n\nA weaker version of this for semirings exists as `AddMonoidHom.mul`. -/\ndef mul : A →ₗ[R] A →ₗ[R] A :=\n LinearMap.mk₂ R (· * ·) add_mul smul_mul_assoc mul_add mul_smul_comm\n#align linear_map.mul LinearMap.mul\n\n/-- The multiplication map on a non-unital algebra, as an `R`-linear map from `A ⊗[R] A` to `A`. -/\nnoncomputable def mul' : A ⊗[R] A →ₗ[R] A :=\n TensorProduct.lift (mul R A)\n#align linear_map.mul' LinearMap.mul'\n\nvariable {A}\n\n/-- The multiplication on the left in a non-unital algebra is a linear map. -/\ndef mulLeft (a : A) : A →ₗ[R] A :=\n mul R A a\n#align linear_map.mul_left LinearMap.mulLeft\n\n/-- The multiplication on the right in an algebra is a linear map. -/\ndef mulRight (a : A) : A →ₗ[R] A :=\n (mul R A).flip a\n#align linear_map.mul_right LinearMap.mulRight\n\n/-- Simultaneous multiplication on the left and right is a linear map. -/\ndef mulLeftRight (ab : A × A) : A →ₗ[R] A :=\n (mulRight R ab.snd).comp (mulLeft R ab.fst)\n#align linear_map.mul_left_right LinearMap.mulLeftRight\n\n@[simp]\ntheorem mulLeft_toAddMonoidHom (a : A) : (mulLeft R a : A →+ A) = AddMonoidHom.mulLeft a :=\n rfl\n#align linear_map.mul_left_to_add_monoid_hom LinearMap.mulLeft_toAddMonoidHom\n\n@[simp]\ntheorem mulRight_toAddMonoidHom (a : A) : (mulRight R a : A →+ A) = AddMonoidHom.mulRight a :=\n rfl\n#align linear_map.mul_right_to_add_monoid_hom LinearMap.mulRight_toAddMonoidHom\n\nvariable {R}\n\n@[simp]\ntheorem mul_apply' (a b : A) : mul R A a b = a * b :=\n rfl\n#align linear_map.mul_apply' LinearMap.mul_apply'\n\n@[simp]\ntheorem mulLeft_apply (a b : A) : mulLeft R a b = a * b :=\n rfl\n#align linear_map.mul_left_apply LinearMap.mulLeft_apply\n\n@[simp]\ntheorem mulRight_apply (a b : A) : mulRight R a b = b * a :=\n rfl\n#align linear_map.mul_right_apply LinearMap.mulRight_apply\n\n@[simp]\ntheorem mulLeftRight_apply (a b x : A) : mulLeftRight R (a, b) x = a * x * b :=\n rfl\n#align linear_map.mul_left_right_apply LinearMap.mulLeftRight_apply\n\n@[simp]\ntheorem mul'_apply {a b : A} : mul' R A (a ⊗ₜ b) = a * b :=\n rfl\n#align linear_map.mul'_apply LinearMap.mul'_apply\n\n@[simp]\ntheorem mulLeft_zero_eq_zero : mulLeft R (0 : A) = 0 :=\n (mul R A).map_zero\n#align linear_map.mul_left_zero_eq_zero LinearMap.mulLeft_zero_eq_zero\n\n@[simp]\ntheorem mulRight_zero_eq_zero : mulRight R (0 : A) = 0 :=\n (mul R A).flip.map_zero\n#align linear_map.mul_right_zero_eq_zero LinearMap.mulRight_zero_eq_zero\n\nend NonUnitalNonAssoc\n\nsection NonUnital\n\nvariable (R A : Type*) [CommSemiring R] [NonUnitalSemiring A] [Module R A] [SMulCommClass R A A]\n [IsScalarTower R A A]\n\n/-- The multiplication in a non-unital algebra is a bilinear map.\n\nA weaker version of this for non-unital non-associative algebras exists as `LinearMap.mul`. -/\ndef _root_.NonUnitalAlgHom.lmul : A →ₙₐ[R] End R A :=\n { mul R A with\n map_mul' := by\n intro a b\n ext c\n exact mul_assoc a b c\n map_zero' := by\n ext a\n exact zero_mul a }\n#align non_unital_alg_hom.lmul NonUnitalAlgHom.lmul\n\nvariable {R A}\n\n@[simp]\ntheorem _root_.NonUnitalAlgHom.coe_lmul_eq_mul : ⇑(NonUnitalAlgHom.lmul R A) = mul R A :=\n rfl\n#align non_unital_alg_hom.coe_lmul_eq_mul NonUnitalAlgHom.coe_lmul_eq_mul\n\ntheorem commute_mulLeft_right (a b : A) : Commute (mulLeft R a) (mulRight R b) := by\n ext c\n exact (mul_assoc a c b).symm\n#align linear_map.commute_mul_left_right LinearMap.commute_mulLeft_right\n\n@[simp]\ntheorem mulLeft_mul (a b : A) : mulLeft R (a * b) = (mulLeft R a).comp (mulLeft R b) := by\n ext\n simp only [mulLeft_apply, comp_apply, mul_assoc]\n#align linear_map.mul_left_mul LinearMap.mulLeft_mul\n\n@[simp]\ntheorem mulRight_mul (a b : A) : mulRight R (a * b) = (mulRight R b).comp (mulRight R a) := by\n ext\n simp only [mulRight_apply, comp_apply, mul_assoc]\n#align linear_map.mul_right_mul LinearMap.mulRight_mul\n\nend NonUnital\n\nsection Semiring\n\nvariable (R A B : Type*) [CommSemiring R] [Semiring A] [Semiring B] [Algebra R A] [Algebra R B]\n\nvariable {R A B} in\n/-- A `LinearMap` preserves multiplication if pre- and post- composition with `LinearMap.mul` are\nequivalent. By converting the statement into an equality of `LinearMap`s, this lemma allows various\nspecialized `ext` lemmas about `→ₗ[R]` to then be applied.\n\nThis is the `LinearMap` version of `AddMonoidHom.map_mul_iff`. -/\ntheorem map_mul_iff (f : A →ₗ[R] B) :\n (∀ x y, f (x * y) = f x * f y) ↔\n (LinearMap.mul R A).compr₂ f = (LinearMap.mul R B ∘ₗ f).compl₂ f :=\n Iff.symm LinearMap.ext_iff₂\n\n/-- The multiplication in an algebra is an algebra homomorphism into the endomorphisms on\nthe algebra.\n\nA weaker version of this for non-unital algebras exists as `NonUnitalAlgHom.mul`. -/\ndef _root_.Algebra.lmul : A →ₐ[R] End R A :=\n { LinearMap.mul R A with\n map_one' := by\n ext a\n exact one_mul a\n map_mul' := by\n intro a b\n ext c\n exact mul_assoc a b c\n map_zero' := by\n ext a\n exact zero_mul a\n commutes' := by\n intro r\n ext a\n exact (Algebra.smul_def r a).symm }\n#align algebra.lmul Algebra.lmul\n\nvariable {R A}\n\n@[simp]\ntheorem _root_.Algebra.coe_lmul_eq_mul : ⇑(Algebra.lmul R A) = mul R A :=\n rfl\n#align algebra.coe_lmul_eq_mul Algebra.coe_lmul_eq_mul\n\ntheorem _root_.Algebra.lmul_injective : Function.Injective (Algebra.lmul R A) :=\n fun a₁ a₂ h ↦ by simpa using FunLike.congr_fun h 1\n\n@[simp]\ntheorem mulLeft_eq_zero_iff (a : A) : mulLeft R a = 0 ↔ a = 0 := by\n constructor <;> intro h\n -- porting note: had to supply `R` explicitly in `@mulLeft_apply` below\n · rw [← mul_one a, ← @mulLeft_apply R _ _ _ _ _ _ a 1, h, LinearMap.zero_apply]\n · rw [h]\n exact mulLeft_zero_eq_zero\n#align linear_map.mul_left_eq_zero_iff LinearMap.mulLeft_eq_zero_iff\n\n@[simp]\ntheorem mulRight_eq_zero_iff (a : A) : mulRight R a = 0 ↔ a = 0 := by\n constructor <;> intro h\n -- porting note: had to supply `R` explicitly in `@mulRight_apply` below\n · ","nextTactic":"rw [← one_mul a, ← @mulRight_apply R _ _ _ _ _ _ a 1, h, LinearMap.zero_apply]","declUpToTactic":"@[simp]\ntheorem mulRight_eq_zero_iff (a : A) : mulRight R a = 0 ↔ a = 0 := by\n constructor <;> intro h\n -- porting note: had to supply `R` explicitly in `@mulRight_apply` below\n · ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Bilinear.210_0.cGBk1UxpwLhzgI8","decl":"@[simp]\ntheorem mulRight_eq_zero_iff (a : A) : mulRight R a = 0 ↔ a = 0 "} -{"state":"case mpr\nR : Type u_1\nA : Type u_2\nB : Type u_3\ninst✝⁴ : CommSemiring R\ninst✝³ : Semiring A\ninst✝² : Semiring B\ninst✝¹ : Algebra R A\ninst✝ : Algebra R B\na : A\nh : a = 0\n⊢ mulRight R a = 0","srcUpToTactic":"/-\nCopyright (c) 2018 Kenny Lau. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Kenny Lau, Yury Kudryashov\n-/\nimport Mathlib.Algebra.Algebra.Basic\nimport Mathlib.Algebra.Algebra.Equiv\nimport Mathlib.Algebra.Algebra.NonUnitalHom\nimport Mathlib.Algebra.GroupPower.IterateHom\nimport Mathlib.LinearAlgebra.TensorProduct\n\n#align_import algebra.algebra.bilinear from \"leanprover-community/mathlib\"@\"657df4339ae6ceada048c8a2980fb10e393143ec\"\n\n/-!\n# Facts about algebras involving bilinear maps and tensor products\n\nWe move a few basic statements about algebras out of `Algebra.Algebra.Basic`,\nin order to avoid importing `LinearAlgebra.BilinearMap` and\n`LinearAlgebra.TensorProduct` unnecessarily.\n-/\n\nopen TensorProduct Module\n\nnamespace LinearMap\n\nsection NonUnitalNonAssoc\n\nvariable (R A : Type*) [CommSemiring R] [NonUnitalNonAssocSemiring A] [Module R A]\n [SMulCommClass R A A] [IsScalarTower R A A]\n\n/-- The multiplication in a non-unital non-associative algebra is a bilinear map.\n\nA weaker version of this for semirings exists as `AddMonoidHom.mul`. -/\ndef mul : A →ₗ[R] A →ₗ[R] A :=\n LinearMap.mk₂ R (· * ·) add_mul smul_mul_assoc mul_add mul_smul_comm\n#align linear_map.mul LinearMap.mul\n\n/-- The multiplication map on a non-unital algebra, as an `R`-linear map from `A ⊗[R] A` to `A`. -/\nnoncomputable def mul' : A ⊗[R] A →ₗ[R] A :=\n TensorProduct.lift (mul R A)\n#align linear_map.mul' LinearMap.mul'\n\nvariable {A}\n\n/-- The multiplication on the left in a non-unital algebra is a linear map. -/\ndef mulLeft (a : A) : A →ₗ[R] A :=\n mul R A a\n#align linear_map.mul_left LinearMap.mulLeft\n\n/-- The multiplication on the right in an algebra is a linear map. -/\ndef mulRight (a : A) : A →ₗ[R] A :=\n (mul R A).flip a\n#align linear_map.mul_right LinearMap.mulRight\n\n/-- Simultaneous multiplication on the left and right is a linear map. -/\ndef mulLeftRight (ab : A × A) : A →ₗ[R] A :=\n (mulRight R ab.snd).comp (mulLeft R ab.fst)\n#align linear_map.mul_left_right LinearMap.mulLeftRight\n\n@[simp]\ntheorem mulLeft_toAddMonoidHom (a : A) : (mulLeft R a : A →+ A) = AddMonoidHom.mulLeft a :=\n rfl\n#align linear_map.mul_left_to_add_monoid_hom LinearMap.mulLeft_toAddMonoidHom\n\n@[simp]\ntheorem mulRight_toAddMonoidHom (a : A) : (mulRight R a : A →+ A) = AddMonoidHom.mulRight a :=\n rfl\n#align linear_map.mul_right_to_add_monoid_hom LinearMap.mulRight_toAddMonoidHom\n\nvariable {R}\n\n@[simp]\ntheorem mul_apply' (a b : A) : mul R A a b = a * b :=\n rfl\n#align linear_map.mul_apply' LinearMap.mul_apply'\n\n@[simp]\ntheorem mulLeft_apply (a b : A) : mulLeft R a b = a * b :=\n rfl\n#align linear_map.mul_left_apply LinearMap.mulLeft_apply\n\n@[simp]\ntheorem mulRight_apply (a b : A) : mulRight R a b = b * a :=\n rfl\n#align linear_map.mul_right_apply LinearMap.mulRight_apply\n\n@[simp]\ntheorem mulLeftRight_apply (a b x : A) : mulLeftRight R (a, b) x = a * x * b :=\n rfl\n#align linear_map.mul_left_right_apply LinearMap.mulLeftRight_apply\n\n@[simp]\ntheorem mul'_apply {a b : A} : mul' R A (a ⊗ₜ b) = a * b :=\n rfl\n#align linear_map.mul'_apply LinearMap.mul'_apply\n\n@[simp]\ntheorem mulLeft_zero_eq_zero : mulLeft R (0 : A) = 0 :=\n (mul R A).map_zero\n#align linear_map.mul_left_zero_eq_zero LinearMap.mulLeft_zero_eq_zero\n\n@[simp]\ntheorem mulRight_zero_eq_zero : mulRight R (0 : A) = 0 :=\n (mul R A).flip.map_zero\n#align linear_map.mul_right_zero_eq_zero LinearMap.mulRight_zero_eq_zero\n\nend NonUnitalNonAssoc\n\nsection NonUnital\n\nvariable (R A : Type*) [CommSemiring R] [NonUnitalSemiring A] [Module R A] [SMulCommClass R A A]\n [IsScalarTower R A A]\n\n/-- The multiplication in a non-unital algebra is a bilinear map.\n\nA weaker version of this for non-unital non-associative algebras exists as `LinearMap.mul`. -/\ndef _root_.NonUnitalAlgHom.lmul : A →ₙₐ[R] End R A :=\n { mul R A with\n map_mul' := by\n intro a b\n ext c\n exact mul_assoc a b c\n map_zero' := by\n ext a\n exact zero_mul a }\n#align non_unital_alg_hom.lmul NonUnitalAlgHom.lmul\n\nvariable {R A}\n\n@[simp]\ntheorem _root_.NonUnitalAlgHom.coe_lmul_eq_mul : ⇑(NonUnitalAlgHom.lmul R A) = mul R A :=\n rfl\n#align non_unital_alg_hom.coe_lmul_eq_mul NonUnitalAlgHom.coe_lmul_eq_mul\n\ntheorem commute_mulLeft_right (a b : A) : Commute (mulLeft R a) (mulRight R b) := by\n ext c\n exact (mul_assoc a c b).symm\n#align linear_map.commute_mul_left_right LinearMap.commute_mulLeft_right\n\n@[simp]\ntheorem mulLeft_mul (a b : A) : mulLeft R (a * b) = (mulLeft R a).comp (mulLeft R b) := by\n ext\n simp only [mulLeft_apply, comp_apply, mul_assoc]\n#align linear_map.mul_left_mul LinearMap.mulLeft_mul\n\n@[simp]\ntheorem mulRight_mul (a b : A) : mulRight R (a * b) = (mulRight R b).comp (mulRight R a) := by\n ext\n simp only [mulRight_apply, comp_apply, mul_assoc]\n#align linear_map.mul_right_mul LinearMap.mulRight_mul\n\nend NonUnital\n\nsection Semiring\n\nvariable (R A B : Type*) [CommSemiring R] [Semiring A] [Semiring B] [Algebra R A] [Algebra R B]\n\nvariable {R A B} in\n/-- A `LinearMap` preserves multiplication if pre- and post- composition with `LinearMap.mul` are\nequivalent. By converting the statement into an equality of `LinearMap`s, this lemma allows various\nspecialized `ext` lemmas about `→ₗ[R]` to then be applied.\n\nThis is the `LinearMap` version of `AddMonoidHom.map_mul_iff`. -/\ntheorem map_mul_iff (f : A →ₗ[R] B) :\n (∀ x y, f (x * y) = f x * f y) ↔\n (LinearMap.mul R A).compr₂ f = (LinearMap.mul R B ∘ₗ f).compl₂ f :=\n Iff.symm LinearMap.ext_iff₂\n\n/-- The multiplication in an algebra is an algebra homomorphism into the endomorphisms on\nthe algebra.\n\nA weaker version of this for non-unital algebras exists as `NonUnitalAlgHom.mul`. -/\ndef _root_.Algebra.lmul : A →ₐ[R] End R A :=\n { LinearMap.mul R A with\n map_one' := by\n ext a\n exact one_mul a\n map_mul' := by\n intro a b\n ext c\n exact mul_assoc a b c\n map_zero' := by\n ext a\n exact zero_mul a\n commutes' := by\n intro r\n ext a\n exact (Algebra.smul_def r a).symm }\n#align algebra.lmul Algebra.lmul\n\nvariable {R A}\n\n@[simp]\ntheorem _root_.Algebra.coe_lmul_eq_mul : ⇑(Algebra.lmul R A) = mul R A :=\n rfl\n#align algebra.coe_lmul_eq_mul Algebra.coe_lmul_eq_mul\n\ntheorem _root_.Algebra.lmul_injective : Function.Injective (Algebra.lmul R A) :=\n fun a₁ a₂ h ↦ by simpa using FunLike.congr_fun h 1\n\n@[simp]\ntheorem mulLeft_eq_zero_iff (a : A) : mulLeft R a = 0 ↔ a = 0 := by\n constructor <;> intro h\n -- porting note: had to supply `R` explicitly in `@mulLeft_apply` below\n · rw [← mul_one a, ← @mulLeft_apply R _ _ _ _ _ _ a 1, h, LinearMap.zero_apply]\n · rw [h]\n exact mulLeft_zero_eq_zero\n#align linear_map.mul_left_eq_zero_iff LinearMap.mulLeft_eq_zero_iff\n\n@[simp]\ntheorem mulRight_eq_zero_iff (a : A) : mulRight R a = 0 ↔ a = 0 := by\n constructor <;> intro h\n -- porting note: had to supply `R` explicitly in `@mulRight_apply` below\n · rw [← one_mul a, ← @mulRight_apply R _ _ _ _ _ _ a 1, h, LinearMap.zero_apply]\n · ","nextTactic":"rw [h]","declUpToTactic":"@[simp]\ntheorem mulRight_eq_zero_iff (a : A) : mulRight R a = 0 ↔ a = 0 := by\n constructor <;> intro h\n -- porting note: had to supply `R` explicitly in `@mulRight_apply` below\n · rw [← one_mul a, ← @mulRight_apply R _ _ _ _ _ _ a 1, h, LinearMap.zero_apply]\n · ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Bilinear.210_0.cGBk1UxpwLhzgI8","decl":"@[simp]\ntheorem mulRight_eq_zero_iff (a : A) : mulRight R a = 0 ↔ a = 0 "} -{"state":"case mpr\nR : Type u_1\nA : Type u_2\nB : Type u_3\ninst✝⁴ : CommSemiring R\ninst✝³ : Semiring A\ninst✝² : Semiring B\ninst✝¹ : Algebra R A\ninst✝ : Algebra R B\na : A\nh : a = 0\n⊢ mulRight R 0 = 0","srcUpToTactic":"/-\nCopyright (c) 2018 Kenny Lau. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Kenny Lau, Yury Kudryashov\n-/\nimport Mathlib.Algebra.Algebra.Basic\nimport Mathlib.Algebra.Algebra.Equiv\nimport Mathlib.Algebra.Algebra.NonUnitalHom\nimport Mathlib.Algebra.GroupPower.IterateHom\nimport Mathlib.LinearAlgebra.TensorProduct\n\n#align_import algebra.algebra.bilinear from \"leanprover-community/mathlib\"@\"657df4339ae6ceada048c8a2980fb10e393143ec\"\n\n/-!\n# Facts about algebras involving bilinear maps and tensor products\n\nWe move a few basic statements about algebras out of `Algebra.Algebra.Basic`,\nin order to avoid importing `LinearAlgebra.BilinearMap` and\n`LinearAlgebra.TensorProduct` unnecessarily.\n-/\n\nopen TensorProduct Module\n\nnamespace LinearMap\n\nsection NonUnitalNonAssoc\n\nvariable (R A : Type*) [CommSemiring R] [NonUnitalNonAssocSemiring A] [Module R A]\n [SMulCommClass R A A] [IsScalarTower R A A]\n\n/-- The multiplication in a non-unital non-associative algebra is a bilinear map.\n\nA weaker version of this for semirings exists as `AddMonoidHom.mul`. -/\ndef mul : A →ₗ[R] A →ₗ[R] A :=\n LinearMap.mk₂ R (· * ·) add_mul smul_mul_assoc mul_add mul_smul_comm\n#align linear_map.mul LinearMap.mul\n\n/-- The multiplication map on a non-unital algebra, as an `R`-linear map from `A ⊗[R] A` to `A`. -/\nnoncomputable def mul' : A ⊗[R] A →ₗ[R] A :=\n TensorProduct.lift (mul R A)\n#align linear_map.mul' LinearMap.mul'\n\nvariable {A}\n\n/-- The multiplication on the left in a non-unital algebra is a linear map. -/\ndef mulLeft (a : A) : A →ₗ[R] A :=\n mul R A a\n#align linear_map.mul_left LinearMap.mulLeft\n\n/-- The multiplication on the right in an algebra is a linear map. -/\ndef mulRight (a : A) : A →ₗ[R] A :=\n (mul R A).flip a\n#align linear_map.mul_right LinearMap.mulRight\n\n/-- Simultaneous multiplication on the left and right is a linear map. -/\ndef mulLeftRight (ab : A × A) : A →ₗ[R] A :=\n (mulRight R ab.snd).comp (mulLeft R ab.fst)\n#align linear_map.mul_left_right LinearMap.mulLeftRight\n\n@[simp]\ntheorem mulLeft_toAddMonoidHom (a : A) : (mulLeft R a : A →+ A) = AddMonoidHom.mulLeft a :=\n rfl\n#align linear_map.mul_left_to_add_monoid_hom LinearMap.mulLeft_toAddMonoidHom\n\n@[simp]\ntheorem mulRight_toAddMonoidHom (a : A) : (mulRight R a : A →+ A) = AddMonoidHom.mulRight a :=\n rfl\n#align linear_map.mul_right_to_add_monoid_hom LinearMap.mulRight_toAddMonoidHom\n\nvariable {R}\n\n@[simp]\ntheorem mul_apply' (a b : A) : mul R A a b = a * b :=\n rfl\n#align linear_map.mul_apply' LinearMap.mul_apply'\n\n@[simp]\ntheorem mulLeft_apply (a b : A) : mulLeft R a b = a * b :=\n rfl\n#align linear_map.mul_left_apply LinearMap.mulLeft_apply\n\n@[simp]\ntheorem mulRight_apply (a b : A) : mulRight R a b = b * a :=\n rfl\n#align linear_map.mul_right_apply LinearMap.mulRight_apply\n\n@[simp]\ntheorem mulLeftRight_apply (a b x : A) : mulLeftRight R (a, b) x = a * x * b :=\n rfl\n#align linear_map.mul_left_right_apply LinearMap.mulLeftRight_apply\n\n@[simp]\ntheorem mul'_apply {a b : A} : mul' R A (a ⊗ₜ b) = a * b :=\n rfl\n#align linear_map.mul'_apply LinearMap.mul'_apply\n\n@[simp]\ntheorem mulLeft_zero_eq_zero : mulLeft R (0 : A) = 0 :=\n (mul R A).map_zero\n#align linear_map.mul_left_zero_eq_zero LinearMap.mulLeft_zero_eq_zero\n\n@[simp]\ntheorem mulRight_zero_eq_zero : mulRight R (0 : A) = 0 :=\n (mul R A).flip.map_zero\n#align linear_map.mul_right_zero_eq_zero LinearMap.mulRight_zero_eq_zero\n\nend NonUnitalNonAssoc\n\nsection NonUnital\n\nvariable (R A : Type*) [CommSemiring R] [NonUnitalSemiring A] [Module R A] [SMulCommClass R A A]\n [IsScalarTower R A A]\n\n/-- The multiplication in a non-unital algebra is a bilinear map.\n\nA weaker version of this for non-unital non-associative algebras exists as `LinearMap.mul`. -/\ndef _root_.NonUnitalAlgHom.lmul : A →ₙₐ[R] End R A :=\n { mul R A with\n map_mul' := by\n intro a b\n ext c\n exact mul_assoc a b c\n map_zero' := by\n ext a\n exact zero_mul a }\n#align non_unital_alg_hom.lmul NonUnitalAlgHom.lmul\n\nvariable {R A}\n\n@[simp]\ntheorem _root_.NonUnitalAlgHom.coe_lmul_eq_mul : ⇑(NonUnitalAlgHom.lmul R A) = mul R A :=\n rfl\n#align non_unital_alg_hom.coe_lmul_eq_mul NonUnitalAlgHom.coe_lmul_eq_mul\n\ntheorem commute_mulLeft_right (a b : A) : Commute (mulLeft R a) (mulRight R b) := by\n ext c\n exact (mul_assoc a c b).symm\n#align linear_map.commute_mul_left_right LinearMap.commute_mulLeft_right\n\n@[simp]\ntheorem mulLeft_mul (a b : A) : mulLeft R (a * b) = (mulLeft R a).comp (mulLeft R b) := by\n ext\n simp only [mulLeft_apply, comp_apply, mul_assoc]\n#align linear_map.mul_left_mul LinearMap.mulLeft_mul\n\n@[simp]\ntheorem mulRight_mul (a b : A) : mulRight R (a * b) = (mulRight R b).comp (mulRight R a) := by\n ext\n simp only [mulRight_apply, comp_apply, mul_assoc]\n#align linear_map.mul_right_mul LinearMap.mulRight_mul\n\nend NonUnital\n\nsection Semiring\n\nvariable (R A B : Type*) [CommSemiring R] [Semiring A] [Semiring B] [Algebra R A] [Algebra R B]\n\nvariable {R A B} in\n/-- A `LinearMap` preserves multiplication if pre- and post- composition with `LinearMap.mul` are\nequivalent. By converting the statement into an equality of `LinearMap`s, this lemma allows various\nspecialized `ext` lemmas about `→ₗ[R]` to then be applied.\n\nThis is the `LinearMap` version of `AddMonoidHom.map_mul_iff`. -/\ntheorem map_mul_iff (f : A →ₗ[R] B) :\n (∀ x y, f (x * y) = f x * f y) ↔\n (LinearMap.mul R A).compr₂ f = (LinearMap.mul R B ∘ₗ f).compl₂ f :=\n Iff.symm LinearMap.ext_iff₂\n\n/-- The multiplication in an algebra is an algebra homomorphism into the endomorphisms on\nthe algebra.\n\nA weaker version of this for non-unital algebras exists as `NonUnitalAlgHom.mul`. -/\ndef _root_.Algebra.lmul : A →ₐ[R] End R A :=\n { LinearMap.mul R A with\n map_one' := by\n ext a\n exact one_mul a\n map_mul' := by\n intro a b\n ext c\n exact mul_assoc a b c\n map_zero' := by\n ext a\n exact zero_mul a\n commutes' := by\n intro r\n ext a\n exact (Algebra.smul_def r a).symm }\n#align algebra.lmul Algebra.lmul\n\nvariable {R A}\n\n@[simp]\ntheorem _root_.Algebra.coe_lmul_eq_mul : ⇑(Algebra.lmul R A) = mul R A :=\n rfl\n#align algebra.coe_lmul_eq_mul Algebra.coe_lmul_eq_mul\n\ntheorem _root_.Algebra.lmul_injective : Function.Injective (Algebra.lmul R A) :=\n fun a₁ a₂ h ↦ by simpa using FunLike.congr_fun h 1\n\n@[simp]\ntheorem mulLeft_eq_zero_iff (a : A) : mulLeft R a = 0 ↔ a = 0 := by\n constructor <;> intro h\n -- porting note: had to supply `R` explicitly in `@mulLeft_apply` below\n · rw [← mul_one a, ← @mulLeft_apply R _ _ _ _ _ _ a 1, h, LinearMap.zero_apply]\n · rw [h]\n exact mulLeft_zero_eq_zero\n#align linear_map.mul_left_eq_zero_iff LinearMap.mulLeft_eq_zero_iff\n\n@[simp]\ntheorem mulRight_eq_zero_iff (a : A) : mulRight R a = 0 ↔ a = 0 := by\n constructor <;> intro h\n -- porting note: had to supply `R` explicitly in `@mulRight_apply` below\n · rw [← one_mul a, ← @mulRight_apply R _ _ _ _ _ _ a 1, h, LinearMap.zero_apply]\n · rw [h]\n ","nextTactic":"exact mulRight_zero_eq_zero","declUpToTactic":"@[simp]\ntheorem mulRight_eq_zero_iff (a : A) : mulRight R a = 0 ↔ a = 0 := by\n constructor <;> intro h\n -- porting note: had to supply `R` explicitly in `@mulRight_apply` below\n · rw [← one_mul a, ← @mulRight_apply R _ _ _ _ _ _ a 1, h, LinearMap.zero_apply]\n · rw [h]\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Bilinear.210_0.cGBk1UxpwLhzgI8","decl":"@[simp]\ntheorem mulRight_eq_zero_iff (a : A) : mulRight R a = 0 ↔ a = 0 "} -{"state":"R : Type u_1\nA : Type u_2\nB : Type u_3\ninst✝⁴ : CommSemiring R\ninst✝³ : Semiring A\ninst✝² : Semiring B\ninst✝¹ : Algebra R A\ninst✝ : Algebra R B\n⊢ mulLeft R 1 = id","srcUpToTactic":"/-\nCopyright (c) 2018 Kenny Lau. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Kenny Lau, Yury Kudryashov\n-/\nimport Mathlib.Algebra.Algebra.Basic\nimport Mathlib.Algebra.Algebra.Equiv\nimport Mathlib.Algebra.Algebra.NonUnitalHom\nimport Mathlib.Algebra.GroupPower.IterateHom\nimport Mathlib.LinearAlgebra.TensorProduct\n\n#align_import algebra.algebra.bilinear from \"leanprover-community/mathlib\"@\"657df4339ae6ceada048c8a2980fb10e393143ec\"\n\n/-!\n# Facts about algebras involving bilinear maps and tensor products\n\nWe move a few basic statements about algebras out of `Algebra.Algebra.Basic`,\nin order to avoid importing `LinearAlgebra.BilinearMap` and\n`LinearAlgebra.TensorProduct` unnecessarily.\n-/\n\nopen TensorProduct Module\n\nnamespace LinearMap\n\nsection NonUnitalNonAssoc\n\nvariable (R A : Type*) [CommSemiring R] [NonUnitalNonAssocSemiring A] [Module R A]\n [SMulCommClass R A A] [IsScalarTower R A A]\n\n/-- The multiplication in a non-unital non-associative algebra is a bilinear map.\n\nA weaker version of this for semirings exists as `AddMonoidHom.mul`. -/\ndef mul : A →ₗ[R] A →ₗ[R] A :=\n LinearMap.mk₂ R (· * ·) add_mul smul_mul_assoc mul_add mul_smul_comm\n#align linear_map.mul LinearMap.mul\n\n/-- The multiplication map on a non-unital algebra, as an `R`-linear map from `A ⊗[R] A` to `A`. -/\nnoncomputable def mul' : A ⊗[R] A →ₗ[R] A :=\n TensorProduct.lift (mul R A)\n#align linear_map.mul' LinearMap.mul'\n\nvariable {A}\n\n/-- The multiplication on the left in a non-unital algebra is a linear map. -/\ndef mulLeft (a : A) : A →ₗ[R] A :=\n mul R A a\n#align linear_map.mul_left LinearMap.mulLeft\n\n/-- The multiplication on the right in an algebra is a linear map. -/\ndef mulRight (a : A) : A →ₗ[R] A :=\n (mul R A).flip a\n#align linear_map.mul_right LinearMap.mulRight\n\n/-- Simultaneous multiplication on the left and right is a linear map. -/\ndef mulLeftRight (ab : A × A) : A →ₗ[R] A :=\n (mulRight R ab.snd).comp (mulLeft R ab.fst)\n#align linear_map.mul_left_right LinearMap.mulLeftRight\n\n@[simp]\ntheorem mulLeft_toAddMonoidHom (a : A) : (mulLeft R a : A →+ A) = AddMonoidHom.mulLeft a :=\n rfl\n#align linear_map.mul_left_to_add_monoid_hom LinearMap.mulLeft_toAddMonoidHom\n\n@[simp]\ntheorem mulRight_toAddMonoidHom (a : A) : (mulRight R a : A →+ A) = AddMonoidHom.mulRight a :=\n rfl\n#align linear_map.mul_right_to_add_monoid_hom LinearMap.mulRight_toAddMonoidHom\n\nvariable {R}\n\n@[simp]\ntheorem mul_apply' (a b : A) : mul R A a b = a * b :=\n rfl\n#align linear_map.mul_apply' LinearMap.mul_apply'\n\n@[simp]\ntheorem mulLeft_apply (a b : A) : mulLeft R a b = a * b :=\n rfl\n#align linear_map.mul_left_apply LinearMap.mulLeft_apply\n\n@[simp]\ntheorem mulRight_apply (a b : A) : mulRight R a b = b * a :=\n rfl\n#align linear_map.mul_right_apply LinearMap.mulRight_apply\n\n@[simp]\ntheorem mulLeftRight_apply (a b x : A) : mulLeftRight R (a, b) x = a * x * b :=\n rfl\n#align linear_map.mul_left_right_apply LinearMap.mulLeftRight_apply\n\n@[simp]\ntheorem mul'_apply {a b : A} : mul' R A (a ⊗ₜ b) = a * b :=\n rfl\n#align linear_map.mul'_apply LinearMap.mul'_apply\n\n@[simp]\ntheorem mulLeft_zero_eq_zero : mulLeft R (0 : A) = 0 :=\n (mul R A).map_zero\n#align linear_map.mul_left_zero_eq_zero LinearMap.mulLeft_zero_eq_zero\n\n@[simp]\ntheorem mulRight_zero_eq_zero : mulRight R (0 : A) = 0 :=\n (mul R A).flip.map_zero\n#align linear_map.mul_right_zero_eq_zero LinearMap.mulRight_zero_eq_zero\n\nend NonUnitalNonAssoc\n\nsection NonUnital\n\nvariable (R A : Type*) [CommSemiring R] [NonUnitalSemiring A] [Module R A] [SMulCommClass R A A]\n [IsScalarTower R A A]\n\n/-- The multiplication in a non-unital algebra is a bilinear map.\n\nA weaker version of this for non-unital non-associative algebras exists as `LinearMap.mul`. -/\ndef _root_.NonUnitalAlgHom.lmul : A →ₙₐ[R] End R A :=\n { mul R A with\n map_mul' := by\n intro a b\n ext c\n exact mul_assoc a b c\n map_zero' := by\n ext a\n exact zero_mul a }\n#align non_unital_alg_hom.lmul NonUnitalAlgHom.lmul\n\nvariable {R A}\n\n@[simp]\ntheorem _root_.NonUnitalAlgHom.coe_lmul_eq_mul : ⇑(NonUnitalAlgHom.lmul R A) = mul R A :=\n rfl\n#align non_unital_alg_hom.coe_lmul_eq_mul NonUnitalAlgHom.coe_lmul_eq_mul\n\ntheorem commute_mulLeft_right (a b : A) : Commute (mulLeft R a) (mulRight R b) := by\n ext c\n exact (mul_assoc a c b).symm\n#align linear_map.commute_mul_left_right LinearMap.commute_mulLeft_right\n\n@[simp]\ntheorem mulLeft_mul (a b : A) : mulLeft R (a * b) = (mulLeft R a).comp (mulLeft R b) := by\n ext\n simp only [mulLeft_apply, comp_apply, mul_assoc]\n#align linear_map.mul_left_mul LinearMap.mulLeft_mul\n\n@[simp]\ntheorem mulRight_mul (a b : A) : mulRight R (a * b) = (mulRight R b).comp (mulRight R a) := by\n ext\n simp only [mulRight_apply, comp_apply, mul_assoc]\n#align linear_map.mul_right_mul LinearMap.mulRight_mul\n\nend NonUnital\n\nsection Semiring\n\nvariable (R A B : Type*) [CommSemiring R] [Semiring A] [Semiring B] [Algebra R A] [Algebra R B]\n\nvariable {R A B} in\n/-- A `LinearMap` preserves multiplication if pre- and post- composition with `LinearMap.mul` are\nequivalent. By converting the statement into an equality of `LinearMap`s, this lemma allows various\nspecialized `ext` lemmas about `→ₗ[R]` to then be applied.\n\nThis is the `LinearMap` version of `AddMonoidHom.map_mul_iff`. -/\ntheorem map_mul_iff (f : A →ₗ[R] B) :\n (∀ x y, f (x * y) = f x * f y) ↔\n (LinearMap.mul R A).compr₂ f = (LinearMap.mul R B ∘ₗ f).compl₂ f :=\n Iff.symm LinearMap.ext_iff₂\n\n/-- The multiplication in an algebra is an algebra homomorphism into the endomorphisms on\nthe algebra.\n\nA weaker version of this for non-unital algebras exists as `NonUnitalAlgHom.mul`. -/\ndef _root_.Algebra.lmul : A →ₐ[R] End R A :=\n { LinearMap.mul R A with\n map_one' := by\n ext a\n exact one_mul a\n map_mul' := by\n intro a b\n ext c\n exact mul_assoc a b c\n map_zero' := by\n ext a\n exact zero_mul a\n commutes' := by\n intro r\n ext a\n exact (Algebra.smul_def r a).symm }\n#align algebra.lmul Algebra.lmul\n\nvariable {R A}\n\n@[simp]\ntheorem _root_.Algebra.coe_lmul_eq_mul : ⇑(Algebra.lmul R A) = mul R A :=\n rfl\n#align algebra.coe_lmul_eq_mul Algebra.coe_lmul_eq_mul\n\ntheorem _root_.Algebra.lmul_injective : Function.Injective (Algebra.lmul R A) :=\n fun a₁ a₂ h ↦ by simpa using FunLike.congr_fun h 1\n\n@[simp]\ntheorem mulLeft_eq_zero_iff (a : A) : mulLeft R a = 0 ↔ a = 0 := by\n constructor <;> intro h\n -- porting note: had to supply `R` explicitly in `@mulLeft_apply` below\n · rw [← mul_one a, ← @mulLeft_apply R _ _ _ _ _ _ a 1, h, LinearMap.zero_apply]\n · rw [h]\n exact mulLeft_zero_eq_zero\n#align linear_map.mul_left_eq_zero_iff LinearMap.mulLeft_eq_zero_iff\n\n@[simp]\ntheorem mulRight_eq_zero_iff (a : A) : mulRight R a = 0 ↔ a = 0 := by\n constructor <;> intro h\n -- porting note: had to supply `R` explicitly in `@mulRight_apply` below\n · rw [← one_mul a, ← @mulRight_apply R _ _ _ _ _ _ a 1, h, LinearMap.zero_apply]\n · rw [h]\n exact mulRight_zero_eq_zero\n#align linear_map.mul_right_eq_zero_iff LinearMap.mulRight_eq_zero_iff\n\n@[simp]\ntheorem mulLeft_one : mulLeft R (1 : A) = LinearMap.id := by\n ","nextTactic":"ext","declUpToTactic":"@[simp]\ntheorem mulLeft_one : mulLeft R (1 : A) = LinearMap.id := by\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Bilinear.219_0.cGBk1UxpwLhzgI8","decl":"@[simp]\ntheorem mulLeft_one : mulLeft R (1 : A) = LinearMap.id "} -{"state":"case h\nR : Type u_1\nA : Type u_2\nB : Type u_3\ninst✝⁴ : CommSemiring R\ninst✝³ : Semiring A\ninst✝² : Semiring B\ninst✝¹ : Algebra R A\ninst✝ : Algebra R B\nx✝ : A\n⊢ (mulLeft R 1) x✝ = id x✝","srcUpToTactic":"/-\nCopyright (c) 2018 Kenny Lau. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Kenny Lau, Yury Kudryashov\n-/\nimport Mathlib.Algebra.Algebra.Basic\nimport Mathlib.Algebra.Algebra.Equiv\nimport Mathlib.Algebra.Algebra.NonUnitalHom\nimport Mathlib.Algebra.GroupPower.IterateHom\nimport Mathlib.LinearAlgebra.TensorProduct\n\n#align_import algebra.algebra.bilinear from \"leanprover-community/mathlib\"@\"657df4339ae6ceada048c8a2980fb10e393143ec\"\n\n/-!\n# Facts about algebras involving bilinear maps and tensor products\n\nWe move a few basic statements about algebras out of `Algebra.Algebra.Basic`,\nin order to avoid importing `LinearAlgebra.BilinearMap` and\n`LinearAlgebra.TensorProduct` unnecessarily.\n-/\n\nopen TensorProduct Module\n\nnamespace LinearMap\n\nsection NonUnitalNonAssoc\n\nvariable (R A : Type*) [CommSemiring R] [NonUnitalNonAssocSemiring A] [Module R A]\n [SMulCommClass R A A] [IsScalarTower R A A]\n\n/-- The multiplication in a non-unital non-associative algebra is a bilinear map.\n\nA weaker version of this for semirings exists as `AddMonoidHom.mul`. -/\ndef mul : A →ₗ[R] A →ₗ[R] A :=\n LinearMap.mk₂ R (· * ·) add_mul smul_mul_assoc mul_add mul_smul_comm\n#align linear_map.mul LinearMap.mul\n\n/-- The multiplication map on a non-unital algebra, as an `R`-linear map from `A ⊗[R] A` to `A`. -/\nnoncomputable def mul' : A ⊗[R] A →ₗ[R] A :=\n TensorProduct.lift (mul R A)\n#align linear_map.mul' LinearMap.mul'\n\nvariable {A}\n\n/-- The multiplication on the left in a non-unital algebra is a linear map. -/\ndef mulLeft (a : A) : A →ₗ[R] A :=\n mul R A a\n#align linear_map.mul_left LinearMap.mulLeft\n\n/-- The multiplication on the right in an algebra is a linear map. -/\ndef mulRight (a : A) : A →ₗ[R] A :=\n (mul R A).flip a\n#align linear_map.mul_right LinearMap.mulRight\n\n/-- Simultaneous multiplication on the left and right is a linear map. -/\ndef mulLeftRight (ab : A × A) : A →ₗ[R] A :=\n (mulRight R ab.snd).comp (mulLeft R ab.fst)\n#align linear_map.mul_left_right LinearMap.mulLeftRight\n\n@[simp]\ntheorem mulLeft_toAddMonoidHom (a : A) : (mulLeft R a : A →+ A) = AddMonoidHom.mulLeft a :=\n rfl\n#align linear_map.mul_left_to_add_monoid_hom LinearMap.mulLeft_toAddMonoidHom\n\n@[simp]\ntheorem mulRight_toAddMonoidHom (a : A) : (mulRight R a : A →+ A) = AddMonoidHom.mulRight a :=\n rfl\n#align linear_map.mul_right_to_add_monoid_hom LinearMap.mulRight_toAddMonoidHom\n\nvariable {R}\n\n@[simp]\ntheorem mul_apply' (a b : A) : mul R A a b = a * b :=\n rfl\n#align linear_map.mul_apply' LinearMap.mul_apply'\n\n@[simp]\ntheorem mulLeft_apply (a b : A) : mulLeft R a b = a * b :=\n rfl\n#align linear_map.mul_left_apply LinearMap.mulLeft_apply\n\n@[simp]\ntheorem mulRight_apply (a b : A) : mulRight R a b = b * a :=\n rfl\n#align linear_map.mul_right_apply LinearMap.mulRight_apply\n\n@[simp]\ntheorem mulLeftRight_apply (a b x : A) : mulLeftRight R (a, b) x = a * x * b :=\n rfl\n#align linear_map.mul_left_right_apply LinearMap.mulLeftRight_apply\n\n@[simp]\ntheorem mul'_apply {a b : A} : mul' R A (a ⊗ₜ b) = a * b :=\n rfl\n#align linear_map.mul'_apply LinearMap.mul'_apply\n\n@[simp]\ntheorem mulLeft_zero_eq_zero : mulLeft R (0 : A) = 0 :=\n (mul R A).map_zero\n#align linear_map.mul_left_zero_eq_zero LinearMap.mulLeft_zero_eq_zero\n\n@[simp]\ntheorem mulRight_zero_eq_zero : mulRight R (0 : A) = 0 :=\n (mul R A).flip.map_zero\n#align linear_map.mul_right_zero_eq_zero LinearMap.mulRight_zero_eq_zero\n\nend NonUnitalNonAssoc\n\nsection NonUnital\n\nvariable (R A : Type*) [CommSemiring R] [NonUnitalSemiring A] [Module R A] [SMulCommClass R A A]\n [IsScalarTower R A A]\n\n/-- The multiplication in a non-unital algebra is a bilinear map.\n\nA weaker version of this for non-unital non-associative algebras exists as `LinearMap.mul`. -/\ndef _root_.NonUnitalAlgHom.lmul : A →ₙₐ[R] End R A :=\n { mul R A with\n map_mul' := by\n intro a b\n ext c\n exact mul_assoc a b c\n map_zero' := by\n ext a\n exact zero_mul a }\n#align non_unital_alg_hom.lmul NonUnitalAlgHom.lmul\n\nvariable {R A}\n\n@[simp]\ntheorem _root_.NonUnitalAlgHom.coe_lmul_eq_mul : ⇑(NonUnitalAlgHom.lmul R A) = mul R A :=\n rfl\n#align non_unital_alg_hom.coe_lmul_eq_mul NonUnitalAlgHom.coe_lmul_eq_mul\n\ntheorem commute_mulLeft_right (a b : A) : Commute (mulLeft R a) (mulRight R b) := by\n ext c\n exact (mul_assoc a c b).symm\n#align linear_map.commute_mul_left_right LinearMap.commute_mulLeft_right\n\n@[simp]\ntheorem mulLeft_mul (a b : A) : mulLeft R (a * b) = (mulLeft R a).comp (mulLeft R b) := by\n ext\n simp only [mulLeft_apply, comp_apply, mul_assoc]\n#align linear_map.mul_left_mul LinearMap.mulLeft_mul\n\n@[simp]\ntheorem mulRight_mul (a b : A) : mulRight R (a * b) = (mulRight R b).comp (mulRight R a) := by\n ext\n simp only [mulRight_apply, comp_apply, mul_assoc]\n#align linear_map.mul_right_mul LinearMap.mulRight_mul\n\nend NonUnital\n\nsection Semiring\n\nvariable (R A B : Type*) [CommSemiring R] [Semiring A] [Semiring B] [Algebra R A] [Algebra R B]\n\nvariable {R A B} in\n/-- A `LinearMap` preserves multiplication if pre- and post- composition with `LinearMap.mul` are\nequivalent. By converting the statement into an equality of `LinearMap`s, this lemma allows various\nspecialized `ext` lemmas about `→ₗ[R]` to then be applied.\n\nThis is the `LinearMap` version of `AddMonoidHom.map_mul_iff`. -/\ntheorem map_mul_iff (f : A →ₗ[R] B) :\n (∀ x y, f (x * y) = f x * f y) ↔\n (LinearMap.mul R A).compr₂ f = (LinearMap.mul R B ∘ₗ f).compl₂ f :=\n Iff.symm LinearMap.ext_iff₂\n\n/-- The multiplication in an algebra is an algebra homomorphism into the endomorphisms on\nthe algebra.\n\nA weaker version of this for non-unital algebras exists as `NonUnitalAlgHom.mul`. -/\ndef _root_.Algebra.lmul : A →ₐ[R] End R A :=\n { LinearMap.mul R A with\n map_one' := by\n ext a\n exact one_mul a\n map_mul' := by\n intro a b\n ext c\n exact mul_assoc a b c\n map_zero' := by\n ext a\n exact zero_mul a\n commutes' := by\n intro r\n ext a\n exact (Algebra.smul_def r a).symm }\n#align algebra.lmul Algebra.lmul\n\nvariable {R A}\n\n@[simp]\ntheorem _root_.Algebra.coe_lmul_eq_mul : ⇑(Algebra.lmul R A) = mul R A :=\n rfl\n#align algebra.coe_lmul_eq_mul Algebra.coe_lmul_eq_mul\n\ntheorem _root_.Algebra.lmul_injective : Function.Injective (Algebra.lmul R A) :=\n fun a₁ a₂ h ↦ by simpa using FunLike.congr_fun h 1\n\n@[simp]\ntheorem mulLeft_eq_zero_iff (a : A) : mulLeft R a = 0 ↔ a = 0 := by\n constructor <;> intro h\n -- porting note: had to supply `R` explicitly in `@mulLeft_apply` below\n · rw [← mul_one a, ← @mulLeft_apply R _ _ _ _ _ _ a 1, h, LinearMap.zero_apply]\n · rw [h]\n exact mulLeft_zero_eq_zero\n#align linear_map.mul_left_eq_zero_iff LinearMap.mulLeft_eq_zero_iff\n\n@[simp]\ntheorem mulRight_eq_zero_iff (a : A) : mulRight R a = 0 ↔ a = 0 := by\n constructor <;> intro h\n -- porting note: had to supply `R` explicitly in `@mulRight_apply` below\n · rw [← one_mul a, ← @mulRight_apply R _ _ _ _ _ _ a 1, h, LinearMap.zero_apply]\n · rw [h]\n exact mulRight_zero_eq_zero\n#align linear_map.mul_right_eq_zero_iff LinearMap.mulRight_eq_zero_iff\n\n@[simp]\ntheorem mulLeft_one : mulLeft R (1 : A) = LinearMap.id := by\n ext\n ","nextTactic":"simp only [LinearMap.id_coe, one_mul, id.def, mulLeft_apply]","declUpToTactic":"@[simp]\ntheorem mulLeft_one : mulLeft R (1 : A) = LinearMap.id := by\n ext\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Bilinear.219_0.cGBk1UxpwLhzgI8","decl":"@[simp]\ntheorem mulLeft_one : mulLeft R (1 : A) = LinearMap.id "} -{"state":"R : Type u_1\nA : Type u_2\nB : Type u_3\ninst✝⁴ : CommSemiring R\ninst✝³ : Semiring A\ninst✝² : Semiring B\ninst✝¹ : Algebra R A\ninst✝ : Algebra R B\n⊢ mulRight R 1 = id","srcUpToTactic":"/-\nCopyright (c) 2018 Kenny Lau. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Kenny Lau, Yury Kudryashov\n-/\nimport Mathlib.Algebra.Algebra.Basic\nimport Mathlib.Algebra.Algebra.Equiv\nimport Mathlib.Algebra.Algebra.NonUnitalHom\nimport Mathlib.Algebra.GroupPower.IterateHom\nimport Mathlib.LinearAlgebra.TensorProduct\n\n#align_import algebra.algebra.bilinear from \"leanprover-community/mathlib\"@\"657df4339ae6ceada048c8a2980fb10e393143ec\"\n\n/-!\n# Facts about algebras involving bilinear maps and tensor products\n\nWe move a few basic statements about algebras out of `Algebra.Algebra.Basic`,\nin order to avoid importing `LinearAlgebra.BilinearMap` and\n`LinearAlgebra.TensorProduct` unnecessarily.\n-/\n\nopen TensorProduct Module\n\nnamespace LinearMap\n\nsection NonUnitalNonAssoc\n\nvariable (R A : Type*) [CommSemiring R] [NonUnitalNonAssocSemiring A] [Module R A]\n [SMulCommClass R A A] [IsScalarTower R A A]\n\n/-- The multiplication in a non-unital non-associative algebra is a bilinear map.\n\nA weaker version of this for semirings exists as `AddMonoidHom.mul`. -/\ndef mul : A →ₗ[R] A →ₗ[R] A :=\n LinearMap.mk₂ R (· * ·) add_mul smul_mul_assoc mul_add mul_smul_comm\n#align linear_map.mul LinearMap.mul\n\n/-- The multiplication map on a non-unital algebra, as an `R`-linear map from `A ⊗[R] A` to `A`. -/\nnoncomputable def mul' : A ⊗[R] A →ₗ[R] A :=\n TensorProduct.lift (mul R A)\n#align linear_map.mul' LinearMap.mul'\n\nvariable {A}\n\n/-- The multiplication on the left in a non-unital algebra is a linear map. -/\ndef mulLeft (a : A) : A →ₗ[R] A :=\n mul R A a\n#align linear_map.mul_left LinearMap.mulLeft\n\n/-- The multiplication on the right in an algebra is a linear map. -/\ndef mulRight (a : A) : A →ₗ[R] A :=\n (mul R A).flip a\n#align linear_map.mul_right LinearMap.mulRight\n\n/-- Simultaneous multiplication on the left and right is a linear map. -/\ndef mulLeftRight (ab : A × A) : A →ₗ[R] A :=\n (mulRight R ab.snd).comp (mulLeft R ab.fst)\n#align linear_map.mul_left_right LinearMap.mulLeftRight\n\n@[simp]\ntheorem mulLeft_toAddMonoidHom (a : A) : (mulLeft R a : A →+ A) = AddMonoidHom.mulLeft a :=\n rfl\n#align linear_map.mul_left_to_add_monoid_hom LinearMap.mulLeft_toAddMonoidHom\n\n@[simp]\ntheorem mulRight_toAddMonoidHom (a : A) : (mulRight R a : A →+ A) = AddMonoidHom.mulRight a :=\n rfl\n#align linear_map.mul_right_to_add_monoid_hom LinearMap.mulRight_toAddMonoidHom\n\nvariable {R}\n\n@[simp]\ntheorem mul_apply' (a b : A) : mul R A a b = a * b :=\n rfl\n#align linear_map.mul_apply' LinearMap.mul_apply'\n\n@[simp]\ntheorem mulLeft_apply (a b : A) : mulLeft R a b = a * b :=\n rfl\n#align linear_map.mul_left_apply LinearMap.mulLeft_apply\n\n@[simp]\ntheorem mulRight_apply (a b : A) : mulRight R a b = b * a :=\n rfl\n#align linear_map.mul_right_apply LinearMap.mulRight_apply\n\n@[simp]\ntheorem mulLeftRight_apply (a b x : A) : mulLeftRight R (a, b) x = a * x * b :=\n rfl\n#align linear_map.mul_left_right_apply LinearMap.mulLeftRight_apply\n\n@[simp]\ntheorem mul'_apply {a b : A} : mul' R A (a ⊗ₜ b) = a * b :=\n rfl\n#align linear_map.mul'_apply LinearMap.mul'_apply\n\n@[simp]\ntheorem mulLeft_zero_eq_zero : mulLeft R (0 : A) = 0 :=\n (mul R A).map_zero\n#align linear_map.mul_left_zero_eq_zero LinearMap.mulLeft_zero_eq_zero\n\n@[simp]\ntheorem mulRight_zero_eq_zero : mulRight R (0 : A) = 0 :=\n (mul R A).flip.map_zero\n#align linear_map.mul_right_zero_eq_zero LinearMap.mulRight_zero_eq_zero\n\nend NonUnitalNonAssoc\n\nsection NonUnital\n\nvariable (R A : Type*) [CommSemiring R] [NonUnitalSemiring A] [Module R A] [SMulCommClass R A A]\n [IsScalarTower R A A]\n\n/-- The multiplication in a non-unital algebra is a bilinear map.\n\nA weaker version of this for non-unital non-associative algebras exists as `LinearMap.mul`. -/\ndef _root_.NonUnitalAlgHom.lmul : A →ₙₐ[R] End R A :=\n { mul R A with\n map_mul' := by\n intro a b\n ext c\n exact mul_assoc a b c\n map_zero' := by\n ext a\n exact zero_mul a }\n#align non_unital_alg_hom.lmul NonUnitalAlgHom.lmul\n\nvariable {R A}\n\n@[simp]\ntheorem _root_.NonUnitalAlgHom.coe_lmul_eq_mul : ⇑(NonUnitalAlgHom.lmul R A) = mul R A :=\n rfl\n#align non_unital_alg_hom.coe_lmul_eq_mul NonUnitalAlgHom.coe_lmul_eq_mul\n\ntheorem commute_mulLeft_right (a b : A) : Commute (mulLeft R a) (mulRight R b) := by\n ext c\n exact (mul_assoc a c b).symm\n#align linear_map.commute_mul_left_right LinearMap.commute_mulLeft_right\n\n@[simp]\ntheorem mulLeft_mul (a b : A) : mulLeft R (a * b) = (mulLeft R a).comp (mulLeft R b) := by\n ext\n simp only [mulLeft_apply, comp_apply, mul_assoc]\n#align linear_map.mul_left_mul LinearMap.mulLeft_mul\n\n@[simp]\ntheorem mulRight_mul (a b : A) : mulRight R (a * b) = (mulRight R b).comp (mulRight R a) := by\n ext\n simp only [mulRight_apply, comp_apply, mul_assoc]\n#align linear_map.mul_right_mul LinearMap.mulRight_mul\n\nend NonUnital\n\nsection Semiring\n\nvariable (R A B : Type*) [CommSemiring R] [Semiring A] [Semiring B] [Algebra R A] [Algebra R B]\n\nvariable {R A B} in\n/-- A `LinearMap` preserves multiplication if pre- and post- composition with `LinearMap.mul` are\nequivalent. By converting the statement into an equality of `LinearMap`s, this lemma allows various\nspecialized `ext` lemmas about `→ₗ[R]` to then be applied.\n\nThis is the `LinearMap` version of `AddMonoidHom.map_mul_iff`. -/\ntheorem map_mul_iff (f : A →ₗ[R] B) :\n (∀ x y, f (x * y) = f x * f y) ↔\n (LinearMap.mul R A).compr₂ f = (LinearMap.mul R B ∘ₗ f).compl₂ f :=\n Iff.symm LinearMap.ext_iff₂\n\n/-- The multiplication in an algebra is an algebra homomorphism into the endomorphisms on\nthe algebra.\n\nA weaker version of this for non-unital algebras exists as `NonUnitalAlgHom.mul`. -/\ndef _root_.Algebra.lmul : A →ₐ[R] End R A :=\n { LinearMap.mul R A with\n map_one' := by\n ext a\n exact one_mul a\n map_mul' := by\n intro a b\n ext c\n exact mul_assoc a b c\n map_zero' := by\n ext a\n exact zero_mul a\n commutes' := by\n intro r\n ext a\n exact (Algebra.smul_def r a).symm }\n#align algebra.lmul Algebra.lmul\n\nvariable {R A}\n\n@[simp]\ntheorem _root_.Algebra.coe_lmul_eq_mul : ⇑(Algebra.lmul R A) = mul R A :=\n rfl\n#align algebra.coe_lmul_eq_mul Algebra.coe_lmul_eq_mul\n\ntheorem _root_.Algebra.lmul_injective : Function.Injective (Algebra.lmul R A) :=\n fun a₁ a₂ h ↦ by simpa using FunLike.congr_fun h 1\n\n@[simp]\ntheorem mulLeft_eq_zero_iff (a : A) : mulLeft R a = 0 ↔ a = 0 := by\n constructor <;> intro h\n -- porting note: had to supply `R` explicitly in `@mulLeft_apply` below\n · rw [← mul_one a, ← @mulLeft_apply R _ _ _ _ _ _ a 1, h, LinearMap.zero_apply]\n · rw [h]\n exact mulLeft_zero_eq_zero\n#align linear_map.mul_left_eq_zero_iff LinearMap.mulLeft_eq_zero_iff\n\n@[simp]\ntheorem mulRight_eq_zero_iff (a : A) : mulRight R a = 0 ↔ a = 0 := by\n constructor <;> intro h\n -- porting note: had to supply `R` explicitly in `@mulRight_apply` below\n · rw [← one_mul a, ← @mulRight_apply R _ _ _ _ _ _ a 1, h, LinearMap.zero_apply]\n · rw [h]\n exact mulRight_zero_eq_zero\n#align linear_map.mul_right_eq_zero_iff LinearMap.mulRight_eq_zero_iff\n\n@[simp]\ntheorem mulLeft_one : mulLeft R (1 : A) = LinearMap.id := by\n ext\n simp only [LinearMap.id_coe, one_mul, id.def, mulLeft_apply]\n#align linear_map.mul_left_one LinearMap.mulLeft_one\n\n@[simp]\ntheorem mulRight_one : mulRight R (1 : A) = LinearMap.id := by\n ","nextTactic":"ext","declUpToTactic":"@[simp]\ntheorem mulRight_one : mulRight R (1 : A) = LinearMap.id := by\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Bilinear.225_0.cGBk1UxpwLhzgI8","decl":"@[simp]\ntheorem mulRight_one : mulRight R (1 : A) = LinearMap.id "} -{"state":"case h\nR : Type u_1\nA : Type u_2\nB : Type u_3\ninst✝⁴ : CommSemiring R\ninst✝³ : Semiring A\ninst✝² : Semiring B\ninst✝¹ : Algebra R A\ninst✝ : Algebra R B\nx✝ : A\n⊢ (mulRight R 1) x✝ = id x✝","srcUpToTactic":"/-\nCopyright (c) 2018 Kenny Lau. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Kenny Lau, Yury Kudryashov\n-/\nimport Mathlib.Algebra.Algebra.Basic\nimport Mathlib.Algebra.Algebra.Equiv\nimport Mathlib.Algebra.Algebra.NonUnitalHom\nimport Mathlib.Algebra.GroupPower.IterateHom\nimport Mathlib.LinearAlgebra.TensorProduct\n\n#align_import algebra.algebra.bilinear from \"leanprover-community/mathlib\"@\"657df4339ae6ceada048c8a2980fb10e393143ec\"\n\n/-!\n# Facts about algebras involving bilinear maps and tensor products\n\nWe move a few basic statements about algebras out of `Algebra.Algebra.Basic`,\nin order to avoid importing `LinearAlgebra.BilinearMap` and\n`LinearAlgebra.TensorProduct` unnecessarily.\n-/\n\nopen TensorProduct Module\n\nnamespace LinearMap\n\nsection NonUnitalNonAssoc\n\nvariable (R A : Type*) [CommSemiring R] [NonUnitalNonAssocSemiring A] [Module R A]\n [SMulCommClass R A A] [IsScalarTower R A A]\n\n/-- The multiplication in a non-unital non-associative algebra is a bilinear map.\n\nA weaker version of this for semirings exists as `AddMonoidHom.mul`. -/\ndef mul : A →ₗ[R] A →ₗ[R] A :=\n LinearMap.mk₂ R (· * ·) add_mul smul_mul_assoc mul_add mul_smul_comm\n#align linear_map.mul LinearMap.mul\n\n/-- The multiplication map on a non-unital algebra, as an `R`-linear map from `A ⊗[R] A` to `A`. -/\nnoncomputable def mul' : A ⊗[R] A →ₗ[R] A :=\n TensorProduct.lift (mul R A)\n#align linear_map.mul' LinearMap.mul'\n\nvariable {A}\n\n/-- The multiplication on the left in a non-unital algebra is a linear map. -/\ndef mulLeft (a : A) : A →ₗ[R] A :=\n mul R A a\n#align linear_map.mul_left LinearMap.mulLeft\n\n/-- The multiplication on the right in an algebra is a linear map. -/\ndef mulRight (a : A) : A →ₗ[R] A :=\n (mul R A).flip a\n#align linear_map.mul_right LinearMap.mulRight\n\n/-- Simultaneous multiplication on the left and right is a linear map. -/\ndef mulLeftRight (ab : A × A) : A →ₗ[R] A :=\n (mulRight R ab.snd).comp (mulLeft R ab.fst)\n#align linear_map.mul_left_right LinearMap.mulLeftRight\n\n@[simp]\ntheorem mulLeft_toAddMonoidHom (a : A) : (mulLeft R a : A →+ A) = AddMonoidHom.mulLeft a :=\n rfl\n#align linear_map.mul_left_to_add_monoid_hom LinearMap.mulLeft_toAddMonoidHom\n\n@[simp]\ntheorem mulRight_toAddMonoidHom (a : A) : (mulRight R a : A →+ A) = AddMonoidHom.mulRight a :=\n rfl\n#align linear_map.mul_right_to_add_monoid_hom LinearMap.mulRight_toAddMonoidHom\n\nvariable {R}\n\n@[simp]\ntheorem mul_apply' (a b : A) : mul R A a b = a * b :=\n rfl\n#align linear_map.mul_apply' LinearMap.mul_apply'\n\n@[simp]\ntheorem mulLeft_apply (a b : A) : mulLeft R a b = a * b :=\n rfl\n#align linear_map.mul_left_apply LinearMap.mulLeft_apply\n\n@[simp]\ntheorem mulRight_apply (a b : A) : mulRight R a b = b * a :=\n rfl\n#align linear_map.mul_right_apply LinearMap.mulRight_apply\n\n@[simp]\ntheorem mulLeftRight_apply (a b x : A) : mulLeftRight R (a, b) x = a * x * b :=\n rfl\n#align linear_map.mul_left_right_apply LinearMap.mulLeftRight_apply\n\n@[simp]\ntheorem mul'_apply {a b : A} : mul' R A (a ⊗ₜ b) = a * b :=\n rfl\n#align linear_map.mul'_apply LinearMap.mul'_apply\n\n@[simp]\ntheorem mulLeft_zero_eq_zero : mulLeft R (0 : A) = 0 :=\n (mul R A).map_zero\n#align linear_map.mul_left_zero_eq_zero LinearMap.mulLeft_zero_eq_zero\n\n@[simp]\ntheorem mulRight_zero_eq_zero : mulRight R (0 : A) = 0 :=\n (mul R A).flip.map_zero\n#align linear_map.mul_right_zero_eq_zero LinearMap.mulRight_zero_eq_zero\n\nend NonUnitalNonAssoc\n\nsection NonUnital\n\nvariable (R A : Type*) [CommSemiring R] [NonUnitalSemiring A] [Module R A] [SMulCommClass R A A]\n [IsScalarTower R A A]\n\n/-- The multiplication in a non-unital algebra is a bilinear map.\n\nA weaker version of this for non-unital non-associative algebras exists as `LinearMap.mul`. -/\ndef _root_.NonUnitalAlgHom.lmul : A →ₙₐ[R] End R A :=\n { mul R A with\n map_mul' := by\n intro a b\n ext c\n exact mul_assoc a b c\n map_zero' := by\n ext a\n exact zero_mul a }\n#align non_unital_alg_hom.lmul NonUnitalAlgHom.lmul\n\nvariable {R A}\n\n@[simp]\ntheorem _root_.NonUnitalAlgHom.coe_lmul_eq_mul : ⇑(NonUnitalAlgHom.lmul R A) = mul R A :=\n rfl\n#align non_unital_alg_hom.coe_lmul_eq_mul NonUnitalAlgHom.coe_lmul_eq_mul\n\ntheorem commute_mulLeft_right (a b : A) : Commute (mulLeft R a) (mulRight R b) := by\n ext c\n exact (mul_assoc a c b).symm\n#align linear_map.commute_mul_left_right LinearMap.commute_mulLeft_right\n\n@[simp]\ntheorem mulLeft_mul (a b : A) : mulLeft R (a * b) = (mulLeft R a).comp (mulLeft R b) := by\n ext\n simp only [mulLeft_apply, comp_apply, mul_assoc]\n#align linear_map.mul_left_mul LinearMap.mulLeft_mul\n\n@[simp]\ntheorem mulRight_mul (a b : A) : mulRight R (a * b) = (mulRight R b).comp (mulRight R a) := by\n ext\n simp only [mulRight_apply, comp_apply, mul_assoc]\n#align linear_map.mul_right_mul LinearMap.mulRight_mul\n\nend NonUnital\n\nsection Semiring\n\nvariable (R A B : Type*) [CommSemiring R] [Semiring A] [Semiring B] [Algebra R A] [Algebra R B]\n\nvariable {R A B} in\n/-- A `LinearMap` preserves multiplication if pre- and post- composition with `LinearMap.mul` are\nequivalent. By converting the statement into an equality of `LinearMap`s, this lemma allows various\nspecialized `ext` lemmas about `→ₗ[R]` to then be applied.\n\nThis is the `LinearMap` version of `AddMonoidHom.map_mul_iff`. -/\ntheorem map_mul_iff (f : A →ₗ[R] B) :\n (∀ x y, f (x * y) = f x * f y) ↔\n (LinearMap.mul R A).compr₂ f = (LinearMap.mul R B ∘ₗ f).compl₂ f :=\n Iff.symm LinearMap.ext_iff₂\n\n/-- The multiplication in an algebra is an algebra homomorphism into the endomorphisms on\nthe algebra.\n\nA weaker version of this for non-unital algebras exists as `NonUnitalAlgHom.mul`. -/\ndef _root_.Algebra.lmul : A →ₐ[R] End R A :=\n { LinearMap.mul R A with\n map_one' := by\n ext a\n exact one_mul a\n map_mul' := by\n intro a b\n ext c\n exact mul_assoc a b c\n map_zero' := by\n ext a\n exact zero_mul a\n commutes' := by\n intro r\n ext a\n exact (Algebra.smul_def r a).symm }\n#align algebra.lmul Algebra.lmul\n\nvariable {R A}\n\n@[simp]\ntheorem _root_.Algebra.coe_lmul_eq_mul : ⇑(Algebra.lmul R A) = mul R A :=\n rfl\n#align algebra.coe_lmul_eq_mul Algebra.coe_lmul_eq_mul\n\ntheorem _root_.Algebra.lmul_injective : Function.Injective (Algebra.lmul R A) :=\n fun a₁ a₂ h ↦ by simpa using FunLike.congr_fun h 1\n\n@[simp]\ntheorem mulLeft_eq_zero_iff (a : A) : mulLeft R a = 0 ↔ a = 0 := by\n constructor <;> intro h\n -- porting note: had to supply `R` explicitly in `@mulLeft_apply` below\n · rw [← mul_one a, ← @mulLeft_apply R _ _ _ _ _ _ a 1, h, LinearMap.zero_apply]\n · rw [h]\n exact mulLeft_zero_eq_zero\n#align linear_map.mul_left_eq_zero_iff LinearMap.mulLeft_eq_zero_iff\n\n@[simp]\ntheorem mulRight_eq_zero_iff (a : A) : mulRight R a = 0 ↔ a = 0 := by\n constructor <;> intro h\n -- porting note: had to supply `R` explicitly in `@mulRight_apply` below\n · rw [← one_mul a, ← @mulRight_apply R _ _ _ _ _ _ a 1, h, LinearMap.zero_apply]\n · rw [h]\n exact mulRight_zero_eq_zero\n#align linear_map.mul_right_eq_zero_iff LinearMap.mulRight_eq_zero_iff\n\n@[simp]\ntheorem mulLeft_one : mulLeft R (1 : A) = LinearMap.id := by\n ext\n simp only [LinearMap.id_coe, one_mul, id.def, mulLeft_apply]\n#align linear_map.mul_left_one LinearMap.mulLeft_one\n\n@[simp]\ntheorem mulRight_one : mulRight R (1 : A) = LinearMap.id := by\n ext\n ","nextTactic":"simp only [LinearMap.id_coe, mul_one, id.def, mulRight_apply]","declUpToTactic":"@[simp]\ntheorem mulRight_one : mulRight R (1 : A) = LinearMap.id := by\n ext\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Bilinear.225_0.cGBk1UxpwLhzgI8","decl":"@[simp]\ntheorem mulRight_one : mulRight R (1 : A) = LinearMap.id "} -{"state":"R : Type u_1\nA : Type u_2\nB : Type u_3\ninst✝⁴ : CommSemiring R\ninst✝³ : Semiring A\ninst✝² : Semiring B\ninst✝¹ : Algebra R A\ninst✝ : Algebra R B\na : A\nn : ℕ\n⊢ mulLeft R a ^ n = mulLeft R (a ^ n)","srcUpToTactic":"/-\nCopyright (c) 2018 Kenny Lau. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Kenny Lau, Yury Kudryashov\n-/\nimport Mathlib.Algebra.Algebra.Basic\nimport Mathlib.Algebra.Algebra.Equiv\nimport Mathlib.Algebra.Algebra.NonUnitalHom\nimport Mathlib.Algebra.GroupPower.IterateHom\nimport Mathlib.LinearAlgebra.TensorProduct\n\n#align_import algebra.algebra.bilinear from \"leanprover-community/mathlib\"@\"657df4339ae6ceada048c8a2980fb10e393143ec\"\n\n/-!\n# Facts about algebras involving bilinear maps and tensor products\n\nWe move a few basic statements about algebras out of `Algebra.Algebra.Basic`,\nin order to avoid importing `LinearAlgebra.BilinearMap` and\n`LinearAlgebra.TensorProduct` unnecessarily.\n-/\n\nopen TensorProduct Module\n\nnamespace LinearMap\n\nsection NonUnitalNonAssoc\n\nvariable (R A : Type*) [CommSemiring R] [NonUnitalNonAssocSemiring A] [Module R A]\n [SMulCommClass R A A] [IsScalarTower R A A]\n\n/-- The multiplication in a non-unital non-associative algebra is a bilinear map.\n\nA weaker version of this for semirings exists as `AddMonoidHom.mul`. -/\ndef mul : A →ₗ[R] A →ₗ[R] A :=\n LinearMap.mk₂ R (· * ·) add_mul smul_mul_assoc mul_add mul_smul_comm\n#align linear_map.mul LinearMap.mul\n\n/-- The multiplication map on a non-unital algebra, as an `R`-linear map from `A ⊗[R] A` to `A`. -/\nnoncomputable def mul' : A ⊗[R] A →ₗ[R] A :=\n TensorProduct.lift (mul R A)\n#align linear_map.mul' LinearMap.mul'\n\nvariable {A}\n\n/-- The multiplication on the left in a non-unital algebra is a linear map. -/\ndef mulLeft (a : A) : A →ₗ[R] A :=\n mul R A a\n#align linear_map.mul_left LinearMap.mulLeft\n\n/-- The multiplication on the right in an algebra is a linear map. -/\ndef mulRight (a : A) : A →ₗ[R] A :=\n (mul R A).flip a\n#align linear_map.mul_right LinearMap.mulRight\n\n/-- Simultaneous multiplication on the left and right is a linear map. -/\ndef mulLeftRight (ab : A × A) : A →ₗ[R] A :=\n (mulRight R ab.snd).comp (mulLeft R ab.fst)\n#align linear_map.mul_left_right LinearMap.mulLeftRight\n\n@[simp]\ntheorem mulLeft_toAddMonoidHom (a : A) : (mulLeft R a : A →+ A) = AddMonoidHom.mulLeft a :=\n rfl\n#align linear_map.mul_left_to_add_monoid_hom LinearMap.mulLeft_toAddMonoidHom\n\n@[simp]\ntheorem mulRight_toAddMonoidHom (a : A) : (mulRight R a : A →+ A) = AddMonoidHom.mulRight a :=\n rfl\n#align linear_map.mul_right_to_add_monoid_hom LinearMap.mulRight_toAddMonoidHom\n\nvariable {R}\n\n@[simp]\ntheorem mul_apply' (a b : A) : mul R A a b = a * b :=\n rfl\n#align linear_map.mul_apply' LinearMap.mul_apply'\n\n@[simp]\ntheorem mulLeft_apply (a b : A) : mulLeft R a b = a * b :=\n rfl\n#align linear_map.mul_left_apply LinearMap.mulLeft_apply\n\n@[simp]\ntheorem mulRight_apply (a b : A) : mulRight R a b = b * a :=\n rfl\n#align linear_map.mul_right_apply LinearMap.mulRight_apply\n\n@[simp]\ntheorem mulLeftRight_apply (a b x : A) : mulLeftRight R (a, b) x = a * x * b :=\n rfl\n#align linear_map.mul_left_right_apply LinearMap.mulLeftRight_apply\n\n@[simp]\ntheorem mul'_apply {a b : A} : mul' R A (a ⊗ₜ b) = a * b :=\n rfl\n#align linear_map.mul'_apply LinearMap.mul'_apply\n\n@[simp]\ntheorem mulLeft_zero_eq_zero : mulLeft R (0 : A) = 0 :=\n (mul R A).map_zero\n#align linear_map.mul_left_zero_eq_zero LinearMap.mulLeft_zero_eq_zero\n\n@[simp]\ntheorem mulRight_zero_eq_zero : mulRight R (0 : A) = 0 :=\n (mul R A).flip.map_zero\n#align linear_map.mul_right_zero_eq_zero LinearMap.mulRight_zero_eq_zero\n\nend NonUnitalNonAssoc\n\nsection NonUnital\n\nvariable (R A : Type*) [CommSemiring R] [NonUnitalSemiring A] [Module R A] [SMulCommClass R A A]\n [IsScalarTower R A A]\n\n/-- The multiplication in a non-unital algebra is a bilinear map.\n\nA weaker version of this for non-unital non-associative algebras exists as `LinearMap.mul`. -/\ndef _root_.NonUnitalAlgHom.lmul : A →ₙₐ[R] End R A :=\n { mul R A with\n map_mul' := by\n intro a b\n ext c\n exact mul_assoc a b c\n map_zero' := by\n ext a\n exact zero_mul a }\n#align non_unital_alg_hom.lmul NonUnitalAlgHom.lmul\n\nvariable {R A}\n\n@[simp]\ntheorem _root_.NonUnitalAlgHom.coe_lmul_eq_mul : ⇑(NonUnitalAlgHom.lmul R A) = mul R A :=\n rfl\n#align non_unital_alg_hom.coe_lmul_eq_mul NonUnitalAlgHom.coe_lmul_eq_mul\n\ntheorem commute_mulLeft_right (a b : A) : Commute (mulLeft R a) (mulRight R b) := by\n ext c\n exact (mul_assoc a c b).symm\n#align linear_map.commute_mul_left_right LinearMap.commute_mulLeft_right\n\n@[simp]\ntheorem mulLeft_mul (a b : A) : mulLeft R (a * b) = (mulLeft R a).comp (mulLeft R b) := by\n ext\n simp only [mulLeft_apply, comp_apply, mul_assoc]\n#align linear_map.mul_left_mul LinearMap.mulLeft_mul\n\n@[simp]\ntheorem mulRight_mul (a b : A) : mulRight R (a * b) = (mulRight R b).comp (mulRight R a) := by\n ext\n simp only [mulRight_apply, comp_apply, mul_assoc]\n#align linear_map.mul_right_mul LinearMap.mulRight_mul\n\nend NonUnital\n\nsection Semiring\n\nvariable (R A B : Type*) [CommSemiring R] [Semiring A] [Semiring B] [Algebra R A] [Algebra R B]\n\nvariable {R A B} in\n/-- A `LinearMap` preserves multiplication if pre- and post- composition with `LinearMap.mul` are\nequivalent. By converting the statement into an equality of `LinearMap`s, this lemma allows various\nspecialized `ext` lemmas about `→ₗ[R]` to then be applied.\n\nThis is the `LinearMap` version of `AddMonoidHom.map_mul_iff`. -/\ntheorem map_mul_iff (f : A →ₗ[R] B) :\n (∀ x y, f (x * y) = f x * f y) ↔\n (LinearMap.mul R A).compr₂ f = (LinearMap.mul R B ∘ₗ f).compl₂ f :=\n Iff.symm LinearMap.ext_iff₂\n\n/-- The multiplication in an algebra is an algebra homomorphism into the endomorphisms on\nthe algebra.\n\nA weaker version of this for non-unital algebras exists as `NonUnitalAlgHom.mul`. -/\ndef _root_.Algebra.lmul : A →ₐ[R] End R A :=\n { LinearMap.mul R A with\n map_one' := by\n ext a\n exact one_mul a\n map_mul' := by\n intro a b\n ext c\n exact mul_assoc a b c\n map_zero' := by\n ext a\n exact zero_mul a\n commutes' := by\n intro r\n ext a\n exact (Algebra.smul_def r a).symm }\n#align algebra.lmul Algebra.lmul\n\nvariable {R A}\n\n@[simp]\ntheorem _root_.Algebra.coe_lmul_eq_mul : ⇑(Algebra.lmul R A) = mul R A :=\n rfl\n#align algebra.coe_lmul_eq_mul Algebra.coe_lmul_eq_mul\n\ntheorem _root_.Algebra.lmul_injective : Function.Injective (Algebra.lmul R A) :=\n fun a₁ a₂ h ↦ by simpa using FunLike.congr_fun h 1\n\n@[simp]\ntheorem mulLeft_eq_zero_iff (a : A) : mulLeft R a = 0 ↔ a = 0 := by\n constructor <;> intro h\n -- porting note: had to supply `R` explicitly in `@mulLeft_apply` below\n · rw [← mul_one a, ← @mulLeft_apply R _ _ _ _ _ _ a 1, h, LinearMap.zero_apply]\n · rw [h]\n exact mulLeft_zero_eq_zero\n#align linear_map.mul_left_eq_zero_iff LinearMap.mulLeft_eq_zero_iff\n\n@[simp]\ntheorem mulRight_eq_zero_iff (a : A) : mulRight R a = 0 ↔ a = 0 := by\n constructor <;> intro h\n -- porting note: had to supply `R` explicitly in `@mulRight_apply` below\n · rw [← one_mul a, ← @mulRight_apply R _ _ _ _ _ _ a 1, h, LinearMap.zero_apply]\n · rw [h]\n exact mulRight_zero_eq_zero\n#align linear_map.mul_right_eq_zero_iff LinearMap.mulRight_eq_zero_iff\n\n@[simp]\ntheorem mulLeft_one : mulLeft R (1 : A) = LinearMap.id := by\n ext\n simp only [LinearMap.id_coe, one_mul, id.def, mulLeft_apply]\n#align linear_map.mul_left_one LinearMap.mulLeft_one\n\n@[simp]\ntheorem mulRight_one : mulRight R (1 : A) = LinearMap.id := by\n ext\n simp only [LinearMap.id_coe, mul_one, id.def, mulRight_apply]\n#align linear_map.mul_right_one LinearMap.mulRight_one\n\n@[simp]\ntheorem pow_mulLeft (a : A) (n : ℕ) : mulLeft R a ^ n = mulLeft R (a ^ n) := by\n ","nextTactic":"simpa only [mulLeft, ← Algebra.coe_lmul_eq_mul] using ((Algebra.lmul R A).map_pow a n).symm","declUpToTactic":"@[simp]\ntheorem pow_mulLeft (a : A) (n : ℕ) : mulLeft R a ^ n = mulLeft R (a ^ n) := by\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Bilinear.231_0.cGBk1UxpwLhzgI8","decl":"@[simp]\ntheorem pow_mulLeft (a : A) (n : ℕ) : mulLeft R a ^ n = mulLeft R (a ^ n) "} -{"state":"R : Type u_1\nA : Type u_2\nB : Type u_3\ninst✝⁴ : CommSemiring R\ninst✝³ : Semiring A\ninst✝² : Semiring B\ninst✝¹ : Algebra R A\ninst✝ : Algebra R B\na : A\nn : ℕ\n⊢ mulRight R a ^ n = mulRight R (a ^ n)","srcUpToTactic":"/-\nCopyright (c) 2018 Kenny Lau. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Kenny Lau, Yury Kudryashov\n-/\nimport Mathlib.Algebra.Algebra.Basic\nimport Mathlib.Algebra.Algebra.Equiv\nimport Mathlib.Algebra.Algebra.NonUnitalHom\nimport Mathlib.Algebra.GroupPower.IterateHom\nimport Mathlib.LinearAlgebra.TensorProduct\n\n#align_import algebra.algebra.bilinear from \"leanprover-community/mathlib\"@\"657df4339ae6ceada048c8a2980fb10e393143ec\"\n\n/-!\n# Facts about algebras involving bilinear maps and tensor products\n\nWe move a few basic statements about algebras out of `Algebra.Algebra.Basic`,\nin order to avoid importing `LinearAlgebra.BilinearMap` and\n`LinearAlgebra.TensorProduct` unnecessarily.\n-/\n\nopen TensorProduct Module\n\nnamespace LinearMap\n\nsection NonUnitalNonAssoc\n\nvariable (R A : Type*) [CommSemiring R] [NonUnitalNonAssocSemiring A] [Module R A]\n [SMulCommClass R A A] [IsScalarTower R A A]\n\n/-- The multiplication in a non-unital non-associative algebra is a bilinear map.\n\nA weaker version of this for semirings exists as `AddMonoidHom.mul`. -/\ndef mul : A →ₗ[R] A →ₗ[R] A :=\n LinearMap.mk₂ R (· * ·) add_mul smul_mul_assoc mul_add mul_smul_comm\n#align linear_map.mul LinearMap.mul\n\n/-- The multiplication map on a non-unital algebra, as an `R`-linear map from `A ⊗[R] A` to `A`. -/\nnoncomputable def mul' : A ⊗[R] A →ₗ[R] A :=\n TensorProduct.lift (mul R A)\n#align linear_map.mul' LinearMap.mul'\n\nvariable {A}\n\n/-- The multiplication on the left in a non-unital algebra is a linear map. -/\ndef mulLeft (a : A) : A →ₗ[R] A :=\n mul R A a\n#align linear_map.mul_left LinearMap.mulLeft\n\n/-- The multiplication on the right in an algebra is a linear map. -/\ndef mulRight (a : A) : A →ₗ[R] A :=\n (mul R A).flip a\n#align linear_map.mul_right LinearMap.mulRight\n\n/-- Simultaneous multiplication on the left and right is a linear map. -/\ndef mulLeftRight (ab : A × A) : A →ₗ[R] A :=\n (mulRight R ab.snd).comp (mulLeft R ab.fst)\n#align linear_map.mul_left_right LinearMap.mulLeftRight\n\n@[simp]\ntheorem mulLeft_toAddMonoidHom (a : A) : (mulLeft R a : A →+ A) = AddMonoidHom.mulLeft a :=\n rfl\n#align linear_map.mul_left_to_add_monoid_hom LinearMap.mulLeft_toAddMonoidHom\n\n@[simp]\ntheorem mulRight_toAddMonoidHom (a : A) : (mulRight R a : A →+ A) = AddMonoidHom.mulRight a :=\n rfl\n#align linear_map.mul_right_to_add_monoid_hom LinearMap.mulRight_toAddMonoidHom\n\nvariable {R}\n\n@[simp]\ntheorem mul_apply' (a b : A) : mul R A a b = a * b :=\n rfl\n#align linear_map.mul_apply' LinearMap.mul_apply'\n\n@[simp]\ntheorem mulLeft_apply (a b : A) : mulLeft R a b = a * b :=\n rfl\n#align linear_map.mul_left_apply LinearMap.mulLeft_apply\n\n@[simp]\ntheorem mulRight_apply (a b : A) : mulRight R a b = b * a :=\n rfl\n#align linear_map.mul_right_apply LinearMap.mulRight_apply\n\n@[simp]\ntheorem mulLeftRight_apply (a b x : A) : mulLeftRight R (a, b) x = a * x * b :=\n rfl\n#align linear_map.mul_left_right_apply LinearMap.mulLeftRight_apply\n\n@[simp]\ntheorem mul'_apply {a b : A} : mul' R A (a ⊗ₜ b) = a * b :=\n rfl\n#align linear_map.mul'_apply LinearMap.mul'_apply\n\n@[simp]\ntheorem mulLeft_zero_eq_zero : mulLeft R (0 : A) = 0 :=\n (mul R A).map_zero\n#align linear_map.mul_left_zero_eq_zero LinearMap.mulLeft_zero_eq_zero\n\n@[simp]\ntheorem mulRight_zero_eq_zero : mulRight R (0 : A) = 0 :=\n (mul R A).flip.map_zero\n#align linear_map.mul_right_zero_eq_zero LinearMap.mulRight_zero_eq_zero\n\nend NonUnitalNonAssoc\n\nsection NonUnital\n\nvariable (R A : Type*) [CommSemiring R] [NonUnitalSemiring A] [Module R A] [SMulCommClass R A A]\n [IsScalarTower R A A]\n\n/-- The multiplication in a non-unital algebra is a bilinear map.\n\nA weaker version of this for non-unital non-associative algebras exists as `LinearMap.mul`. -/\ndef _root_.NonUnitalAlgHom.lmul : A →ₙₐ[R] End R A :=\n { mul R A with\n map_mul' := by\n intro a b\n ext c\n exact mul_assoc a b c\n map_zero' := by\n ext a\n exact zero_mul a }\n#align non_unital_alg_hom.lmul NonUnitalAlgHom.lmul\n\nvariable {R A}\n\n@[simp]\ntheorem _root_.NonUnitalAlgHom.coe_lmul_eq_mul : ⇑(NonUnitalAlgHom.lmul R A) = mul R A :=\n rfl\n#align non_unital_alg_hom.coe_lmul_eq_mul NonUnitalAlgHom.coe_lmul_eq_mul\n\ntheorem commute_mulLeft_right (a b : A) : Commute (mulLeft R a) (mulRight R b) := by\n ext c\n exact (mul_assoc a c b).symm\n#align linear_map.commute_mul_left_right LinearMap.commute_mulLeft_right\n\n@[simp]\ntheorem mulLeft_mul (a b : A) : mulLeft R (a * b) = (mulLeft R a).comp (mulLeft R b) := by\n ext\n simp only [mulLeft_apply, comp_apply, mul_assoc]\n#align linear_map.mul_left_mul LinearMap.mulLeft_mul\n\n@[simp]\ntheorem mulRight_mul (a b : A) : mulRight R (a * b) = (mulRight R b).comp (mulRight R a) := by\n ext\n simp only [mulRight_apply, comp_apply, mul_assoc]\n#align linear_map.mul_right_mul LinearMap.mulRight_mul\n\nend NonUnital\n\nsection Semiring\n\nvariable (R A B : Type*) [CommSemiring R] [Semiring A] [Semiring B] [Algebra R A] [Algebra R B]\n\nvariable {R A B} in\n/-- A `LinearMap` preserves multiplication if pre- and post- composition with `LinearMap.mul` are\nequivalent. By converting the statement into an equality of `LinearMap`s, this lemma allows various\nspecialized `ext` lemmas about `→ₗ[R]` to then be applied.\n\nThis is the `LinearMap` version of `AddMonoidHom.map_mul_iff`. -/\ntheorem map_mul_iff (f : A →ₗ[R] B) :\n (∀ x y, f (x * y) = f x * f y) ↔\n (LinearMap.mul R A).compr₂ f = (LinearMap.mul R B ∘ₗ f).compl₂ f :=\n Iff.symm LinearMap.ext_iff₂\n\n/-- The multiplication in an algebra is an algebra homomorphism into the endomorphisms on\nthe algebra.\n\nA weaker version of this for non-unital algebras exists as `NonUnitalAlgHom.mul`. -/\ndef _root_.Algebra.lmul : A →ₐ[R] End R A :=\n { LinearMap.mul R A with\n map_one' := by\n ext a\n exact one_mul a\n map_mul' := by\n intro a b\n ext c\n exact mul_assoc a b c\n map_zero' := by\n ext a\n exact zero_mul a\n commutes' := by\n intro r\n ext a\n exact (Algebra.smul_def r a).symm }\n#align algebra.lmul Algebra.lmul\n\nvariable {R A}\n\n@[simp]\ntheorem _root_.Algebra.coe_lmul_eq_mul : ⇑(Algebra.lmul R A) = mul R A :=\n rfl\n#align algebra.coe_lmul_eq_mul Algebra.coe_lmul_eq_mul\n\ntheorem _root_.Algebra.lmul_injective : Function.Injective (Algebra.lmul R A) :=\n fun a₁ a₂ h ↦ by simpa using FunLike.congr_fun h 1\n\n@[simp]\ntheorem mulLeft_eq_zero_iff (a : A) : mulLeft R a = 0 ↔ a = 0 := by\n constructor <;> intro h\n -- porting note: had to supply `R` explicitly in `@mulLeft_apply` below\n · rw [← mul_one a, ← @mulLeft_apply R _ _ _ _ _ _ a 1, h, LinearMap.zero_apply]\n · rw [h]\n exact mulLeft_zero_eq_zero\n#align linear_map.mul_left_eq_zero_iff LinearMap.mulLeft_eq_zero_iff\n\n@[simp]\ntheorem mulRight_eq_zero_iff (a : A) : mulRight R a = 0 ↔ a = 0 := by\n constructor <;> intro h\n -- porting note: had to supply `R` explicitly in `@mulRight_apply` below\n · rw [← one_mul a, ← @mulRight_apply R _ _ _ _ _ _ a 1, h, LinearMap.zero_apply]\n · rw [h]\n exact mulRight_zero_eq_zero\n#align linear_map.mul_right_eq_zero_iff LinearMap.mulRight_eq_zero_iff\n\n@[simp]\ntheorem mulLeft_one : mulLeft R (1 : A) = LinearMap.id := by\n ext\n simp only [LinearMap.id_coe, one_mul, id.def, mulLeft_apply]\n#align linear_map.mul_left_one LinearMap.mulLeft_one\n\n@[simp]\ntheorem mulRight_one : mulRight R (1 : A) = LinearMap.id := by\n ext\n simp only [LinearMap.id_coe, mul_one, id.def, mulRight_apply]\n#align linear_map.mul_right_one LinearMap.mulRight_one\n\n@[simp]\ntheorem pow_mulLeft (a : A) (n : ℕ) : mulLeft R a ^ n = mulLeft R (a ^ n) := by\n simpa only [mulLeft, ← Algebra.coe_lmul_eq_mul] using ((Algebra.lmul R A).map_pow a n).symm\n#align linear_map.pow_mul_left LinearMap.pow_mulLeft\n\n@[simp]\ntheorem pow_mulRight (a : A) (n : ℕ) : mulRight R a ^ n = mulRight R (a ^ n) := by\n ","nextTactic":"simp only [mulRight, ← Algebra.coe_lmul_eq_mul]","declUpToTactic":"@[simp]\ntheorem pow_mulRight (a : A) (n : ℕ) : mulRight R a ^ n = mulRight R (a ^ n) := by\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Bilinear.236_0.cGBk1UxpwLhzgI8","decl":"@[simp]\ntheorem pow_mulRight (a : A) (n : ℕ) : mulRight R a ^ n = mulRight R (a ^ n) "} -{"state":"R : Type u_1\nA : Type u_2\nB : Type u_3\ninst✝⁴ : CommSemiring R\ninst✝³ : Semiring A\ninst✝² : Semiring B\ninst✝¹ : Algebra R A\ninst✝ : Algebra R B\na : A\nn : ℕ\n⊢ (flip (mul R A)) a ^ n = (flip (mul R A)) (a ^ n)","srcUpToTactic":"/-\nCopyright (c) 2018 Kenny Lau. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Kenny Lau, Yury Kudryashov\n-/\nimport Mathlib.Algebra.Algebra.Basic\nimport Mathlib.Algebra.Algebra.Equiv\nimport Mathlib.Algebra.Algebra.NonUnitalHom\nimport Mathlib.Algebra.GroupPower.IterateHom\nimport Mathlib.LinearAlgebra.TensorProduct\n\n#align_import algebra.algebra.bilinear from \"leanprover-community/mathlib\"@\"657df4339ae6ceada048c8a2980fb10e393143ec\"\n\n/-!\n# Facts about algebras involving bilinear maps and tensor products\n\nWe move a few basic statements about algebras out of `Algebra.Algebra.Basic`,\nin order to avoid importing `LinearAlgebra.BilinearMap` and\n`LinearAlgebra.TensorProduct` unnecessarily.\n-/\n\nopen TensorProduct Module\n\nnamespace LinearMap\n\nsection NonUnitalNonAssoc\n\nvariable (R A : Type*) [CommSemiring R] [NonUnitalNonAssocSemiring A] [Module R A]\n [SMulCommClass R A A] [IsScalarTower R A A]\n\n/-- The multiplication in a non-unital non-associative algebra is a bilinear map.\n\nA weaker version of this for semirings exists as `AddMonoidHom.mul`. -/\ndef mul : A →ₗ[R] A →ₗ[R] A :=\n LinearMap.mk₂ R (· * ·) add_mul smul_mul_assoc mul_add mul_smul_comm\n#align linear_map.mul LinearMap.mul\n\n/-- The multiplication map on a non-unital algebra, as an `R`-linear map from `A ⊗[R] A` to `A`. -/\nnoncomputable def mul' : A ⊗[R] A →ₗ[R] A :=\n TensorProduct.lift (mul R A)\n#align linear_map.mul' LinearMap.mul'\n\nvariable {A}\n\n/-- The multiplication on the left in a non-unital algebra is a linear map. -/\ndef mulLeft (a : A) : A →ₗ[R] A :=\n mul R A a\n#align linear_map.mul_left LinearMap.mulLeft\n\n/-- The multiplication on the right in an algebra is a linear map. -/\ndef mulRight (a : A) : A →ₗ[R] A :=\n (mul R A).flip a\n#align linear_map.mul_right LinearMap.mulRight\n\n/-- Simultaneous multiplication on the left and right is a linear map. -/\ndef mulLeftRight (ab : A × A) : A →ₗ[R] A :=\n (mulRight R ab.snd).comp (mulLeft R ab.fst)\n#align linear_map.mul_left_right LinearMap.mulLeftRight\n\n@[simp]\ntheorem mulLeft_toAddMonoidHom (a : A) : (mulLeft R a : A →+ A) = AddMonoidHom.mulLeft a :=\n rfl\n#align linear_map.mul_left_to_add_monoid_hom LinearMap.mulLeft_toAddMonoidHom\n\n@[simp]\ntheorem mulRight_toAddMonoidHom (a : A) : (mulRight R a : A →+ A) = AddMonoidHom.mulRight a :=\n rfl\n#align linear_map.mul_right_to_add_monoid_hom LinearMap.mulRight_toAddMonoidHom\n\nvariable {R}\n\n@[simp]\ntheorem mul_apply' (a b : A) : mul R A a b = a * b :=\n rfl\n#align linear_map.mul_apply' LinearMap.mul_apply'\n\n@[simp]\ntheorem mulLeft_apply (a b : A) : mulLeft R a b = a * b :=\n rfl\n#align linear_map.mul_left_apply LinearMap.mulLeft_apply\n\n@[simp]\ntheorem mulRight_apply (a b : A) : mulRight R a b = b * a :=\n rfl\n#align linear_map.mul_right_apply LinearMap.mulRight_apply\n\n@[simp]\ntheorem mulLeftRight_apply (a b x : A) : mulLeftRight R (a, b) x = a * x * b :=\n rfl\n#align linear_map.mul_left_right_apply LinearMap.mulLeftRight_apply\n\n@[simp]\ntheorem mul'_apply {a b : A} : mul' R A (a ⊗ₜ b) = a * b :=\n rfl\n#align linear_map.mul'_apply LinearMap.mul'_apply\n\n@[simp]\ntheorem mulLeft_zero_eq_zero : mulLeft R (0 : A) = 0 :=\n (mul R A).map_zero\n#align linear_map.mul_left_zero_eq_zero LinearMap.mulLeft_zero_eq_zero\n\n@[simp]\ntheorem mulRight_zero_eq_zero : mulRight R (0 : A) = 0 :=\n (mul R A).flip.map_zero\n#align linear_map.mul_right_zero_eq_zero LinearMap.mulRight_zero_eq_zero\n\nend NonUnitalNonAssoc\n\nsection NonUnital\n\nvariable (R A : Type*) [CommSemiring R] [NonUnitalSemiring A] [Module R A] [SMulCommClass R A A]\n [IsScalarTower R A A]\n\n/-- The multiplication in a non-unital algebra is a bilinear map.\n\nA weaker version of this for non-unital non-associative algebras exists as `LinearMap.mul`. -/\ndef _root_.NonUnitalAlgHom.lmul : A →ₙₐ[R] End R A :=\n { mul R A with\n map_mul' := by\n intro a b\n ext c\n exact mul_assoc a b c\n map_zero' := by\n ext a\n exact zero_mul a }\n#align non_unital_alg_hom.lmul NonUnitalAlgHom.lmul\n\nvariable {R A}\n\n@[simp]\ntheorem _root_.NonUnitalAlgHom.coe_lmul_eq_mul : ⇑(NonUnitalAlgHom.lmul R A) = mul R A :=\n rfl\n#align non_unital_alg_hom.coe_lmul_eq_mul NonUnitalAlgHom.coe_lmul_eq_mul\n\ntheorem commute_mulLeft_right (a b : A) : Commute (mulLeft R a) (mulRight R b) := by\n ext c\n exact (mul_assoc a c b).symm\n#align linear_map.commute_mul_left_right LinearMap.commute_mulLeft_right\n\n@[simp]\ntheorem mulLeft_mul (a b : A) : mulLeft R (a * b) = (mulLeft R a).comp (mulLeft R b) := by\n ext\n simp only [mulLeft_apply, comp_apply, mul_assoc]\n#align linear_map.mul_left_mul LinearMap.mulLeft_mul\n\n@[simp]\ntheorem mulRight_mul (a b : A) : mulRight R (a * b) = (mulRight R b).comp (mulRight R a) := by\n ext\n simp only [mulRight_apply, comp_apply, mul_assoc]\n#align linear_map.mul_right_mul LinearMap.mulRight_mul\n\nend NonUnital\n\nsection Semiring\n\nvariable (R A B : Type*) [CommSemiring R] [Semiring A] [Semiring B] [Algebra R A] [Algebra R B]\n\nvariable {R A B} in\n/-- A `LinearMap` preserves multiplication if pre- and post- composition with `LinearMap.mul` are\nequivalent. By converting the statement into an equality of `LinearMap`s, this lemma allows various\nspecialized `ext` lemmas about `→ₗ[R]` to then be applied.\n\nThis is the `LinearMap` version of `AddMonoidHom.map_mul_iff`. -/\ntheorem map_mul_iff (f : A →ₗ[R] B) :\n (∀ x y, f (x * y) = f x * f y) ↔\n (LinearMap.mul R A).compr₂ f = (LinearMap.mul R B ∘ₗ f).compl₂ f :=\n Iff.symm LinearMap.ext_iff₂\n\n/-- The multiplication in an algebra is an algebra homomorphism into the endomorphisms on\nthe algebra.\n\nA weaker version of this for non-unital algebras exists as `NonUnitalAlgHom.mul`. -/\ndef _root_.Algebra.lmul : A →ₐ[R] End R A :=\n { LinearMap.mul R A with\n map_one' := by\n ext a\n exact one_mul a\n map_mul' := by\n intro a b\n ext c\n exact mul_assoc a b c\n map_zero' := by\n ext a\n exact zero_mul a\n commutes' := by\n intro r\n ext a\n exact (Algebra.smul_def r a).symm }\n#align algebra.lmul Algebra.lmul\n\nvariable {R A}\n\n@[simp]\ntheorem _root_.Algebra.coe_lmul_eq_mul : ⇑(Algebra.lmul R A) = mul R A :=\n rfl\n#align algebra.coe_lmul_eq_mul Algebra.coe_lmul_eq_mul\n\ntheorem _root_.Algebra.lmul_injective : Function.Injective (Algebra.lmul R A) :=\n fun a₁ a₂ h ↦ by simpa using FunLike.congr_fun h 1\n\n@[simp]\ntheorem mulLeft_eq_zero_iff (a : A) : mulLeft R a = 0 ↔ a = 0 := by\n constructor <;> intro h\n -- porting note: had to supply `R` explicitly in `@mulLeft_apply` below\n · rw [← mul_one a, ← @mulLeft_apply R _ _ _ _ _ _ a 1, h, LinearMap.zero_apply]\n · rw [h]\n exact mulLeft_zero_eq_zero\n#align linear_map.mul_left_eq_zero_iff LinearMap.mulLeft_eq_zero_iff\n\n@[simp]\ntheorem mulRight_eq_zero_iff (a : A) : mulRight R a = 0 ↔ a = 0 := by\n constructor <;> intro h\n -- porting note: had to supply `R` explicitly in `@mulRight_apply` below\n · rw [← one_mul a, ← @mulRight_apply R _ _ _ _ _ _ a 1, h, LinearMap.zero_apply]\n · rw [h]\n exact mulRight_zero_eq_zero\n#align linear_map.mul_right_eq_zero_iff LinearMap.mulRight_eq_zero_iff\n\n@[simp]\ntheorem mulLeft_one : mulLeft R (1 : A) = LinearMap.id := by\n ext\n simp only [LinearMap.id_coe, one_mul, id.def, mulLeft_apply]\n#align linear_map.mul_left_one LinearMap.mulLeft_one\n\n@[simp]\ntheorem mulRight_one : mulRight R (1 : A) = LinearMap.id := by\n ext\n simp only [LinearMap.id_coe, mul_one, id.def, mulRight_apply]\n#align linear_map.mul_right_one LinearMap.mulRight_one\n\n@[simp]\ntheorem pow_mulLeft (a : A) (n : ℕ) : mulLeft R a ^ n = mulLeft R (a ^ n) := by\n simpa only [mulLeft, ← Algebra.coe_lmul_eq_mul] using ((Algebra.lmul R A).map_pow a n).symm\n#align linear_map.pow_mul_left LinearMap.pow_mulLeft\n\n@[simp]\ntheorem pow_mulRight (a : A) (n : ℕ) : mulRight R a ^ n = mulRight R (a ^ n) := by\n simp only [mulRight, ← Algebra.coe_lmul_eq_mul]\n ","nextTactic":"exact\n LinearMap.coe_injective (((mulRight R a).coe_pow n).symm ▸ mul_right_iterate a n)","declUpToTactic":"@[simp]\ntheorem pow_mulRight (a : A) (n : ℕ) : mulRight R a ^ n = mulRight R (a ^ n) := by\n simp only [mulRight, ← Algebra.coe_lmul_eq_mul]\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Bilinear.236_0.cGBk1UxpwLhzgI8","decl":"@[simp]\ntheorem pow_mulRight (a : A) (n : ℕ) : mulRight R a ^ n = mulRight R (a ^ n) "} -{"state":"R : Type u_1\nA : Type u_2\ninst✝³ : CommSemiring R\ninst✝² : Ring A\ninst✝¹ : Algebra R A\ninst✝ : NoZeroDivisors A\nx : A\nhx : x ≠ 0\n⊢ Function.Injective ⇑(mulLeft R x)","srcUpToTactic":"/-\nCopyright (c) 2018 Kenny Lau. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Kenny Lau, Yury Kudryashov\n-/\nimport Mathlib.Algebra.Algebra.Basic\nimport Mathlib.Algebra.Algebra.Equiv\nimport Mathlib.Algebra.Algebra.NonUnitalHom\nimport Mathlib.Algebra.GroupPower.IterateHom\nimport Mathlib.LinearAlgebra.TensorProduct\n\n#align_import algebra.algebra.bilinear from \"leanprover-community/mathlib\"@\"657df4339ae6ceada048c8a2980fb10e393143ec\"\n\n/-!\n# Facts about algebras involving bilinear maps and tensor products\n\nWe move a few basic statements about algebras out of `Algebra.Algebra.Basic`,\nin order to avoid importing `LinearAlgebra.BilinearMap` and\n`LinearAlgebra.TensorProduct` unnecessarily.\n-/\n\nopen TensorProduct Module\n\nnamespace LinearMap\n\nsection NonUnitalNonAssoc\n\nvariable (R A : Type*) [CommSemiring R] [NonUnitalNonAssocSemiring A] [Module R A]\n [SMulCommClass R A A] [IsScalarTower R A A]\n\n/-- The multiplication in a non-unital non-associative algebra is a bilinear map.\n\nA weaker version of this for semirings exists as `AddMonoidHom.mul`. -/\ndef mul : A →ₗ[R] A →ₗ[R] A :=\n LinearMap.mk₂ R (· * ·) add_mul smul_mul_assoc mul_add mul_smul_comm\n#align linear_map.mul LinearMap.mul\n\n/-- The multiplication map on a non-unital algebra, as an `R`-linear map from `A ⊗[R] A` to `A`. -/\nnoncomputable def mul' : A ⊗[R] A →ₗ[R] A :=\n TensorProduct.lift (mul R A)\n#align linear_map.mul' LinearMap.mul'\n\nvariable {A}\n\n/-- The multiplication on the left in a non-unital algebra is a linear map. -/\ndef mulLeft (a : A) : A →ₗ[R] A :=\n mul R A a\n#align linear_map.mul_left LinearMap.mulLeft\n\n/-- The multiplication on the right in an algebra is a linear map. -/\ndef mulRight (a : A) : A →ₗ[R] A :=\n (mul R A).flip a\n#align linear_map.mul_right LinearMap.mulRight\n\n/-- Simultaneous multiplication on the left and right is a linear map. -/\ndef mulLeftRight (ab : A × A) : A →ₗ[R] A :=\n (mulRight R ab.snd).comp (mulLeft R ab.fst)\n#align linear_map.mul_left_right LinearMap.mulLeftRight\n\n@[simp]\ntheorem mulLeft_toAddMonoidHom (a : A) : (mulLeft R a : A →+ A) = AddMonoidHom.mulLeft a :=\n rfl\n#align linear_map.mul_left_to_add_monoid_hom LinearMap.mulLeft_toAddMonoidHom\n\n@[simp]\ntheorem mulRight_toAddMonoidHom (a : A) : (mulRight R a : A →+ A) = AddMonoidHom.mulRight a :=\n rfl\n#align linear_map.mul_right_to_add_monoid_hom LinearMap.mulRight_toAddMonoidHom\n\nvariable {R}\n\n@[simp]\ntheorem mul_apply' (a b : A) : mul R A a b = a * b :=\n rfl\n#align linear_map.mul_apply' LinearMap.mul_apply'\n\n@[simp]\ntheorem mulLeft_apply (a b : A) : mulLeft R a b = a * b :=\n rfl\n#align linear_map.mul_left_apply LinearMap.mulLeft_apply\n\n@[simp]\ntheorem mulRight_apply (a b : A) : mulRight R a b = b * a :=\n rfl\n#align linear_map.mul_right_apply LinearMap.mulRight_apply\n\n@[simp]\ntheorem mulLeftRight_apply (a b x : A) : mulLeftRight R (a, b) x = a * x * b :=\n rfl\n#align linear_map.mul_left_right_apply LinearMap.mulLeftRight_apply\n\n@[simp]\ntheorem mul'_apply {a b : A} : mul' R A (a ⊗ₜ b) = a * b :=\n rfl\n#align linear_map.mul'_apply LinearMap.mul'_apply\n\n@[simp]\ntheorem mulLeft_zero_eq_zero : mulLeft R (0 : A) = 0 :=\n (mul R A).map_zero\n#align linear_map.mul_left_zero_eq_zero LinearMap.mulLeft_zero_eq_zero\n\n@[simp]\ntheorem mulRight_zero_eq_zero : mulRight R (0 : A) = 0 :=\n (mul R A).flip.map_zero\n#align linear_map.mul_right_zero_eq_zero LinearMap.mulRight_zero_eq_zero\n\nend NonUnitalNonAssoc\n\nsection NonUnital\n\nvariable (R A : Type*) [CommSemiring R] [NonUnitalSemiring A] [Module R A] [SMulCommClass R A A]\n [IsScalarTower R A A]\n\n/-- The multiplication in a non-unital algebra is a bilinear map.\n\nA weaker version of this for non-unital non-associative algebras exists as `LinearMap.mul`. -/\ndef _root_.NonUnitalAlgHom.lmul : A →ₙₐ[R] End R A :=\n { mul R A with\n map_mul' := by\n intro a b\n ext c\n exact mul_assoc a b c\n map_zero' := by\n ext a\n exact zero_mul a }\n#align non_unital_alg_hom.lmul NonUnitalAlgHom.lmul\n\nvariable {R A}\n\n@[simp]\ntheorem _root_.NonUnitalAlgHom.coe_lmul_eq_mul : ⇑(NonUnitalAlgHom.lmul R A) = mul R A :=\n rfl\n#align non_unital_alg_hom.coe_lmul_eq_mul NonUnitalAlgHom.coe_lmul_eq_mul\n\ntheorem commute_mulLeft_right (a b : A) : Commute (mulLeft R a) (mulRight R b) := by\n ext c\n exact (mul_assoc a c b).symm\n#align linear_map.commute_mul_left_right LinearMap.commute_mulLeft_right\n\n@[simp]\ntheorem mulLeft_mul (a b : A) : mulLeft R (a * b) = (mulLeft R a).comp (mulLeft R b) := by\n ext\n simp only [mulLeft_apply, comp_apply, mul_assoc]\n#align linear_map.mul_left_mul LinearMap.mulLeft_mul\n\n@[simp]\ntheorem mulRight_mul (a b : A) : mulRight R (a * b) = (mulRight R b).comp (mulRight R a) := by\n ext\n simp only [mulRight_apply, comp_apply, mul_assoc]\n#align linear_map.mul_right_mul LinearMap.mulRight_mul\n\nend NonUnital\n\nsection Semiring\n\nvariable (R A B : Type*) [CommSemiring R] [Semiring A] [Semiring B] [Algebra R A] [Algebra R B]\n\nvariable {R A B} in\n/-- A `LinearMap` preserves multiplication if pre- and post- composition with `LinearMap.mul` are\nequivalent. By converting the statement into an equality of `LinearMap`s, this lemma allows various\nspecialized `ext` lemmas about `→ₗ[R]` to then be applied.\n\nThis is the `LinearMap` version of `AddMonoidHom.map_mul_iff`. -/\ntheorem map_mul_iff (f : A →ₗ[R] B) :\n (∀ x y, f (x * y) = f x * f y) ↔\n (LinearMap.mul R A).compr₂ f = (LinearMap.mul R B ∘ₗ f).compl₂ f :=\n Iff.symm LinearMap.ext_iff₂\n\n/-- The multiplication in an algebra is an algebra homomorphism into the endomorphisms on\nthe algebra.\n\nA weaker version of this for non-unital algebras exists as `NonUnitalAlgHom.mul`. -/\ndef _root_.Algebra.lmul : A →ₐ[R] End R A :=\n { LinearMap.mul R A with\n map_one' := by\n ext a\n exact one_mul a\n map_mul' := by\n intro a b\n ext c\n exact mul_assoc a b c\n map_zero' := by\n ext a\n exact zero_mul a\n commutes' := by\n intro r\n ext a\n exact (Algebra.smul_def r a).symm }\n#align algebra.lmul Algebra.lmul\n\nvariable {R A}\n\n@[simp]\ntheorem _root_.Algebra.coe_lmul_eq_mul : ⇑(Algebra.lmul R A) = mul R A :=\n rfl\n#align algebra.coe_lmul_eq_mul Algebra.coe_lmul_eq_mul\n\ntheorem _root_.Algebra.lmul_injective : Function.Injective (Algebra.lmul R A) :=\n fun a₁ a₂ h ↦ by simpa using FunLike.congr_fun h 1\n\n@[simp]\ntheorem mulLeft_eq_zero_iff (a : A) : mulLeft R a = 0 ↔ a = 0 := by\n constructor <;> intro h\n -- porting note: had to supply `R` explicitly in `@mulLeft_apply` below\n · rw [← mul_one a, ← @mulLeft_apply R _ _ _ _ _ _ a 1, h, LinearMap.zero_apply]\n · rw [h]\n exact mulLeft_zero_eq_zero\n#align linear_map.mul_left_eq_zero_iff LinearMap.mulLeft_eq_zero_iff\n\n@[simp]\ntheorem mulRight_eq_zero_iff (a : A) : mulRight R a = 0 ↔ a = 0 := by\n constructor <;> intro h\n -- porting note: had to supply `R` explicitly in `@mulRight_apply` below\n · rw [← one_mul a, ← @mulRight_apply R _ _ _ _ _ _ a 1, h, LinearMap.zero_apply]\n · rw [h]\n exact mulRight_zero_eq_zero\n#align linear_map.mul_right_eq_zero_iff LinearMap.mulRight_eq_zero_iff\n\n@[simp]\ntheorem mulLeft_one : mulLeft R (1 : A) = LinearMap.id := by\n ext\n simp only [LinearMap.id_coe, one_mul, id.def, mulLeft_apply]\n#align linear_map.mul_left_one LinearMap.mulLeft_one\n\n@[simp]\ntheorem mulRight_one : mulRight R (1 : A) = LinearMap.id := by\n ext\n simp only [LinearMap.id_coe, mul_one, id.def, mulRight_apply]\n#align linear_map.mul_right_one LinearMap.mulRight_one\n\n@[simp]\ntheorem pow_mulLeft (a : A) (n : ℕ) : mulLeft R a ^ n = mulLeft R (a ^ n) := by\n simpa only [mulLeft, ← Algebra.coe_lmul_eq_mul] using ((Algebra.lmul R A).map_pow a n).symm\n#align linear_map.pow_mul_left LinearMap.pow_mulLeft\n\n@[simp]\ntheorem pow_mulRight (a : A) (n : ℕ) : mulRight R a ^ n = mulRight R (a ^ n) := by\n simp only [mulRight, ← Algebra.coe_lmul_eq_mul]\n exact\n LinearMap.coe_injective (((mulRight R a).coe_pow n).symm ▸ mul_right_iterate a n)\n#align linear_map.pow_mul_right LinearMap.pow_mulRight\n\nend Semiring\n\nsection Ring\n\nvariable {R A : Type*} [CommSemiring R] [Ring A] [Algebra R A]\n\ntheorem mulLeft_injective [NoZeroDivisors A] {x : A} (hx : x ≠ 0) :\n Function.Injective (mulLeft R x) := by\n ","nextTactic":"letI : Nontrivial A := ⟨⟨x, 0, hx⟩⟩","declUpToTactic":"theorem mulLeft_injective [NoZeroDivisors A] {x : A} (hx : x ≠ 0) :\n Function.Injective (mulLeft R x) := by\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Bilinear.249_0.cGBk1UxpwLhzgI8","decl":"theorem mulLeft_injective [NoZeroDivisors A] {x : A} (hx : x ≠ 0) :\n Function.Injective (mulLeft R x) "} -{"state":"R : Type u_1\nA : Type u_2\ninst✝³ : CommSemiring R\ninst✝² : Ring A\ninst✝¹ : Algebra R A\ninst✝ : NoZeroDivisors A\nx : A\nhx : x ≠ 0\nthis : Nontrivial A := { exists_pair_ne := Exists.intro x (Exists.intro 0 hx) }\n⊢ Function.Injective ⇑(mulLeft R x)","srcUpToTactic":"/-\nCopyright (c) 2018 Kenny Lau. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Kenny Lau, Yury Kudryashov\n-/\nimport Mathlib.Algebra.Algebra.Basic\nimport Mathlib.Algebra.Algebra.Equiv\nimport Mathlib.Algebra.Algebra.NonUnitalHom\nimport Mathlib.Algebra.GroupPower.IterateHom\nimport Mathlib.LinearAlgebra.TensorProduct\n\n#align_import algebra.algebra.bilinear from \"leanprover-community/mathlib\"@\"657df4339ae6ceada048c8a2980fb10e393143ec\"\n\n/-!\n# Facts about algebras involving bilinear maps and tensor products\n\nWe move a few basic statements about algebras out of `Algebra.Algebra.Basic`,\nin order to avoid importing `LinearAlgebra.BilinearMap` and\n`LinearAlgebra.TensorProduct` unnecessarily.\n-/\n\nopen TensorProduct Module\n\nnamespace LinearMap\n\nsection NonUnitalNonAssoc\n\nvariable (R A : Type*) [CommSemiring R] [NonUnitalNonAssocSemiring A] [Module R A]\n [SMulCommClass R A A] [IsScalarTower R A A]\n\n/-- The multiplication in a non-unital non-associative algebra is a bilinear map.\n\nA weaker version of this for semirings exists as `AddMonoidHom.mul`. -/\ndef mul : A →ₗ[R] A →ₗ[R] A :=\n LinearMap.mk₂ R (· * ·) add_mul smul_mul_assoc mul_add mul_smul_comm\n#align linear_map.mul LinearMap.mul\n\n/-- The multiplication map on a non-unital algebra, as an `R`-linear map from `A ⊗[R] A` to `A`. -/\nnoncomputable def mul' : A ⊗[R] A →ₗ[R] A :=\n TensorProduct.lift (mul R A)\n#align linear_map.mul' LinearMap.mul'\n\nvariable {A}\n\n/-- The multiplication on the left in a non-unital algebra is a linear map. -/\ndef mulLeft (a : A) : A →ₗ[R] A :=\n mul R A a\n#align linear_map.mul_left LinearMap.mulLeft\n\n/-- The multiplication on the right in an algebra is a linear map. -/\ndef mulRight (a : A) : A →ₗ[R] A :=\n (mul R A).flip a\n#align linear_map.mul_right LinearMap.mulRight\n\n/-- Simultaneous multiplication on the left and right is a linear map. -/\ndef mulLeftRight (ab : A × A) : A →ₗ[R] A :=\n (mulRight R ab.snd).comp (mulLeft R ab.fst)\n#align linear_map.mul_left_right LinearMap.mulLeftRight\n\n@[simp]\ntheorem mulLeft_toAddMonoidHom (a : A) : (mulLeft R a : A →+ A) = AddMonoidHom.mulLeft a :=\n rfl\n#align linear_map.mul_left_to_add_monoid_hom LinearMap.mulLeft_toAddMonoidHom\n\n@[simp]\ntheorem mulRight_toAddMonoidHom (a : A) : (mulRight R a : A →+ A) = AddMonoidHom.mulRight a :=\n rfl\n#align linear_map.mul_right_to_add_monoid_hom LinearMap.mulRight_toAddMonoidHom\n\nvariable {R}\n\n@[simp]\ntheorem mul_apply' (a b : A) : mul R A a b = a * b :=\n rfl\n#align linear_map.mul_apply' LinearMap.mul_apply'\n\n@[simp]\ntheorem mulLeft_apply (a b : A) : mulLeft R a b = a * b :=\n rfl\n#align linear_map.mul_left_apply LinearMap.mulLeft_apply\n\n@[simp]\ntheorem mulRight_apply (a b : A) : mulRight R a b = b * a :=\n rfl\n#align linear_map.mul_right_apply LinearMap.mulRight_apply\n\n@[simp]\ntheorem mulLeftRight_apply (a b x : A) : mulLeftRight R (a, b) x = a * x * b :=\n rfl\n#align linear_map.mul_left_right_apply LinearMap.mulLeftRight_apply\n\n@[simp]\ntheorem mul'_apply {a b : A} : mul' R A (a ⊗ₜ b) = a * b :=\n rfl\n#align linear_map.mul'_apply LinearMap.mul'_apply\n\n@[simp]\ntheorem mulLeft_zero_eq_zero : mulLeft R (0 : A) = 0 :=\n (mul R A).map_zero\n#align linear_map.mul_left_zero_eq_zero LinearMap.mulLeft_zero_eq_zero\n\n@[simp]\ntheorem mulRight_zero_eq_zero : mulRight R (0 : A) = 0 :=\n (mul R A).flip.map_zero\n#align linear_map.mul_right_zero_eq_zero LinearMap.mulRight_zero_eq_zero\n\nend NonUnitalNonAssoc\n\nsection NonUnital\n\nvariable (R A : Type*) [CommSemiring R] [NonUnitalSemiring A] [Module R A] [SMulCommClass R A A]\n [IsScalarTower R A A]\n\n/-- The multiplication in a non-unital algebra is a bilinear map.\n\nA weaker version of this for non-unital non-associative algebras exists as `LinearMap.mul`. -/\ndef _root_.NonUnitalAlgHom.lmul : A →ₙₐ[R] End R A :=\n { mul R A with\n map_mul' := by\n intro a b\n ext c\n exact mul_assoc a b c\n map_zero' := by\n ext a\n exact zero_mul a }\n#align non_unital_alg_hom.lmul NonUnitalAlgHom.lmul\n\nvariable {R A}\n\n@[simp]\ntheorem _root_.NonUnitalAlgHom.coe_lmul_eq_mul : ⇑(NonUnitalAlgHom.lmul R A) = mul R A :=\n rfl\n#align non_unital_alg_hom.coe_lmul_eq_mul NonUnitalAlgHom.coe_lmul_eq_mul\n\ntheorem commute_mulLeft_right (a b : A) : Commute (mulLeft R a) (mulRight R b) := by\n ext c\n exact (mul_assoc a c b).symm\n#align linear_map.commute_mul_left_right LinearMap.commute_mulLeft_right\n\n@[simp]\ntheorem mulLeft_mul (a b : A) : mulLeft R (a * b) = (mulLeft R a).comp (mulLeft R b) := by\n ext\n simp only [mulLeft_apply, comp_apply, mul_assoc]\n#align linear_map.mul_left_mul LinearMap.mulLeft_mul\n\n@[simp]\ntheorem mulRight_mul (a b : A) : mulRight R (a * b) = (mulRight R b).comp (mulRight R a) := by\n ext\n simp only [mulRight_apply, comp_apply, mul_assoc]\n#align linear_map.mul_right_mul LinearMap.mulRight_mul\n\nend NonUnital\n\nsection Semiring\n\nvariable (R A B : Type*) [CommSemiring R] [Semiring A] [Semiring B] [Algebra R A] [Algebra R B]\n\nvariable {R A B} in\n/-- A `LinearMap` preserves multiplication if pre- and post- composition with `LinearMap.mul` are\nequivalent. By converting the statement into an equality of `LinearMap`s, this lemma allows various\nspecialized `ext` lemmas about `→ₗ[R]` to then be applied.\n\nThis is the `LinearMap` version of `AddMonoidHom.map_mul_iff`. -/\ntheorem map_mul_iff (f : A →ₗ[R] B) :\n (∀ x y, f (x * y) = f x * f y) ↔\n (LinearMap.mul R A).compr₂ f = (LinearMap.mul R B ∘ₗ f).compl₂ f :=\n Iff.symm LinearMap.ext_iff₂\n\n/-- The multiplication in an algebra is an algebra homomorphism into the endomorphisms on\nthe algebra.\n\nA weaker version of this for non-unital algebras exists as `NonUnitalAlgHom.mul`. -/\ndef _root_.Algebra.lmul : A →ₐ[R] End R A :=\n { LinearMap.mul R A with\n map_one' := by\n ext a\n exact one_mul a\n map_mul' := by\n intro a b\n ext c\n exact mul_assoc a b c\n map_zero' := by\n ext a\n exact zero_mul a\n commutes' := by\n intro r\n ext a\n exact (Algebra.smul_def r a).symm }\n#align algebra.lmul Algebra.lmul\n\nvariable {R A}\n\n@[simp]\ntheorem _root_.Algebra.coe_lmul_eq_mul : ⇑(Algebra.lmul R A) = mul R A :=\n rfl\n#align algebra.coe_lmul_eq_mul Algebra.coe_lmul_eq_mul\n\ntheorem _root_.Algebra.lmul_injective : Function.Injective (Algebra.lmul R A) :=\n fun a₁ a₂ h ↦ by simpa using FunLike.congr_fun h 1\n\n@[simp]\ntheorem mulLeft_eq_zero_iff (a : A) : mulLeft R a = 0 ↔ a = 0 := by\n constructor <;> intro h\n -- porting note: had to supply `R` explicitly in `@mulLeft_apply` below\n · rw [← mul_one a, ← @mulLeft_apply R _ _ _ _ _ _ a 1, h, LinearMap.zero_apply]\n · rw [h]\n exact mulLeft_zero_eq_zero\n#align linear_map.mul_left_eq_zero_iff LinearMap.mulLeft_eq_zero_iff\n\n@[simp]\ntheorem mulRight_eq_zero_iff (a : A) : mulRight R a = 0 ↔ a = 0 := by\n constructor <;> intro h\n -- porting note: had to supply `R` explicitly in `@mulRight_apply` below\n · rw [← one_mul a, ← @mulRight_apply R _ _ _ _ _ _ a 1, h, LinearMap.zero_apply]\n · rw [h]\n exact mulRight_zero_eq_zero\n#align linear_map.mul_right_eq_zero_iff LinearMap.mulRight_eq_zero_iff\n\n@[simp]\ntheorem mulLeft_one : mulLeft R (1 : A) = LinearMap.id := by\n ext\n simp only [LinearMap.id_coe, one_mul, id.def, mulLeft_apply]\n#align linear_map.mul_left_one LinearMap.mulLeft_one\n\n@[simp]\ntheorem mulRight_one : mulRight R (1 : A) = LinearMap.id := by\n ext\n simp only [LinearMap.id_coe, mul_one, id.def, mulRight_apply]\n#align linear_map.mul_right_one LinearMap.mulRight_one\n\n@[simp]\ntheorem pow_mulLeft (a : A) (n : ℕ) : mulLeft R a ^ n = mulLeft R (a ^ n) := by\n simpa only [mulLeft, ← Algebra.coe_lmul_eq_mul] using ((Algebra.lmul R A).map_pow a n).symm\n#align linear_map.pow_mul_left LinearMap.pow_mulLeft\n\n@[simp]\ntheorem pow_mulRight (a : A) (n : ℕ) : mulRight R a ^ n = mulRight R (a ^ n) := by\n simp only [mulRight, ← Algebra.coe_lmul_eq_mul]\n exact\n LinearMap.coe_injective (((mulRight R a).coe_pow n).symm ▸ mul_right_iterate a n)\n#align linear_map.pow_mul_right LinearMap.pow_mulRight\n\nend Semiring\n\nsection Ring\n\nvariable {R A : Type*} [CommSemiring R] [Ring A] [Algebra R A]\n\ntheorem mulLeft_injective [NoZeroDivisors A] {x : A} (hx : x ≠ 0) :\n Function.Injective (mulLeft R x) := by\n letI : Nontrivial A := ⟨⟨x, 0, hx⟩⟩\n ","nextTactic":"letI := NoZeroDivisors.to_isDomain A","declUpToTactic":"theorem mulLeft_injective [NoZeroDivisors A] {x : A} (hx : x ≠ 0) :\n Function.Injective (mulLeft R x) := by\n letI : Nontrivial A := ⟨⟨x, 0, hx⟩⟩\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Bilinear.249_0.cGBk1UxpwLhzgI8","decl":"theorem mulLeft_injective [NoZeroDivisors A] {x : A} (hx : x ≠ 0) :\n Function.Injective (mulLeft R x) "} -{"state":"R : Type u_1\nA : Type u_2\ninst✝³ : CommSemiring R\ninst✝² : Ring A\ninst✝¹ : Algebra R A\ninst✝ : NoZeroDivisors A\nx : A\nhx : x ≠ 0\nthis✝ : Nontrivial A := { exists_pair_ne := Exists.intro x (Exists.intro 0 hx) }\nthis : IsDomain A := NoZeroDivisors.to_isDomain A\n⊢ Function.Injective ⇑(mulLeft R x)","srcUpToTactic":"/-\nCopyright (c) 2018 Kenny Lau. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Kenny Lau, Yury Kudryashov\n-/\nimport Mathlib.Algebra.Algebra.Basic\nimport Mathlib.Algebra.Algebra.Equiv\nimport Mathlib.Algebra.Algebra.NonUnitalHom\nimport Mathlib.Algebra.GroupPower.IterateHom\nimport Mathlib.LinearAlgebra.TensorProduct\n\n#align_import algebra.algebra.bilinear from \"leanprover-community/mathlib\"@\"657df4339ae6ceada048c8a2980fb10e393143ec\"\n\n/-!\n# Facts about algebras involving bilinear maps and tensor products\n\nWe move a few basic statements about algebras out of `Algebra.Algebra.Basic`,\nin order to avoid importing `LinearAlgebra.BilinearMap` and\n`LinearAlgebra.TensorProduct` unnecessarily.\n-/\n\nopen TensorProduct Module\n\nnamespace LinearMap\n\nsection NonUnitalNonAssoc\n\nvariable (R A : Type*) [CommSemiring R] [NonUnitalNonAssocSemiring A] [Module R A]\n [SMulCommClass R A A] [IsScalarTower R A A]\n\n/-- The multiplication in a non-unital non-associative algebra is a bilinear map.\n\nA weaker version of this for semirings exists as `AddMonoidHom.mul`. -/\ndef mul : A →ₗ[R] A →ₗ[R] A :=\n LinearMap.mk₂ R (· * ·) add_mul smul_mul_assoc mul_add mul_smul_comm\n#align linear_map.mul LinearMap.mul\n\n/-- The multiplication map on a non-unital algebra, as an `R`-linear map from `A ⊗[R] A` to `A`. -/\nnoncomputable def mul' : A ⊗[R] A →ₗ[R] A :=\n TensorProduct.lift (mul R A)\n#align linear_map.mul' LinearMap.mul'\n\nvariable {A}\n\n/-- The multiplication on the left in a non-unital algebra is a linear map. -/\ndef mulLeft (a : A) : A →ₗ[R] A :=\n mul R A a\n#align linear_map.mul_left LinearMap.mulLeft\n\n/-- The multiplication on the right in an algebra is a linear map. -/\ndef mulRight (a : A) : A →ₗ[R] A :=\n (mul R A).flip a\n#align linear_map.mul_right LinearMap.mulRight\n\n/-- Simultaneous multiplication on the left and right is a linear map. -/\ndef mulLeftRight (ab : A × A) : A →ₗ[R] A :=\n (mulRight R ab.snd).comp (mulLeft R ab.fst)\n#align linear_map.mul_left_right LinearMap.mulLeftRight\n\n@[simp]\ntheorem mulLeft_toAddMonoidHom (a : A) : (mulLeft R a : A →+ A) = AddMonoidHom.mulLeft a :=\n rfl\n#align linear_map.mul_left_to_add_monoid_hom LinearMap.mulLeft_toAddMonoidHom\n\n@[simp]\ntheorem mulRight_toAddMonoidHom (a : A) : (mulRight R a : A →+ A) = AddMonoidHom.mulRight a :=\n rfl\n#align linear_map.mul_right_to_add_monoid_hom LinearMap.mulRight_toAddMonoidHom\n\nvariable {R}\n\n@[simp]\ntheorem mul_apply' (a b : A) : mul R A a b = a * b :=\n rfl\n#align linear_map.mul_apply' LinearMap.mul_apply'\n\n@[simp]\ntheorem mulLeft_apply (a b : A) : mulLeft R a b = a * b :=\n rfl\n#align linear_map.mul_left_apply LinearMap.mulLeft_apply\n\n@[simp]\ntheorem mulRight_apply (a b : A) : mulRight R a b = b * a :=\n rfl\n#align linear_map.mul_right_apply LinearMap.mulRight_apply\n\n@[simp]\ntheorem mulLeftRight_apply (a b x : A) : mulLeftRight R (a, b) x = a * x * b :=\n rfl\n#align linear_map.mul_left_right_apply LinearMap.mulLeftRight_apply\n\n@[simp]\ntheorem mul'_apply {a b : A} : mul' R A (a ⊗ₜ b) = a * b :=\n rfl\n#align linear_map.mul'_apply LinearMap.mul'_apply\n\n@[simp]\ntheorem mulLeft_zero_eq_zero : mulLeft R (0 : A) = 0 :=\n (mul R A).map_zero\n#align linear_map.mul_left_zero_eq_zero LinearMap.mulLeft_zero_eq_zero\n\n@[simp]\ntheorem mulRight_zero_eq_zero : mulRight R (0 : A) = 0 :=\n (mul R A).flip.map_zero\n#align linear_map.mul_right_zero_eq_zero LinearMap.mulRight_zero_eq_zero\n\nend NonUnitalNonAssoc\n\nsection NonUnital\n\nvariable (R A : Type*) [CommSemiring R] [NonUnitalSemiring A] [Module R A] [SMulCommClass R A A]\n [IsScalarTower R A A]\n\n/-- The multiplication in a non-unital algebra is a bilinear map.\n\nA weaker version of this for non-unital non-associative algebras exists as `LinearMap.mul`. -/\ndef _root_.NonUnitalAlgHom.lmul : A →ₙₐ[R] End R A :=\n { mul R A with\n map_mul' := by\n intro a b\n ext c\n exact mul_assoc a b c\n map_zero' := by\n ext a\n exact zero_mul a }\n#align non_unital_alg_hom.lmul NonUnitalAlgHom.lmul\n\nvariable {R A}\n\n@[simp]\ntheorem _root_.NonUnitalAlgHom.coe_lmul_eq_mul : ⇑(NonUnitalAlgHom.lmul R A) = mul R A :=\n rfl\n#align non_unital_alg_hom.coe_lmul_eq_mul NonUnitalAlgHom.coe_lmul_eq_mul\n\ntheorem commute_mulLeft_right (a b : A) : Commute (mulLeft R a) (mulRight R b) := by\n ext c\n exact (mul_assoc a c b).symm\n#align linear_map.commute_mul_left_right LinearMap.commute_mulLeft_right\n\n@[simp]\ntheorem mulLeft_mul (a b : A) : mulLeft R (a * b) = (mulLeft R a).comp (mulLeft R b) := by\n ext\n simp only [mulLeft_apply, comp_apply, mul_assoc]\n#align linear_map.mul_left_mul LinearMap.mulLeft_mul\n\n@[simp]\ntheorem mulRight_mul (a b : A) : mulRight R (a * b) = (mulRight R b).comp (mulRight R a) := by\n ext\n simp only [mulRight_apply, comp_apply, mul_assoc]\n#align linear_map.mul_right_mul LinearMap.mulRight_mul\n\nend NonUnital\n\nsection Semiring\n\nvariable (R A B : Type*) [CommSemiring R] [Semiring A] [Semiring B] [Algebra R A] [Algebra R B]\n\nvariable {R A B} in\n/-- A `LinearMap` preserves multiplication if pre- and post- composition with `LinearMap.mul` are\nequivalent. By converting the statement into an equality of `LinearMap`s, this lemma allows various\nspecialized `ext` lemmas about `→ₗ[R]` to then be applied.\n\nThis is the `LinearMap` version of `AddMonoidHom.map_mul_iff`. -/\ntheorem map_mul_iff (f : A →ₗ[R] B) :\n (∀ x y, f (x * y) = f x * f y) ↔\n (LinearMap.mul R A).compr₂ f = (LinearMap.mul R B ∘ₗ f).compl₂ f :=\n Iff.symm LinearMap.ext_iff₂\n\n/-- The multiplication in an algebra is an algebra homomorphism into the endomorphisms on\nthe algebra.\n\nA weaker version of this for non-unital algebras exists as `NonUnitalAlgHom.mul`. -/\ndef _root_.Algebra.lmul : A →ₐ[R] End R A :=\n { LinearMap.mul R A with\n map_one' := by\n ext a\n exact one_mul a\n map_mul' := by\n intro a b\n ext c\n exact mul_assoc a b c\n map_zero' := by\n ext a\n exact zero_mul a\n commutes' := by\n intro r\n ext a\n exact (Algebra.smul_def r a).symm }\n#align algebra.lmul Algebra.lmul\n\nvariable {R A}\n\n@[simp]\ntheorem _root_.Algebra.coe_lmul_eq_mul : ⇑(Algebra.lmul R A) = mul R A :=\n rfl\n#align algebra.coe_lmul_eq_mul Algebra.coe_lmul_eq_mul\n\ntheorem _root_.Algebra.lmul_injective : Function.Injective (Algebra.lmul R A) :=\n fun a₁ a₂ h ↦ by simpa using FunLike.congr_fun h 1\n\n@[simp]\ntheorem mulLeft_eq_zero_iff (a : A) : mulLeft R a = 0 ↔ a = 0 := by\n constructor <;> intro h\n -- porting note: had to supply `R` explicitly in `@mulLeft_apply` below\n · rw [← mul_one a, ← @mulLeft_apply R _ _ _ _ _ _ a 1, h, LinearMap.zero_apply]\n · rw [h]\n exact mulLeft_zero_eq_zero\n#align linear_map.mul_left_eq_zero_iff LinearMap.mulLeft_eq_zero_iff\n\n@[simp]\ntheorem mulRight_eq_zero_iff (a : A) : mulRight R a = 0 ↔ a = 0 := by\n constructor <;> intro h\n -- porting note: had to supply `R` explicitly in `@mulRight_apply` below\n · rw [← one_mul a, ← @mulRight_apply R _ _ _ _ _ _ a 1, h, LinearMap.zero_apply]\n · rw [h]\n exact mulRight_zero_eq_zero\n#align linear_map.mul_right_eq_zero_iff LinearMap.mulRight_eq_zero_iff\n\n@[simp]\ntheorem mulLeft_one : mulLeft R (1 : A) = LinearMap.id := by\n ext\n simp only [LinearMap.id_coe, one_mul, id.def, mulLeft_apply]\n#align linear_map.mul_left_one LinearMap.mulLeft_one\n\n@[simp]\ntheorem mulRight_one : mulRight R (1 : A) = LinearMap.id := by\n ext\n simp only [LinearMap.id_coe, mul_one, id.def, mulRight_apply]\n#align linear_map.mul_right_one LinearMap.mulRight_one\n\n@[simp]\ntheorem pow_mulLeft (a : A) (n : ℕ) : mulLeft R a ^ n = mulLeft R (a ^ n) := by\n simpa only [mulLeft, ← Algebra.coe_lmul_eq_mul] using ((Algebra.lmul R A).map_pow a n).symm\n#align linear_map.pow_mul_left LinearMap.pow_mulLeft\n\n@[simp]\ntheorem pow_mulRight (a : A) (n : ℕ) : mulRight R a ^ n = mulRight R (a ^ n) := by\n simp only [mulRight, ← Algebra.coe_lmul_eq_mul]\n exact\n LinearMap.coe_injective (((mulRight R a).coe_pow n).symm ▸ mul_right_iterate a n)\n#align linear_map.pow_mul_right LinearMap.pow_mulRight\n\nend Semiring\n\nsection Ring\n\nvariable {R A : Type*} [CommSemiring R] [Ring A] [Algebra R A]\n\ntheorem mulLeft_injective [NoZeroDivisors A] {x : A} (hx : x ≠ 0) :\n Function.Injective (mulLeft R x) := by\n letI : Nontrivial A := ⟨⟨x, 0, hx⟩⟩\n letI := NoZeroDivisors.to_isDomain A\n ","nextTactic":"exact mul_right_injective₀ hx","declUpToTactic":"theorem mulLeft_injective [NoZeroDivisors A] {x : A} (hx : x ≠ 0) :\n Function.Injective (mulLeft R x) := by\n letI : Nontrivial A := ⟨⟨x, 0, hx⟩⟩\n letI := NoZeroDivisors.to_isDomain A\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Bilinear.249_0.cGBk1UxpwLhzgI8","decl":"theorem mulLeft_injective [NoZeroDivisors A] {x : A} (hx : x ≠ 0) :\n Function.Injective (mulLeft R x) "} -{"state":"R : Type u_1\nA : Type u_2\ninst✝³ : CommSemiring R\ninst✝² : Ring A\ninst✝¹ : Algebra R A\ninst✝ : NoZeroDivisors A\nx : A\nhx : x ≠ 0\n⊢ Function.Injective ⇑(mulRight R x)","srcUpToTactic":"/-\nCopyright (c) 2018 Kenny Lau. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Kenny Lau, Yury Kudryashov\n-/\nimport Mathlib.Algebra.Algebra.Basic\nimport Mathlib.Algebra.Algebra.Equiv\nimport Mathlib.Algebra.Algebra.NonUnitalHom\nimport Mathlib.Algebra.GroupPower.IterateHom\nimport Mathlib.LinearAlgebra.TensorProduct\n\n#align_import algebra.algebra.bilinear from \"leanprover-community/mathlib\"@\"657df4339ae6ceada048c8a2980fb10e393143ec\"\n\n/-!\n# Facts about algebras involving bilinear maps and tensor products\n\nWe move a few basic statements about algebras out of `Algebra.Algebra.Basic`,\nin order to avoid importing `LinearAlgebra.BilinearMap` and\n`LinearAlgebra.TensorProduct` unnecessarily.\n-/\n\nopen TensorProduct Module\n\nnamespace LinearMap\n\nsection NonUnitalNonAssoc\n\nvariable (R A : Type*) [CommSemiring R] [NonUnitalNonAssocSemiring A] [Module R A]\n [SMulCommClass R A A] [IsScalarTower R A A]\n\n/-- The multiplication in a non-unital non-associative algebra is a bilinear map.\n\nA weaker version of this for semirings exists as `AddMonoidHom.mul`. -/\ndef mul : A →ₗ[R] A →ₗ[R] A :=\n LinearMap.mk₂ R (· * ·) add_mul smul_mul_assoc mul_add mul_smul_comm\n#align linear_map.mul LinearMap.mul\n\n/-- The multiplication map on a non-unital algebra, as an `R`-linear map from `A ⊗[R] A` to `A`. -/\nnoncomputable def mul' : A ⊗[R] A →ₗ[R] A :=\n TensorProduct.lift (mul R A)\n#align linear_map.mul' LinearMap.mul'\n\nvariable {A}\n\n/-- The multiplication on the left in a non-unital algebra is a linear map. -/\ndef mulLeft (a : A) : A →ₗ[R] A :=\n mul R A a\n#align linear_map.mul_left LinearMap.mulLeft\n\n/-- The multiplication on the right in an algebra is a linear map. -/\ndef mulRight (a : A) : A →ₗ[R] A :=\n (mul R A).flip a\n#align linear_map.mul_right LinearMap.mulRight\n\n/-- Simultaneous multiplication on the left and right is a linear map. -/\ndef mulLeftRight (ab : A × A) : A →ₗ[R] A :=\n (mulRight R ab.snd).comp (mulLeft R ab.fst)\n#align linear_map.mul_left_right LinearMap.mulLeftRight\n\n@[simp]\ntheorem mulLeft_toAddMonoidHom (a : A) : (mulLeft R a : A →+ A) = AddMonoidHom.mulLeft a :=\n rfl\n#align linear_map.mul_left_to_add_monoid_hom LinearMap.mulLeft_toAddMonoidHom\n\n@[simp]\ntheorem mulRight_toAddMonoidHom (a : A) : (mulRight R a : A →+ A) = AddMonoidHom.mulRight a :=\n rfl\n#align linear_map.mul_right_to_add_monoid_hom LinearMap.mulRight_toAddMonoidHom\n\nvariable {R}\n\n@[simp]\ntheorem mul_apply' (a b : A) : mul R A a b = a * b :=\n rfl\n#align linear_map.mul_apply' LinearMap.mul_apply'\n\n@[simp]\ntheorem mulLeft_apply (a b : A) : mulLeft R a b = a * b :=\n rfl\n#align linear_map.mul_left_apply LinearMap.mulLeft_apply\n\n@[simp]\ntheorem mulRight_apply (a b : A) : mulRight R a b = b * a :=\n rfl\n#align linear_map.mul_right_apply LinearMap.mulRight_apply\n\n@[simp]\ntheorem mulLeftRight_apply (a b x : A) : mulLeftRight R (a, b) x = a * x * b :=\n rfl\n#align linear_map.mul_left_right_apply LinearMap.mulLeftRight_apply\n\n@[simp]\ntheorem mul'_apply {a b : A} : mul' R A (a ⊗ₜ b) = a * b :=\n rfl\n#align linear_map.mul'_apply LinearMap.mul'_apply\n\n@[simp]\ntheorem mulLeft_zero_eq_zero : mulLeft R (0 : A) = 0 :=\n (mul R A).map_zero\n#align linear_map.mul_left_zero_eq_zero LinearMap.mulLeft_zero_eq_zero\n\n@[simp]\ntheorem mulRight_zero_eq_zero : mulRight R (0 : A) = 0 :=\n (mul R A).flip.map_zero\n#align linear_map.mul_right_zero_eq_zero LinearMap.mulRight_zero_eq_zero\n\nend NonUnitalNonAssoc\n\nsection NonUnital\n\nvariable (R A : Type*) [CommSemiring R] [NonUnitalSemiring A] [Module R A] [SMulCommClass R A A]\n [IsScalarTower R A A]\n\n/-- The multiplication in a non-unital algebra is a bilinear map.\n\nA weaker version of this for non-unital non-associative algebras exists as `LinearMap.mul`. -/\ndef _root_.NonUnitalAlgHom.lmul : A →ₙₐ[R] End R A :=\n { mul R A with\n map_mul' := by\n intro a b\n ext c\n exact mul_assoc a b c\n map_zero' := by\n ext a\n exact zero_mul a }\n#align non_unital_alg_hom.lmul NonUnitalAlgHom.lmul\n\nvariable {R A}\n\n@[simp]\ntheorem _root_.NonUnitalAlgHom.coe_lmul_eq_mul : ⇑(NonUnitalAlgHom.lmul R A) = mul R A :=\n rfl\n#align non_unital_alg_hom.coe_lmul_eq_mul NonUnitalAlgHom.coe_lmul_eq_mul\n\ntheorem commute_mulLeft_right (a b : A) : Commute (mulLeft R a) (mulRight R b) := by\n ext c\n exact (mul_assoc a c b).symm\n#align linear_map.commute_mul_left_right LinearMap.commute_mulLeft_right\n\n@[simp]\ntheorem mulLeft_mul (a b : A) : mulLeft R (a * b) = (mulLeft R a).comp (mulLeft R b) := by\n ext\n simp only [mulLeft_apply, comp_apply, mul_assoc]\n#align linear_map.mul_left_mul LinearMap.mulLeft_mul\n\n@[simp]\ntheorem mulRight_mul (a b : A) : mulRight R (a * b) = (mulRight R b).comp (mulRight R a) := by\n ext\n simp only [mulRight_apply, comp_apply, mul_assoc]\n#align linear_map.mul_right_mul LinearMap.mulRight_mul\n\nend NonUnital\n\nsection Semiring\n\nvariable (R A B : Type*) [CommSemiring R] [Semiring A] [Semiring B] [Algebra R A] [Algebra R B]\n\nvariable {R A B} in\n/-- A `LinearMap` preserves multiplication if pre- and post- composition with `LinearMap.mul` are\nequivalent. By converting the statement into an equality of `LinearMap`s, this lemma allows various\nspecialized `ext` lemmas about `→ₗ[R]` to then be applied.\n\nThis is the `LinearMap` version of `AddMonoidHom.map_mul_iff`. -/\ntheorem map_mul_iff (f : A →ₗ[R] B) :\n (∀ x y, f (x * y) = f x * f y) ↔\n (LinearMap.mul R A).compr₂ f = (LinearMap.mul R B ∘ₗ f).compl₂ f :=\n Iff.symm LinearMap.ext_iff₂\n\n/-- The multiplication in an algebra is an algebra homomorphism into the endomorphisms on\nthe algebra.\n\nA weaker version of this for non-unital algebras exists as `NonUnitalAlgHom.mul`. -/\ndef _root_.Algebra.lmul : A →ₐ[R] End R A :=\n { LinearMap.mul R A with\n map_one' := by\n ext a\n exact one_mul a\n map_mul' := by\n intro a b\n ext c\n exact mul_assoc a b c\n map_zero' := by\n ext a\n exact zero_mul a\n commutes' := by\n intro r\n ext a\n exact (Algebra.smul_def r a).symm }\n#align algebra.lmul Algebra.lmul\n\nvariable {R A}\n\n@[simp]\ntheorem _root_.Algebra.coe_lmul_eq_mul : ⇑(Algebra.lmul R A) = mul R A :=\n rfl\n#align algebra.coe_lmul_eq_mul Algebra.coe_lmul_eq_mul\n\ntheorem _root_.Algebra.lmul_injective : Function.Injective (Algebra.lmul R A) :=\n fun a₁ a₂ h ↦ by simpa using FunLike.congr_fun h 1\n\n@[simp]\ntheorem mulLeft_eq_zero_iff (a : A) : mulLeft R a = 0 ↔ a = 0 := by\n constructor <;> intro h\n -- porting note: had to supply `R` explicitly in `@mulLeft_apply` below\n · rw [← mul_one a, ← @mulLeft_apply R _ _ _ _ _ _ a 1, h, LinearMap.zero_apply]\n · rw [h]\n exact mulLeft_zero_eq_zero\n#align linear_map.mul_left_eq_zero_iff LinearMap.mulLeft_eq_zero_iff\n\n@[simp]\ntheorem mulRight_eq_zero_iff (a : A) : mulRight R a = 0 ↔ a = 0 := by\n constructor <;> intro h\n -- porting note: had to supply `R` explicitly in `@mulRight_apply` below\n · rw [← one_mul a, ← @mulRight_apply R _ _ _ _ _ _ a 1, h, LinearMap.zero_apply]\n · rw [h]\n exact mulRight_zero_eq_zero\n#align linear_map.mul_right_eq_zero_iff LinearMap.mulRight_eq_zero_iff\n\n@[simp]\ntheorem mulLeft_one : mulLeft R (1 : A) = LinearMap.id := by\n ext\n simp only [LinearMap.id_coe, one_mul, id.def, mulLeft_apply]\n#align linear_map.mul_left_one LinearMap.mulLeft_one\n\n@[simp]\ntheorem mulRight_one : mulRight R (1 : A) = LinearMap.id := by\n ext\n simp only [LinearMap.id_coe, mul_one, id.def, mulRight_apply]\n#align linear_map.mul_right_one LinearMap.mulRight_one\n\n@[simp]\ntheorem pow_mulLeft (a : A) (n : ℕ) : mulLeft R a ^ n = mulLeft R (a ^ n) := by\n simpa only [mulLeft, ← Algebra.coe_lmul_eq_mul] using ((Algebra.lmul R A).map_pow a n).symm\n#align linear_map.pow_mul_left LinearMap.pow_mulLeft\n\n@[simp]\ntheorem pow_mulRight (a : A) (n : ℕ) : mulRight R a ^ n = mulRight R (a ^ n) := by\n simp only [mulRight, ← Algebra.coe_lmul_eq_mul]\n exact\n LinearMap.coe_injective (((mulRight R a).coe_pow n).symm ▸ mul_right_iterate a n)\n#align linear_map.pow_mul_right LinearMap.pow_mulRight\n\nend Semiring\n\nsection Ring\n\nvariable {R A : Type*} [CommSemiring R] [Ring A] [Algebra R A]\n\ntheorem mulLeft_injective [NoZeroDivisors A] {x : A} (hx : x ≠ 0) :\n Function.Injective (mulLeft R x) := by\n letI : Nontrivial A := ⟨⟨x, 0, hx⟩⟩\n letI := NoZeroDivisors.to_isDomain A\n exact mul_right_injective₀ hx\n#align linear_map.mul_left_injective LinearMap.mulLeft_injective\n\ntheorem mulRight_injective [NoZeroDivisors A] {x : A} (hx : x ≠ 0) :\n Function.Injective (mulRight R x) := by\n ","nextTactic":"letI : Nontrivial A := ⟨⟨x, 0, hx⟩⟩","declUpToTactic":"theorem mulRight_injective [NoZeroDivisors A] {x : A} (hx : x ≠ 0) :\n Function.Injective (mulRight R x) := by\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Bilinear.256_0.cGBk1UxpwLhzgI8","decl":"theorem mulRight_injective [NoZeroDivisors A] {x : A} (hx : x ≠ 0) :\n Function.Injective (mulRight R x) "} -{"state":"R : Type u_1\nA : Type u_2\ninst✝³ : CommSemiring R\ninst✝² : Ring A\ninst✝¹ : Algebra R A\ninst✝ : NoZeroDivisors A\nx : A\nhx : x ≠ 0\nthis : Nontrivial A := { exists_pair_ne := Exists.intro x (Exists.intro 0 hx) }\n⊢ Function.Injective ⇑(mulRight R x)","srcUpToTactic":"/-\nCopyright (c) 2018 Kenny Lau. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Kenny Lau, Yury Kudryashov\n-/\nimport Mathlib.Algebra.Algebra.Basic\nimport Mathlib.Algebra.Algebra.Equiv\nimport Mathlib.Algebra.Algebra.NonUnitalHom\nimport Mathlib.Algebra.GroupPower.IterateHom\nimport Mathlib.LinearAlgebra.TensorProduct\n\n#align_import algebra.algebra.bilinear from \"leanprover-community/mathlib\"@\"657df4339ae6ceada048c8a2980fb10e393143ec\"\n\n/-!\n# Facts about algebras involving bilinear maps and tensor products\n\nWe move a few basic statements about algebras out of `Algebra.Algebra.Basic`,\nin order to avoid importing `LinearAlgebra.BilinearMap` and\n`LinearAlgebra.TensorProduct` unnecessarily.\n-/\n\nopen TensorProduct Module\n\nnamespace LinearMap\n\nsection NonUnitalNonAssoc\n\nvariable (R A : Type*) [CommSemiring R] [NonUnitalNonAssocSemiring A] [Module R A]\n [SMulCommClass R A A] [IsScalarTower R A A]\n\n/-- The multiplication in a non-unital non-associative algebra is a bilinear map.\n\nA weaker version of this for semirings exists as `AddMonoidHom.mul`. -/\ndef mul : A →ₗ[R] A →ₗ[R] A :=\n LinearMap.mk₂ R (· * ·) add_mul smul_mul_assoc mul_add mul_smul_comm\n#align linear_map.mul LinearMap.mul\n\n/-- The multiplication map on a non-unital algebra, as an `R`-linear map from `A ⊗[R] A` to `A`. -/\nnoncomputable def mul' : A ⊗[R] A →ₗ[R] A :=\n TensorProduct.lift (mul R A)\n#align linear_map.mul' LinearMap.mul'\n\nvariable {A}\n\n/-- The multiplication on the left in a non-unital algebra is a linear map. -/\ndef mulLeft (a : A) : A →ₗ[R] A :=\n mul R A a\n#align linear_map.mul_left LinearMap.mulLeft\n\n/-- The multiplication on the right in an algebra is a linear map. -/\ndef mulRight (a : A) : A →ₗ[R] A :=\n (mul R A).flip a\n#align linear_map.mul_right LinearMap.mulRight\n\n/-- Simultaneous multiplication on the left and right is a linear map. -/\ndef mulLeftRight (ab : A × A) : A →ₗ[R] A :=\n (mulRight R ab.snd).comp (mulLeft R ab.fst)\n#align linear_map.mul_left_right LinearMap.mulLeftRight\n\n@[simp]\ntheorem mulLeft_toAddMonoidHom (a : A) : (mulLeft R a : A →+ A) = AddMonoidHom.mulLeft a :=\n rfl\n#align linear_map.mul_left_to_add_monoid_hom LinearMap.mulLeft_toAddMonoidHom\n\n@[simp]\ntheorem mulRight_toAddMonoidHom (a : A) : (mulRight R a : A →+ A) = AddMonoidHom.mulRight a :=\n rfl\n#align linear_map.mul_right_to_add_monoid_hom LinearMap.mulRight_toAddMonoidHom\n\nvariable {R}\n\n@[simp]\ntheorem mul_apply' (a b : A) : mul R A a b = a * b :=\n rfl\n#align linear_map.mul_apply' LinearMap.mul_apply'\n\n@[simp]\ntheorem mulLeft_apply (a b : A) : mulLeft R a b = a * b :=\n rfl\n#align linear_map.mul_left_apply LinearMap.mulLeft_apply\n\n@[simp]\ntheorem mulRight_apply (a b : A) : mulRight R a b = b * a :=\n rfl\n#align linear_map.mul_right_apply LinearMap.mulRight_apply\n\n@[simp]\ntheorem mulLeftRight_apply (a b x : A) : mulLeftRight R (a, b) x = a * x * b :=\n rfl\n#align linear_map.mul_left_right_apply LinearMap.mulLeftRight_apply\n\n@[simp]\ntheorem mul'_apply {a b : A} : mul' R A (a ⊗ₜ b) = a * b :=\n rfl\n#align linear_map.mul'_apply LinearMap.mul'_apply\n\n@[simp]\ntheorem mulLeft_zero_eq_zero : mulLeft R (0 : A) = 0 :=\n (mul R A).map_zero\n#align linear_map.mul_left_zero_eq_zero LinearMap.mulLeft_zero_eq_zero\n\n@[simp]\ntheorem mulRight_zero_eq_zero : mulRight R (0 : A) = 0 :=\n (mul R A).flip.map_zero\n#align linear_map.mul_right_zero_eq_zero LinearMap.mulRight_zero_eq_zero\n\nend NonUnitalNonAssoc\n\nsection NonUnital\n\nvariable (R A : Type*) [CommSemiring R] [NonUnitalSemiring A] [Module R A] [SMulCommClass R A A]\n [IsScalarTower R A A]\n\n/-- The multiplication in a non-unital algebra is a bilinear map.\n\nA weaker version of this for non-unital non-associative algebras exists as `LinearMap.mul`. -/\ndef _root_.NonUnitalAlgHom.lmul : A →ₙₐ[R] End R A :=\n { mul R A with\n map_mul' := by\n intro a b\n ext c\n exact mul_assoc a b c\n map_zero' := by\n ext a\n exact zero_mul a }\n#align non_unital_alg_hom.lmul NonUnitalAlgHom.lmul\n\nvariable {R A}\n\n@[simp]\ntheorem _root_.NonUnitalAlgHom.coe_lmul_eq_mul : ⇑(NonUnitalAlgHom.lmul R A) = mul R A :=\n rfl\n#align non_unital_alg_hom.coe_lmul_eq_mul NonUnitalAlgHom.coe_lmul_eq_mul\n\ntheorem commute_mulLeft_right (a b : A) : Commute (mulLeft R a) (mulRight R b) := by\n ext c\n exact (mul_assoc a c b).symm\n#align linear_map.commute_mul_left_right LinearMap.commute_mulLeft_right\n\n@[simp]\ntheorem mulLeft_mul (a b : A) : mulLeft R (a * b) = (mulLeft R a).comp (mulLeft R b) := by\n ext\n simp only [mulLeft_apply, comp_apply, mul_assoc]\n#align linear_map.mul_left_mul LinearMap.mulLeft_mul\n\n@[simp]\ntheorem mulRight_mul (a b : A) : mulRight R (a * b) = (mulRight R b).comp (mulRight R a) := by\n ext\n simp only [mulRight_apply, comp_apply, mul_assoc]\n#align linear_map.mul_right_mul LinearMap.mulRight_mul\n\nend NonUnital\n\nsection Semiring\n\nvariable (R A B : Type*) [CommSemiring R] [Semiring A] [Semiring B] [Algebra R A] [Algebra R B]\n\nvariable {R A B} in\n/-- A `LinearMap` preserves multiplication if pre- and post- composition with `LinearMap.mul` are\nequivalent. By converting the statement into an equality of `LinearMap`s, this lemma allows various\nspecialized `ext` lemmas about `→ₗ[R]` to then be applied.\n\nThis is the `LinearMap` version of `AddMonoidHom.map_mul_iff`. -/\ntheorem map_mul_iff (f : A →ₗ[R] B) :\n (∀ x y, f (x * y) = f x * f y) ↔\n (LinearMap.mul R A).compr₂ f = (LinearMap.mul R B ∘ₗ f).compl₂ f :=\n Iff.symm LinearMap.ext_iff₂\n\n/-- The multiplication in an algebra is an algebra homomorphism into the endomorphisms on\nthe algebra.\n\nA weaker version of this for non-unital algebras exists as `NonUnitalAlgHom.mul`. -/\ndef _root_.Algebra.lmul : A →ₐ[R] End R A :=\n { LinearMap.mul R A with\n map_one' := by\n ext a\n exact one_mul a\n map_mul' := by\n intro a b\n ext c\n exact mul_assoc a b c\n map_zero' := by\n ext a\n exact zero_mul a\n commutes' := by\n intro r\n ext a\n exact (Algebra.smul_def r a).symm }\n#align algebra.lmul Algebra.lmul\n\nvariable {R A}\n\n@[simp]\ntheorem _root_.Algebra.coe_lmul_eq_mul : ⇑(Algebra.lmul R A) = mul R A :=\n rfl\n#align algebra.coe_lmul_eq_mul Algebra.coe_lmul_eq_mul\n\ntheorem _root_.Algebra.lmul_injective : Function.Injective (Algebra.lmul R A) :=\n fun a₁ a₂ h ↦ by simpa using FunLike.congr_fun h 1\n\n@[simp]\ntheorem mulLeft_eq_zero_iff (a : A) : mulLeft R a = 0 ↔ a = 0 := by\n constructor <;> intro h\n -- porting note: had to supply `R` explicitly in `@mulLeft_apply` below\n · rw [← mul_one a, ← @mulLeft_apply R _ _ _ _ _ _ a 1, h, LinearMap.zero_apply]\n · rw [h]\n exact mulLeft_zero_eq_zero\n#align linear_map.mul_left_eq_zero_iff LinearMap.mulLeft_eq_zero_iff\n\n@[simp]\ntheorem mulRight_eq_zero_iff (a : A) : mulRight R a = 0 ↔ a = 0 := by\n constructor <;> intro h\n -- porting note: had to supply `R` explicitly in `@mulRight_apply` below\n · rw [← one_mul a, ← @mulRight_apply R _ _ _ _ _ _ a 1, h, LinearMap.zero_apply]\n · rw [h]\n exact mulRight_zero_eq_zero\n#align linear_map.mul_right_eq_zero_iff LinearMap.mulRight_eq_zero_iff\n\n@[simp]\ntheorem mulLeft_one : mulLeft R (1 : A) = LinearMap.id := by\n ext\n simp only [LinearMap.id_coe, one_mul, id.def, mulLeft_apply]\n#align linear_map.mul_left_one LinearMap.mulLeft_one\n\n@[simp]\ntheorem mulRight_one : mulRight R (1 : A) = LinearMap.id := by\n ext\n simp only [LinearMap.id_coe, mul_one, id.def, mulRight_apply]\n#align linear_map.mul_right_one LinearMap.mulRight_one\n\n@[simp]\ntheorem pow_mulLeft (a : A) (n : ℕ) : mulLeft R a ^ n = mulLeft R (a ^ n) := by\n simpa only [mulLeft, ← Algebra.coe_lmul_eq_mul] using ((Algebra.lmul R A).map_pow a n).symm\n#align linear_map.pow_mul_left LinearMap.pow_mulLeft\n\n@[simp]\ntheorem pow_mulRight (a : A) (n : ℕ) : mulRight R a ^ n = mulRight R (a ^ n) := by\n simp only [mulRight, ← Algebra.coe_lmul_eq_mul]\n exact\n LinearMap.coe_injective (((mulRight R a).coe_pow n).symm ▸ mul_right_iterate a n)\n#align linear_map.pow_mul_right LinearMap.pow_mulRight\n\nend Semiring\n\nsection Ring\n\nvariable {R A : Type*} [CommSemiring R] [Ring A] [Algebra R A]\n\ntheorem mulLeft_injective [NoZeroDivisors A] {x : A} (hx : x ≠ 0) :\n Function.Injective (mulLeft R x) := by\n letI : Nontrivial A := ⟨⟨x, 0, hx⟩⟩\n letI := NoZeroDivisors.to_isDomain A\n exact mul_right_injective₀ hx\n#align linear_map.mul_left_injective LinearMap.mulLeft_injective\n\ntheorem mulRight_injective [NoZeroDivisors A] {x : A} (hx : x ≠ 0) :\n Function.Injective (mulRight R x) := by\n letI : Nontrivial A := ⟨⟨x, 0, hx⟩⟩\n ","nextTactic":"letI := NoZeroDivisors.to_isDomain A","declUpToTactic":"theorem mulRight_injective [NoZeroDivisors A] {x : A} (hx : x ≠ 0) :\n Function.Injective (mulRight R x) := by\n letI : Nontrivial A := ⟨⟨x, 0, hx⟩⟩\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Bilinear.256_0.cGBk1UxpwLhzgI8","decl":"theorem mulRight_injective [NoZeroDivisors A] {x : A} (hx : x ≠ 0) :\n Function.Injective (mulRight R x) "} -{"state":"R : Type u_1\nA : Type u_2\ninst✝³ : CommSemiring R\ninst✝² : Ring A\ninst✝¹ : Algebra R A\ninst✝ : NoZeroDivisors A\nx : A\nhx : x ≠ 0\nthis✝ : Nontrivial A := { exists_pair_ne := Exists.intro x (Exists.intro 0 hx) }\nthis : IsDomain A := NoZeroDivisors.to_isDomain A\n⊢ Function.Injective ⇑(mulRight R x)","srcUpToTactic":"/-\nCopyright (c) 2018 Kenny Lau. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Kenny Lau, Yury Kudryashov\n-/\nimport Mathlib.Algebra.Algebra.Basic\nimport Mathlib.Algebra.Algebra.Equiv\nimport Mathlib.Algebra.Algebra.NonUnitalHom\nimport Mathlib.Algebra.GroupPower.IterateHom\nimport Mathlib.LinearAlgebra.TensorProduct\n\n#align_import algebra.algebra.bilinear from \"leanprover-community/mathlib\"@\"657df4339ae6ceada048c8a2980fb10e393143ec\"\n\n/-!\n# Facts about algebras involving bilinear maps and tensor products\n\nWe move a few basic statements about algebras out of `Algebra.Algebra.Basic`,\nin order to avoid importing `LinearAlgebra.BilinearMap` and\n`LinearAlgebra.TensorProduct` unnecessarily.\n-/\n\nopen TensorProduct Module\n\nnamespace LinearMap\n\nsection NonUnitalNonAssoc\n\nvariable (R A : Type*) [CommSemiring R] [NonUnitalNonAssocSemiring A] [Module R A]\n [SMulCommClass R A A] [IsScalarTower R A A]\n\n/-- The multiplication in a non-unital non-associative algebra is a bilinear map.\n\nA weaker version of this for semirings exists as `AddMonoidHom.mul`. -/\ndef mul : A →ₗ[R] A →ₗ[R] A :=\n LinearMap.mk₂ R (· * ·) add_mul smul_mul_assoc mul_add mul_smul_comm\n#align linear_map.mul LinearMap.mul\n\n/-- The multiplication map on a non-unital algebra, as an `R`-linear map from `A ⊗[R] A` to `A`. -/\nnoncomputable def mul' : A ⊗[R] A →ₗ[R] A :=\n TensorProduct.lift (mul R A)\n#align linear_map.mul' LinearMap.mul'\n\nvariable {A}\n\n/-- The multiplication on the left in a non-unital algebra is a linear map. -/\ndef mulLeft (a : A) : A →ₗ[R] A :=\n mul R A a\n#align linear_map.mul_left LinearMap.mulLeft\n\n/-- The multiplication on the right in an algebra is a linear map. -/\ndef mulRight (a : A) : A →ₗ[R] A :=\n (mul R A).flip a\n#align linear_map.mul_right LinearMap.mulRight\n\n/-- Simultaneous multiplication on the left and right is a linear map. -/\ndef mulLeftRight (ab : A × A) : A →ₗ[R] A :=\n (mulRight R ab.snd).comp (mulLeft R ab.fst)\n#align linear_map.mul_left_right LinearMap.mulLeftRight\n\n@[simp]\ntheorem mulLeft_toAddMonoidHom (a : A) : (mulLeft R a : A →+ A) = AddMonoidHom.mulLeft a :=\n rfl\n#align linear_map.mul_left_to_add_monoid_hom LinearMap.mulLeft_toAddMonoidHom\n\n@[simp]\ntheorem mulRight_toAddMonoidHom (a : A) : (mulRight R a : A →+ A) = AddMonoidHom.mulRight a :=\n rfl\n#align linear_map.mul_right_to_add_monoid_hom LinearMap.mulRight_toAddMonoidHom\n\nvariable {R}\n\n@[simp]\ntheorem mul_apply' (a b : A) : mul R A a b = a * b :=\n rfl\n#align linear_map.mul_apply' LinearMap.mul_apply'\n\n@[simp]\ntheorem mulLeft_apply (a b : A) : mulLeft R a b = a * b :=\n rfl\n#align linear_map.mul_left_apply LinearMap.mulLeft_apply\n\n@[simp]\ntheorem mulRight_apply (a b : A) : mulRight R a b = b * a :=\n rfl\n#align linear_map.mul_right_apply LinearMap.mulRight_apply\n\n@[simp]\ntheorem mulLeftRight_apply (a b x : A) : mulLeftRight R (a, b) x = a * x * b :=\n rfl\n#align linear_map.mul_left_right_apply LinearMap.mulLeftRight_apply\n\n@[simp]\ntheorem mul'_apply {a b : A} : mul' R A (a ⊗ₜ b) = a * b :=\n rfl\n#align linear_map.mul'_apply LinearMap.mul'_apply\n\n@[simp]\ntheorem mulLeft_zero_eq_zero : mulLeft R (0 : A) = 0 :=\n (mul R A).map_zero\n#align linear_map.mul_left_zero_eq_zero LinearMap.mulLeft_zero_eq_zero\n\n@[simp]\ntheorem mulRight_zero_eq_zero : mulRight R (0 : A) = 0 :=\n (mul R A).flip.map_zero\n#align linear_map.mul_right_zero_eq_zero LinearMap.mulRight_zero_eq_zero\n\nend NonUnitalNonAssoc\n\nsection NonUnital\n\nvariable (R A : Type*) [CommSemiring R] [NonUnitalSemiring A] [Module R A] [SMulCommClass R A A]\n [IsScalarTower R A A]\n\n/-- The multiplication in a non-unital algebra is a bilinear map.\n\nA weaker version of this for non-unital non-associative algebras exists as `LinearMap.mul`. -/\ndef _root_.NonUnitalAlgHom.lmul : A →ₙₐ[R] End R A :=\n { mul R A with\n map_mul' := by\n intro a b\n ext c\n exact mul_assoc a b c\n map_zero' := by\n ext a\n exact zero_mul a }\n#align non_unital_alg_hom.lmul NonUnitalAlgHom.lmul\n\nvariable {R A}\n\n@[simp]\ntheorem _root_.NonUnitalAlgHom.coe_lmul_eq_mul : ⇑(NonUnitalAlgHom.lmul R A) = mul R A :=\n rfl\n#align non_unital_alg_hom.coe_lmul_eq_mul NonUnitalAlgHom.coe_lmul_eq_mul\n\ntheorem commute_mulLeft_right (a b : A) : Commute (mulLeft R a) (mulRight R b) := by\n ext c\n exact (mul_assoc a c b).symm\n#align linear_map.commute_mul_left_right LinearMap.commute_mulLeft_right\n\n@[simp]\ntheorem mulLeft_mul (a b : A) : mulLeft R (a * b) = (mulLeft R a).comp (mulLeft R b) := by\n ext\n simp only [mulLeft_apply, comp_apply, mul_assoc]\n#align linear_map.mul_left_mul LinearMap.mulLeft_mul\n\n@[simp]\ntheorem mulRight_mul (a b : A) : mulRight R (a * b) = (mulRight R b).comp (mulRight R a) := by\n ext\n simp only [mulRight_apply, comp_apply, mul_assoc]\n#align linear_map.mul_right_mul LinearMap.mulRight_mul\n\nend NonUnital\n\nsection Semiring\n\nvariable (R A B : Type*) [CommSemiring R] [Semiring A] [Semiring B] [Algebra R A] [Algebra R B]\n\nvariable {R A B} in\n/-- A `LinearMap` preserves multiplication if pre- and post- composition with `LinearMap.mul` are\nequivalent. By converting the statement into an equality of `LinearMap`s, this lemma allows various\nspecialized `ext` lemmas about `→ₗ[R]` to then be applied.\n\nThis is the `LinearMap` version of `AddMonoidHom.map_mul_iff`. -/\ntheorem map_mul_iff (f : A →ₗ[R] B) :\n (∀ x y, f (x * y) = f x * f y) ↔\n (LinearMap.mul R A).compr₂ f = (LinearMap.mul R B ∘ₗ f).compl₂ f :=\n Iff.symm LinearMap.ext_iff₂\n\n/-- The multiplication in an algebra is an algebra homomorphism into the endomorphisms on\nthe algebra.\n\nA weaker version of this for non-unital algebras exists as `NonUnitalAlgHom.mul`. -/\ndef _root_.Algebra.lmul : A →ₐ[R] End R A :=\n { LinearMap.mul R A with\n map_one' := by\n ext a\n exact one_mul a\n map_mul' := by\n intro a b\n ext c\n exact mul_assoc a b c\n map_zero' := by\n ext a\n exact zero_mul a\n commutes' := by\n intro r\n ext a\n exact (Algebra.smul_def r a).symm }\n#align algebra.lmul Algebra.lmul\n\nvariable {R A}\n\n@[simp]\ntheorem _root_.Algebra.coe_lmul_eq_mul : ⇑(Algebra.lmul R A) = mul R A :=\n rfl\n#align algebra.coe_lmul_eq_mul Algebra.coe_lmul_eq_mul\n\ntheorem _root_.Algebra.lmul_injective : Function.Injective (Algebra.lmul R A) :=\n fun a₁ a₂ h ↦ by simpa using FunLike.congr_fun h 1\n\n@[simp]\ntheorem mulLeft_eq_zero_iff (a : A) : mulLeft R a = 0 ↔ a = 0 := by\n constructor <;> intro h\n -- porting note: had to supply `R` explicitly in `@mulLeft_apply` below\n · rw [← mul_one a, ← @mulLeft_apply R _ _ _ _ _ _ a 1, h, LinearMap.zero_apply]\n · rw [h]\n exact mulLeft_zero_eq_zero\n#align linear_map.mul_left_eq_zero_iff LinearMap.mulLeft_eq_zero_iff\n\n@[simp]\ntheorem mulRight_eq_zero_iff (a : A) : mulRight R a = 0 ↔ a = 0 := by\n constructor <;> intro h\n -- porting note: had to supply `R` explicitly in `@mulRight_apply` below\n · rw [← one_mul a, ← @mulRight_apply R _ _ _ _ _ _ a 1, h, LinearMap.zero_apply]\n · rw [h]\n exact mulRight_zero_eq_zero\n#align linear_map.mul_right_eq_zero_iff LinearMap.mulRight_eq_zero_iff\n\n@[simp]\ntheorem mulLeft_one : mulLeft R (1 : A) = LinearMap.id := by\n ext\n simp only [LinearMap.id_coe, one_mul, id.def, mulLeft_apply]\n#align linear_map.mul_left_one LinearMap.mulLeft_one\n\n@[simp]\ntheorem mulRight_one : mulRight R (1 : A) = LinearMap.id := by\n ext\n simp only [LinearMap.id_coe, mul_one, id.def, mulRight_apply]\n#align linear_map.mul_right_one LinearMap.mulRight_one\n\n@[simp]\ntheorem pow_mulLeft (a : A) (n : ℕ) : mulLeft R a ^ n = mulLeft R (a ^ n) := by\n simpa only [mulLeft, ← Algebra.coe_lmul_eq_mul] using ((Algebra.lmul R A).map_pow a n).symm\n#align linear_map.pow_mul_left LinearMap.pow_mulLeft\n\n@[simp]\ntheorem pow_mulRight (a : A) (n : ℕ) : mulRight R a ^ n = mulRight R (a ^ n) := by\n simp only [mulRight, ← Algebra.coe_lmul_eq_mul]\n exact\n LinearMap.coe_injective (((mulRight R a).coe_pow n).symm ▸ mul_right_iterate a n)\n#align linear_map.pow_mul_right LinearMap.pow_mulRight\n\nend Semiring\n\nsection Ring\n\nvariable {R A : Type*} [CommSemiring R] [Ring A] [Algebra R A]\n\ntheorem mulLeft_injective [NoZeroDivisors A] {x : A} (hx : x ≠ 0) :\n Function.Injective (mulLeft R x) := by\n letI : Nontrivial A := ⟨⟨x, 0, hx⟩⟩\n letI := NoZeroDivisors.to_isDomain A\n exact mul_right_injective₀ hx\n#align linear_map.mul_left_injective LinearMap.mulLeft_injective\n\ntheorem mulRight_injective [NoZeroDivisors A] {x : A} (hx : x ≠ 0) :\n Function.Injective (mulRight R x) := by\n letI : Nontrivial A := ⟨⟨x, 0, hx⟩⟩\n letI := NoZeroDivisors.to_isDomain A\n ","nextTactic":"exact mul_left_injective₀ hx","declUpToTactic":"theorem mulRight_injective [NoZeroDivisors A] {x : A} (hx : x ≠ 0) :\n Function.Injective (mulRight R x) := by\n letI : Nontrivial A := ⟨⟨x, 0, hx⟩⟩\n letI := NoZeroDivisors.to_isDomain A\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Bilinear.256_0.cGBk1UxpwLhzgI8","decl":"theorem mulRight_injective [NoZeroDivisors A] {x : A} (hx : x ≠ 0) :\n Function.Injective (mulRight R x) "} -{"state":"R : Type u_1\nA : Type u_2\ninst✝³ : CommSemiring R\ninst✝² : Ring A\ninst✝¹ : Algebra R A\ninst✝ : NoZeroDivisors A\nx : A\nhx : x ≠ 0\n⊢ Function.Injective ⇑((mul R A) x)","srcUpToTactic":"/-\nCopyright (c) 2018 Kenny Lau. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Kenny Lau, Yury Kudryashov\n-/\nimport Mathlib.Algebra.Algebra.Basic\nimport Mathlib.Algebra.Algebra.Equiv\nimport Mathlib.Algebra.Algebra.NonUnitalHom\nimport Mathlib.Algebra.GroupPower.IterateHom\nimport Mathlib.LinearAlgebra.TensorProduct\n\n#align_import algebra.algebra.bilinear from \"leanprover-community/mathlib\"@\"657df4339ae6ceada048c8a2980fb10e393143ec\"\n\n/-!\n# Facts about algebras involving bilinear maps and tensor products\n\nWe move a few basic statements about algebras out of `Algebra.Algebra.Basic`,\nin order to avoid importing `LinearAlgebra.BilinearMap` and\n`LinearAlgebra.TensorProduct` unnecessarily.\n-/\n\nopen TensorProduct Module\n\nnamespace LinearMap\n\nsection NonUnitalNonAssoc\n\nvariable (R A : Type*) [CommSemiring R] [NonUnitalNonAssocSemiring A] [Module R A]\n [SMulCommClass R A A] [IsScalarTower R A A]\n\n/-- The multiplication in a non-unital non-associative algebra is a bilinear map.\n\nA weaker version of this for semirings exists as `AddMonoidHom.mul`. -/\ndef mul : A →ₗ[R] A →ₗ[R] A :=\n LinearMap.mk₂ R (· * ·) add_mul smul_mul_assoc mul_add mul_smul_comm\n#align linear_map.mul LinearMap.mul\n\n/-- The multiplication map on a non-unital algebra, as an `R`-linear map from `A ⊗[R] A` to `A`. -/\nnoncomputable def mul' : A ⊗[R] A →ₗ[R] A :=\n TensorProduct.lift (mul R A)\n#align linear_map.mul' LinearMap.mul'\n\nvariable {A}\n\n/-- The multiplication on the left in a non-unital algebra is a linear map. -/\ndef mulLeft (a : A) : A →ₗ[R] A :=\n mul R A a\n#align linear_map.mul_left LinearMap.mulLeft\n\n/-- The multiplication on the right in an algebra is a linear map. -/\ndef mulRight (a : A) : A →ₗ[R] A :=\n (mul R A).flip a\n#align linear_map.mul_right LinearMap.mulRight\n\n/-- Simultaneous multiplication on the left and right is a linear map. -/\ndef mulLeftRight (ab : A × A) : A →ₗ[R] A :=\n (mulRight R ab.snd).comp (mulLeft R ab.fst)\n#align linear_map.mul_left_right LinearMap.mulLeftRight\n\n@[simp]\ntheorem mulLeft_toAddMonoidHom (a : A) : (mulLeft R a : A →+ A) = AddMonoidHom.mulLeft a :=\n rfl\n#align linear_map.mul_left_to_add_monoid_hom LinearMap.mulLeft_toAddMonoidHom\n\n@[simp]\ntheorem mulRight_toAddMonoidHom (a : A) : (mulRight R a : A →+ A) = AddMonoidHom.mulRight a :=\n rfl\n#align linear_map.mul_right_to_add_monoid_hom LinearMap.mulRight_toAddMonoidHom\n\nvariable {R}\n\n@[simp]\ntheorem mul_apply' (a b : A) : mul R A a b = a * b :=\n rfl\n#align linear_map.mul_apply' LinearMap.mul_apply'\n\n@[simp]\ntheorem mulLeft_apply (a b : A) : mulLeft R a b = a * b :=\n rfl\n#align linear_map.mul_left_apply LinearMap.mulLeft_apply\n\n@[simp]\ntheorem mulRight_apply (a b : A) : mulRight R a b = b * a :=\n rfl\n#align linear_map.mul_right_apply LinearMap.mulRight_apply\n\n@[simp]\ntheorem mulLeftRight_apply (a b x : A) : mulLeftRight R (a, b) x = a * x * b :=\n rfl\n#align linear_map.mul_left_right_apply LinearMap.mulLeftRight_apply\n\n@[simp]\ntheorem mul'_apply {a b : A} : mul' R A (a ⊗ₜ b) = a * b :=\n rfl\n#align linear_map.mul'_apply LinearMap.mul'_apply\n\n@[simp]\ntheorem mulLeft_zero_eq_zero : mulLeft R (0 : A) = 0 :=\n (mul R A).map_zero\n#align linear_map.mul_left_zero_eq_zero LinearMap.mulLeft_zero_eq_zero\n\n@[simp]\ntheorem mulRight_zero_eq_zero : mulRight R (0 : A) = 0 :=\n (mul R A).flip.map_zero\n#align linear_map.mul_right_zero_eq_zero LinearMap.mulRight_zero_eq_zero\n\nend NonUnitalNonAssoc\n\nsection NonUnital\n\nvariable (R A : Type*) [CommSemiring R] [NonUnitalSemiring A] [Module R A] [SMulCommClass R A A]\n [IsScalarTower R A A]\n\n/-- The multiplication in a non-unital algebra is a bilinear map.\n\nA weaker version of this for non-unital non-associative algebras exists as `LinearMap.mul`. -/\ndef _root_.NonUnitalAlgHom.lmul : A →ₙₐ[R] End R A :=\n { mul R A with\n map_mul' := by\n intro a b\n ext c\n exact mul_assoc a b c\n map_zero' := by\n ext a\n exact zero_mul a }\n#align non_unital_alg_hom.lmul NonUnitalAlgHom.lmul\n\nvariable {R A}\n\n@[simp]\ntheorem _root_.NonUnitalAlgHom.coe_lmul_eq_mul : ⇑(NonUnitalAlgHom.lmul R A) = mul R A :=\n rfl\n#align non_unital_alg_hom.coe_lmul_eq_mul NonUnitalAlgHom.coe_lmul_eq_mul\n\ntheorem commute_mulLeft_right (a b : A) : Commute (mulLeft R a) (mulRight R b) := by\n ext c\n exact (mul_assoc a c b).symm\n#align linear_map.commute_mul_left_right LinearMap.commute_mulLeft_right\n\n@[simp]\ntheorem mulLeft_mul (a b : A) : mulLeft R (a * b) = (mulLeft R a).comp (mulLeft R b) := by\n ext\n simp only [mulLeft_apply, comp_apply, mul_assoc]\n#align linear_map.mul_left_mul LinearMap.mulLeft_mul\n\n@[simp]\ntheorem mulRight_mul (a b : A) : mulRight R (a * b) = (mulRight R b).comp (mulRight R a) := by\n ext\n simp only [mulRight_apply, comp_apply, mul_assoc]\n#align linear_map.mul_right_mul LinearMap.mulRight_mul\n\nend NonUnital\n\nsection Semiring\n\nvariable (R A B : Type*) [CommSemiring R] [Semiring A] [Semiring B] [Algebra R A] [Algebra R B]\n\nvariable {R A B} in\n/-- A `LinearMap` preserves multiplication if pre- and post- composition with `LinearMap.mul` are\nequivalent. By converting the statement into an equality of `LinearMap`s, this lemma allows various\nspecialized `ext` lemmas about `→ₗ[R]` to then be applied.\n\nThis is the `LinearMap` version of `AddMonoidHom.map_mul_iff`. -/\ntheorem map_mul_iff (f : A →ₗ[R] B) :\n (∀ x y, f (x * y) = f x * f y) ↔\n (LinearMap.mul R A).compr₂ f = (LinearMap.mul R B ∘ₗ f).compl₂ f :=\n Iff.symm LinearMap.ext_iff₂\n\n/-- The multiplication in an algebra is an algebra homomorphism into the endomorphisms on\nthe algebra.\n\nA weaker version of this for non-unital algebras exists as `NonUnitalAlgHom.mul`. -/\ndef _root_.Algebra.lmul : A →ₐ[R] End R A :=\n { LinearMap.mul R A with\n map_one' := by\n ext a\n exact one_mul a\n map_mul' := by\n intro a b\n ext c\n exact mul_assoc a b c\n map_zero' := by\n ext a\n exact zero_mul a\n commutes' := by\n intro r\n ext a\n exact (Algebra.smul_def r a).symm }\n#align algebra.lmul Algebra.lmul\n\nvariable {R A}\n\n@[simp]\ntheorem _root_.Algebra.coe_lmul_eq_mul : ⇑(Algebra.lmul R A) = mul R A :=\n rfl\n#align algebra.coe_lmul_eq_mul Algebra.coe_lmul_eq_mul\n\ntheorem _root_.Algebra.lmul_injective : Function.Injective (Algebra.lmul R A) :=\n fun a₁ a₂ h ↦ by simpa using FunLike.congr_fun h 1\n\n@[simp]\ntheorem mulLeft_eq_zero_iff (a : A) : mulLeft R a = 0 ↔ a = 0 := by\n constructor <;> intro h\n -- porting note: had to supply `R` explicitly in `@mulLeft_apply` below\n · rw [← mul_one a, ← @mulLeft_apply R _ _ _ _ _ _ a 1, h, LinearMap.zero_apply]\n · rw [h]\n exact mulLeft_zero_eq_zero\n#align linear_map.mul_left_eq_zero_iff LinearMap.mulLeft_eq_zero_iff\n\n@[simp]\ntheorem mulRight_eq_zero_iff (a : A) : mulRight R a = 0 ↔ a = 0 := by\n constructor <;> intro h\n -- porting note: had to supply `R` explicitly in `@mulRight_apply` below\n · rw [← one_mul a, ← @mulRight_apply R _ _ _ _ _ _ a 1, h, LinearMap.zero_apply]\n · rw [h]\n exact mulRight_zero_eq_zero\n#align linear_map.mul_right_eq_zero_iff LinearMap.mulRight_eq_zero_iff\n\n@[simp]\ntheorem mulLeft_one : mulLeft R (1 : A) = LinearMap.id := by\n ext\n simp only [LinearMap.id_coe, one_mul, id.def, mulLeft_apply]\n#align linear_map.mul_left_one LinearMap.mulLeft_one\n\n@[simp]\ntheorem mulRight_one : mulRight R (1 : A) = LinearMap.id := by\n ext\n simp only [LinearMap.id_coe, mul_one, id.def, mulRight_apply]\n#align linear_map.mul_right_one LinearMap.mulRight_one\n\n@[simp]\ntheorem pow_mulLeft (a : A) (n : ℕ) : mulLeft R a ^ n = mulLeft R (a ^ n) := by\n simpa only [mulLeft, ← Algebra.coe_lmul_eq_mul] using ((Algebra.lmul R A).map_pow a n).symm\n#align linear_map.pow_mul_left LinearMap.pow_mulLeft\n\n@[simp]\ntheorem pow_mulRight (a : A) (n : ℕ) : mulRight R a ^ n = mulRight R (a ^ n) := by\n simp only [mulRight, ← Algebra.coe_lmul_eq_mul]\n exact\n LinearMap.coe_injective (((mulRight R a).coe_pow n).symm ▸ mul_right_iterate a n)\n#align linear_map.pow_mul_right LinearMap.pow_mulRight\n\nend Semiring\n\nsection Ring\n\nvariable {R A : Type*} [CommSemiring R] [Ring A] [Algebra R A]\n\ntheorem mulLeft_injective [NoZeroDivisors A] {x : A} (hx : x ≠ 0) :\n Function.Injective (mulLeft R x) := by\n letI : Nontrivial A := ⟨⟨x, 0, hx⟩⟩\n letI := NoZeroDivisors.to_isDomain A\n exact mul_right_injective₀ hx\n#align linear_map.mul_left_injective LinearMap.mulLeft_injective\n\ntheorem mulRight_injective [NoZeroDivisors A] {x : A} (hx : x ≠ 0) :\n Function.Injective (mulRight R x) := by\n letI : Nontrivial A := ⟨⟨x, 0, hx⟩⟩\n letI := NoZeroDivisors.to_isDomain A\n exact mul_left_injective₀ hx\n#align linear_map.mul_right_injective LinearMap.mulRight_injective\n\ntheorem mul_injective [NoZeroDivisors A] {x : A} (hx : x ≠ 0) : Function.Injective (mul R A x) := by\n ","nextTactic":"letI : Nontrivial A := ⟨⟨x, 0, hx⟩⟩","declUpToTactic":"theorem mul_injective [NoZeroDivisors A] {x : A} (hx : x ≠ 0) : Function.Injective (mul R A x) := by\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Bilinear.263_0.cGBk1UxpwLhzgI8","decl":"theorem mul_injective [NoZeroDivisors A] {x : A} (hx : x ≠ 0) : Function.Injective (mul R A x) "} -{"state":"R : Type u_1\nA : Type u_2\ninst✝³ : CommSemiring R\ninst✝² : Ring A\ninst✝¹ : Algebra R A\ninst✝ : NoZeroDivisors A\nx : A\nhx : x ≠ 0\nthis : Nontrivial A := { exists_pair_ne := Exists.intro x (Exists.intro 0 hx) }\n⊢ Function.Injective ⇑((mul R A) x)","srcUpToTactic":"/-\nCopyright (c) 2018 Kenny Lau. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Kenny Lau, Yury Kudryashov\n-/\nimport Mathlib.Algebra.Algebra.Basic\nimport Mathlib.Algebra.Algebra.Equiv\nimport Mathlib.Algebra.Algebra.NonUnitalHom\nimport Mathlib.Algebra.GroupPower.IterateHom\nimport Mathlib.LinearAlgebra.TensorProduct\n\n#align_import algebra.algebra.bilinear from \"leanprover-community/mathlib\"@\"657df4339ae6ceada048c8a2980fb10e393143ec\"\n\n/-!\n# Facts about algebras involving bilinear maps and tensor products\n\nWe move a few basic statements about algebras out of `Algebra.Algebra.Basic`,\nin order to avoid importing `LinearAlgebra.BilinearMap` and\n`LinearAlgebra.TensorProduct` unnecessarily.\n-/\n\nopen TensorProduct Module\n\nnamespace LinearMap\n\nsection NonUnitalNonAssoc\n\nvariable (R A : Type*) [CommSemiring R] [NonUnitalNonAssocSemiring A] [Module R A]\n [SMulCommClass R A A] [IsScalarTower R A A]\n\n/-- The multiplication in a non-unital non-associative algebra is a bilinear map.\n\nA weaker version of this for semirings exists as `AddMonoidHom.mul`. -/\ndef mul : A →ₗ[R] A →ₗ[R] A :=\n LinearMap.mk₂ R (· * ·) add_mul smul_mul_assoc mul_add mul_smul_comm\n#align linear_map.mul LinearMap.mul\n\n/-- The multiplication map on a non-unital algebra, as an `R`-linear map from `A ⊗[R] A` to `A`. -/\nnoncomputable def mul' : A ⊗[R] A →ₗ[R] A :=\n TensorProduct.lift (mul R A)\n#align linear_map.mul' LinearMap.mul'\n\nvariable {A}\n\n/-- The multiplication on the left in a non-unital algebra is a linear map. -/\ndef mulLeft (a : A) : A →ₗ[R] A :=\n mul R A a\n#align linear_map.mul_left LinearMap.mulLeft\n\n/-- The multiplication on the right in an algebra is a linear map. -/\ndef mulRight (a : A) : A →ₗ[R] A :=\n (mul R A).flip a\n#align linear_map.mul_right LinearMap.mulRight\n\n/-- Simultaneous multiplication on the left and right is a linear map. -/\ndef mulLeftRight (ab : A × A) : A →ₗ[R] A :=\n (mulRight R ab.snd).comp (mulLeft R ab.fst)\n#align linear_map.mul_left_right LinearMap.mulLeftRight\n\n@[simp]\ntheorem mulLeft_toAddMonoidHom (a : A) : (mulLeft R a : A →+ A) = AddMonoidHom.mulLeft a :=\n rfl\n#align linear_map.mul_left_to_add_monoid_hom LinearMap.mulLeft_toAddMonoidHom\n\n@[simp]\ntheorem mulRight_toAddMonoidHom (a : A) : (mulRight R a : A →+ A) = AddMonoidHom.mulRight a :=\n rfl\n#align linear_map.mul_right_to_add_monoid_hom LinearMap.mulRight_toAddMonoidHom\n\nvariable {R}\n\n@[simp]\ntheorem mul_apply' (a b : A) : mul R A a b = a * b :=\n rfl\n#align linear_map.mul_apply' LinearMap.mul_apply'\n\n@[simp]\ntheorem mulLeft_apply (a b : A) : mulLeft R a b = a * b :=\n rfl\n#align linear_map.mul_left_apply LinearMap.mulLeft_apply\n\n@[simp]\ntheorem mulRight_apply (a b : A) : mulRight R a b = b * a :=\n rfl\n#align linear_map.mul_right_apply LinearMap.mulRight_apply\n\n@[simp]\ntheorem mulLeftRight_apply (a b x : A) : mulLeftRight R (a, b) x = a * x * b :=\n rfl\n#align linear_map.mul_left_right_apply LinearMap.mulLeftRight_apply\n\n@[simp]\ntheorem mul'_apply {a b : A} : mul' R A (a ⊗ₜ b) = a * b :=\n rfl\n#align linear_map.mul'_apply LinearMap.mul'_apply\n\n@[simp]\ntheorem mulLeft_zero_eq_zero : mulLeft R (0 : A) = 0 :=\n (mul R A).map_zero\n#align linear_map.mul_left_zero_eq_zero LinearMap.mulLeft_zero_eq_zero\n\n@[simp]\ntheorem mulRight_zero_eq_zero : mulRight R (0 : A) = 0 :=\n (mul R A).flip.map_zero\n#align linear_map.mul_right_zero_eq_zero LinearMap.mulRight_zero_eq_zero\n\nend NonUnitalNonAssoc\n\nsection NonUnital\n\nvariable (R A : Type*) [CommSemiring R] [NonUnitalSemiring A] [Module R A] [SMulCommClass R A A]\n [IsScalarTower R A A]\n\n/-- The multiplication in a non-unital algebra is a bilinear map.\n\nA weaker version of this for non-unital non-associative algebras exists as `LinearMap.mul`. -/\ndef _root_.NonUnitalAlgHom.lmul : A →ₙₐ[R] End R A :=\n { mul R A with\n map_mul' := by\n intro a b\n ext c\n exact mul_assoc a b c\n map_zero' := by\n ext a\n exact zero_mul a }\n#align non_unital_alg_hom.lmul NonUnitalAlgHom.lmul\n\nvariable {R A}\n\n@[simp]\ntheorem _root_.NonUnitalAlgHom.coe_lmul_eq_mul : ⇑(NonUnitalAlgHom.lmul R A) = mul R A :=\n rfl\n#align non_unital_alg_hom.coe_lmul_eq_mul NonUnitalAlgHom.coe_lmul_eq_mul\n\ntheorem commute_mulLeft_right (a b : A) : Commute (mulLeft R a) (mulRight R b) := by\n ext c\n exact (mul_assoc a c b).symm\n#align linear_map.commute_mul_left_right LinearMap.commute_mulLeft_right\n\n@[simp]\ntheorem mulLeft_mul (a b : A) : mulLeft R (a * b) = (mulLeft R a).comp (mulLeft R b) := by\n ext\n simp only [mulLeft_apply, comp_apply, mul_assoc]\n#align linear_map.mul_left_mul LinearMap.mulLeft_mul\n\n@[simp]\ntheorem mulRight_mul (a b : A) : mulRight R (a * b) = (mulRight R b).comp (mulRight R a) := by\n ext\n simp only [mulRight_apply, comp_apply, mul_assoc]\n#align linear_map.mul_right_mul LinearMap.mulRight_mul\n\nend NonUnital\n\nsection Semiring\n\nvariable (R A B : Type*) [CommSemiring R] [Semiring A] [Semiring B] [Algebra R A] [Algebra R B]\n\nvariable {R A B} in\n/-- A `LinearMap` preserves multiplication if pre- and post- composition with `LinearMap.mul` are\nequivalent. By converting the statement into an equality of `LinearMap`s, this lemma allows various\nspecialized `ext` lemmas about `→ₗ[R]` to then be applied.\n\nThis is the `LinearMap` version of `AddMonoidHom.map_mul_iff`. -/\ntheorem map_mul_iff (f : A →ₗ[R] B) :\n (∀ x y, f (x * y) = f x * f y) ↔\n (LinearMap.mul R A).compr₂ f = (LinearMap.mul R B ∘ₗ f).compl₂ f :=\n Iff.symm LinearMap.ext_iff₂\n\n/-- The multiplication in an algebra is an algebra homomorphism into the endomorphisms on\nthe algebra.\n\nA weaker version of this for non-unital algebras exists as `NonUnitalAlgHom.mul`. -/\ndef _root_.Algebra.lmul : A →ₐ[R] End R A :=\n { LinearMap.mul R A with\n map_one' := by\n ext a\n exact one_mul a\n map_mul' := by\n intro a b\n ext c\n exact mul_assoc a b c\n map_zero' := by\n ext a\n exact zero_mul a\n commutes' := by\n intro r\n ext a\n exact (Algebra.smul_def r a).symm }\n#align algebra.lmul Algebra.lmul\n\nvariable {R A}\n\n@[simp]\ntheorem _root_.Algebra.coe_lmul_eq_mul : ⇑(Algebra.lmul R A) = mul R A :=\n rfl\n#align algebra.coe_lmul_eq_mul Algebra.coe_lmul_eq_mul\n\ntheorem _root_.Algebra.lmul_injective : Function.Injective (Algebra.lmul R A) :=\n fun a₁ a₂ h ↦ by simpa using FunLike.congr_fun h 1\n\n@[simp]\ntheorem mulLeft_eq_zero_iff (a : A) : mulLeft R a = 0 ↔ a = 0 := by\n constructor <;> intro h\n -- porting note: had to supply `R` explicitly in `@mulLeft_apply` below\n · rw [← mul_one a, ← @mulLeft_apply R _ _ _ _ _ _ a 1, h, LinearMap.zero_apply]\n · rw [h]\n exact mulLeft_zero_eq_zero\n#align linear_map.mul_left_eq_zero_iff LinearMap.mulLeft_eq_zero_iff\n\n@[simp]\ntheorem mulRight_eq_zero_iff (a : A) : mulRight R a = 0 ↔ a = 0 := by\n constructor <;> intro h\n -- porting note: had to supply `R` explicitly in `@mulRight_apply` below\n · rw [← one_mul a, ← @mulRight_apply R _ _ _ _ _ _ a 1, h, LinearMap.zero_apply]\n · rw [h]\n exact mulRight_zero_eq_zero\n#align linear_map.mul_right_eq_zero_iff LinearMap.mulRight_eq_zero_iff\n\n@[simp]\ntheorem mulLeft_one : mulLeft R (1 : A) = LinearMap.id := by\n ext\n simp only [LinearMap.id_coe, one_mul, id.def, mulLeft_apply]\n#align linear_map.mul_left_one LinearMap.mulLeft_one\n\n@[simp]\ntheorem mulRight_one : mulRight R (1 : A) = LinearMap.id := by\n ext\n simp only [LinearMap.id_coe, mul_one, id.def, mulRight_apply]\n#align linear_map.mul_right_one LinearMap.mulRight_one\n\n@[simp]\ntheorem pow_mulLeft (a : A) (n : ℕ) : mulLeft R a ^ n = mulLeft R (a ^ n) := by\n simpa only [mulLeft, ← Algebra.coe_lmul_eq_mul] using ((Algebra.lmul R A).map_pow a n).symm\n#align linear_map.pow_mul_left LinearMap.pow_mulLeft\n\n@[simp]\ntheorem pow_mulRight (a : A) (n : ℕ) : mulRight R a ^ n = mulRight R (a ^ n) := by\n simp only [mulRight, ← Algebra.coe_lmul_eq_mul]\n exact\n LinearMap.coe_injective (((mulRight R a).coe_pow n).symm ▸ mul_right_iterate a n)\n#align linear_map.pow_mul_right LinearMap.pow_mulRight\n\nend Semiring\n\nsection Ring\n\nvariable {R A : Type*} [CommSemiring R] [Ring A] [Algebra R A]\n\ntheorem mulLeft_injective [NoZeroDivisors A] {x : A} (hx : x ≠ 0) :\n Function.Injective (mulLeft R x) := by\n letI : Nontrivial A := ⟨⟨x, 0, hx⟩⟩\n letI := NoZeroDivisors.to_isDomain A\n exact mul_right_injective₀ hx\n#align linear_map.mul_left_injective LinearMap.mulLeft_injective\n\ntheorem mulRight_injective [NoZeroDivisors A] {x : A} (hx : x ≠ 0) :\n Function.Injective (mulRight R x) := by\n letI : Nontrivial A := ⟨⟨x, 0, hx⟩⟩\n letI := NoZeroDivisors.to_isDomain A\n exact mul_left_injective₀ hx\n#align linear_map.mul_right_injective LinearMap.mulRight_injective\n\ntheorem mul_injective [NoZeroDivisors A] {x : A} (hx : x ≠ 0) : Function.Injective (mul R A x) := by\n letI : Nontrivial A := ⟨⟨x, 0, hx⟩⟩\n ","nextTactic":"letI := NoZeroDivisors.to_isDomain A","declUpToTactic":"theorem mul_injective [NoZeroDivisors A] {x : A} (hx : x ≠ 0) : Function.Injective (mul R A x) := by\n letI : Nontrivial A := ⟨⟨x, 0, hx⟩⟩\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Bilinear.263_0.cGBk1UxpwLhzgI8","decl":"theorem mul_injective [NoZeroDivisors A] {x : A} (hx : x ≠ 0) : Function.Injective (mul R A x) "} -{"state":"R : Type u_1\nA : Type u_2\ninst✝³ : CommSemiring R\ninst✝² : Ring A\ninst✝¹ : Algebra R A\ninst✝ : NoZeroDivisors A\nx : A\nhx : x ≠ 0\nthis✝ : Nontrivial A := { exists_pair_ne := Exists.intro x (Exists.intro 0 hx) }\nthis : IsDomain A := NoZeroDivisors.to_isDomain A\n⊢ Function.Injective ⇑((mul R A) x)","srcUpToTactic":"/-\nCopyright (c) 2018 Kenny Lau. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Kenny Lau, Yury Kudryashov\n-/\nimport Mathlib.Algebra.Algebra.Basic\nimport Mathlib.Algebra.Algebra.Equiv\nimport Mathlib.Algebra.Algebra.NonUnitalHom\nimport Mathlib.Algebra.GroupPower.IterateHom\nimport Mathlib.LinearAlgebra.TensorProduct\n\n#align_import algebra.algebra.bilinear from \"leanprover-community/mathlib\"@\"657df4339ae6ceada048c8a2980fb10e393143ec\"\n\n/-!\n# Facts about algebras involving bilinear maps and tensor products\n\nWe move a few basic statements about algebras out of `Algebra.Algebra.Basic`,\nin order to avoid importing `LinearAlgebra.BilinearMap` and\n`LinearAlgebra.TensorProduct` unnecessarily.\n-/\n\nopen TensorProduct Module\n\nnamespace LinearMap\n\nsection NonUnitalNonAssoc\n\nvariable (R A : Type*) [CommSemiring R] [NonUnitalNonAssocSemiring A] [Module R A]\n [SMulCommClass R A A] [IsScalarTower R A A]\n\n/-- The multiplication in a non-unital non-associative algebra is a bilinear map.\n\nA weaker version of this for semirings exists as `AddMonoidHom.mul`. -/\ndef mul : A →ₗ[R] A →ₗ[R] A :=\n LinearMap.mk₂ R (· * ·) add_mul smul_mul_assoc mul_add mul_smul_comm\n#align linear_map.mul LinearMap.mul\n\n/-- The multiplication map on a non-unital algebra, as an `R`-linear map from `A ⊗[R] A` to `A`. -/\nnoncomputable def mul' : A ⊗[R] A →ₗ[R] A :=\n TensorProduct.lift (mul R A)\n#align linear_map.mul' LinearMap.mul'\n\nvariable {A}\n\n/-- The multiplication on the left in a non-unital algebra is a linear map. -/\ndef mulLeft (a : A) : A →ₗ[R] A :=\n mul R A a\n#align linear_map.mul_left LinearMap.mulLeft\n\n/-- The multiplication on the right in an algebra is a linear map. -/\ndef mulRight (a : A) : A →ₗ[R] A :=\n (mul R A).flip a\n#align linear_map.mul_right LinearMap.mulRight\n\n/-- Simultaneous multiplication on the left and right is a linear map. -/\ndef mulLeftRight (ab : A × A) : A →ₗ[R] A :=\n (mulRight R ab.snd).comp (mulLeft R ab.fst)\n#align linear_map.mul_left_right LinearMap.mulLeftRight\n\n@[simp]\ntheorem mulLeft_toAddMonoidHom (a : A) : (mulLeft R a : A →+ A) = AddMonoidHom.mulLeft a :=\n rfl\n#align linear_map.mul_left_to_add_monoid_hom LinearMap.mulLeft_toAddMonoidHom\n\n@[simp]\ntheorem mulRight_toAddMonoidHom (a : A) : (mulRight R a : A →+ A) = AddMonoidHom.mulRight a :=\n rfl\n#align linear_map.mul_right_to_add_monoid_hom LinearMap.mulRight_toAddMonoidHom\n\nvariable {R}\n\n@[simp]\ntheorem mul_apply' (a b : A) : mul R A a b = a * b :=\n rfl\n#align linear_map.mul_apply' LinearMap.mul_apply'\n\n@[simp]\ntheorem mulLeft_apply (a b : A) : mulLeft R a b = a * b :=\n rfl\n#align linear_map.mul_left_apply LinearMap.mulLeft_apply\n\n@[simp]\ntheorem mulRight_apply (a b : A) : mulRight R a b = b * a :=\n rfl\n#align linear_map.mul_right_apply LinearMap.mulRight_apply\n\n@[simp]\ntheorem mulLeftRight_apply (a b x : A) : mulLeftRight R (a, b) x = a * x * b :=\n rfl\n#align linear_map.mul_left_right_apply LinearMap.mulLeftRight_apply\n\n@[simp]\ntheorem mul'_apply {a b : A} : mul' R A (a ⊗ₜ b) = a * b :=\n rfl\n#align linear_map.mul'_apply LinearMap.mul'_apply\n\n@[simp]\ntheorem mulLeft_zero_eq_zero : mulLeft R (0 : A) = 0 :=\n (mul R A).map_zero\n#align linear_map.mul_left_zero_eq_zero LinearMap.mulLeft_zero_eq_zero\n\n@[simp]\ntheorem mulRight_zero_eq_zero : mulRight R (0 : A) = 0 :=\n (mul R A).flip.map_zero\n#align linear_map.mul_right_zero_eq_zero LinearMap.mulRight_zero_eq_zero\n\nend NonUnitalNonAssoc\n\nsection NonUnital\n\nvariable (R A : Type*) [CommSemiring R] [NonUnitalSemiring A] [Module R A] [SMulCommClass R A A]\n [IsScalarTower R A A]\n\n/-- The multiplication in a non-unital algebra is a bilinear map.\n\nA weaker version of this for non-unital non-associative algebras exists as `LinearMap.mul`. -/\ndef _root_.NonUnitalAlgHom.lmul : A →ₙₐ[R] End R A :=\n { mul R A with\n map_mul' := by\n intro a b\n ext c\n exact mul_assoc a b c\n map_zero' := by\n ext a\n exact zero_mul a }\n#align non_unital_alg_hom.lmul NonUnitalAlgHom.lmul\n\nvariable {R A}\n\n@[simp]\ntheorem _root_.NonUnitalAlgHom.coe_lmul_eq_mul : ⇑(NonUnitalAlgHom.lmul R A) = mul R A :=\n rfl\n#align non_unital_alg_hom.coe_lmul_eq_mul NonUnitalAlgHom.coe_lmul_eq_mul\n\ntheorem commute_mulLeft_right (a b : A) : Commute (mulLeft R a) (mulRight R b) := by\n ext c\n exact (mul_assoc a c b).symm\n#align linear_map.commute_mul_left_right LinearMap.commute_mulLeft_right\n\n@[simp]\ntheorem mulLeft_mul (a b : A) : mulLeft R (a * b) = (mulLeft R a).comp (mulLeft R b) := by\n ext\n simp only [mulLeft_apply, comp_apply, mul_assoc]\n#align linear_map.mul_left_mul LinearMap.mulLeft_mul\n\n@[simp]\ntheorem mulRight_mul (a b : A) : mulRight R (a * b) = (mulRight R b).comp (mulRight R a) := by\n ext\n simp only [mulRight_apply, comp_apply, mul_assoc]\n#align linear_map.mul_right_mul LinearMap.mulRight_mul\n\nend NonUnital\n\nsection Semiring\n\nvariable (R A B : Type*) [CommSemiring R] [Semiring A] [Semiring B] [Algebra R A] [Algebra R B]\n\nvariable {R A B} in\n/-- A `LinearMap` preserves multiplication if pre- and post- composition with `LinearMap.mul` are\nequivalent. By converting the statement into an equality of `LinearMap`s, this lemma allows various\nspecialized `ext` lemmas about `→ₗ[R]` to then be applied.\n\nThis is the `LinearMap` version of `AddMonoidHom.map_mul_iff`. -/\ntheorem map_mul_iff (f : A →ₗ[R] B) :\n (∀ x y, f (x * y) = f x * f y) ↔\n (LinearMap.mul R A).compr₂ f = (LinearMap.mul R B ∘ₗ f).compl₂ f :=\n Iff.symm LinearMap.ext_iff₂\n\n/-- The multiplication in an algebra is an algebra homomorphism into the endomorphisms on\nthe algebra.\n\nA weaker version of this for non-unital algebras exists as `NonUnitalAlgHom.mul`. -/\ndef _root_.Algebra.lmul : A →ₐ[R] End R A :=\n { LinearMap.mul R A with\n map_one' := by\n ext a\n exact one_mul a\n map_mul' := by\n intro a b\n ext c\n exact mul_assoc a b c\n map_zero' := by\n ext a\n exact zero_mul a\n commutes' := by\n intro r\n ext a\n exact (Algebra.smul_def r a).symm }\n#align algebra.lmul Algebra.lmul\n\nvariable {R A}\n\n@[simp]\ntheorem _root_.Algebra.coe_lmul_eq_mul : ⇑(Algebra.lmul R A) = mul R A :=\n rfl\n#align algebra.coe_lmul_eq_mul Algebra.coe_lmul_eq_mul\n\ntheorem _root_.Algebra.lmul_injective : Function.Injective (Algebra.lmul R A) :=\n fun a₁ a₂ h ↦ by simpa using FunLike.congr_fun h 1\n\n@[simp]\ntheorem mulLeft_eq_zero_iff (a : A) : mulLeft R a = 0 ↔ a = 0 := by\n constructor <;> intro h\n -- porting note: had to supply `R` explicitly in `@mulLeft_apply` below\n · rw [← mul_one a, ← @mulLeft_apply R _ _ _ _ _ _ a 1, h, LinearMap.zero_apply]\n · rw [h]\n exact mulLeft_zero_eq_zero\n#align linear_map.mul_left_eq_zero_iff LinearMap.mulLeft_eq_zero_iff\n\n@[simp]\ntheorem mulRight_eq_zero_iff (a : A) : mulRight R a = 0 ↔ a = 0 := by\n constructor <;> intro h\n -- porting note: had to supply `R` explicitly in `@mulRight_apply` below\n · rw [← one_mul a, ← @mulRight_apply R _ _ _ _ _ _ a 1, h, LinearMap.zero_apply]\n · rw [h]\n exact mulRight_zero_eq_zero\n#align linear_map.mul_right_eq_zero_iff LinearMap.mulRight_eq_zero_iff\n\n@[simp]\ntheorem mulLeft_one : mulLeft R (1 : A) = LinearMap.id := by\n ext\n simp only [LinearMap.id_coe, one_mul, id.def, mulLeft_apply]\n#align linear_map.mul_left_one LinearMap.mulLeft_one\n\n@[simp]\ntheorem mulRight_one : mulRight R (1 : A) = LinearMap.id := by\n ext\n simp only [LinearMap.id_coe, mul_one, id.def, mulRight_apply]\n#align linear_map.mul_right_one LinearMap.mulRight_one\n\n@[simp]\ntheorem pow_mulLeft (a : A) (n : ℕ) : mulLeft R a ^ n = mulLeft R (a ^ n) := by\n simpa only [mulLeft, ← Algebra.coe_lmul_eq_mul] using ((Algebra.lmul R A).map_pow a n).symm\n#align linear_map.pow_mul_left LinearMap.pow_mulLeft\n\n@[simp]\ntheorem pow_mulRight (a : A) (n : ℕ) : mulRight R a ^ n = mulRight R (a ^ n) := by\n simp only [mulRight, ← Algebra.coe_lmul_eq_mul]\n exact\n LinearMap.coe_injective (((mulRight R a).coe_pow n).symm ▸ mul_right_iterate a n)\n#align linear_map.pow_mul_right LinearMap.pow_mulRight\n\nend Semiring\n\nsection Ring\n\nvariable {R A : Type*} [CommSemiring R] [Ring A] [Algebra R A]\n\ntheorem mulLeft_injective [NoZeroDivisors A] {x : A} (hx : x ≠ 0) :\n Function.Injective (mulLeft R x) := by\n letI : Nontrivial A := ⟨⟨x, 0, hx⟩⟩\n letI := NoZeroDivisors.to_isDomain A\n exact mul_right_injective₀ hx\n#align linear_map.mul_left_injective LinearMap.mulLeft_injective\n\ntheorem mulRight_injective [NoZeroDivisors A] {x : A} (hx : x ≠ 0) :\n Function.Injective (mulRight R x) := by\n letI : Nontrivial A := ⟨⟨x, 0, hx⟩⟩\n letI := NoZeroDivisors.to_isDomain A\n exact mul_left_injective₀ hx\n#align linear_map.mul_right_injective LinearMap.mulRight_injective\n\ntheorem mul_injective [NoZeroDivisors A] {x : A} (hx : x ≠ 0) : Function.Injective (mul R A x) := by\n letI : Nontrivial A := ⟨⟨x, 0, hx⟩⟩\n letI := NoZeroDivisors.to_isDomain A\n ","nextTactic":"exact mul_right_injective₀ hx","declUpToTactic":"theorem mul_injective [NoZeroDivisors A] {x : A} (hx : x ≠ 0) : Function.Injective (mul R A x) := by\n letI : Nontrivial A := ⟨⟨x, 0, hx⟩⟩\n letI := NoZeroDivisors.to_isDomain A\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Bilinear.263_0.cGBk1UxpwLhzgI8","decl":"theorem mul_injective [NoZeroDivisors A] {x : A} (hx : x ≠ 0) : Function.Injective (mul R A x) "}