| {"completion":"by\n ext x\n simp\n\nvariable {M : Type*} [AddCommMonoid M] [Module R M]","context_contains_namespace":true,"context_suffix":"end NonUnitalNonAssoc\nend LinearMap","dependency_ids":["import:Mathlib.Algebra.Algebra.NonUnitalHom","import:Mathlib.LinearAlgebra.TensorProduct.Map"],"family_id":"restrictscalars_mul","file_id":"mathlib/Mathlib/Algebra/Algebra/Bilinear.lean","imports":["public import Mathlib.Algebra.Algebra.NonUnitalHom","public import Mathlib.LinearAlgebra.TensorProduct.Map"],"local_context":"/-\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-/\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\n@[expose] public section\n\nopen TensorProduct Module\n\nvariable {R A B : Type*}\n\nnamespace LinearMap\n\nsection NonUnitalNonAssoc\n\nvariable (R A) [CommSemiring R] [NonUnitalNonAssocSemiring A] [Module R A]\nvariable [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`. -/\n@[instance_reducible, simps!]\ndef mul : A →ₗ[R] A →ₗ[R] A :=\n LinearMap.mk₂ R (· * ·) add_mul smul_mul_assoc mul_add mul_smul_comm\n\n/-- The multiplication map on a non-unital algebra, as an `R`-linear map from `A ⊗[R] A` to `A`. -/\ndef mul' : A ⊗[R] A →ₗ[R] A :=\n TensorProduct.lift (mul R A)\n\n@[inherit_doc] scoped[RingTheory.LinearMap] notation \"μ\" => LinearMap.mul' _ _\n@[inherit_doc] scoped[RingTheory.LinearMap] notation \"μ[\" R \"]\" => LinearMap.mul' R _\n\nvariable {A R}\n\n@[simp]\ntheorem mul_apply' (a b : A) : mul R A a b = a * b :=\n rfl\n\n@[simp]\ntheorem mul'_apply {a b : A} : mul' R A (a ⊗ₜ b) = a * b :=\n rfl","module_header":true,"namespace":"LinearMap","prompt":"Return exactly one Lean proof body beginning with `by`. Do not emit prose, fences, declarations, sorry, admit, by?, or warnings.\n\nImports:\npublic import Mathlib.Algebra.Algebra.NonUnitalHom\npublic import Mathlib.LinearAlgebra.TensorProduct.Map\n\nNamespace:\nLinearMap\n\nLocal context:\n/-\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-/\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\n@[expose] public section\n\nopen TensorProduct Module\n\nvariable {R A B : Type*}\n\nnamespace LinearMap\n\nsection NonUnitalNonAssoc\n\nvariable (R A) [CommSemiring R] [NonUnitalNonAssocSemiring A] [Module R A]\nvariable [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`. -/\n@[instance_reducible, simps!]\ndef mul : A →ₗ[R] A →ₗ[R] A :=\n LinearMap.mk₂ R (· * ·) add_mul smul_mul_assoc mul_add mul_smul_comm\n\n/-- The multiplication map on a non-unital algebra, as an `R`-linear map from `A ⊗[R] A` to `A`. -/\ndef mul' : A ⊗[R] A →ₗ[R] A :=\n TensorProduct.lift (mul R A)\n\n@[inherit_doc] scoped[RingTheory.LinearMap] notation \"μ\" => LinearMap.mul' _ _\n@[inherit_doc] scoped[RingTheory.LinearMap] notation \"μ[\" R \"]\" => LinearMap.mul' R _\n\nvariable {A R}\n\n@[simp]\ntheorem mul_apply' (a b : A) : mul R A a b = a * b :=\n rfl\n\n@[simp]\ntheorem mul'_apply {a b : A} : mul' R A (a ⊗ₜ b) = a * b :=\n rfl\n\nTarget:\nlemma restrictScalars_mul {S : Type*} [CommSemiring S] [Module S A] [SMulCommClass S A A]\n [IsScalarTower S A A] [CompatibleSMul A A R S] (a : A) :\n LinearMap.restrictScalars R (LinearMap.mul S A a) = LinearMap.mul R A a :=\n\nProof body:\n","proof_body":"by\n ext x\n simp\n\nvariable {M : Type*} [AddCommMonoid M] [Module R M]","provenance":{"declaration_index":2,"environment_hash":"08dda26699fe1025520aeb9450ff1df6b58e8ef0aa8100ae158997e8a703b831","lean_toolchain":"leanprover/lean4:v4.32.0-rc1","license":"Apache-2.0","original_import_scope":"module-specific","source_revision":"360da6fa66c1273b76b6b2d8c5666fd5ac2e3b56","source_sha256":"b5f215cf4eadac7c6f9754350b2eea8e0f5d2135c14ced3b4efe579b04b26116","source_uri":"https://github.com/leanprover-community/mathlib4/blob/360da6fa66c1273b76b6b2d8c5666fd5ac2e3b56/Mathlib/Algebra/Algebra/Bilinear.lean"},"sample_id":"f62415822810b2b44b8d599ff65f8714ae872abc95184812b190d9e64e8ee70c","schema_version":1,"split":"holdout","theorem_statement":"lemma restrictScalars_mul {S : Type*} [CommSemiring S] [Module S A] [SMulCommClass S A A]\n [IsScalarTower S A A] [CompatibleSMul A A R S] (a : A) :\n LinearMap.restrictScalars R (LinearMap.mul S A a) = LinearMap.mul R A a :="} |
| {"completion":"by\n apply TensorProduct.ext'\n intro x a\n simp [← mul_smul, mul_comm]","context_contains_namespace":true,"context_suffix":"end NonUnitalNonAssoc\nend LinearMap","dependency_ids":["import:Mathlib.Algebra.Algebra.NonUnitalHom","import:Mathlib.LinearAlgebra.TensorProduct.Map"],"family_id":"lift_lsmul_mul_eq_lsmul_lift_lsmul","file_id":"mathlib/Mathlib/Algebra/Algebra/Bilinear.lean","imports":["public import Mathlib.Algebra.Algebra.NonUnitalHom","public import Mathlib.LinearAlgebra.TensorProduct.Map"],"local_context":"/-\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-/\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\n@[expose] public section\n\nopen TensorProduct Module\n\nvariable {R A B : Type*}\n\nnamespace LinearMap\n\nsection NonUnitalNonAssoc\n\nvariable (R A) [CommSemiring R] [NonUnitalNonAssocSemiring A] [Module R A]\nvariable [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`. -/\n@[instance_reducible, simps!]\ndef mul : A →ₗ[R] A →ₗ[R] A :=\n LinearMap.mk₂ R (· * ·) add_mul smul_mul_assoc mul_add mul_smul_comm\n\n/-- The multiplication map on a non-unital algebra, as an `R`-linear map from `A ⊗[R] A` to `A`. -/\ndef mul' : A ⊗[R] A →ₗ[R] A :=\n TensorProduct.lift (mul R A)\n\n@[inherit_doc] scoped[RingTheory.LinearMap] notation \"μ\" => LinearMap.mul' _ _\n@[inherit_doc] scoped[RingTheory.LinearMap] notation \"μ[\" R \"]\" => LinearMap.mul' R _\n\nvariable {A R}\n\n@[simp]\ntheorem mul_apply' (a b : A) : mul R A a b = a * b :=\n rfl\n\n@[simp]\ntheorem mul'_apply {a b : A} : mul' R A (a ⊗ₜ b) = a * b :=\n rfl\n\nlemma restrictScalars_mul {S : Type*} [CommSemiring S] [Module S A] [SMulCommClass S A A]\n [IsScalarTower S A A] [CompatibleSMul A A R S] (a : A) :\n LinearMap.restrictScalars R (LinearMap.mul S A a) = LinearMap.mul R A a := by\n ext x\n simp\n\nvariable {M : Type*} [AddCommMonoid M] [Module R M]","module_header":true,"namespace":"LinearMap","prompt":"Return exactly one Lean proof body beginning with `by`. Do not emit prose, fences, declarations, sorry, admit, by?, or warnings.\n\nImports:\npublic import Mathlib.Algebra.Algebra.NonUnitalHom\npublic import Mathlib.LinearAlgebra.TensorProduct.Map\n\nNamespace:\nLinearMap\n\nLocal context:\n/-\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-/\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\n@[expose] public section\n\nopen TensorProduct Module\n\nvariable {R A B : Type*}\n\nnamespace LinearMap\n\nsection NonUnitalNonAssoc\n\nvariable (R A) [CommSemiring R] [NonUnitalNonAssocSemiring A] [Module R A]\nvariable [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`. -/\n@[instance_reducible, simps!]\ndef mul : A →ₗ[R] A →ₗ[R] A :=\n LinearMap.mk₂ R (· * ·) add_mul smul_mul_assoc mul_add mul_smul_comm\n\n/-- The multiplication map on a non-unital algebra, as an `R`-linear map from `A ⊗[R] A` to `A`. -/\ndef mul' : A ⊗[R] A →ₗ[R] A :=\n TensorProduct.lift (mul R A)\n\n@[inherit_doc] scoped[RingTheory.LinearMap] notation \"μ\" => LinearMap.mul' _ _\n@[inherit_doc] scoped[RingTheory.LinearMap] notation \"μ[\" R \"]\" => LinearMap.mul' R _\n\nvariable {A R}\n\n@[simp]\ntheorem mul_apply' (a b : A) : mul R A a b = a * b :=\n rfl\n\n@[simp]\ntheorem mul'_apply {a b : A} : mul' R A (a ⊗ₜ b) = a * b :=\n rfl\n\nlemma restrictScalars_mul {S : Type*} [CommSemiring S] [Module S A] [SMulCommClass S A A]\n [IsScalarTower S A A] [CompatibleSMul A A R S] (a : A) :\n LinearMap.restrictScalars R (LinearMap.mul S A a) = LinearMap.mul R A a := by\n ext x\n simp\n\nvariable {M : Type*} [AddCommMonoid M] [Module R M]\n\nTarget:\ntheorem lift_lsmul_mul_eq_lsmul_lift_lsmul {r : R} :\n lift (lsmul R M ∘ₗ mul R R r) = lsmul R M r ∘ₗ lift (lsmul R M) :=\n\nProof body:\n","proof_body":"by\n apply TensorProduct.ext'\n intro x a\n simp [← mul_smul, mul_comm]","provenance":{"declaration_index":3,"environment_hash":"08dda26699fe1025520aeb9450ff1df6b58e8ef0aa8100ae158997e8a703b831","lean_toolchain":"leanprover/lean4:v4.32.0-rc1","license":"Apache-2.0","original_import_scope":"module-specific","source_revision":"360da6fa66c1273b76b6b2d8c5666fd5ac2e3b56","source_sha256":"b5f215cf4eadac7c6f9754350b2eea8e0f5d2135c14ced3b4efe579b04b26116","source_uri":"https://github.com/leanprover-community/mathlib4/blob/360da6fa66c1273b76b6b2d8c5666fd5ac2e3b56/Mathlib/Algebra/Algebra/Bilinear.lean"},"sample_id":"756c833bb1403a31b9b4a213930da4b0d915305ddd84c92a8d7e783da3ae3d26","schema_version":1,"split":"holdout","theorem_statement":"theorem lift_lsmul_mul_eq_lsmul_lift_lsmul {r : R} :\n lift (lsmul R M ∘ₗ mul R R r) = lsmul R M r ∘ₗ lift (lsmul R M) :="} |
| {"completion":"by\n rw [Module.End.isUnit_iff, Iff.comm]\n exact IsUnit.isUnit_iff_mulLeft_bijective","context_contains_namespace":true,"context_suffix":"end Semiring\nend LinearMap","dependency_ids":["import:Mathlib.Algebra.Algebra.NonUnitalHom","import:Mathlib.LinearAlgebra.TensorProduct.Map"],"family_id":"root","file_id":"mathlib/Mathlib/Algebra/Algebra/Bilinear.lean","imports":["public import Mathlib.Algebra.Algebra.NonUnitalHom","public import Mathlib.LinearAlgebra.TensorProduct.Map"],"local_context":"/-\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-/\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\n@[expose] public section\n\nopen TensorProduct Module\n\nvariable {R A B : Type*}\n\nnamespace LinearMap\n\nsection NonUnitalNonAssoc\n\nvariable (R A) [CommSemiring R] [NonUnitalNonAssocSemiring A] [Module R A]\nvariable [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`. -/\n@[instance_reducible, simps!]\ndef mul : A →ₗ[R] A →ₗ[R] A :=\n LinearMap.mk₂ R (· * ·) add_mul smul_mul_assoc mul_add mul_smul_comm\n\n/-- The multiplication map on a non-unital algebra, as an `R`-linear map from `A ⊗[R] A` to `A`. -/\ndef mul' : A ⊗[R] A →ₗ[R] A :=\n TensorProduct.lift (mul R A)\n\n@[inherit_doc] scoped[RingTheory.LinearMap] notation \"μ\" => LinearMap.mul' _ _\n@[inherit_doc] scoped[RingTheory.LinearMap] notation \"μ[\" R \"]\" => LinearMap.mul' R _\n\nvariable {A R}\n\n@[simp]\ntheorem mul_apply' (a b : A) : mul R A a b = a * b :=\n rfl\n\n@[simp]\ntheorem mul'_apply {a b : A} : mul' R A (a ⊗ₜ b) = a * b :=\n rfl\n\nlemma restrictScalars_mul {S : Type*} [CommSemiring S] [Module S A] [SMulCommClass S A A]\n [IsScalarTower S A A] [CompatibleSMul A A R S] (a : A) :\n LinearMap.restrictScalars R (LinearMap.mul S A a) = LinearMap.mul R A a := by\n ext x\n simp\n\nvariable {M : Type*} [AddCommMonoid M] [Module R M]\n\ntheorem lift_lsmul_mul_eq_lsmul_lift_lsmul {r : R} :\n lift (lsmul R M ∘ₗ mul R R r) = lsmul R M r ∘ₗ lift (lsmul R M) := by\n apply TensorProduct.ext'\n intro x a\n simp [← mul_smul, mul_comm]\n\nend NonUnitalNonAssoc\n\nsection NonUnital\n\nvariable [CommSemiring R] [NonUnitalSemiring A] [NonUnitalSemiring B] [Module R B] [Module R A]\nvariable [SMulCommClass R A A] [IsScalarTower R A A]\nvariable [SMulCommClass R B B] [IsScalarTower R B B]\n\nvariable (R A) in\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 where\n __ := mul R A\n map_mul' := mulLeft_mul _ _\n map_zero' := mulLeft_zero_eq_zero _ _\n\n@[simp]\ntheorem _root_.NonUnitalAlgHom.coe_lmul_eq_mul : ⇑(NonUnitalAlgHom.lmul R A) = mul R A :=\n rfl\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\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\nend NonUnital\n\nsection Semiring\n\nvariable (R A)\nsection one_side\nvariable [Semiring R] [Semiring A]\n\nsection left\nvariable [Module R A] [SMulCommClass R A A]\n\n@[simp]\ntheorem pow_mulLeft (a : A) (n : ℕ) : mulLeft R a ^ n = mulLeft R (a ^ n) :=\n match n with\n | 0 => by rw [pow_zero, pow_zero, mulLeft_one, Module.End.one_eq_id]\n | (n + 1) => by rw [pow_succ, pow_succ, mulLeft_mul, Module.End.mul_eq_comp, pow_mulLeft]\n\nend left\n\nsection right\nvariable [Module R A] [IsScalarTower R A A]\n\n@[simp]\ntheorem pow_mulRight (a : A) (n : ℕ) : mulRight R a ^ n = mulRight R (a ^ n) :=\n match n with\n | 0 => by rw [pow_zero, pow_zero, mulRight_one, Module.End.one_eq_id]\n | (n + 1) => by rw [pow_succ, pow_succ', mulRight_mul, Module.End.mul_eq_comp, pow_mulRight]\n\nend right\n\nend one_side\n\nvariable [CommSemiring R] [Semiring A] [Algebra R A]\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.lmul`. -/\ndef _root_.Algebra.lmul : A →ₐ[R] End R A where\n __ := NonUnitalAlgHom.lmul R A\n map_one' := mulLeft_one _ _\n commutes' r := ext fun a => (Algebra.smul_def r a).symm\n\nvariable {R A}\n\n@[simp]\ntheorem _root_.Algebra.coe_lmul_eq_mul : ⇑(Algebra.lmul R A) = mul R A :=\n rfl\n\ntheorem _root_.Algebra.lmul_injective : Function.Injective (Algebra.lmul R A) :=\n fun a₁ a₂ h ↦ by simpa using DFunLike.congr_fun h 1","module_header":true,"namespace":"LinearMap","prompt":"Return exactly one Lean proof body beginning with `by`. Do not emit prose, fences, declarations, sorry, admit, by?, or warnings.\n\nImports:\npublic import Mathlib.Algebra.Algebra.NonUnitalHom\npublic import Mathlib.LinearAlgebra.TensorProduct.Map\n\nNamespace:\nLinearMap\n\nLocal context:\n/-\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-/\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\n@[expose] public section\n\nopen TensorProduct Module\n\nvariable {R A B : Type*}\n\nnamespace LinearMap\n\nsection NonUnitalNonAssoc\n\nvariable (R A) [CommSemiring R] [NonUnitalNonAssocSemiring A] [Module R A]\nvariable [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`. -/\n@[instance_reducible, simps!]\ndef mul : A →ₗ[R] A →ₗ[R] A :=\n LinearMap.mk₂ R (· * ·) add_mul smul_mul_assoc mul_add mul_smul_comm\n\n/-- The multiplication map on a non-unital algebra, as an `R`-linear map from `A ⊗[R] A` to `A`. -/\ndef mul' : A ⊗[R] A →ₗ[R] A :=\n TensorProduct.lift (mul R A)\n\n@[inherit_doc] scoped[RingTheory.LinearMap] notation \"μ\" => LinearMap.mul' _ _\n@[inherit_doc] scoped[RingTheory.LinearMap] notation \"μ[\" R \"]\" => LinearMap.mul' R _\n\nvariable {A R}\n\n@[simp]\ntheorem mul_apply' (a b : A) : mul R A a b = a * b :=\n rfl\n\n@[simp]\ntheorem mul'_apply {a b : A} : mul' R A (a ⊗ₜ b) = a * b :=\n rfl\n\nlemma restrictScalars_mul {S : Type*} [CommSemiring S] [Module S A] [SMulCommClass S A A]\n [IsScalarTower S A A] [CompatibleSMul A A R S] (a : A) :\n LinearMap.restrictScalars R (LinearMap.mul S A a) = LinearMap.mul R A a := by\n ext x\n simp\n\nvariable {M : Type*} [AddCommMonoid M] [Module R M]\n\ntheorem lift_lsmul_mul_eq_lsmul_lift_lsmul {r : R} :\n lift (lsmul R M ∘ₗ mul R R r) = lsmul R M r ∘ₗ lift (lsmul R M) := by\n apply TensorProduct.ext'\n intro x a\n simp [← mul_smul, mul_comm]\n\nend NonUnitalNonAssoc\n\nsection NonUnital\n\nvariable [CommSemiring R] [NonUnitalSemiring A] [NonUnitalSemiring B] [Module R B] [Module R A]\nvariable [SMulCommClass R A A] [IsScalarTower R A A]\nvariable [SMulCommClass R B B] [IsScalarTower R B B]\n\nvariable (R A) in\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 where\n __ := mul R A\n map_mul' := mulLeft_mul _ _\n map_zero' := mulLeft_zero_eq_zero _ _\n\n@[simp]\ntheorem _root_.NonUnitalAlgHom.coe_lmul_eq_mul : ⇑(NonUnitalAlgHom.lmul R A) = mul R A :=\n rfl\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\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\nend NonUnital\n\nsection Semiring\n\nvariable (R A)\nsection one_side\nvariable [Semiring R] [Semiring A]\n\nsection left\nvariable [Module R A] [SMulCommClass R A A]\n\n@[simp]\ntheorem pow_mulLeft (a : A) (n : ℕ) : mulLeft R a ^ n = mulLeft R (a ^ n) :=\n match n with\n | 0 => by rw [pow_zero, pow_zero, mulLeft_one, Module.End.one_eq_id]\n | (n + 1) => by rw [pow_succ, pow_succ, mulLeft_mul, Module.End.mul_eq_comp, pow_mulLeft]\n\nend left\n\nsection right\nvariable [Module R A] [IsScalarTower R A A]\n\n@[simp]\ntheorem pow_mulRight (a : A) (n : ℕ) : mulRight R a ^ n = mulRight R (a ^ n) :=\n match n with\n | 0 => by rw [pow_zero, pow_zero, mulRight_one, Module.End.one_eq_id]\n | (n + 1) => by rw [pow_succ, pow_succ', mulRight_mul, Module.End.mul_eq_comp, pow_mulRight]\n\nend right\n\nend one_side\n\nvariable [CommSemiring R] [Semiring A] [Algebra R A]\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.lmul`. -/\ndef _root_.Algebra.lmul : A →ₐ[R] End R A where\n __ := NonUnitalAlgHom.lmul R A\n map_one' := mulLeft_one _ _\n commutes' r := ext fun a => (Algebra.smul_def r a).symm\n\nvariable {R A}\n\n@[simp]\ntheorem _root_.Algebra.coe_lmul_eq_mul : ⇑(Algebra.lmul R A) = mul R A :=\n rfl\n\ntheorem _root_.Algebra.lmul_injective : Function.Injective (Algebra.lmul R A) :=\n fun a₁ a₂ h ↦ by simpa using DFunLike.congr_fun h 1\n\nTarget:\ntheorem _root_.Algebra.lmul_isUnit_iff {x : A} :\n IsUnit (Algebra.lmul R A x) ↔ IsUnit x :=\n\nProof body:\n","proof_body":"by\n rw [Module.End.isUnit_iff, Iff.comm]\n exact IsUnit.isUnit_iff_mulLeft_bijective","provenance":{"declaration_index":11,"environment_hash":"08dda26699fe1025520aeb9450ff1df6b58e8ef0aa8100ae158997e8a703b831","lean_toolchain":"leanprover/lean4:v4.32.0-rc1","license":"Apache-2.0","original_import_scope":"module-specific","source_revision":"360da6fa66c1273b76b6b2d8c5666fd5ac2e3b56","source_sha256":"b5f215cf4eadac7c6f9754350b2eea8e0f5d2135c14ced3b4efe579b04b26116","source_uri":"https://github.com/leanprover-community/mathlib4/blob/360da6fa66c1273b76b6b2d8c5666fd5ac2e3b56/Mathlib/Algebra/Algebra/Bilinear.lean"},"sample_id":"f900c4905bcccf7cab99aaf2498c05a1343d32af1b35424ba41c7c427d729fb0","schema_version":1,"split":"holdout","theorem_statement":"theorem _root_.Algebra.lmul_isUnit_iff {x : A} :\n IsUnit (Algebra.lmul R A x) ↔ IsUnit x :="} |
| {"completion":"by ext; simp","context_contains_namespace":true,"context_suffix":"end Semiring\nend LinearMap","dependency_ids":["import:Mathlib.Algebra.Algebra.NonUnitalHom","import:Mathlib.LinearAlgebra.TensorProduct.Map"],"family_id":"tospansingleton_one_eq_algebralinearmap","file_id":"mathlib/Mathlib/Algebra/Algebra/Bilinear.lean","imports":["public import Mathlib.Algebra.Algebra.NonUnitalHom","public import Mathlib.LinearAlgebra.TensorProduct.Map"],"local_context":"/-\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-/\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\n@[expose] public section\n\nopen TensorProduct Module\n\nvariable {R A B : Type*}\n\nnamespace LinearMap\n\nsection NonUnitalNonAssoc\n\nvariable (R A) [CommSemiring R] [NonUnitalNonAssocSemiring A] [Module R A]\nvariable [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`. -/\n@[instance_reducible, simps!]\ndef mul : A →ₗ[R] A →ₗ[R] A :=\n LinearMap.mk₂ R (· * ·) add_mul smul_mul_assoc mul_add mul_smul_comm\n\n/-- The multiplication map on a non-unital algebra, as an `R`-linear map from `A ⊗[R] A` to `A`. -/\ndef mul' : A ⊗[R] A →ₗ[R] A :=\n TensorProduct.lift (mul R A)\n\n@[inherit_doc] scoped[RingTheory.LinearMap] notation \"μ\" => LinearMap.mul' _ _\n@[inherit_doc] scoped[RingTheory.LinearMap] notation \"μ[\" R \"]\" => LinearMap.mul' R _\n\nvariable {A R}\n\n@[simp]\ntheorem mul_apply' (a b : A) : mul R A a b = a * b :=\n rfl\n\n@[simp]\ntheorem mul'_apply {a b : A} : mul' R A (a ⊗ₜ b) = a * b :=\n rfl\n\nlemma restrictScalars_mul {S : Type*} [CommSemiring S] [Module S A] [SMulCommClass S A A]\n [IsScalarTower S A A] [CompatibleSMul A A R S] (a : A) :\n LinearMap.restrictScalars R (LinearMap.mul S A a) = LinearMap.mul R A a := by\n ext x\n simp\n\nvariable {M : Type*} [AddCommMonoid M] [Module R M]\n\ntheorem lift_lsmul_mul_eq_lsmul_lift_lsmul {r : R} :\n lift (lsmul R M ∘ₗ mul R R r) = lsmul R M r ∘ₗ lift (lsmul R M) := by\n apply TensorProduct.ext'\n intro x a\n simp [← mul_smul, mul_comm]\n\nend NonUnitalNonAssoc\n\nsection NonUnital\n\nvariable [CommSemiring R] [NonUnitalSemiring A] [NonUnitalSemiring B] [Module R B] [Module R A]\nvariable [SMulCommClass R A A] [IsScalarTower R A A]\nvariable [SMulCommClass R B B] [IsScalarTower R B B]\n\nvariable (R A) in\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 where\n __ := mul R A\n map_mul' := mulLeft_mul _ _\n map_zero' := mulLeft_zero_eq_zero _ _\n\n@[simp]\ntheorem _root_.NonUnitalAlgHom.coe_lmul_eq_mul : ⇑(NonUnitalAlgHom.lmul R A) = mul R A :=\n rfl\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\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\nend NonUnital\n\nsection Semiring\n\nvariable (R A)\nsection one_side\nvariable [Semiring R] [Semiring A]\n\nsection left\nvariable [Module R A] [SMulCommClass R A A]\n\n@[simp]\ntheorem pow_mulLeft (a : A) (n : ℕ) : mulLeft R a ^ n = mulLeft R (a ^ n) :=\n match n with\n | 0 => by rw [pow_zero, pow_zero, mulLeft_one, Module.End.one_eq_id]\n | (n + 1) => by rw [pow_succ, pow_succ, mulLeft_mul, Module.End.mul_eq_comp, pow_mulLeft]\n\nend left\n\nsection right\nvariable [Module R A] [IsScalarTower R A A]\n\n@[simp]\ntheorem pow_mulRight (a : A) (n : ℕ) : mulRight R a ^ n = mulRight R (a ^ n) :=\n match n with\n | 0 => by rw [pow_zero, pow_zero, mulRight_one, Module.End.one_eq_id]\n | (n + 1) => by rw [pow_succ, pow_succ', mulRight_mul, Module.End.mul_eq_comp, pow_mulRight]\n\nend right\n\nend one_side\n\nvariable [CommSemiring R] [Semiring A] [Algebra R A]\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.lmul`. -/\ndef _root_.Algebra.lmul : A →ₐ[R] End R A where\n __ := NonUnitalAlgHom.lmul R A\n map_one' := mulLeft_one _ _\n commutes' r := ext fun a => (Algebra.smul_def r a).symm\n\nvariable {R A}\n\n@[simp]\ntheorem _root_.Algebra.coe_lmul_eq_mul : ⇑(Algebra.lmul R A) = mul R A :=\n rfl\n\ntheorem _root_.Algebra.lmul_injective : Function.Injective (Algebra.lmul R A) :=\n fun a₁ a₂ h ↦ by simpa using DFunLike.congr_fun h 1\n\ntheorem _root_.Algebra.lmul_isUnit_iff {x : A} :\n IsUnit (Algebra.lmul R A x) ↔ IsUnit x := by\n rw [Module.End.isUnit_iff, Iff.comm]\n exact IsUnit.isUnit_iff_mulLeft_bijective","module_header":true,"namespace":"LinearMap","prompt":"Return exactly one Lean proof body beginning with `by`. Do not emit prose, fences, declarations, sorry, admit, by?, or warnings.\n\nImports:\npublic import Mathlib.Algebra.Algebra.NonUnitalHom\npublic import Mathlib.LinearAlgebra.TensorProduct.Map\n\nNamespace:\nLinearMap\n\nLocal context:\n/-\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-/\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\n@[expose] public section\n\nopen TensorProduct Module\n\nvariable {R A B : Type*}\n\nnamespace LinearMap\n\nsection NonUnitalNonAssoc\n\nvariable (R A) [CommSemiring R] [NonUnitalNonAssocSemiring A] [Module R A]\nvariable [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`. -/\n@[instance_reducible, simps!]\ndef mul : A →ₗ[R] A →ₗ[R] A :=\n LinearMap.mk₂ R (· * ·) add_mul smul_mul_assoc mul_add mul_smul_comm\n\n/-- The multiplication map on a non-unital algebra, as an `R`-linear map from `A ⊗[R] A` to `A`. -/\ndef mul' : A ⊗[R] A →ₗ[R] A :=\n TensorProduct.lift (mul R A)\n\n@[inherit_doc] scoped[RingTheory.LinearMap] notation \"μ\" => LinearMap.mul' _ _\n@[inherit_doc] scoped[RingTheory.LinearMap] notation \"μ[\" R \"]\" => LinearMap.mul' R _\n\nvariable {A R}\n\n@[simp]\ntheorem mul_apply' (a b : A) : mul R A a b = a * b :=\n rfl\n\n@[simp]\ntheorem mul'_apply {a b : A} : mul' R A (a ⊗ₜ b) = a * b :=\n rfl\n\nlemma restrictScalars_mul {S : Type*} [CommSemiring S] [Module S A] [SMulCommClass S A A]\n [IsScalarTower S A A] [CompatibleSMul A A R S] (a : A) :\n LinearMap.restrictScalars R (LinearMap.mul S A a) = LinearMap.mul R A a := by\n ext x\n simp\n\nvariable {M : Type*} [AddCommMonoid M] [Module R M]\n\ntheorem lift_lsmul_mul_eq_lsmul_lift_lsmul {r : R} :\n lift (lsmul R M ∘ₗ mul R R r) = lsmul R M r ∘ₗ lift (lsmul R M) := by\n apply TensorProduct.ext'\n intro x a\n simp [← mul_smul, mul_comm]\n\nend NonUnitalNonAssoc\n\nsection NonUnital\n\nvariable [CommSemiring R] [NonUnitalSemiring A] [NonUnitalSemiring B] [Module R B] [Module R A]\nvariable [SMulCommClass R A A] [IsScalarTower R A A]\nvariable [SMulCommClass R B B] [IsScalarTower R B B]\n\nvariable (R A) in\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 where\n __ := mul R A\n map_mul' := mulLeft_mul _ _\n map_zero' := mulLeft_zero_eq_zero _ _\n\n@[simp]\ntheorem _root_.NonUnitalAlgHom.coe_lmul_eq_mul : ⇑(NonUnitalAlgHom.lmul R A) = mul R A :=\n rfl\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\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\nend NonUnital\n\nsection Semiring\n\nvariable (R A)\nsection one_side\nvariable [Semiring R] [Semiring A]\n\nsection left\nvariable [Module R A] [SMulCommClass R A A]\n\n@[simp]\ntheorem pow_mulLeft (a : A) (n : ℕ) : mulLeft R a ^ n = mulLeft R (a ^ n) :=\n match n with\n | 0 => by rw [pow_zero, pow_zero, mulLeft_one, Module.End.one_eq_id]\n | (n + 1) => by rw [pow_succ, pow_succ, mulLeft_mul, Module.End.mul_eq_comp, pow_mulLeft]\n\nend left\n\nsection right\nvariable [Module R A] [IsScalarTower R A A]\n\n@[simp]\ntheorem pow_mulRight (a : A) (n : ℕ) : mulRight R a ^ n = mulRight R (a ^ n) :=\n match n with\n | 0 => by rw [pow_zero, pow_zero, mulRight_one, Module.End.one_eq_id]\n | (n + 1) => by rw [pow_succ, pow_succ', mulRight_mul, Module.End.mul_eq_comp, pow_mulRight]\n\nend right\n\nend one_side\n\nvariable [CommSemiring R] [Semiring A] [Algebra R A]\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.lmul`. -/\ndef _root_.Algebra.lmul : A →ₐ[R] End R A where\n __ := NonUnitalAlgHom.lmul R A\n map_one' := mulLeft_one _ _\n commutes' r := ext fun a => (Algebra.smul_def r a).symm\n\nvariable {R A}\n\n@[simp]\ntheorem _root_.Algebra.coe_lmul_eq_mul : ⇑(Algebra.lmul R A) = mul R A :=\n rfl\n\ntheorem _root_.Algebra.lmul_injective : Function.Injective (Algebra.lmul R A) :=\n fun a₁ a₂ h ↦ by simpa using DFunLike.congr_fun h 1\n\ntheorem _root_.Algebra.lmul_isUnit_iff {x : A} :\n IsUnit (Algebra.lmul R A x) ↔ IsUnit x := by\n rw [Module.End.isUnit_iff, Iff.comm]\n exact IsUnit.isUnit_iff_mulLeft_bijective\n\nTarget:\ntheorem toSpanSingleton_one_eq_algebraLinearMap :\n toSpanSingleton R A 1 = Algebra.linearMap R A :=\n\nProof body:\n","proof_body":"by ext; simp","provenance":{"declaration_index":12,"environment_hash":"08dda26699fe1025520aeb9450ff1df6b58e8ef0aa8100ae158997e8a703b831","lean_toolchain":"leanprover/lean4:v4.32.0-rc1","license":"Apache-2.0","original_import_scope":"module-specific","source_revision":"360da6fa66c1273b76b6b2d8c5666fd5ac2e3b56","source_sha256":"b5f215cf4eadac7c6f9754350b2eea8e0f5d2135c14ced3b4efe579b04b26116","source_uri":"https://github.com/leanprover-community/mathlib4/blob/360da6fa66c1273b76b6b2d8c5666fd5ac2e3b56/Mathlib/Algebra/Algebra/Bilinear.lean"},"sample_id":"354c6ab9240d489d760785405022488141481fc93a2bd2a7c656b6c3a3e54013","schema_version":1,"split":"holdout","theorem_statement":"theorem toSpanSingleton_one_eq_algebraLinearMap :\n toSpanSingleton R A 1 = Algebra.linearMap R A :="} |
| {"completion":"by\n simp [mul', lift_comp_comm_eq]","context_contains_namespace":true,"context_suffix":"end CommSemiring\nend LinearMap","dependency_ids":["import:Mathlib.Algebra.Algebra.NonUnitalHom","import:Mathlib.LinearAlgebra.TensorProduct.Map"],"family_id":"mul'_comp_comm","file_id":"mathlib/Mathlib/Algebra/Algebra/Bilinear.lean","imports":["public import Mathlib.Algebra.Algebra.NonUnitalHom","public import Mathlib.LinearAlgebra.TensorProduct.Map"],"local_context":"/-\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-/\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\n@[expose] public section\n\nopen TensorProduct Module\n\nvariable {R A B : Type*}\n\nnamespace LinearMap\n\nsection NonUnitalNonAssoc\n\nvariable (R A) [CommSemiring R] [NonUnitalNonAssocSemiring A] [Module R A]\nvariable [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`. -/\n@[instance_reducible, simps!]\ndef mul : A →ₗ[R] A →ₗ[R] A :=\n LinearMap.mk₂ R (· * ·) add_mul smul_mul_assoc mul_add mul_smul_comm\n\n/-- The multiplication map on a non-unital algebra, as an `R`-linear map from `A ⊗[R] A` to `A`. -/\ndef mul' : A ⊗[R] A →ₗ[R] A :=\n TensorProduct.lift (mul R A)\n\n@[inherit_doc] scoped[RingTheory.LinearMap] notation \"μ\" => LinearMap.mul' _ _\n@[inherit_doc] scoped[RingTheory.LinearMap] notation \"μ[\" R \"]\" => LinearMap.mul' R _\n\nvariable {A R}\n\n@[simp]\ntheorem mul_apply' (a b : A) : mul R A a b = a * b :=\n rfl\n\n@[simp]\ntheorem mul'_apply {a b : A} : mul' R A (a ⊗ₜ b) = a * b :=\n rfl\n\nlemma restrictScalars_mul {S : Type*} [CommSemiring S] [Module S A] [SMulCommClass S A A]\n [IsScalarTower S A A] [CompatibleSMul A A R S] (a : A) :\n LinearMap.restrictScalars R (LinearMap.mul S A a) = LinearMap.mul R A a := by\n ext x\n simp\n\nvariable {M : Type*} [AddCommMonoid M] [Module R M]\n\ntheorem lift_lsmul_mul_eq_lsmul_lift_lsmul {r : R} :\n lift (lsmul R M ∘ₗ mul R R r) = lsmul R M r ∘ₗ lift (lsmul R M) := by\n apply TensorProduct.ext'\n intro x a\n simp [← mul_smul, mul_comm]\n\nend NonUnitalNonAssoc\n\nsection NonUnital\n\nvariable [CommSemiring R] [NonUnitalSemiring A] [NonUnitalSemiring B] [Module R B] [Module R A]\nvariable [SMulCommClass R A A] [IsScalarTower R A A]\nvariable [SMulCommClass R B B] [IsScalarTower R B B]\n\nvariable (R A) in\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 where\n __ := mul R A\n map_mul' := mulLeft_mul _ _\n map_zero' := mulLeft_zero_eq_zero _ _\n\n@[simp]\ntheorem _root_.NonUnitalAlgHom.coe_lmul_eq_mul : ⇑(NonUnitalAlgHom.lmul R A) = mul R A :=\n rfl\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\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\nend NonUnital\n\nsection Semiring\n\nvariable (R A)\nsection one_side\nvariable [Semiring R] [Semiring A]\n\nsection left\nvariable [Module R A] [SMulCommClass R A A]\n\n@[simp]\ntheorem pow_mulLeft (a : A) (n : ℕ) : mulLeft R a ^ n = mulLeft R (a ^ n) :=\n match n with\n | 0 => by rw [pow_zero, pow_zero, mulLeft_one, Module.End.one_eq_id]\n | (n + 1) => by rw [pow_succ, pow_succ, mulLeft_mul, Module.End.mul_eq_comp, pow_mulLeft]\n\nend left\n\nsection right\nvariable [Module R A] [IsScalarTower R A A]\n\n@[simp]\ntheorem pow_mulRight (a : A) (n : ℕ) : mulRight R a ^ n = mulRight R (a ^ n) :=\n match n with\n | 0 => by rw [pow_zero, pow_zero, mulRight_one, Module.End.one_eq_id]\n | (n + 1) => by rw [pow_succ, pow_succ', mulRight_mul, Module.End.mul_eq_comp, pow_mulRight]\n\nend right\n\nend one_side\n\nvariable [CommSemiring R] [Semiring A] [Algebra R A]\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.lmul`. -/\ndef _root_.Algebra.lmul : A →ₐ[R] End R A where\n __ := NonUnitalAlgHom.lmul R A\n map_one' := mulLeft_one _ _\n commutes' r := ext fun a => (Algebra.smul_def r a).symm\n\nvariable {R A}\n\n@[simp]\ntheorem _root_.Algebra.coe_lmul_eq_mul : ⇑(Algebra.lmul R A) = mul R A :=\n rfl\n\ntheorem _root_.Algebra.lmul_injective : Function.Injective (Algebra.lmul R A) :=\n fun a₁ a₂ h ↦ by simpa using DFunLike.congr_fun h 1\n\ntheorem _root_.Algebra.lmul_isUnit_iff {x : A} :\n IsUnit (Algebra.lmul R A x) ↔ IsUnit x := by\n rw [Module.End.isUnit_iff, Iff.comm]\n exact IsUnit.isUnit_iff_mulLeft_bijective\n\ntheorem toSpanSingleton_one_eq_algebraLinearMap :\n toSpanSingleton R A 1 = Algebra.linearMap R A := by ext; simp\n\n@[deprecated (since := \"2025-12-30\")] alias toSpanSingleton_eq_algebra_linearMap :=\n toSpanSingleton_one_eq_algebraLinearMap\n\nvariable (R A) in\n/-- The multiplication map on an `R`-algebra, as an `A`-linear map from `A ⊗[R] A` to `A`. -/\n@[simps!] def mul'' : A ⊗[R] A →ₗ[A] A where\n __ := mul' R A\n map_smul' a x := x.induction_on (by simp) (by simp +contextual [mul', smul_tmul', mul_assoc])\n (by simp +contextual [mul_add])\n\nend Semiring\n\nsection CommSemiring\n-- TODO: Generalise to `NonUnitalNonAssocCommSemiring`. This can't currently be done\n-- because there is no instance **to** `NonUnitalNonAssocCommSemiring`.\nvariable [CommSemiring R] [NonUnitalCommSemiring A]\n [Module R A] [SMulCommClass R A A] [IsScalarTower R A A]\n\n@[simp] lemma flip_mul : (mul R A).flip = mul R A := by ext; simp [mul_comm]","module_header":true,"namespace":"LinearMap","prompt":"Return exactly one Lean proof body beginning with `by`. Do not emit prose, fences, declarations, sorry, admit, by?, or warnings.\n\nImports:\npublic import Mathlib.Algebra.Algebra.NonUnitalHom\npublic import Mathlib.LinearAlgebra.TensorProduct.Map\n\nNamespace:\nLinearMap\n\nLocal context:\n/-\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-/\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\n@[expose] public section\n\nopen TensorProduct Module\n\nvariable {R A B : Type*}\n\nnamespace LinearMap\n\nsection NonUnitalNonAssoc\n\nvariable (R A) [CommSemiring R] [NonUnitalNonAssocSemiring A] [Module R A]\nvariable [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`. -/\n@[instance_reducible, simps!]\ndef mul : A →ₗ[R] A →ₗ[R] A :=\n LinearMap.mk₂ R (· * ·) add_mul smul_mul_assoc mul_add mul_smul_comm\n\n/-- The multiplication map on a non-unital algebra, as an `R`-linear map from `A ⊗[R] A` to `A`. -/\ndef mul' : A ⊗[R] A →ₗ[R] A :=\n TensorProduct.lift (mul R A)\n\n@[inherit_doc] scoped[RingTheory.LinearMap] notation \"μ\" => LinearMap.mul' _ _\n@[inherit_doc] scoped[RingTheory.LinearMap] notation \"μ[\" R \"]\" => LinearMap.mul' R _\n\nvariable {A R}\n\n@[simp]\ntheorem mul_apply' (a b : A) : mul R A a b = a * b :=\n rfl\n\n@[simp]\ntheorem mul'_apply {a b : A} : mul' R A (a ⊗ₜ b) = a * b :=\n rfl\n\nlemma restrictScalars_mul {S : Type*} [CommSemiring S] [Module S A] [SMulCommClass S A A]\n [IsScalarTower S A A] [CompatibleSMul A A R S] (a : A) :\n LinearMap.restrictScalars R (LinearMap.mul S A a) = LinearMap.mul R A a := by\n ext x\n simp\n\nvariable {M : Type*} [AddCommMonoid M] [Module R M]\n\ntheorem lift_lsmul_mul_eq_lsmul_lift_lsmul {r : R} :\n lift (lsmul R M ∘ₗ mul R R r) = lsmul R M r ∘ₗ lift (lsmul R M) := by\n apply TensorProduct.ext'\n intro x a\n simp [← mul_smul, mul_comm]\n\nend NonUnitalNonAssoc\n\nsection NonUnital\n\nvariable [CommSemiring R] [NonUnitalSemiring A] [NonUnitalSemiring B] [Module R B] [Module R A]\nvariable [SMulCommClass R A A] [IsScalarTower R A A]\nvariable [SMulCommClass R B B] [IsScalarTower R B B]\n\nvariable (R A) in\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 where\n __ := mul R A\n map_mul' := mulLeft_mul _ _\n map_zero' := mulLeft_zero_eq_zero _ _\n\n@[simp]\ntheorem _root_.NonUnitalAlgHom.coe_lmul_eq_mul : ⇑(NonUnitalAlgHom.lmul R A) = mul R A :=\n rfl\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\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\nend NonUnital\n\nsection Semiring\n\nvariable (R A)\nsection one_side\nvariable [Semiring R] [Semiring A]\n\nsection left\nvariable [Module R A] [SMulCommClass R A A]\n\n@[simp]\ntheorem pow_mulLeft (a : A) (n : ℕ) : mulLeft R a ^ n = mulLeft R (a ^ n) :=\n match n with\n | 0 => by rw [pow_zero, pow_zero, mulLeft_one, Module.End.one_eq_id]\n | (n + 1) => by rw [pow_succ, pow_succ, mulLeft_mul, Module.End.mul_eq_comp, pow_mulLeft]\n\nend left\n\nsection right\nvariable [Module R A] [IsScalarTower R A A]\n\n@[simp]\ntheorem pow_mulRight (a : A) (n : ℕ) : mulRight R a ^ n = mulRight R (a ^ n) :=\n match n with\n | 0 => by rw [pow_zero, pow_zero, mulRight_one, Module.End.one_eq_id]\n | (n + 1) => by rw [pow_succ, pow_succ', mulRight_mul, Module.End.mul_eq_comp, pow_mulRight]\n\nend right\n\nend one_side\n\nvariable [CommSemiring R] [Semiring A] [Algebra R A]\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.lmul`. -/\ndef _root_.Algebra.lmul : A →ₐ[R] End R A where\n __ := NonUnitalAlgHom.lmul R A\n map_one' := mulLeft_one _ _\n commutes' r := ext fun a => (Algebra.smul_def r a).symm\n\nvariable {R A}\n\n@[simp]\ntheorem _root_.Algebra.coe_lmul_eq_mul : ⇑(Algebra.lmul R A) = mul R A :=\n rfl\n\ntheorem _root_.Algebra.lmul_injective : Function.Injective (Algebra.lmul R A) :=\n fun a₁ a₂ h ↦ by simpa using DFunLike.congr_fun h 1\n\ntheorem _root_.Algebra.lmul_isUnit_iff {x : A} :\n IsUnit (Algebra.lmul R A x) ↔ IsUnit x := by\n rw [Module.End.isUnit_iff, Iff.comm]\n exact IsUnit.isUnit_iff_mulLeft_bijective\n\ntheorem toSpanSingleton_one_eq_algebraLinearMap :\n toSpanSingleton R A 1 = Algebra.linearMap R A := by ext; simp\n\n@[deprecated (since := \"2025-12-30\")] alias toSpanSingleton_eq_algebra_linearMap :=\n toSpanSingleton_one_eq_algebraLinearMap\n\nvariable (R A) in\n/-- The multiplication map on an `R`-algebra, as an `A`-linear map from `A ⊗[R] A` to `A`. -/\n@[simps!] def mul'' : A ⊗[R] A →ₗ[A] A where\n __ := mul' R A\n map_smul' a x := x.induction_on (by simp) (by simp +contextual [mul', smul_tmul', mul_assoc])\n (by simp +contextual [mul_add])\n\nend Semiring\n\nsection CommSemiring\n-- TODO: Generalise to `NonUnitalNonAssocCommSemiring`. This can't currently be done\n-- because there is no instance **to** `NonUnitalNonAssocCommSemiring`.\nvariable [CommSemiring R] [NonUnitalCommSemiring A]\n [Module R A] [SMulCommClass R A A] [IsScalarTower R A A]\n\n@[simp] lemma flip_mul : (mul R A).flip = mul R A := by ext; simp [mul_comm]\n\nTarget:\nlemma mul'_comp_comm : mul' R A ∘ₗ TensorProduct.comm R A A = mul' R A :=\n\nProof body:\n","proof_body":"by\n simp [mul', lift_comp_comm_eq]","provenance":{"declaration_index":13,"environment_hash":"08dda26699fe1025520aeb9450ff1df6b58e8ef0aa8100ae158997e8a703b831","lean_toolchain":"leanprover/lean4:v4.32.0-rc1","license":"Apache-2.0","original_import_scope":"module-specific","source_revision":"360da6fa66c1273b76b6b2d8c5666fd5ac2e3b56","source_sha256":"b5f215cf4eadac7c6f9754350b2eea8e0f5d2135c14ced3b4efe579b04b26116","source_uri":"https://github.com/leanprover-community/mathlib4/blob/360da6fa66c1273b76b6b2d8c5666fd5ac2e3b56/Mathlib/Algebra/Algebra/Bilinear.lean"},"sample_id":"b8d84457ed5626a8763dcffe3d0369c2c9e378c1b1bc236062b7f6bdd4789af1","schema_version":1,"split":"holdout","theorem_statement":"lemma mul'_comp_comm : mul' R A ∘ₗ TensorProduct.comm R A A = mul' R A :="} |
| {"completion":"by\n simp_rw [IsStrictlyPositive.iff_of_unital, hu.star_right_conjugate_nonneg_iff]\n lift u to Aˣ using hu\n rw [← Units.coe_star, Units.isUnit_mul_units, Units.isUnit_units_mul]","context_contains_namespace":true,"context_suffix":"end StarOrderedRing\nend IsStrictlyPositive","dependency_ids":["import:Mathlib.Algebra.Algebra.Spectrum.Quasispectrum","import:Mathlib.Algebra.Order.Star.Basic","import:Mathlib.Algebra.Order.Module.Defs","import:Mathlib.Tactic.ContinuousFunctionalCalculus"],"family_id":"root","file_id":"mathlib/Mathlib/Algebra/Algebra/StrictPositivity.lean","imports":["public import Mathlib.Algebra.Algebra.Spectrum.Quasispectrum","public import Mathlib.Algebra.Order.Star.Basic","public import Mathlib.Algebra.Order.Module.Defs","public import Mathlib.Tactic.ContinuousFunctionalCalculus"],"local_context":"/-\nCopyright (c) 2025 Frédéric Dupuis. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Frédéric Dupuis\n-/\n/-!\n# Strictly positive elements of an algebra\n\nThis file introduces strictly positive elements of an algebra (also known as positive definite\nelements). This is mostly used for C⋆-algebras, but the basic definition makes sense in a more\ngeneral context.\n\n## Implementation notes\n\nNote that, while the current definition is adequate in the unital case, it will eventually be\nreplaced by a definition that makes sense in the non-unital case (an element is strictly\npositive if the hereditary C⋆-subalgebra generated by that element is the whole algebra).\nThus, it is best to avoid unfolding the definition and only use the API provided.\n\n## TODO\n\n+ Generalize the definition to non-unital algebras.\n-/\n\n@[expose] public section\n\n/-- An element of an ordered algebra is *strictly positive* if it is nonnegative and invertible.\n\nNOTE: This definition will be generalized to the non-unital case in the future; do not unfold\nthe definition and use the API provided instead to avoid breakage when the refactor happens. -/\ndef IsStrictlyPositive {A : Type*} [LE A] [Monoid A] [Zero A] (a : A) : Prop :=\n 0 ≤ a ∧ IsUnit a\n\nvariable {A : Type*}\n\nnamespace IsStrictlyPositive\n\nsection basic\n\n@[grind _=_]\nlemma iff_of_unital [LE A] [Monoid A] [Zero A] {a : A} :\n IsStrictlyPositive a ↔ 0 ≤ a ∧ IsUnit a := Iff.rfl\n\n@[aesop 20% apply (rule_sets := [CStarAlgebra])]\nprotected lemma nonneg [LE A] [Monoid A] [Zero A] {a : A} (ha : IsStrictlyPositive a) :\n 0 ≤ a := ha.1\n\n@[aesop 20% apply (rule_sets := [CStarAlgebra])]\nprotected lemma isUnit [LE A] [Monoid A] [Zero A] {a : A} (ha : IsStrictlyPositive a) :\n IsUnit a := ha.2\n\nlemma _root_.IsUnit.isStrictlyPositive [LE A] [Monoid A] [Zero A]\n {a : A} (ha : IsUnit a) (ha₀ : 0 ≤ a) : IsStrictlyPositive a := iff_of_unital.mpr ⟨ha₀, ha⟩\n\n@[grind →]\nlemma isSelfAdjoint [Semiring A] [PartialOrder A] [StarRing A] [StarOrderedRing A] {a : A}\n (ha : IsStrictlyPositive a) : IsSelfAdjoint a := ha.nonneg.isSelfAdjoint\n\n@[simp, grind .]\nlemma _root_.isStrictlyPositive_one [LE A] [Monoid A] [Zero A] [ZeroLEOneClass A] :\n IsStrictlyPositive (1 : A) := iff_of_unital.mpr ⟨zero_le_one, isUnit_one⟩\n\n@[grind =]\nlemma _root_.Units.isStrictlyPositive_iff [LE A] [Monoid A] [Zero A] {a : Aˣ} :\n IsStrictlyPositive (a : A) ↔ (0 : A) ≤ a :=\n ⟨fun h => h.nonneg, fun h => iff_of_unital.mp ⟨h, a.isUnit⟩⟩\n\n@[aesop safe apply]\nlemma _root_.Units.isStrictlyPositive_of_le [LE A] [Monoid A] [Zero A] {a : Aˣ}\n (h : (0 : A) ≤ a) : IsStrictlyPositive (a : A) := a.isStrictlyPositive_iff.mpr h\n\n@[nontriviality]\nprotected lemma of_subsingleton [PartialOrder A] [Monoid A] [Zero A] [Subsingleton A]\n {a : A} : IsStrictlyPositive a :=\n iff_of_unital.mpr ⟨by simp, isUnit_of_subsingleton _⟩\n\nend basic\n\nsection StarOrderedRing\nvariable [Semiring A] [StarRing A] [PartialOrder A] [StarOrderedRing A]","module_header":true,"namespace":"IsStrictlyPositive","prompt":"Return exactly one Lean proof body beginning with `by`. Do not emit prose, fences, declarations, sorry, admit, by?, or warnings.\n\nImports:\npublic import Mathlib.Algebra.Algebra.Spectrum.Quasispectrum\npublic import Mathlib.Algebra.Order.Star.Basic\npublic import Mathlib.Algebra.Order.Module.Defs\npublic import Mathlib.Tactic.ContinuousFunctionalCalculus\n\nNamespace:\nIsStrictlyPositive\n\nLocal context:\n/-\nCopyright (c) 2025 Frédéric Dupuis. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Frédéric Dupuis\n-/\n/-!\n# Strictly positive elements of an algebra\n\nThis file introduces strictly positive elements of an algebra (also known as positive definite\nelements). This is mostly used for C⋆-algebras, but the basic definition makes sense in a more\ngeneral context.\n\n## Implementation notes\n\nNote that, while the current definition is adequate in the unital case, it will eventually be\nreplaced by a definition that makes sense in the non-unital case (an element is strictly\npositive if the hereditary C⋆-subalgebra generated by that element is the whole algebra).\nThus, it is best to avoid unfolding the definition and only use the API provided.\n\n## TODO\n\n+ Generalize the definition to non-unital algebras.\n-/\n\n@[expose] public section\n\n/-- An element of an ordered algebra is *strictly positive* if it is nonnegative and invertible.\n\nNOTE: This definition will be generalized to the non-unital case in the future; do not unfold\nthe definition and use the API provided instead to avoid breakage when the refactor happens. -/\ndef IsStrictlyPositive {A : Type*} [LE A] [Monoid A] [Zero A] (a : A) : Prop :=\n 0 ≤ a ∧ IsUnit a\n\nvariable {A : Type*}\n\nnamespace IsStrictlyPositive\n\nsection basic\n\n@[grind _=_]\nlemma iff_of_unital [LE A] [Monoid A] [Zero A] {a : A} :\n IsStrictlyPositive a ↔ 0 ≤ a ∧ IsUnit a := Iff.rfl\n\n@[aesop 20% apply (rule_sets := [CStarAlgebra])]\nprotected lemma nonneg [LE A] [Monoid A] [Zero A] {a : A} (ha : IsStrictlyPositive a) :\n 0 ≤ a := ha.1\n\n@[aesop 20% apply (rule_sets := [CStarAlgebra])]\nprotected lemma isUnit [LE A] [Monoid A] [Zero A] {a : A} (ha : IsStrictlyPositive a) :\n IsUnit a := ha.2\n\nlemma _root_.IsUnit.isStrictlyPositive [LE A] [Monoid A] [Zero A]\n {a : A} (ha : IsUnit a) (ha₀ : 0 ≤ a) : IsStrictlyPositive a := iff_of_unital.mpr ⟨ha₀, ha⟩\n\n@[grind →]\nlemma isSelfAdjoint [Semiring A] [PartialOrder A] [StarRing A] [StarOrderedRing A] {a : A}\n (ha : IsStrictlyPositive a) : IsSelfAdjoint a := ha.nonneg.isSelfAdjoint\n\n@[simp, grind .]\nlemma _root_.isStrictlyPositive_one [LE A] [Monoid A] [Zero A] [ZeroLEOneClass A] :\n IsStrictlyPositive (1 : A) := iff_of_unital.mpr ⟨zero_le_one, isUnit_one⟩\n\n@[grind =]\nlemma _root_.Units.isStrictlyPositive_iff [LE A] [Monoid A] [Zero A] {a : Aˣ} :\n IsStrictlyPositive (a : A) ↔ (0 : A) ≤ a :=\n ⟨fun h => h.nonneg, fun h => iff_of_unital.mp ⟨h, a.isUnit⟩⟩\n\n@[aesop safe apply]\nlemma _root_.Units.isStrictlyPositive_of_le [LE A] [Monoid A] [Zero A] {a : Aˣ}\n (h : (0 : A) ≤ a) : IsStrictlyPositive (a : A) := a.isStrictlyPositive_iff.mpr h\n\n@[nontriviality]\nprotected lemma of_subsingleton [PartialOrder A] [Monoid A] [Zero A] [Subsingleton A]\n {a : A} : IsStrictlyPositive a :=\n iff_of_unital.mpr ⟨by simp, isUnit_of_subsingleton _⟩\n\nend basic\n\nsection StarOrderedRing\nvariable [Semiring A] [StarRing A] [PartialOrder A] [StarOrderedRing A]\n\nTarget:\nlemma _root_.IsUnit.isStrictlyPositive_star_right_conjugate_iff {u a : A} (hu : IsUnit u) :\n IsStrictlyPositive (u * a * star u) ↔ IsStrictlyPositive a :=\n\nProof body:\n","proof_body":"by\n simp_rw [IsStrictlyPositive.iff_of_unital, hu.star_right_conjugate_nonneg_iff]\n lift u to Aˣ using hu\n rw [← Units.coe_star, Units.isUnit_mul_units, Units.isUnit_units_mul]","provenance":{"declaration_index":6,"environment_hash":"08dda26699fe1025520aeb9450ff1df6b58e8ef0aa8100ae158997e8a703b831","lean_toolchain":"leanprover/lean4:v4.32.0-rc1","license":"Apache-2.0","original_import_scope":"module-specific","source_revision":"360da6fa66c1273b76b6b2d8c5666fd5ac2e3b56","source_sha256":"a9f5a2e040db478eb9f090e7d70b777b335932049f29e1fe5943dbeb9bc624ee","source_uri":"https://github.com/leanprover-community/mathlib4/blob/360da6fa66c1273b76b6b2d8c5666fd5ac2e3b56/Mathlib/Algebra/Algebra/StrictPositivity.lean"},"sample_id":"8e52f7e7d4abc1cbadcfeac6b0697214ff0be1711917c1f7f7c52bd06eea013c","schema_version":1,"split":"holdout","theorem_statement":"lemma _root_.IsUnit.isStrictlyPositive_star_right_conjugate_iff {u a : A} (hu : IsUnit u) :\n IsStrictlyPositive (u * a * star u) ↔ IsStrictlyPositive a :="} |
| {"completion":"by\n simpa using hu.star.isStrictlyPositive_star_right_conjugate_iff","context_contains_namespace":true,"context_suffix":"end StarOrderedRing\nend IsStrictlyPositive","dependency_ids":["import:Mathlib.Algebra.Algebra.Spectrum.Quasispectrum","import:Mathlib.Algebra.Order.Star.Basic","import:Mathlib.Algebra.Order.Module.Defs","import:Mathlib.Tactic.ContinuousFunctionalCalculus"],"family_id":"root","file_id":"mathlib/Mathlib/Algebra/Algebra/StrictPositivity.lean","imports":["public import Mathlib.Algebra.Algebra.Spectrum.Quasispectrum","public import Mathlib.Algebra.Order.Star.Basic","public import Mathlib.Algebra.Order.Module.Defs","public import Mathlib.Tactic.ContinuousFunctionalCalculus"],"local_context":"/-\nCopyright (c) 2025 Frédéric Dupuis. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Frédéric Dupuis\n-/\n/-!\n# Strictly positive elements of an algebra\n\nThis file introduces strictly positive elements of an algebra (also known as positive definite\nelements). This is mostly used for C⋆-algebras, but the basic definition makes sense in a more\ngeneral context.\n\n## Implementation notes\n\nNote that, while the current definition is adequate in the unital case, it will eventually be\nreplaced by a definition that makes sense in the non-unital case (an element is strictly\npositive if the hereditary C⋆-subalgebra generated by that element is the whole algebra).\nThus, it is best to avoid unfolding the definition and only use the API provided.\n\n## TODO\n\n+ Generalize the definition to non-unital algebras.\n-/\n\n@[expose] public section\n\n/-- An element of an ordered algebra is *strictly positive* if it is nonnegative and invertible.\n\nNOTE: This definition will be generalized to the non-unital case in the future; do not unfold\nthe definition and use the API provided instead to avoid breakage when the refactor happens. -/\ndef IsStrictlyPositive {A : Type*} [LE A] [Monoid A] [Zero A] (a : A) : Prop :=\n 0 ≤ a ∧ IsUnit a\n\nvariable {A : Type*}\n\nnamespace IsStrictlyPositive\n\nsection basic\n\n@[grind _=_]\nlemma iff_of_unital [LE A] [Monoid A] [Zero A] {a : A} :\n IsStrictlyPositive a ↔ 0 ≤ a ∧ IsUnit a := Iff.rfl\n\n@[aesop 20% apply (rule_sets := [CStarAlgebra])]\nprotected lemma nonneg [LE A] [Monoid A] [Zero A] {a : A} (ha : IsStrictlyPositive a) :\n 0 ≤ a := ha.1\n\n@[aesop 20% apply (rule_sets := [CStarAlgebra])]\nprotected lemma isUnit [LE A] [Monoid A] [Zero A] {a : A} (ha : IsStrictlyPositive a) :\n IsUnit a := ha.2\n\nlemma _root_.IsUnit.isStrictlyPositive [LE A] [Monoid A] [Zero A]\n {a : A} (ha : IsUnit a) (ha₀ : 0 ≤ a) : IsStrictlyPositive a := iff_of_unital.mpr ⟨ha₀, ha⟩\n\n@[grind →]\nlemma isSelfAdjoint [Semiring A] [PartialOrder A] [StarRing A] [StarOrderedRing A] {a : A}\n (ha : IsStrictlyPositive a) : IsSelfAdjoint a := ha.nonneg.isSelfAdjoint\n\n@[simp, grind .]\nlemma _root_.isStrictlyPositive_one [LE A] [Monoid A] [Zero A] [ZeroLEOneClass A] :\n IsStrictlyPositive (1 : A) := iff_of_unital.mpr ⟨zero_le_one, isUnit_one⟩\n\n@[grind =]\nlemma _root_.Units.isStrictlyPositive_iff [LE A] [Monoid A] [Zero A] {a : Aˣ} :\n IsStrictlyPositive (a : A) ↔ (0 : A) ≤ a :=\n ⟨fun h => h.nonneg, fun h => iff_of_unital.mp ⟨h, a.isUnit⟩⟩\n\n@[aesop safe apply]\nlemma _root_.Units.isStrictlyPositive_of_le [LE A] [Monoid A] [Zero A] {a : Aˣ}\n (h : (0 : A) ≤ a) : IsStrictlyPositive (a : A) := a.isStrictlyPositive_iff.mpr h\n\n@[nontriviality]\nprotected lemma of_subsingleton [PartialOrder A] [Monoid A] [Zero A] [Subsingleton A]\n {a : A} : IsStrictlyPositive a :=\n iff_of_unital.mpr ⟨by simp, isUnit_of_subsingleton _⟩\n\nend basic\n\nsection StarOrderedRing\nvariable [Semiring A] [StarRing A] [PartialOrder A] [StarOrderedRing A]\n\nlemma _root_.IsUnit.isStrictlyPositive_star_right_conjugate_iff {u a : A} (hu : IsUnit u) :\n IsStrictlyPositive (u * a * star u) ↔ IsStrictlyPositive a := by\n simp_rw [IsStrictlyPositive.iff_of_unital, hu.star_right_conjugate_nonneg_iff]\n lift u to Aˣ using hu\n rw [← Units.coe_star, Units.isUnit_mul_units, Units.isUnit_units_mul]","module_header":true,"namespace":"IsStrictlyPositive","prompt":"Return exactly one Lean proof body beginning with `by`. Do not emit prose, fences, declarations, sorry, admit, by?, or warnings.\n\nImports:\npublic import Mathlib.Algebra.Algebra.Spectrum.Quasispectrum\npublic import Mathlib.Algebra.Order.Star.Basic\npublic import Mathlib.Algebra.Order.Module.Defs\npublic import Mathlib.Tactic.ContinuousFunctionalCalculus\n\nNamespace:\nIsStrictlyPositive\n\nLocal context:\n/-\nCopyright (c) 2025 Frédéric Dupuis. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Frédéric Dupuis\n-/\n/-!\n# Strictly positive elements of an algebra\n\nThis file introduces strictly positive elements of an algebra (also known as positive definite\nelements). This is mostly used for C⋆-algebras, but the basic definition makes sense in a more\ngeneral context.\n\n## Implementation notes\n\nNote that, while the current definition is adequate in the unital case, it will eventually be\nreplaced by a definition that makes sense in the non-unital case (an element is strictly\npositive if the hereditary C⋆-subalgebra generated by that element is the whole algebra).\nThus, it is best to avoid unfolding the definition and only use the API provided.\n\n## TODO\n\n+ Generalize the definition to non-unital algebras.\n-/\n\n@[expose] public section\n\n/-- An element of an ordered algebra is *strictly positive* if it is nonnegative and invertible.\n\nNOTE: This definition will be generalized to the non-unital case in the future; do not unfold\nthe definition and use the API provided instead to avoid breakage when the refactor happens. -/\ndef IsStrictlyPositive {A : Type*} [LE A] [Monoid A] [Zero A] (a : A) : Prop :=\n 0 ≤ a ∧ IsUnit a\n\nvariable {A : Type*}\n\nnamespace IsStrictlyPositive\n\nsection basic\n\n@[grind _=_]\nlemma iff_of_unital [LE A] [Monoid A] [Zero A] {a : A} :\n IsStrictlyPositive a ↔ 0 ≤ a ∧ IsUnit a := Iff.rfl\n\n@[aesop 20% apply (rule_sets := [CStarAlgebra])]\nprotected lemma nonneg [LE A] [Monoid A] [Zero A] {a : A} (ha : IsStrictlyPositive a) :\n 0 ≤ a := ha.1\n\n@[aesop 20% apply (rule_sets := [CStarAlgebra])]\nprotected lemma isUnit [LE A] [Monoid A] [Zero A] {a : A} (ha : IsStrictlyPositive a) :\n IsUnit a := ha.2\n\nlemma _root_.IsUnit.isStrictlyPositive [LE A] [Monoid A] [Zero A]\n {a : A} (ha : IsUnit a) (ha₀ : 0 ≤ a) : IsStrictlyPositive a := iff_of_unital.mpr ⟨ha₀, ha⟩\n\n@[grind →]\nlemma isSelfAdjoint [Semiring A] [PartialOrder A] [StarRing A] [StarOrderedRing A] {a : A}\n (ha : IsStrictlyPositive a) : IsSelfAdjoint a := ha.nonneg.isSelfAdjoint\n\n@[simp, grind .]\nlemma _root_.isStrictlyPositive_one [LE A] [Monoid A] [Zero A] [ZeroLEOneClass A] :\n IsStrictlyPositive (1 : A) := iff_of_unital.mpr ⟨zero_le_one, isUnit_one⟩\n\n@[grind =]\nlemma _root_.Units.isStrictlyPositive_iff [LE A] [Monoid A] [Zero A] {a : Aˣ} :\n IsStrictlyPositive (a : A) ↔ (0 : A) ≤ a :=\n ⟨fun h => h.nonneg, fun h => iff_of_unital.mp ⟨h, a.isUnit⟩⟩\n\n@[aesop safe apply]\nlemma _root_.Units.isStrictlyPositive_of_le [LE A] [Monoid A] [Zero A] {a : Aˣ}\n (h : (0 : A) ≤ a) : IsStrictlyPositive (a : A) := a.isStrictlyPositive_iff.mpr h\n\n@[nontriviality]\nprotected lemma of_subsingleton [PartialOrder A] [Monoid A] [Zero A] [Subsingleton A]\n {a : A} : IsStrictlyPositive a :=\n iff_of_unital.mpr ⟨by simp, isUnit_of_subsingleton _⟩\n\nend basic\n\nsection StarOrderedRing\nvariable [Semiring A] [StarRing A] [PartialOrder A] [StarOrderedRing A]\n\nlemma _root_.IsUnit.isStrictlyPositive_star_right_conjugate_iff {u a : A} (hu : IsUnit u) :\n IsStrictlyPositive (u * a * star u) ↔ IsStrictlyPositive a := by\n simp_rw [IsStrictlyPositive.iff_of_unital, hu.star_right_conjugate_nonneg_iff]\n lift u to Aˣ using hu\n rw [← Units.coe_star, Units.isUnit_mul_units, Units.isUnit_units_mul]\n\nTarget:\nlemma _root_.IsUnit.isStrictlyPositive_star_left_conjugate_iff {u a : A} (hu : IsUnit u) :\n IsStrictlyPositive (star u * a * u) ↔ IsStrictlyPositive a :=\n\nProof body:\n","proof_body":"by\n simpa using hu.star.isStrictlyPositive_star_right_conjugate_iff","provenance":{"declaration_index":7,"environment_hash":"08dda26699fe1025520aeb9450ff1df6b58e8ef0aa8100ae158997e8a703b831","lean_toolchain":"leanprover/lean4:v4.32.0-rc1","license":"Apache-2.0","original_import_scope":"module-specific","source_revision":"360da6fa66c1273b76b6b2d8c5666fd5ac2e3b56","source_sha256":"a9f5a2e040db478eb9f090e7d70b777b335932049f29e1fe5943dbeb9bc624ee","source_uri":"https://github.com/leanprover-community/mathlib4/blob/360da6fa66c1273b76b6b2d8c5666fd5ac2e3b56/Mathlib/Algebra/Algebra/StrictPositivity.lean"},"sample_id":"7cb33889170a70f2f9d7186b8adb11f6a2457abe4e2813fb79657e1dd80bb758","schema_version":1,"split":"holdout","theorem_statement":"lemma _root_.IsUnit.isStrictlyPositive_star_left_conjugate_iff {u a : A} (hu : IsUnit u) :\n IsStrictlyPositive (star u * a * u) ↔ IsStrictlyPositive a :="} |
| {"completion":"by cfc_tac) :\n IsStrictlyPositive (b * a * b) ↔ IsStrictlyPositive a := by\n grind [hb.isStrictlyPositive_star_left_conjugate_iff]","context_contains_namespace":true,"context_suffix":"end StarOrderedRing\nend IsStrictlyPositive","dependency_ids":["import:Mathlib.Algebra.Algebra.Spectrum.Quasispectrum","import:Mathlib.Algebra.Order.Star.Basic","import:Mathlib.Algebra.Order.Module.Defs","import:Mathlib.Tactic.ContinuousFunctionalCalculus"],"family_id":"root","file_id":"mathlib/Mathlib/Algebra/Algebra/StrictPositivity.lean","imports":["public import Mathlib.Algebra.Algebra.Spectrum.Quasispectrum","public import Mathlib.Algebra.Order.Star.Basic","public import Mathlib.Algebra.Order.Module.Defs","public import Mathlib.Tactic.ContinuousFunctionalCalculus"],"local_context":"/-\nCopyright (c) 2025 Frédéric Dupuis. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Frédéric Dupuis\n-/\n/-!\n# Strictly positive elements of an algebra\n\nThis file introduces strictly positive elements of an algebra (also known as positive definite\nelements). This is mostly used for C⋆-algebras, but the basic definition makes sense in a more\ngeneral context.\n\n## Implementation notes\n\nNote that, while the current definition is adequate in the unital case, it will eventually be\nreplaced by a definition that makes sense in the non-unital case (an element is strictly\npositive if the hereditary C⋆-subalgebra generated by that element is the whole algebra).\nThus, it is best to avoid unfolding the definition and only use the API provided.\n\n## TODO\n\n+ Generalize the definition to non-unital algebras.\n-/\n\n@[expose] public section\n\n/-- An element of an ordered algebra is *strictly positive* if it is nonnegative and invertible.\n\nNOTE: This definition will be generalized to the non-unital case in the future; do not unfold\nthe definition and use the API provided instead to avoid breakage when the refactor happens. -/\ndef IsStrictlyPositive {A : Type*} [LE A] [Monoid A] [Zero A] (a : A) : Prop :=\n 0 ≤ a ∧ IsUnit a\n\nvariable {A : Type*}\n\nnamespace IsStrictlyPositive\n\nsection basic\n\n@[grind _=_]\nlemma iff_of_unital [LE A] [Monoid A] [Zero A] {a : A} :\n IsStrictlyPositive a ↔ 0 ≤ a ∧ IsUnit a := Iff.rfl\n\n@[aesop 20% apply (rule_sets := [CStarAlgebra])]\nprotected lemma nonneg [LE A] [Monoid A] [Zero A] {a : A} (ha : IsStrictlyPositive a) :\n 0 ≤ a := ha.1\n\n@[aesop 20% apply (rule_sets := [CStarAlgebra])]\nprotected lemma isUnit [LE A] [Monoid A] [Zero A] {a : A} (ha : IsStrictlyPositive a) :\n IsUnit a := ha.2\n\nlemma _root_.IsUnit.isStrictlyPositive [LE A] [Monoid A] [Zero A]\n {a : A} (ha : IsUnit a) (ha₀ : 0 ≤ a) : IsStrictlyPositive a := iff_of_unital.mpr ⟨ha₀, ha⟩\n\n@[grind →]\nlemma isSelfAdjoint [Semiring A] [PartialOrder A] [StarRing A] [StarOrderedRing A] {a : A}\n (ha : IsStrictlyPositive a) : IsSelfAdjoint a := ha.nonneg.isSelfAdjoint\n\n@[simp, grind .]\nlemma _root_.isStrictlyPositive_one [LE A] [Monoid A] [Zero A] [ZeroLEOneClass A] :\n IsStrictlyPositive (1 : A) := iff_of_unital.mpr ⟨zero_le_one, isUnit_one⟩\n\n@[grind =]\nlemma _root_.Units.isStrictlyPositive_iff [LE A] [Monoid A] [Zero A] {a : Aˣ} :\n IsStrictlyPositive (a : A) ↔ (0 : A) ≤ a :=\n ⟨fun h => h.nonneg, fun h => iff_of_unital.mp ⟨h, a.isUnit⟩⟩\n\n@[aesop safe apply]\nlemma _root_.Units.isStrictlyPositive_of_le [LE A] [Monoid A] [Zero A] {a : Aˣ}\n (h : (0 : A) ≤ a) : IsStrictlyPositive (a : A) := a.isStrictlyPositive_iff.mpr h\n\n@[nontriviality]\nprotected lemma of_subsingleton [PartialOrder A] [Monoid A] [Zero A] [Subsingleton A]\n {a : A} : IsStrictlyPositive a :=\n iff_of_unital.mpr ⟨by simp, isUnit_of_subsingleton _⟩\n\nend basic\n\nsection StarOrderedRing\nvariable [Semiring A] [StarRing A] [PartialOrder A] [StarOrderedRing A]\n\nlemma _root_.IsUnit.isStrictlyPositive_star_right_conjugate_iff {u a : A} (hu : IsUnit u) :\n IsStrictlyPositive (u * a * star u) ↔ IsStrictlyPositive a := by\n simp_rw [IsStrictlyPositive.iff_of_unital, hu.star_right_conjugate_nonneg_iff]\n lift u to Aˣ using hu\n rw [← Units.coe_star, Units.isUnit_mul_units, Units.isUnit_units_mul]\n\nlemma _root_.IsUnit.isStrictlyPositive_star_left_conjugate_iff {u a : A} (hu : IsUnit u) :\n IsStrictlyPositive (star u * a * u) ↔ IsStrictlyPositive a := by\n simpa using hu.star.isStrictlyPositive_star_right_conjugate_iff\n\n@[grind =]","module_header":true,"namespace":"IsStrictlyPositive","prompt":"Return exactly one Lean proof body beginning with `by`. Do not emit prose, fences, declarations, sorry, admit, by?, or warnings.\n\nImports:\npublic import Mathlib.Algebra.Algebra.Spectrum.Quasispectrum\npublic import Mathlib.Algebra.Order.Star.Basic\npublic import Mathlib.Algebra.Order.Module.Defs\npublic import Mathlib.Tactic.ContinuousFunctionalCalculus\n\nNamespace:\nIsStrictlyPositive\n\nLocal context:\n/-\nCopyright (c) 2025 Frédéric Dupuis. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Frédéric Dupuis\n-/\n/-!\n# Strictly positive elements of an algebra\n\nThis file introduces strictly positive elements of an algebra (also known as positive definite\nelements). This is mostly used for C⋆-algebras, but the basic definition makes sense in a more\ngeneral context.\n\n## Implementation notes\n\nNote that, while the current definition is adequate in the unital case, it will eventually be\nreplaced by a definition that makes sense in the non-unital case (an element is strictly\npositive if the hereditary C⋆-subalgebra generated by that element is the whole algebra).\nThus, it is best to avoid unfolding the definition and only use the API provided.\n\n## TODO\n\n+ Generalize the definition to non-unital algebras.\n-/\n\n@[expose] public section\n\n/-- An element of an ordered algebra is *strictly positive* if it is nonnegative and invertible.\n\nNOTE: This definition will be generalized to the non-unital case in the future; do not unfold\nthe definition and use the API provided instead to avoid breakage when the refactor happens. -/\ndef IsStrictlyPositive {A : Type*} [LE A] [Monoid A] [Zero A] (a : A) : Prop :=\n 0 ≤ a ∧ IsUnit a\n\nvariable {A : Type*}\n\nnamespace IsStrictlyPositive\n\nsection basic\n\n@[grind _=_]\nlemma iff_of_unital [LE A] [Monoid A] [Zero A] {a : A} :\n IsStrictlyPositive a ↔ 0 ≤ a ∧ IsUnit a := Iff.rfl\n\n@[aesop 20% apply (rule_sets := [CStarAlgebra])]\nprotected lemma nonneg [LE A] [Monoid A] [Zero A] {a : A} (ha : IsStrictlyPositive a) :\n 0 ≤ a := ha.1\n\n@[aesop 20% apply (rule_sets := [CStarAlgebra])]\nprotected lemma isUnit [LE A] [Monoid A] [Zero A] {a : A} (ha : IsStrictlyPositive a) :\n IsUnit a := ha.2\n\nlemma _root_.IsUnit.isStrictlyPositive [LE A] [Monoid A] [Zero A]\n {a : A} (ha : IsUnit a) (ha₀ : 0 ≤ a) : IsStrictlyPositive a := iff_of_unital.mpr ⟨ha₀, ha⟩\n\n@[grind →]\nlemma isSelfAdjoint [Semiring A] [PartialOrder A] [StarRing A] [StarOrderedRing A] {a : A}\n (ha : IsStrictlyPositive a) : IsSelfAdjoint a := ha.nonneg.isSelfAdjoint\n\n@[simp, grind .]\nlemma _root_.isStrictlyPositive_one [LE A] [Monoid A] [Zero A] [ZeroLEOneClass A] :\n IsStrictlyPositive (1 : A) := iff_of_unital.mpr ⟨zero_le_one, isUnit_one⟩\n\n@[grind =]\nlemma _root_.Units.isStrictlyPositive_iff [LE A] [Monoid A] [Zero A] {a : Aˣ} :\n IsStrictlyPositive (a : A) ↔ (0 : A) ≤ a :=\n ⟨fun h => h.nonneg, fun h => iff_of_unital.mp ⟨h, a.isUnit⟩⟩\n\n@[aesop safe apply]\nlemma _root_.Units.isStrictlyPositive_of_le [LE A] [Monoid A] [Zero A] {a : Aˣ}\n (h : (0 : A) ≤ a) : IsStrictlyPositive (a : A) := a.isStrictlyPositive_iff.mpr h\n\n@[nontriviality]\nprotected lemma of_subsingleton [PartialOrder A] [Monoid A] [Zero A] [Subsingleton A]\n {a : A} : IsStrictlyPositive a :=\n iff_of_unital.mpr ⟨by simp, isUnit_of_subsingleton _⟩\n\nend basic\n\nsection StarOrderedRing\nvariable [Semiring A] [StarRing A] [PartialOrder A] [StarOrderedRing A]\n\nlemma _root_.IsUnit.isStrictlyPositive_star_right_conjugate_iff {u a : A} (hu : IsUnit u) :\n IsStrictlyPositive (u * a * star u) ↔ IsStrictlyPositive a := by\n simp_rw [IsStrictlyPositive.iff_of_unital, hu.star_right_conjugate_nonneg_iff]\n lift u to Aˣ using hu\n rw [← Units.coe_star, Units.isUnit_mul_units, Units.isUnit_units_mul]\n\nlemma _root_.IsUnit.isStrictlyPositive_star_left_conjugate_iff {u a : A} (hu : IsUnit u) :\n IsStrictlyPositive (star u * a * u) ↔ IsStrictlyPositive a := by\n simpa using hu.star.isStrictlyPositive_star_right_conjugate_iff\n\n@[grind =]\n\nTarget:\ntheorem _root_.IsUnit.isStrictlyPositive_iff_conjugate_of_isSelfAdjoint (a b : A) (hb : IsUnit b)\n (hb₂ : IsSelfAdjoint b :=\n\nProof body:\n","proof_body":"by cfc_tac) :\n IsStrictlyPositive (b * a * b) ↔ IsStrictlyPositive a := by\n grind [hb.isStrictlyPositive_star_left_conjugate_iff]","provenance":{"declaration_index":8,"environment_hash":"08dda26699fe1025520aeb9450ff1df6b58e8ef0aa8100ae158997e8a703b831","lean_toolchain":"leanprover/lean4:v4.32.0-rc1","license":"Apache-2.0","original_import_scope":"module-specific","source_revision":"360da6fa66c1273b76b6b2d8c5666fd5ac2e3b56","source_sha256":"a9f5a2e040db478eb9f090e7d70b777b335932049f29e1fe5943dbeb9bc624ee","source_uri":"https://github.com/leanprover-community/mathlib4/blob/360da6fa66c1273b76b6b2d8c5666fd5ac2e3b56/Mathlib/Algebra/Algebra/StrictPositivity.lean"},"sample_id":"6d8bf0d2dcc47dd84e343933d598b89d5d7e2ab0f76d0f19f4d7520db1ced6e1","schema_version":1,"split":"holdout","theorem_statement":"theorem _root_.IsUnit.isStrictlyPositive_iff_conjugate_of_isSelfAdjoint (a b : A) (hb : IsUnit b)\n (hb₂ : IsSelfAdjoint b :="} |
| {"completion":"by cfc_tac) (ha : IsStrictlyPositive a := by cfc_tac) :\n IsStrictlyPositive (b * a * b) :=\n (hb.isStrictlyPositive_iff_conjugate_of_isSelfAdjoint _ _ hb₂).mpr ha","context_contains_namespace":true,"context_suffix":"end StarOrderedRing\nend IsStrictlyPositive","dependency_ids":["import:Mathlib.Algebra.Algebra.Spectrum.Quasispectrum","import:Mathlib.Algebra.Order.Star.Basic","import:Mathlib.Algebra.Order.Module.Defs","import:Mathlib.Tactic.ContinuousFunctionalCalculus"],"family_id":"conjugate_of_isunit_of_isselfadjoint","file_id":"mathlib/Mathlib/Algebra/Algebra/StrictPositivity.lean","imports":["public import Mathlib.Algebra.Algebra.Spectrum.Quasispectrum","public import Mathlib.Algebra.Order.Star.Basic","public import Mathlib.Algebra.Order.Module.Defs","public import Mathlib.Tactic.ContinuousFunctionalCalculus"],"local_context":"/-\nCopyright (c) 2025 Frédéric Dupuis. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Frédéric Dupuis\n-/\n/-!\n# Strictly positive elements of an algebra\n\nThis file introduces strictly positive elements of an algebra (also known as positive definite\nelements). This is mostly used for C⋆-algebras, but the basic definition makes sense in a more\ngeneral context.\n\n## Implementation notes\n\nNote that, while the current definition is adequate in the unital case, it will eventually be\nreplaced by a definition that makes sense in the non-unital case (an element is strictly\npositive if the hereditary C⋆-subalgebra generated by that element is the whole algebra).\nThus, it is best to avoid unfolding the definition and only use the API provided.\n\n## TODO\n\n+ Generalize the definition to non-unital algebras.\n-/\n\n@[expose] public section\n\n/-- An element of an ordered algebra is *strictly positive* if it is nonnegative and invertible.\n\nNOTE: This definition will be generalized to the non-unital case in the future; do not unfold\nthe definition and use the API provided instead to avoid breakage when the refactor happens. -/\ndef IsStrictlyPositive {A : Type*} [LE A] [Monoid A] [Zero A] (a : A) : Prop :=\n 0 ≤ a ∧ IsUnit a\n\nvariable {A : Type*}\n\nnamespace IsStrictlyPositive\n\nsection basic\n\n@[grind _=_]\nlemma iff_of_unital [LE A] [Monoid A] [Zero A] {a : A} :\n IsStrictlyPositive a ↔ 0 ≤ a ∧ IsUnit a := Iff.rfl\n\n@[aesop 20% apply (rule_sets := [CStarAlgebra])]\nprotected lemma nonneg [LE A] [Monoid A] [Zero A] {a : A} (ha : IsStrictlyPositive a) :\n 0 ≤ a := ha.1\n\n@[aesop 20% apply (rule_sets := [CStarAlgebra])]\nprotected lemma isUnit [LE A] [Monoid A] [Zero A] {a : A} (ha : IsStrictlyPositive a) :\n IsUnit a := ha.2\n\nlemma _root_.IsUnit.isStrictlyPositive [LE A] [Monoid A] [Zero A]\n {a : A} (ha : IsUnit a) (ha₀ : 0 ≤ a) : IsStrictlyPositive a := iff_of_unital.mpr ⟨ha₀, ha⟩\n\n@[grind →]\nlemma isSelfAdjoint [Semiring A] [PartialOrder A] [StarRing A] [StarOrderedRing A] {a : A}\n (ha : IsStrictlyPositive a) : IsSelfAdjoint a := ha.nonneg.isSelfAdjoint\n\n@[simp, grind .]\nlemma _root_.isStrictlyPositive_one [LE A] [Monoid A] [Zero A] [ZeroLEOneClass A] :\n IsStrictlyPositive (1 : A) := iff_of_unital.mpr ⟨zero_le_one, isUnit_one⟩\n\n@[grind =]\nlemma _root_.Units.isStrictlyPositive_iff [LE A] [Monoid A] [Zero A] {a : Aˣ} :\n IsStrictlyPositive (a : A) ↔ (0 : A) ≤ a :=\n ⟨fun h => h.nonneg, fun h => iff_of_unital.mp ⟨h, a.isUnit⟩⟩\n\n@[aesop safe apply]\nlemma _root_.Units.isStrictlyPositive_of_le [LE A] [Monoid A] [Zero A] {a : Aˣ}\n (h : (0 : A) ≤ a) : IsStrictlyPositive (a : A) := a.isStrictlyPositive_iff.mpr h\n\n@[nontriviality]\nprotected lemma of_subsingleton [PartialOrder A] [Monoid A] [Zero A] [Subsingleton A]\n {a : A} : IsStrictlyPositive a :=\n iff_of_unital.mpr ⟨by simp, isUnit_of_subsingleton _⟩\n\nend basic\n\nsection StarOrderedRing\nvariable [Semiring A] [StarRing A] [PartialOrder A] [StarOrderedRing A]\n\nlemma _root_.IsUnit.isStrictlyPositive_star_right_conjugate_iff {u a : A} (hu : IsUnit u) :\n IsStrictlyPositive (u * a * star u) ↔ IsStrictlyPositive a := by\n simp_rw [IsStrictlyPositive.iff_of_unital, hu.star_right_conjugate_nonneg_iff]\n lift u to Aˣ using hu\n rw [← Units.coe_star, Units.isUnit_mul_units, Units.isUnit_units_mul]\n\nlemma _root_.IsUnit.isStrictlyPositive_star_left_conjugate_iff {u a : A} (hu : IsUnit u) :\n IsStrictlyPositive (star u * a * u) ↔ IsStrictlyPositive a := by\n simpa using hu.star.isStrictlyPositive_star_right_conjugate_iff\n\n@[grind =]\ntheorem _root_.IsUnit.isStrictlyPositive_iff_conjugate_of_isSelfAdjoint (a b : A) (hb : IsUnit b)\n (hb₂ : IsSelfAdjoint b := by cfc_tac) :\n IsStrictlyPositive (b * a * b) ↔ IsStrictlyPositive a := by\n grind [hb.isStrictlyPositive_star_left_conjugate_iff]\n\n@[aesop safe apply]","module_header":true,"namespace":"IsStrictlyPositive","prompt":"Return exactly one Lean proof body beginning with `by`. Do not emit prose, fences, declarations, sorry, admit, by?, or warnings.\n\nImports:\npublic import Mathlib.Algebra.Algebra.Spectrum.Quasispectrum\npublic import Mathlib.Algebra.Order.Star.Basic\npublic import Mathlib.Algebra.Order.Module.Defs\npublic import Mathlib.Tactic.ContinuousFunctionalCalculus\n\nNamespace:\nIsStrictlyPositive\n\nLocal context:\n/-\nCopyright (c) 2025 Frédéric Dupuis. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Frédéric Dupuis\n-/\n/-!\n# Strictly positive elements of an algebra\n\nThis file introduces strictly positive elements of an algebra (also known as positive definite\nelements). This is mostly used for C⋆-algebras, but the basic definition makes sense in a more\ngeneral context.\n\n## Implementation notes\n\nNote that, while the current definition is adequate in the unital case, it will eventually be\nreplaced by a definition that makes sense in the non-unital case (an element is strictly\npositive if the hereditary C⋆-subalgebra generated by that element is the whole algebra).\nThus, it is best to avoid unfolding the definition and only use the API provided.\n\n## TODO\n\n+ Generalize the definition to non-unital algebras.\n-/\n\n@[expose] public section\n\n/-- An element of an ordered algebra is *strictly positive* if it is nonnegative and invertible.\n\nNOTE: This definition will be generalized to the non-unital case in the future; do not unfold\nthe definition and use the API provided instead to avoid breakage when the refactor happens. -/\ndef IsStrictlyPositive {A : Type*} [LE A] [Monoid A] [Zero A] (a : A) : Prop :=\n 0 ≤ a ∧ IsUnit a\n\nvariable {A : Type*}\n\nnamespace IsStrictlyPositive\n\nsection basic\n\n@[grind _=_]\nlemma iff_of_unital [LE A] [Monoid A] [Zero A] {a : A} :\n IsStrictlyPositive a ↔ 0 ≤ a ∧ IsUnit a := Iff.rfl\n\n@[aesop 20% apply (rule_sets := [CStarAlgebra])]\nprotected lemma nonneg [LE A] [Monoid A] [Zero A] {a : A} (ha : IsStrictlyPositive a) :\n 0 ≤ a := ha.1\n\n@[aesop 20% apply (rule_sets := [CStarAlgebra])]\nprotected lemma isUnit [LE A] [Monoid A] [Zero A] {a : A} (ha : IsStrictlyPositive a) :\n IsUnit a := ha.2\n\nlemma _root_.IsUnit.isStrictlyPositive [LE A] [Monoid A] [Zero A]\n {a : A} (ha : IsUnit a) (ha₀ : 0 ≤ a) : IsStrictlyPositive a := iff_of_unital.mpr ⟨ha₀, ha⟩\n\n@[grind →]\nlemma isSelfAdjoint [Semiring A] [PartialOrder A] [StarRing A] [StarOrderedRing A] {a : A}\n (ha : IsStrictlyPositive a) : IsSelfAdjoint a := ha.nonneg.isSelfAdjoint\n\n@[simp, grind .]\nlemma _root_.isStrictlyPositive_one [LE A] [Monoid A] [Zero A] [ZeroLEOneClass A] :\n IsStrictlyPositive (1 : A) := iff_of_unital.mpr ⟨zero_le_one, isUnit_one⟩\n\n@[grind =]\nlemma _root_.Units.isStrictlyPositive_iff [LE A] [Monoid A] [Zero A] {a : Aˣ} :\n IsStrictlyPositive (a : A) ↔ (0 : A) ≤ a :=\n ⟨fun h => h.nonneg, fun h => iff_of_unital.mp ⟨h, a.isUnit⟩⟩\n\n@[aesop safe apply]\nlemma _root_.Units.isStrictlyPositive_of_le [LE A] [Monoid A] [Zero A] {a : Aˣ}\n (h : (0 : A) ≤ a) : IsStrictlyPositive (a : A) := a.isStrictlyPositive_iff.mpr h\n\n@[nontriviality]\nprotected lemma of_subsingleton [PartialOrder A] [Monoid A] [Zero A] [Subsingleton A]\n {a : A} : IsStrictlyPositive a :=\n iff_of_unital.mpr ⟨by simp, isUnit_of_subsingleton _⟩\n\nend basic\n\nsection StarOrderedRing\nvariable [Semiring A] [StarRing A] [PartialOrder A] [StarOrderedRing A]\n\nlemma _root_.IsUnit.isStrictlyPositive_star_right_conjugate_iff {u a : A} (hu : IsUnit u) :\n IsStrictlyPositive (u * a * star u) ↔ IsStrictlyPositive a := by\n simp_rw [IsStrictlyPositive.iff_of_unital, hu.star_right_conjugate_nonneg_iff]\n lift u to Aˣ using hu\n rw [← Units.coe_star, Units.isUnit_mul_units, Units.isUnit_units_mul]\n\nlemma _root_.IsUnit.isStrictlyPositive_star_left_conjugate_iff {u a : A} (hu : IsUnit u) :\n IsStrictlyPositive (star u * a * u) ↔ IsStrictlyPositive a := by\n simpa using hu.star.isStrictlyPositive_star_right_conjugate_iff\n\n@[grind =]\ntheorem _root_.IsUnit.isStrictlyPositive_iff_conjugate_of_isSelfAdjoint (a b : A) (hb : IsUnit b)\n (hb₂ : IsSelfAdjoint b := by cfc_tac) :\n IsStrictlyPositive (b * a * b) ↔ IsStrictlyPositive a := by\n grind [hb.isStrictlyPositive_star_left_conjugate_iff]\n\n@[aesop safe apply]\n\nTarget:\ntheorem conjugate_of_isUnit_of_isSelfAdjoint (a b : A) (hb : IsUnit b)\n (hb₂ : IsSelfAdjoint b :=\n\nProof body:\n","proof_body":"by cfc_tac) (ha : IsStrictlyPositive a := by cfc_tac) :\n IsStrictlyPositive (b * a * b) :=\n (hb.isStrictlyPositive_iff_conjugate_of_isSelfAdjoint _ _ hb₂).mpr ha","provenance":{"declaration_index":9,"environment_hash":"08dda26699fe1025520aeb9450ff1df6b58e8ef0aa8100ae158997e8a703b831","lean_toolchain":"leanprover/lean4:v4.32.0-rc1","license":"Apache-2.0","original_import_scope":"module-specific","source_revision":"360da6fa66c1273b76b6b2d8c5666fd5ac2e3b56","source_sha256":"a9f5a2e040db478eb9f090e7d70b777b335932049f29e1fe5943dbeb9bc624ee","source_uri":"https://github.com/leanprover-community/mathlib4/blob/360da6fa66c1273b76b6b2d8c5666fd5ac2e3b56/Mathlib/Algebra/Algebra/StrictPositivity.lean"},"sample_id":"382c48d722d549904c67f1ae0a3a50e4630c4bc177d12d2792657a18fa311cf5","schema_version":1,"split":"holdout","theorem_statement":"theorem conjugate_of_isUnit_of_isSelfAdjoint (a b : A) (hb : IsUnit b)\n (hb₂ : IsSelfAdjoint b :="} |
| {"completion":"by\n rw [Algebra.algebraMap_eq_smul_one]\n exact IsStrictlyPositive.smul hc isStrictlyPositive_one","context_contains_namespace":true,"context_suffix":"end Algebra\nend IsStrictlyPositive","dependency_ids":["import:Mathlib.Algebra.Algebra.Spectrum.Quasispectrum","import:Mathlib.Algebra.Order.Star.Basic","import:Mathlib.Algebra.Order.Module.Defs","import:Mathlib.Tactic.ContinuousFunctionalCalculus"],"family_id":"root","file_id":"mathlib/Mathlib/Algebra/Algebra/StrictPositivity.lean","imports":["public import Mathlib.Algebra.Algebra.Spectrum.Quasispectrum","public import Mathlib.Algebra.Order.Star.Basic","public import Mathlib.Algebra.Order.Module.Defs","public import Mathlib.Tactic.ContinuousFunctionalCalculus"],"local_context":"/-\nCopyright (c) 2025 Frédéric Dupuis. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Frédéric Dupuis\n-/\n/-!\n# Strictly positive elements of an algebra\n\nThis file introduces strictly positive elements of an algebra (also known as positive definite\nelements). This is mostly used for C⋆-algebras, but the basic definition makes sense in a more\ngeneral context.\n\n## Implementation notes\n\nNote that, while the current definition is adequate in the unital case, it will eventually be\nreplaced by a definition that makes sense in the non-unital case (an element is strictly\npositive if the hereditary C⋆-subalgebra generated by that element is the whole algebra).\nThus, it is best to avoid unfolding the definition and only use the API provided.\n\n## TODO\n\n+ Generalize the definition to non-unital algebras.\n-/\n\n@[expose] public section\n\n/-- An element of an ordered algebra is *strictly positive* if it is nonnegative and invertible.\n\nNOTE: This definition will be generalized to the non-unital case in the future; do not unfold\nthe definition and use the API provided instead to avoid breakage when the refactor happens. -/\ndef IsStrictlyPositive {A : Type*} [LE A] [Monoid A] [Zero A] (a : A) : Prop :=\n 0 ≤ a ∧ IsUnit a\n\nvariable {A : Type*}\n\nnamespace IsStrictlyPositive\n\nsection basic\n\n@[grind _=_]\nlemma iff_of_unital [LE A] [Monoid A] [Zero A] {a : A} :\n IsStrictlyPositive a ↔ 0 ≤ a ∧ IsUnit a := Iff.rfl\n\n@[aesop 20% apply (rule_sets := [CStarAlgebra])]\nprotected lemma nonneg [LE A] [Monoid A] [Zero A] {a : A} (ha : IsStrictlyPositive a) :\n 0 ≤ a := ha.1\n\n@[aesop 20% apply (rule_sets := [CStarAlgebra])]\nprotected lemma isUnit [LE A] [Monoid A] [Zero A] {a : A} (ha : IsStrictlyPositive a) :\n IsUnit a := ha.2\n\nlemma _root_.IsUnit.isStrictlyPositive [LE A] [Monoid A] [Zero A]\n {a : A} (ha : IsUnit a) (ha₀ : 0 ≤ a) : IsStrictlyPositive a := iff_of_unital.mpr ⟨ha₀, ha⟩\n\n@[grind →]\nlemma isSelfAdjoint [Semiring A] [PartialOrder A] [StarRing A] [StarOrderedRing A] {a : A}\n (ha : IsStrictlyPositive a) : IsSelfAdjoint a := ha.nonneg.isSelfAdjoint\n\n@[simp, grind .]\nlemma _root_.isStrictlyPositive_one [LE A] [Monoid A] [Zero A] [ZeroLEOneClass A] :\n IsStrictlyPositive (1 : A) := iff_of_unital.mpr ⟨zero_le_one, isUnit_one⟩\n\n@[grind =]\nlemma _root_.Units.isStrictlyPositive_iff [LE A] [Monoid A] [Zero A] {a : Aˣ} :\n IsStrictlyPositive (a : A) ↔ (0 : A) ≤ a :=\n ⟨fun h => h.nonneg, fun h => iff_of_unital.mp ⟨h, a.isUnit⟩⟩\n\n@[aesop safe apply]\nlemma _root_.Units.isStrictlyPositive_of_le [LE A] [Monoid A] [Zero A] {a : Aˣ}\n (h : (0 : A) ≤ a) : IsStrictlyPositive (a : A) := a.isStrictlyPositive_iff.mpr h\n\n@[nontriviality]\nprotected lemma of_subsingleton [PartialOrder A] [Monoid A] [Zero A] [Subsingleton A]\n {a : A} : IsStrictlyPositive a :=\n iff_of_unital.mpr ⟨by simp, isUnit_of_subsingleton _⟩\n\nend basic\n\nsection StarOrderedRing\nvariable [Semiring A] [StarRing A] [PartialOrder A] [StarOrderedRing A]\n\nlemma _root_.IsUnit.isStrictlyPositive_star_right_conjugate_iff {u a : A} (hu : IsUnit u) :\n IsStrictlyPositive (u * a * star u) ↔ IsStrictlyPositive a := by\n simp_rw [IsStrictlyPositive.iff_of_unital, hu.star_right_conjugate_nonneg_iff]\n lift u to Aˣ using hu\n rw [← Units.coe_star, Units.isUnit_mul_units, Units.isUnit_units_mul]\n\nlemma _root_.IsUnit.isStrictlyPositive_star_left_conjugate_iff {u a : A} (hu : IsUnit u) :\n IsStrictlyPositive (star u * a * u) ↔ IsStrictlyPositive a := by\n simpa using hu.star.isStrictlyPositive_star_right_conjugate_iff\n\n@[grind =]\ntheorem _root_.IsUnit.isStrictlyPositive_iff_conjugate_of_isSelfAdjoint (a b : A) (hb : IsUnit b)\n (hb₂ : IsSelfAdjoint b := by cfc_tac) :\n IsStrictlyPositive (b * a * b) ↔ IsStrictlyPositive a := by\n grind [hb.isStrictlyPositive_star_left_conjugate_iff]\n\n@[aesop safe apply]\ntheorem conjugate_of_isUnit_of_isSelfAdjoint (a b : A) (hb : IsUnit b)\n (hb₂ : IsSelfAdjoint b := by cfc_tac) (ha : IsStrictlyPositive a := by cfc_tac) :\n IsStrictlyPositive (b * a * b) :=\n (hb.isStrictlyPositive_iff_conjugate_of_isSelfAdjoint _ _ hb₂).mpr ha\n\nend StarOrderedRing\n\nsection Algebra\n\nvariable {𝕜 : Type*} [Ring A] [PartialOrder A]\n\n@[grind ←, aesop safe apply]\nprotected lemma smul [Semifield 𝕜] [PartialOrder 𝕜] [Algebra 𝕜 A] [PosSMulMono 𝕜 A] {c : 𝕜}\n (hc : 0 < c) {a : A} (ha : IsStrictlyPositive a) :\n IsStrictlyPositive (c • a) := by\n have hunit : IsUnit (c • a) :=\n isUnit_iff_exists.mpr ⟨c⁻¹ • ha.isUnit.unit⁻¹, by simp [(ne_of_lt hc).symm]⟩\n exact hunit.isStrictlyPositive (smul_nonneg hc.le ha.nonneg)\n\n@[grind ←, aesop safe apply]","module_header":true,"namespace":"IsStrictlyPositive","prompt":"Return exactly one Lean proof body beginning with `by`. Do not emit prose, fences, declarations, sorry, admit, by?, or warnings.\n\nImports:\npublic import Mathlib.Algebra.Algebra.Spectrum.Quasispectrum\npublic import Mathlib.Algebra.Order.Star.Basic\npublic import Mathlib.Algebra.Order.Module.Defs\npublic import Mathlib.Tactic.ContinuousFunctionalCalculus\n\nNamespace:\nIsStrictlyPositive\n\nLocal context:\n/-\nCopyright (c) 2025 Frédéric Dupuis. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Frédéric Dupuis\n-/\n/-!\n# Strictly positive elements of an algebra\n\nThis file introduces strictly positive elements of an algebra (also known as positive definite\nelements). This is mostly used for C⋆-algebras, but the basic definition makes sense in a more\ngeneral context.\n\n## Implementation notes\n\nNote that, while the current definition is adequate in the unital case, it will eventually be\nreplaced by a definition that makes sense in the non-unital case (an element is strictly\npositive if the hereditary C⋆-subalgebra generated by that element is the whole algebra).\nThus, it is best to avoid unfolding the definition and only use the API provided.\n\n## TODO\n\n+ Generalize the definition to non-unital algebras.\n-/\n\n@[expose] public section\n\n/-- An element of an ordered algebra is *strictly positive* if it is nonnegative and invertible.\n\nNOTE: This definition will be generalized to the non-unital case in the future; do not unfold\nthe definition and use the API provided instead to avoid breakage when the refactor happens. -/\ndef IsStrictlyPositive {A : Type*} [LE A] [Monoid A] [Zero A] (a : A) : Prop :=\n 0 ≤ a ∧ IsUnit a\n\nvariable {A : Type*}\n\nnamespace IsStrictlyPositive\n\nsection basic\n\n@[grind _=_]\nlemma iff_of_unital [LE A] [Monoid A] [Zero A] {a : A} :\n IsStrictlyPositive a ↔ 0 ≤ a ∧ IsUnit a := Iff.rfl\n\n@[aesop 20% apply (rule_sets := [CStarAlgebra])]\nprotected lemma nonneg [LE A] [Monoid A] [Zero A] {a : A} (ha : IsStrictlyPositive a) :\n 0 ≤ a := ha.1\n\n@[aesop 20% apply (rule_sets := [CStarAlgebra])]\nprotected lemma isUnit [LE A] [Monoid A] [Zero A] {a : A} (ha : IsStrictlyPositive a) :\n IsUnit a := ha.2\n\nlemma _root_.IsUnit.isStrictlyPositive [LE A] [Monoid A] [Zero A]\n {a : A} (ha : IsUnit a) (ha₀ : 0 ≤ a) : IsStrictlyPositive a := iff_of_unital.mpr ⟨ha₀, ha⟩\n\n@[grind →]\nlemma isSelfAdjoint [Semiring A] [PartialOrder A] [StarRing A] [StarOrderedRing A] {a : A}\n (ha : IsStrictlyPositive a) : IsSelfAdjoint a := ha.nonneg.isSelfAdjoint\n\n@[simp, grind .]\nlemma _root_.isStrictlyPositive_one [LE A] [Monoid A] [Zero A] [ZeroLEOneClass A] :\n IsStrictlyPositive (1 : A) := iff_of_unital.mpr ⟨zero_le_one, isUnit_one⟩\n\n@[grind =]\nlemma _root_.Units.isStrictlyPositive_iff [LE A] [Monoid A] [Zero A] {a : Aˣ} :\n IsStrictlyPositive (a : A) ↔ (0 : A) ≤ a :=\n ⟨fun h => h.nonneg, fun h => iff_of_unital.mp ⟨h, a.isUnit⟩⟩\n\n@[aesop safe apply]\nlemma _root_.Units.isStrictlyPositive_of_le [LE A] [Monoid A] [Zero A] {a : Aˣ}\n (h : (0 : A) ≤ a) : IsStrictlyPositive (a : A) := a.isStrictlyPositive_iff.mpr h\n\n@[nontriviality]\nprotected lemma of_subsingleton [PartialOrder A] [Monoid A] [Zero A] [Subsingleton A]\n {a : A} : IsStrictlyPositive a :=\n iff_of_unital.mpr ⟨by simp, isUnit_of_subsingleton _⟩\n\nend basic\n\nsection StarOrderedRing\nvariable [Semiring A] [StarRing A] [PartialOrder A] [StarOrderedRing A]\n\nlemma _root_.IsUnit.isStrictlyPositive_star_right_conjugate_iff {u a : A} (hu : IsUnit u) :\n IsStrictlyPositive (u * a * star u) ↔ IsStrictlyPositive a := by\n simp_rw [IsStrictlyPositive.iff_of_unital, hu.star_right_conjugate_nonneg_iff]\n lift u to Aˣ using hu\n rw [← Units.coe_star, Units.isUnit_mul_units, Units.isUnit_units_mul]\n\nlemma _root_.IsUnit.isStrictlyPositive_star_left_conjugate_iff {u a : A} (hu : IsUnit u) :\n IsStrictlyPositive (star u * a * u) ↔ IsStrictlyPositive a := by\n simpa using hu.star.isStrictlyPositive_star_right_conjugate_iff\n\n@[grind =]\ntheorem _root_.IsUnit.isStrictlyPositive_iff_conjugate_of_isSelfAdjoint (a b : A) (hb : IsUnit b)\n (hb₂ : IsSelfAdjoint b := by cfc_tac) :\n IsStrictlyPositive (b * a * b) ↔ IsStrictlyPositive a := by\n grind [hb.isStrictlyPositive_star_left_conjugate_iff]\n\n@[aesop safe apply]\ntheorem conjugate_of_isUnit_of_isSelfAdjoint (a b : A) (hb : IsUnit b)\n (hb₂ : IsSelfAdjoint b := by cfc_tac) (ha : IsStrictlyPositive a := by cfc_tac) :\n IsStrictlyPositive (b * a * b) :=\n (hb.isStrictlyPositive_iff_conjugate_of_isSelfAdjoint _ _ hb₂).mpr ha\n\nend StarOrderedRing\n\nsection Algebra\n\nvariable {𝕜 : Type*} [Ring A] [PartialOrder A]\n\n@[grind ←, aesop safe apply]\nprotected lemma smul [Semifield 𝕜] [PartialOrder 𝕜] [Algebra 𝕜 A] [PosSMulMono 𝕜 A] {c : 𝕜}\n (hc : 0 < c) {a : A} (ha : IsStrictlyPositive a) :\n IsStrictlyPositive (c • a) := by\n have hunit : IsUnit (c • a) :=\n isUnit_iff_exists.mpr ⟨c⁻¹ • ha.isUnit.unit⁻¹, by simp [(ne_of_lt hc).symm]⟩\n exact hunit.isStrictlyPositive (smul_nonneg hc.le ha.nonneg)\n\n@[grind ←, aesop safe apply]\n\nTarget:\nlemma _root_.isStrictlyPositive_algebraMap [ZeroLEOneClass A] [Semifield 𝕜] [PartialOrder 𝕜]\n [Algebra 𝕜 A] [PosSMulMono 𝕜 A] {c : 𝕜} (hc : 0 < c) :\n IsStrictlyPositive (algebraMap 𝕜 A c) :=\n\nProof body:\n","proof_body":"by\n rw [Algebra.algebraMap_eq_smul_one]\n exact IsStrictlyPositive.smul hc isStrictlyPositive_one","provenance":{"declaration_index":10,"environment_hash":"08dda26699fe1025520aeb9450ff1df6b58e8ef0aa8100ae158997e8a703b831","lean_toolchain":"leanprover/lean4:v4.32.0-rc1","license":"Apache-2.0","original_import_scope":"module-specific","source_revision":"360da6fa66c1273b76b6b2d8c5666fd5ac2e3b56","source_sha256":"a9f5a2e040db478eb9f090e7d70b777b335932049f29e1fe5943dbeb9bc624ee","source_uri":"https://github.com/leanprover-community/mathlib4/blob/360da6fa66c1273b76b6b2d8c5666fd5ac2e3b56/Mathlib/Algebra/Algebra/StrictPositivity.lean"},"sample_id":"6bf1c58c486e033e9ca4b8d0f8d314f8788d09995ff244a4d844d5f6b7a86e07","schema_version":1,"split":"holdout","theorem_statement":"lemma _root_.isStrictlyPositive_algebraMap [ZeroLEOneClass A] [Semifield 𝕜] [PartialOrder 𝕜]\n [Algebra 𝕜 A] [PosSMulMono 𝕜 A] {c : 𝕜} (hc : 0 < c) :\n IsStrictlyPositive (algebraMap 𝕜 A c) :="} |
| {"completion":"by\n rintro ⟨⟨⟨f, _⟩, _⟩, _⟩ ⟨⟨⟨g, _⟩, _⟩, _⟩ h; congr","context_contains_namespace":true,"context_suffix":"end NonUnitalAlgHom","dependency_ids":["import:Mathlib.Algebra.Algebra.Hom","import:Mathlib.Algebra.GroupWithZero.Action.Prod"],"family_id":"coe_injective","file_id":"mathlib/Mathlib/Algebra/Algebra/NonUnitalHom.lean","imports":["public import Mathlib.Algebra.Algebra.Hom","public import Mathlib.Algebra.GroupWithZero.Action.Prod"],"local_context":"/-\nCopyright (c) 2021 Oliver Nash. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Oliver Nash\n-/\n/-!\n# Morphisms of non-unital algebras\n\nThis file defines morphisms between two types, each of which carries:\n* an addition,\n* an additive zero,\n* a multiplication,\n* a scalar action.\n\nThe multiplications are not assumed to be associative or unital, or even to be compatible with the\nscalar actions. In a typical application, the operations will satisfy compatibility conditions\nmaking them into algebras (albeit possibly non-associative and/or non-unital) but such conditions\nare not required to make this definition.\n\nThis notion of morphism should be useful for any category of non-unital algebras. The motivating\napplication at the time it was introduced was to be able to state the adjunction property for\nmagma algebras. These are non-unital, non-associative algebras obtained by applying the\ngroup-algebra construction except where we take a type carrying just `Mul` instead of `Group`.\n\nFor a plausible future application, one could take the non-unital algebra of compactly-supported\nfunctions on a non-compact topological space. A proper map between a pair of such spaces\n(contravariantly) induces a morphism between their algebras of compactly-supported functions which\nwill be a `NonUnitalAlgHom`.\n\nTODO: add `NonUnitalAlgEquiv` when needed.\n\n## Main definitions\n\n * `NonUnitalAlgHom`\n * `AlgHom.toNonUnitalAlgHom`\n\n## Tags\n\nnon-unital, algebra, morphism\n-/\n\n@[expose] public section\n\nuniverse u u₁ v w w₁ w₂ w₃\n\nvariable {R : Type u} {S : Type u₁}\n\n/-- A morphism respecting addition, multiplication, and scalar multiplication\n(denoted as `A →ₛₙₐ[φ] B`, or `A →ₙₐ[R] B` when `φ` is the identity on `R`).\nWhen these arise from algebra structures, this is the same\nas a not-necessarily-unital morphism of algebras. -/\nstructure NonUnitalAlgHom [Monoid R] [Monoid S] (φ : R →* S) (A : Type v) (B : Type w)\n [NonUnitalNonAssocSemiring A] [DistribMulAction R A]\n [NonUnitalNonAssocSemiring B] [DistribMulAction S B] extends A →ₑ+[φ] B, A →ₙ* B\n\n@[inherit_doc NonUnitalAlgHom]\ninfixr:25 \" →ₙₐ \" => NonUnitalAlgHom _\n\n@[inherit_doc]\nnotation:25 A \" →ₛₙₐ[\" φ \"] \" B => NonUnitalAlgHom φ A B\n\n@[inherit_doc]\nnotation:25 A \" →ₙₐ[\" R \"] \" B => NonUnitalAlgHom (MonoidHom.id R) A B\n\nattribute [nolint docBlame] NonUnitalAlgHom.toMulHom\n\n/-- `NonUnitalAlgSemiHomClass F φ A B` asserts `F` is a type of bundled algebra homomorphisms\nfrom `A` to `B` which are equivariant with respect to `φ`. -/\nclass NonUnitalAlgSemiHomClass (F : Type*) {R S : outParam Type*} [Monoid R] [Monoid S]\n (φ : outParam (R →* S)) (A B : outParam Type*)\n [NonUnitalNonAssocSemiring A] [NonUnitalNonAssocSemiring B]\n [DistribMulAction R A] [DistribMulAction S B] [FunLike F A B] : Prop\n extends DistribMulActionSemiHomClass F φ A B, MulHomClass F A B\n\n/-- `NonUnitalAlgHomClass F R A B` asserts `F` is a type of bundled algebra homomorphisms\nfrom `A` to `B` which are `R`-linear.\n\n This is an abbreviation to `NonUnitalAlgSemiHomClass F (MonoidHom.id R) A B` -/\nabbrev NonUnitalAlgHomClass (F : Type*) (R A B : outParam Type*)\n [Monoid R] [NonUnitalNonAssocSemiring A] [NonUnitalNonAssocSemiring B]\n [DistribMulAction R A] [DistribMulAction R B] [FunLike F A B] :=\n NonUnitalAlgSemiHomClass F (MonoidHom.id R) A B\n\nnamespace NonUnitalAlgHomClass\n\n-- See note [lower instance priority]\ninstance (priority := 100) toNonUnitalRingHomClass\n {F R S A B : Type*} {_ : Monoid R} {_ : Monoid S} {φ : outParam (R →* S)}\n {_ : NonUnitalNonAssocSemiring A} [DistribMulAction R A]\n {_ : NonUnitalNonAssocSemiring B} [DistribMulAction S B] [FunLike F A B]\n [NonUnitalAlgSemiHomClass F φ A B] : NonUnitalRingHomClass F A B :=\n { ‹NonUnitalAlgSemiHomClass F φ A B› with }\n\nvariable [Semiring R] [Semiring S] {φ : R →+* S}\n {A B : Type*} [NonUnitalNonAssocSemiring A] [Module R A]\n [NonUnitalNonAssocSemiring B] [Module S B]\n\n-- see Note [lower instance priority]\ninstance (priority := 100) {F R S A B : Type*}\n {_ : Semiring R} {_ : Semiring S} {φ : R →+* S}\n {_ : NonUnitalSemiring A} {_ : NonUnitalSemiring B} [Module R A] [Module S B] [FunLike F A B]\n [NonUnitalAlgSemiHomClass (R := R) (S := S) F φ A B] :\n SemilinearMapClass F φ A B :=\n { ‹NonUnitalAlgSemiHomClass F φ A B› with map_smulₛₗ := map_smulₛₗ }\n\ninstance (priority := 100) {F : Type*} [FunLike F A B] [Module R B] [NonUnitalAlgHomClass F R A B] :\n LinearMapClass F R A B :=\n { ‹NonUnitalAlgHomClass F R A B› with map_smulₛₗ := map_smulₛₗ }\n\n/-- Turn an element of a type `F` satisfying `NonUnitalAlgSemiHomClass F φ A B` into an actual\n`NonUnitalAlgHom`. This is declared as the default coercion from `F` to `A →ₛₙₐ[φ] B`. -/\n@[coe]\ndef toNonUnitalAlgSemiHom {F R S : Type*} [Monoid R] [Monoid S] {φ : R →* S} {A B : Type*}\n [NonUnitalNonAssocSemiring A] [DistribMulAction R A]\n [NonUnitalNonAssocSemiring B] [DistribMulAction S B] [FunLike F A B]\n [NonUnitalAlgSemiHomClass F φ A B] (f : F) : A →ₛₙₐ[φ] B :=\n { (f : A →ₙ+* B) with\n toFun := f\n map_smul' := map_smulₛₗ f }\n\ninstance {F R S A B : Type*} [Monoid R] [Monoid S] {φ : R →* S}\n [NonUnitalNonAssocSemiring A] [DistribMulAction R A]\n [NonUnitalNonAssocSemiring B] [DistribMulAction S B] [FunLike F A B]\n [NonUnitalAlgSemiHomClass F φ A B] :\n CoeTC F (A →ₛₙₐ[φ] B) :=\n ⟨toNonUnitalAlgSemiHom⟩\n\n/-- Turn an element of a type `F` satisfying `NonUnitalAlgHomClass F R A B` into an actual\n@[coe]\n`NonUnitalAlgHom`. This is declared as the default coercion from `F` to `A →ₛₙₐ[R] B`. -/\ndef toNonUnitalAlgHom {F R : Type*} [Monoid R] {A B : Type*}\n [NonUnitalNonAssocSemiring A] [DistribMulAction R A]\n [NonUnitalNonAssocSemiring B] [DistribMulAction R B]\n [FunLike F A B] [NonUnitalAlgHomClass F R A B] (f : F) : A →ₙₐ[R] B :=\n { (f : A →ₙ+* B) with\n toFun := f\n map_smul' := map_smulₛₗ f }\n\ninstance {F R : Type*} [Monoid R] {A B : Type*}\n [NonUnitalNonAssocSemiring A] [DistribMulAction R A]\n [NonUnitalNonAssocSemiring B] [DistribMulAction R B]\n [FunLike F A B] [NonUnitalAlgHomClass F R A B] :\n CoeTC F (A →ₙₐ[R] B) :=\n ⟨toNonUnitalAlgHom⟩\n\nend NonUnitalAlgHomClass\n\nnamespace NonUnitalAlgHom\n\nvariable {T : Type*} [Monoid R] [Monoid S] [Monoid T] (φ : R →* S)\nvariable (A : Type v) (B : Type w) (C : Type w₁)\nvariable [NonUnitalNonAssocSemiring A] [DistribMulAction R A]\nvariable [NonUnitalNonAssocSemiring B] [DistribMulAction S B]\nvariable [NonUnitalNonAssocSemiring C] [DistribMulAction T C]\n\ninstance : FunLike (A →ₛₙₐ[φ] B) A B where\n coe f := f.toFun\n coe_injective := by rintro ⟨⟨⟨f, _⟩, _⟩, _⟩ ⟨⟨⟨g, _⟩, _⟩, _⟩ h; congr\n\n@[simp]\ntheorem toFun_eq_coe (f : A →ₛₙₐ[φ] B) : f.toFun = ⇑f :=\n rfl\n\n/-- See Note [custom simps projection] -/\ndef Simps.apply (f : A →ₛₙₐ[φ] B) : A → B := f\n\ninitialize_simps_projections NonUnitalAlgHom\n (toDistribMulActionHom_toMulActionHom_toFun → apply, -toDistribMulActionHom)\n\nvariable {φ A B C}\n@[simp]\nprotected theorem coe_coe {F : Type*} [FunLike F A B]\n [NonUnitalAlgSemiHomClass F φ A B] (f : F) :\n ⇑(f : A →ₛₙₐ[φ] B) = f :=\n rfl","module_header":true,"namespace":"NonUnitalAlgHom","prompt":"Return exactly one Lean proof body beginning with `by`. Do not emit prose, fences, declarations, sorry, admit, by?, or warnings.\n\nImports:\npublic import Mathlib.Algebra.Algebra.Hom\npublic import Mathlib.Algebra.GroupWithZero.Action.Prod\n\nNamespace:\nNonUnitalAlgHom\n\nLocal context:\n/-\nCopyright (c) 2021 Oliver Nash. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Oliver Nash\n-/\n/-!\n# Morphisms of non-unital algebras\n\nThis file defines morphisms between two types, each of which carries:\n* an addition,\n* an additive zero,\n* a multiplication,\n* a scalar action.\n\nThe multiplications are not assumed to be associative or unital, or even to be compatible with the\nscalar actions. In a typical application, the operations will satisfy compatibility conditions\nmaking them into algebras (albeit possibly non-associative and/or non-unital) but such conditions\nare not required to make this definition.\n\nThis notion of morphism should be useful for any category of non-unital algebras. The motivating\napplication at the time it was introduced was to be able to state the adjunction property for\nmagma algebras. These are non-unital, non-associative algebras obtained by applying the\ngroup-algebra construction except where we take a type carrying just `Mul` instead of `Group`.\n\nFor a plausible future application, one could take the non-unital algebra of compactly-supported\nfunctions on a non-compact topological space. A proper map between a pair of such spaces\n(contravariantly) induces a morphism between their algebras of compactly-supported functions which\nwill be a `NonUnitalAlgHom`.\n\nTODO: add `NonUnitalAlgEquiv` when needed.\n\n## Main definitions\n\n * `NonUnitalAlgHom`\n * `AlgHom.toNonUnitalAlgHom`\n\n## Tags\n\nnon-unital, algebra, morphism\n-/\n\n@[expose] public section\n\nuniverse u u₁ v w w₁ w₂ w₃\n\nvariable {R : Type u} {S : Type u₁}\n\n/-- A morphism respecting addition, multiplication, and scalar multiplication\n(denoted as `A →ₛₙₐ[φ] B`, or `A →ₙₐ[R] B` when `φ` is the identity on `R`).\nWhen these arise from algebra structures, this is the same\nas a not-necessarily-unital morphism of algebras. -/\nstructure NonUnitalAlgHom [Monoid R] [Monoid S] (φ : R →* S) (A : Type v) (B : Type w)\n [NonUnitalNonAssocSemiring A] [DistribMulAction R A]\n [NonUnitalNonAssocSemiring B] [DistribMulAction S B] extends A →ₑ+[φ] B, A →ₙ* B\n\n@[inherit_doc NonUnitalAlgHom]\ninfixr:25 \" →ₙₐ \" => NonUnitalAlgHom _\n\n@[inherit_doc]\nnotation:25 A \" →ₛₙₐ[\" φ \"] \" B => NonUnitalAlgHom φ A B\n\n@[inherit_doc]\nnotation:25 A \" →ₙₐ[\" R \"] \" B => NonUnitalAlgHom (MonoidHom.id R) A B\n\nattribute [nolint docBlame] NonUnitalAlgHom.toMulHom\n\n/-- `NonUnitalAlgSemiHomClass F φ A B` asserts `F` is a type of bundled algebra homomorphisms\nfrom `A` to `B` which are equivariant with respect to `φ`. -/\nclass NonUnitalAlgSemiHomClass (F : Type*) {R S : outParam Type*} [Monoid R] [Monoid S]\n (φ : outParam (R →* S)) (A B : outParam Type*)\n [NonUnitalNonAssocSemiring A] [NonUnitalNonAssocSemiring B]\n [DistribMulAction R A] [DistribMulAction S B] [FunLike F A B] : Prop\n extends DistribMulActionSemiHomClass F φ A B, MulHomClass F A B\n\n/-- `NonUnitalAlgHomClass F R A B` asserts `F` is a type of bundled algebra homomorphisms\nfrom `A` to `B` which are `R`-linear.\n\n This is an abbreviation to `NonUnitalAlgSemiHomClass F (MonoidHom.id R) A B` -/\nabbrev NonUnitalAlgHomClass (F : Type*) (R A B : outParam Type*)\n [Monoid R] [NonUnitalNonAssocSemiring A] [NonUnitalNonAssocSemiring B]\n [DistribMulAction R A] [DistribMulAction R B] [FunLike F A B] :=\n NonUnitalAlgSemiHomClass F (MonoidHom.id R) A B\n\nnamespace NonUnitalAlgHomClass\n\n-- See note [lower instance priority]\ninstance (priority := 100) toNonUnitalRingHomClass\n {F R S A B : Type*} {_ : Monoid R} {_ : Monoid S} {φ : outParam (R →* S)}\n {_ : NonUnitalNonAssocSemiring A} [DistribMulAction R A]\n {_ : NonUnitalNonAssocSemiring B} [DistribMulAction S B] [FunLike F A B]\n [NonUnitalAlgSemiHomClass F φ A B] : NonUnitalRingHomClass F A B :=\n { ‹NonUnitalAlgSemiHomClass F φ A B› with }\n\nvariable [Semiring R] [Semiring S] {φ : R →+* S}\n {A B : Type*} [NonUnitalNonAssocSemiring A] [Module R A]\n [NonUnitalNonAssocSemiring B] [Module S B]\n\n-- see Note [lower instance priority]\ninstance (priority := 100) {F R S A B : Type*}\n {_ : Semiring R} {_ : Semiring S} {φ : R →+* S}\n {_ : NonUnitalSemiring A} {_ : NonUnitalSemiring B} [Module R A] [Module S B] [FunLike F A B]\n [NonUnitalAlgSemiHomClass (R := R) (S := S) F φ A B] :\n SemilinearMapClass F φ A B :=\n { ‹NonUnitalAlgSemiHomClass F φ A B› with map_smulₛₗ := map_smulₛₗ }\n\ninstance (priority := 100) {F : Type*} [FunLike F A B] [Module R B] [NonUnitalAlgHomClass F R A B] :\n LinearMapClass F R A B :=\n { ‹NonUnitalAlgHomClass F R A B› with map_smulₛₗ := map_smulₛₗ }\n\n/-- Turn an element of a type `F` satisfying `NonUnitalAlgSemiHomClass F φ A B` into an actual\n`NonUnitalAlgHom`. This is declared as the default coercion from `F` to `A →ₛₙₐ[φ] B`. -/\n@[coe]\ndef toNonUnitalAlgSemiHom {F R S : Type*} [Monoid R] [Monoid S] {φ : R →* S} {A B : Type*}\n [NonUnitalNonAssocSemiring A] [DistribMulAction R A]\n [NonUnitalNonAssocSemiring B] [DistribMulAction S B] [FunLike F A B]\n [NonUnitalAlgSemiHomClass F φ A B] (f : F) : A →ₛₙₐ[φ] B :=\n { (f : A →ₙ+* B) with\n toFun := f\n map_smul' := map_smulₛₗ f }\n\ninstance {F R S A B : Type*} [Monoid R] [Monoid S] {φ : R →* S}\n [NonUnitalNonAssocSemiring A] [DistribMulAction R A]\n [NonUnitalNonAssocSemiring B] [DistribMulAction S B] [FunLike F A B]\n [NonUnitalAlgSemiHomClass F φ A B] :\n CoeTC F (A →ₛₙₐ[φ] B) :=\n ⟨toNonUnitalAlgSemiHom⟩\n\n/-- Turn an element of a type `F` satisfying `NonUnitalAlgHomClass F R A B` into an actual\n@[coe]\n`NonUnitalAlgHom`. This is declared as the default coercion from `F` to `A →ₛₙₐ[R] B`. -/\ndef toNonUnitalAlgHom {F R : Type*} [Monoid R] {A B : Type*}\n [NonUnitalNonAssocSemiring A] [DistribMulAction R A]\n [NonUnitalNonAssocSemiring B] [DistribMulAction R B]\n [FunLike F A B] [NonUnitalAlgHomClass F R A B] (f : F) : A →ₙₐ[R] B :=\n { (f : A →ₙ+* B) with\n toFun := f\n map_smul' := map_smulₛₗ f }\n\ninstance {F R : Type*} [Monoid R] {A B : Type*}\n [NonUnitalNonAssocSemiring A] [DistribMulAction R A]\n [NonUnitalNonAssocSemiring B] [DistribMulAction R B]\n [FunLike F A B] [NonUnitalAlgHomClass F R A B] :\n CoeTC F (A →ₙₐ[R] B) :=\n ⟨toNonUnitalAlgHom⟩\n\nend NonUnitalAlgHomClass\n\nnamespace NonUnitalAlgHom\n\nvariable {T : Type*} [Monoid R] [Monoid S] [Monoid T] (φ : R →* S)\nvariable (A : Type v) (B : Type w) (C : Type w₁)\nvariable [NonUnitalNonAssocSemiring A] [DistribMulAction R A]\nvariable [NonUnitalNonAssocSemiring B] [DistribMulAction S B]\nvariable [NonUnitalNonAssocSemiring C] [DistribMulAction T C]\n\ninstance : FunLike (A →ₛₙₐ[φ] B) A B where\n coe f := f.toFun\n coe_injective := by rintro ⟨⟨⟨f, _⟩, _⟩, _⟩ ⟨⟨⟨g, _⟩, _⟩, _⟩ h; congr\n\n@[simp]\ntheorem toFun_eq_coe (f : A →ₛₙₐ[φ] B) : f.toFun = ⇑f :=\n rfl\n\n/-- See Note [custom simps projection] -/\ndef Simps.apply (f : A →ₛₙₐ[φ] B) : A → B := f\n\ninitialize_simps_projections NonUnitalAlgHom\n (toDistribMulActionHom_toMulActionHom_toFun → apply, -toDistribMulActionHom)\n\nvariable {φ A B C}\n@[simp]\nprotected theorem coe_coe {F : Type*} [FunLike F A B]\n [NonUnitalAlgSemiHomClass F φ A B] (f : F) :\n ⇑(f : A →ₛₙₐ[φ] B) = f :=\n rfl\n\nTarget:\ntheorem coe_injective : @Function.Injective (A →ₛₙₐ[φ] B) (A → B) (↑) :=\n\nProof body:\n","proof_body":"by\n rintro ⟨⟨⟨f, _⟩, _⟩, _⟩ ⟨⟨⟨g, _⟩, _⟩, _⟩ h; congr","provenance":{"declaration_index":1,"environment_hash":"08dda26699fe1025520aeb9450ff1df6b58e8ef0aa8100ae158997e8a703b831","lean_toolchain":"leanprover/lean4:v4.32.0-rc1","license":"Apache-2.0","original_import_scope":"module-specific","source_revision":"360da6fa66c1273b76b6b2d8c5666fd5ac2e3b56","source_sha256":"929fc720c21b33e33bbf0a692c3be55b0da352771a5dbb4e09a095c80437d1a6","source_uri":"https://github.com/leanprover-community/mathlib4/blob/360da6fa66c1273b76b6b2d8c5666fd5ac2e3b56/Mathlib/Algebra/Algebra/NonUnitalHom.lean"},"sample_id":"ff3ef85326780ec04f162693b7f81032494a8a92b52b64d72381cd7bdcb29635","schema_version":1,"split":"holdout","theorem_statement":"theorem coe_injective : @Function.Injective (A →ₛₙₐ[φ] B) (A → B) (↑) :="} |
| {"completion":"by\n rfl","context_contains_namespace":true,"context_suffix":"end NonUnitalAlgHom","dependency_ids":["import:Mathlib.Algebra.Algebra.Hom","import:Mathlib.Algebra.GroupWithZero.Action.Prod"],"family_id":"mk_coe","file_id":"mathlib/Mathlib/Algebra/Algebra/NonUnitalHom.lean","imports":["public import Mathlib.Algebra.Algebra.Hom","public import Mathlib.Algebra.GroupWithZero.Action.Prod"],"local_context":"/-\nCopyright (c) 2021 Oliver Nash. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Oliver Nash\n-/\n/-!\n# Morphisms of non-unital algebras\n\nThis file defines morphisms between two types, each of which carries:\n* an addition,\n* an additive zero,\n* a multiplication,\n* a scalar action.\n\nThe multiplications are not assumed to be associative or unital, or even to be compatible with the\nscalar actions. In a typical application, the operations will satisfy compatibility conditions\nmaking them into algebras (albeit possibly non-associative and/or non-unital) but such conditions\nare not required to make this definition.\n\nThis notion of morphism should be useful for any category of non-unital algebras. The motivating\napplication at the time it was introduced was to be able to state the adjunction property for\nmagma algebras. These are non-unital, non-associative algebras obtained by applying the\ngroup-algebra construction except where we take a type carrying just `Mul` instead of `Group`.\n\nFor a plausible future application, one could take the non-unital algebra of compactly-supported\nfunctions on a non-compact topological space. A proper map between a pair of such spaces\n(contravariantly) induces a morphism between their algebras of compactly-supported functions which\nwill be a `NonUnitalAlgHom`.\n\nTODO: add `NonUnitalAlgEquiv` when needed.\n\n## Main definitions\n\n * `NonUnitalAlgHom`\n * `AlgHom.toNonUnitalAlgHom`\n\n## Tags\n\nnon-unital, algebra, morphism\n-/\n\n@[expose] public section\n\nuniverse u u₁ v w w₁ w₂ w₃\n\nvariable {R : Type u} {S : Type u₁}\n\n/-- A morphism respecting addition, multiplication, and scalar multiplication\n(denoted as `A →ₛₙₐ[φ] B`, or `A →ₙₐ[R] B` when `φ` is the identity on `R`).\nWhen these arise from algebra structures, this is the same\nas a not-necessarily-unital morphism of algebras. -/\nstructure NonUnitalAlgHom [Monoid R] [Monoid S] (φ : R →* S) (A : Type v) (B : Type w)\n [NonUnitalNonAssocSemiring A] [DistribMulAction R A]\n [NonUnitalNonAssocSemiring B] [DistribMulAction S B] extends A →ₑ+[φ] B, A →ₙ* B\n\n@[inherit_doc NonUnitalAlgHom]\ninfixr:25 \" →ₙₐ \" => NonUnitalAlgHom _\n\n@[inherit_doc]\nnotation:25 A \" →ₛₙₐ[\" φ \"] \" B => NonUnitalAlgHom φ A B\n\n@[inherit_doc]\nnotation:25 A \" →ₙₐ[\" R \"] \" B => NonUnitalAlgHom (MonoidHom.id R) A B\n\nattribute [nolint docBlame] NonUnitalAlgHom.toMulHom\n\n/-- `NonUnitalAlgSemiHomClass F φ A B` asserts `F` is a type of bundled algebra homomorphisms\nfrom `A` to `B` which are equivariant with respect to `φ`. -/\nclass NonUnitalAlgSemiHomClass (F : Type*) {R S : outParam Type*} [Monoid R] [Monoid S]\n (φ : outParam (R →* S)) (A B : outParam Type*)\n [NonUnitalNonAssocSemiring A] [NonUnitalNonAssocSemiring B]\n [DistribMulAction R A] [DistribMulAction S B] [FunLike F A B] : Prop\n extends DistribMulActionSemiHomClass F φ A B, MulHomClass F A B\n\n/-- `NonUnitalAlgHomClass F R A B` asserts `F` is a type of bundled algebra homomorphisms\nfrom `A` to `B` which are `R`-linear.\n\n This is an abbreviation to `NonUnitalAlgSemiHomClass F (MonoidHom.id R) A B` -/\nabbrev NonUnitalAlgHomClass (F : Type*) (R A B : outParam Type*)\n [Monoid R] [NonUnitalNonAssocSemiring A] [NonUnitalNonAssocSemiring B]\n [DistribMulAction R A] [DistribMulAction R B] [FunLike F A B] :=\n NonUnitalAlgSemiHomClass F (MonoidHom.id R) A B\n\nnamespace NonUnitalAlgHomClass\n\n-- See note [lower instance priority]\ninstance (priority := 100) toNonUnitalRingHomClass\n {F R S A B : Type*} {_ : Monoid R} {_ : Monoid S} {φ : outParam (R →* S)}\n {_ : NonUnitalNonAssocSemiring A} [DistribMulAction R A]\n {_ : NonUnitalNonAssocSemiring B} [DistribMulAction S B] [FunLike F A B]\n [NonUnitalAlgSemiHomClass F φ A B] : NonUnitalRingHomClass F A B :=\n { ‹NonUnitalAlgSemiHomClass F φ A B› with }\n\nvariable [Semiring R] [Semiring S] {φ : R →+* S}\n {A B : Type*} [NonUnitalNonAssocSemiring A] [Module R A]\n [NonUnitalNonAssocSemiring B] [Module S B]\n\n-- see Note [lower instance priority]\ninstance (priority := 100) {F R S A B : Type*}\n {_ : Semiring R} {_ : Semiring S} {φ : R →+* S}\n {_ : NonUnitalSemiring A} {_ : NonUnitalSemiring B} [Module R A] [Module S B] [FunLike F A B]\n [NonUnitalAlgSemiHomClass (R := R) (S := S) F φ A B] :\n SemilinearMapClass F φ A B :=\n { ‹NonUnitalAlgSemiHomClass F φ A B› with map_smulₛₗ := map_smulₛₗ }\n\ninstance (priority := 100) {F : Type*} [FunLike F A B] [Module R B] [NonUnitalAlgHomClass F R A B] :\n LinearMapClass F R A B :=\n { ‹NonUnitalAlgHomClass F R A B› with map_smulₛₗ := map_smulₛₗ }\n\n/-- Turn an element of a type `F` satisfying `NonUnitalAlgSemiHomClass F φ A B` into an actual\n`NonUnitalAlgHom`. This is declared as the default coercion from `F` to `A →ₛₙₐ[φ] B`. -/\n@[coe]\ndef toNonUnitalAlgSemiHom {F R S : Type*} [Monoid R] [Monoid S] {φ : R →* S} {A B : Type*}\n [NonUnitalNonAssocSemiring A] [DistribMulAction R A]\n [NonUnitalNonAssocSemiring B] [DistribMulAction S B] [FunLike F A B]\n [NonUnitalAlgSemiHomClass F φ A B] (f : F) : A →ₛₙₐ[φ] B :=\n { (f : A →ₙ+* B) with\n toFun := f\n map_smul' := map_smulₛₗ f }\n\ninstance {F R S A B : Type*} [Monoid R] [Monoid S] {φ : R →* S}\n [NonUnitalNonAssocSemiring A] [DistribMulAction R A]\n [NonUnitalNonAssocSemiring B] [DistribMulAction S B] [FunLike F A B]\n [NonUnitalAlgSemiHomClass F φ A B] :\n CoeTC F (A →ₛₙₐ[φ] B) :=\n ⟨toNonUnitalAlgSemiHom⟩\n\n/-- Turn an element of a type `F` satisfying `NonUnitalAlgHomClass F R A B` into an actual\n@[coe]\n`NonUnitalAlgHom`. This is declared as the default coercion from `F` to `A →ₛₙₐ[R] B`. -/\ndef toNonUnitalAlgHom {F R : Type*} [Monoid R] {A B : Type*}\n [NonUnitalNonAssocSemiring A] [DistribMulAction R A]\n [NonUnitalNonAssocSemiring B] [DistribMulAction R B]\n [FunLike F A B] [NonUnitalAlgHomClass F R A B] (f : F) : A →ₙₐ[R] B :=\n { (f : A →ₙ+* B) with\n toFun := f\n map_smul' := map_smulₛₗ f }\n\ninstance {F R : Type*} [Monoid R] {A B : Type*}\n [NonUnitalNonAssocSemiring A] [DistribMulAction R A]\n [NonUnitalNonAssocSemiring B] [DistribMulAction R B]\n [FunLike F A B] [NonUnitalAlgHomClass F R A B] :\n CoeTC F (A →ₙₐ[R] B) :=\n ⟨toNonUnitalAlgHom⟩\n\nend NonUnitalAlgHomClass\n\nnamespace NonUnitalAlgHom\n\nvariable {T : Type*} [Monoid R] [Monoid S] [Monoid T] (φ : R →* S)\nvariable (A : Type v) (B : Type w) (C : Type w₁)\nvariable [NonUnitalNonAssocSemiring A] [DistribMulAction R A]\nvariable [NonUnitalNonAssocSemiring B] [DistribMulAction S B]\nvariable [NonUnitalNonAssocSemiring C] [DistribMulAction T C]\n\ninstance : FunLike (A →ₛₙₐ[φ] B) A B where\n coe f := f.toFun\n coe_injective := by rintro ⟨⟨⟨f, _⟩, _⟩, _⟩ ⟨⟨⟨g, _⟩, _⟩, _⟩ h; congr\n\n@[simp]\ntheorem toFun_eq_coe (f : A →ₛₙₐ[φ] B) : f.toFun = ⇑f :=\n rfl\n\n/-- See Note [custom simps projection] -/\ndef Simps.apply (f : A →ₛₙₐ[φ] B) : A → B := f\n\ninitialize_simps_projections NonUnitalAlgHom\n (toDistribMulActionHom_toMulActionHom_toFun → apply, -toDistribMulActionHom)\n\nvariable {φ A B C}\n@[simp]\nprotected theorem coe_coe {F : Type*} [FunLike F A B]\n [NonUnitalAlgSemiHomClass F φ A B] (f : F) :\n ⇑(f : A →ₛₙₐ[φ] B) = f :=\n rfl\n\ntheorem coe_injective : @Function.Injective (A →ₛₙₐ[φ] B) (A → B) (↑) := by\n rintro ⟨⟨⟨f, _⟩, _⟩, _⟩ ⟨⟨⟨g, _⟩, _⟩, _⟩ h; congr\ninstance : FunLike (A →ₛₙₐ[φ] B) A B where\n coe f := f.toFun\n coe_injective := coe_injective\n\ninstance : NonUnitalAlgSemiHomClass (A →ₛₙₐ[φ] B) φ A B where\n map_add f := f.map_add'\n map_zero f := f.map_zero'\n map_mul f := f.map_mul'\n map_smulₛₗ f := f.map_smul'\n\n@[ext]\ntheorem ext {f g : A →ₛₙₐ[φ] B} (h : ∀ x, f x = g x) : f = g :=\n coe_injective <| funext h\n\ntheorem congr_fun {f g : A →ₛₙₐ[φ] B} (h : f = g) (x : A) : f x = g x :=\n h ▸ rfl\n\n@[simp]\ntheorem coe_mk (f : A → B) (h₁ h₂ h₃ h₄) : ⇑(⟨⟨⟨f, h₁⟩, h₂, h₃⟩, h₄⟩ : A →ₛₙₐ[φ] B) = f :=\n rfl\n\n@[simp]","module_header":true,"namespace":"NonUnitalAlgHom","prompt":"Return exactly one Lean proof body beginning with `by`. Do not emit prose, fences, declarations, sorry, admit, by?, or warnings.\n\nImports:\npublic import Mathlib.Algebra.Algebra.Hom\npublic import Mathlib.Algebra.GroupWithZero.Action.Prod\n\nNamespace:\nNonUnitalAlgHom\n\nLocal context:\n/-\nCopyright (c) 2021 Oliver Nash. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Oliver Nash\n-/\n/-!\n# Morphisms of non-unital algebras\n\nThis file defines morphisms between two types, each of which carries:\n* an addition,\n* an additive zero,\n* a multiplication,\n* a scalar action.\n\nThe multiplications are not assumed to be associative or unital, or even to be compatible with the\nscalar actions. In a typical application, the operations will satisfy compatibility conditions\nmaking them into algebras (albeit possibly non-associative and/or non-unital) but such conditions\nare not required to make this definition.\n\nThis notion of morphism should be useful for any category of non-unital algebras. The motivating\napplication at the time it was introduced was to be able to state the adjunction property for\nmagma algebras. These are non-unital, non-associative algebras obtained by applying the\ngroup-algebra construction except where we take a type carrying just `Mul` instead of `Group`.\n\nFor a plausible future application, one could take the non-unital algebra of compactly-supported\nfunctions on a non-compact topological space. A proper map between a pair of such spaces\n(contravariantly) induces a morphism between their algebras of compactly-supported functions which\nwill be a `NonUnitalAlgHom`.\n\nTODO: add `NonUnitalAlgEquiv` when needed.\n\n## Main definitions\n\n * `NonUnitalAlgHom`\n * `AlgHom.toNonUnitalAlgHom`\n\n## Tags\n\nnon-unital, algebra, morphism\n-/\n\n@[expose] public section\n\nuniverse u u₁ v w w₁ w₂ w₃\n\nvariable {R : Type u} {S : Type u₁}\n\n/-- A morphism respecting addition, multiplication, and scalar multiplication\n(denoted as `A →ₛₙₐ[φ] B`, or `A →ₙₐ[R] B` when `φ` is the identity on `R`).\nWhen these arise from algebra structures, this is the same\nas a not-necessarily-unital morphism of algebras. -/\nstructure NonUnitalAlgHom [Monoid R] [Monoid S] (φ : R →* S) (A : Type v) (B : Type w)\n [NonUnitalNonAssocSemiring A] [DistribMulAction R A]\n [NonUnitalNonAssocSemiring B] [DistribMulAction S B] extends A →ₑ+[φ] B, A →ₙ* B\n\n@[inherit_doc NonUnitalAlgHom]\ninfixr:25 \" →ₙₐ \" => NonUnitalAlgHom _\n\n@[inherit_doc]\nnotation:25 A \" →ₛₙₐ[\" φ \"] \" B => NonUnitalAlgHom φ A B\n\n@[inherit_doc]\nnotation:25 A \" →ₙₐ[\" R \"] \" B => NonUnitalAlgHom (MonoidHom.id R) A B\n\nattribute [nolint docBlame] NonUnitalAlgHom.toMulHom\n\n/-- `NonUnitalAlgSemiHomClass F φ A B` asserts `F` is a type of bundled algebra homomorphisms\nfrom `A` to `B` which are equivariant with respect to `φ`. -/\nclass NonUnitalAlgSemiHomClass (F : Type*) {R S : outParam Type*} [Monoid R] [Monoid S]\n (φ : outParam (R →* S)) (A B : outParam Type*)\n [NonUnitalNonAssocSemiring A] [NonUnitalNonAssocSemiring B]\n [DistribMulAction R A] [DistribMulAction S B] [FunLike F A B] : Prop\n extends DistribMulActionSemiHomClass F φ A B, MulHomClass F A B\n\n/-- `NonUnitalAlgHomClass F R A B` asserts `F` is a type of bundled algebra homomorphisms\nfrom `A` to `B` which are `R`-linear.\n\n This is an abbreviation to `NonUnitalAlgSemiHomClass F (MonoidHom.id R) A B` -/\nabbrev NonUnitalAlgHomClass (F : Type*) (R A B : outParam Type*)\n [Monoid R] [NonUnitalNonAssocSemiring A] [NonUnitalNonAssocSemiring B]\n [DistribMulAction R A] [DistribMulAction R B] [FunLike F A B] :=\n NonUnitalAlgSemiHomClass F (MonoidHom.id R) A B\n\nnamespace NonUnitalAlgHomClass\n\n-- See note [lower instance priority]\ninstance (priority := 100) toNonUnitalRingHomClass\n {F R S A B : Type*} {_ : Monoid R} {_ : Monoid S} {φ : outParam (R →* S)}\n {_ : NonUnitalNonAssocSemiring A} [DistribMulAction R A]\n {_ : NonUnitalNonAssocSemiring B} [DistribMulAction S B] [FunLike F A B]\n [NonUnitalAlgSemiHomClass F φ A B] : NonUnitalRingHomClass F A B :=\n { ‹NonUnitalAlgSemiHomClass F φ A B› with }\n\nvariable [Semiring R] [Semiring S] {φ : R →+* S}\n {A B : Type*} [NonUnitalNonAssocSemiring A] [Module R A]\n [NonUnitalNonAssocSemiring B] [Module S B]\n\n-- see Note [lower instance priority]\ninstance (priority := 100) {F R S A B : Type*}\n {_ : Semiring R} {_ : Semiring S} {φ : R →+* S}\n {_ : NonUnitalSemiring A} {_ : NonUnitalSemiring B} [Module R A] [Module S B] [FunLike F A B]\n [NonUnitalAlgSemiHomClass (R := R) (S := S) F φ A B] :\n SemilinearMapClass F φ A B :=\n { ‹NonUnitalAlgSemiHomClass F φ A B› with map_smulₛₗ := map_smulₛₗ }\n\ninstance (priority := 100) {F : Type*} [FunLike F A B] [Module R B] [NonUnitalAlgHomClass F R A B] :\n LinearMapClass F R A B :=\n { ‹NonUnitalAlgHomClass F R A B› with map_smulₛₗ := map_smulₛₗ }\n\n/-- Turn an element of a type `F` satisfying `NonUnitalAlgSemiHomClass F φ A B` into an actual\n`NonUnitalAlgHom`. This is declared as the default coercion from `F` to `A →ₛₙₐ[φ] B`. -/\n@[coe]\ndef toNonUnitalAlgSemiHom {F R S : Type*} [Monoid R] [Monoid S] {φ : R →* S} {A B : Type*}\n [NonUnitalNonAssocSemiring A] [DistribMulAction R A]\n [NonUnitalNonAssocSemiring B] [DistribMulAction S B] [FunLike F A B]\n [NonUnitalAlgSemiHomClass F φ A B] (f : F) : A →ₛₙₐ[φ] B :=\n { (f : A →ₙ+* B) with\n toFun := f\n map_smul' := map_smulₛₗ f }\n\ninstance {F R S A B : Type*} [Monoid R] [Monoid S] {φ : R →* S}\n [NonUnitalNonAssocSemiring A] [DistribMulAction R A]\n [NonUnitalNonAssocSemiring B] [DistribMulAction S B] [FunLike F A B]\n [NonUnitalAlgSemiHomClass F φ A B] :\n CoeTC F (A →ₛₙₐ[φ] B) :=\n ⟨toNonUnitalAlgSemiHom⟩\n\n/-- Turn an element of a type `F` satisfying `NonUnitalAlgHomClass F R A B` into an actual\n@[coe]\n`NonUnitalAlgHom`. This is declared as the default coercion from `F` to `A →ₛₙₐ[R] B`. -/\ndef toNonUnitalAlgHom {F R : Type*} [Monoid R] {A B : Type*}\n [NonUnitalNonAssocSemiring A] [DistribMulAction R A]\n [NonUnitalNonAssocSemiring B] [DistribMulAction R B]\n [FunLike F A B] [NonUnitalAlgHomClass F R A B] (f : F) : A →ₙₐ[R] B :=\n { (f : A →ₙ+* B) with\n toFun := f\n map_smul' := map_smulₛₗ f }\n\ninstance {F R : Type*} [Monoid R] {A B : Type*}\n [NonUnitalNonAssocSemiring A] [DistribMulAction R A]\n [NonUnitalNonAssocSemiring B] [DistribMulAction R B]\n [FunLike F A B] [NonUnitalAlgHomClass F R A B] :\n CoeTC F (A →ₙₐ[R] B) :=\n ⟨toNonUnitalAlgHom⟩\n\nend NonUnitalAlgHomClass\n\nnamespace NonUnitalAlgHom\n\nvariable {T : Type*} [Monoid R] [Monoid S] [Monoid T] (φ : R →* S)\nvariable (A : Type v) (B : Type w) (C : Type w₁)\nvariable [NonUnitalNonAssocSemiring A] [DistribMulAction R A]\nvariable [NonUnitalNonAssocSemiring B] [DistribMulAction S B]\nvariable [NonUnitalNonAssocSemiring C] [DistribMulAction T C]\n\ninstance : FunLike (A →ₛₙₐ[φ] B) A B where\n coe f := f.toFun\n coe_injective := by rintro ⟨⟨⟨f, _⟩, _⟩, _⟩ ⟨⟨⟨g, _⟩, _⟩, _⟩ h; congr\n\n@[simp]\ntheorem toFun_eq_coe (f : A →ₛₙₐ[φ] B) : f.toFun = ⇑f :=\n rfl\n\n/-- See Note [custom simps projection] -/\ndef Simps.apply (f : A →ₛₙₐ[φ] B) : A → B := f\n\ninitialize_simps_projections NonUnitalAlgHom\n (toDistribMulActionHom_toMulActionHom_toFun → apply, -toDistribMulActionHom)\n\nvariable {φ A B C}\n@[simp]\nprotected theorem coe_coe {F : Type*} [FunLike F A B]\n [NonUnitalAlgSemiHomClass F φ A B] (f : F) :\n ⇑(f : A →ₛₙₐ[φ] B) = f :=\n rfl\n\ntheorem coe_injective : @Function.Injective (A →ₛₙₐ[φ] B) (A → B) (↑) := by\n rintro ⟨⟨⟨f, _⟩, _⟩, _⟩ ⟨⟨⟨g, _⟩, _⟩, _⟩ h; congr\ninstance : FunLike (A →ₛₙₐ[φ] B) A B where\n coe f := f.toFun\n coe_injective := coe_injective\n\ninstance : NonUnitalAlgSemiHomClass (A →ₛₙₐ[φ] B) φ A B where\n map_add f := f.map_add'\n map_zero f := f.map_zero'\n map_mul f := f.map_mul'\n map_smulₛₗ f := f.map_smul'\n\n@[ext]\ntheorem ext {f g : A →ₛₙₐ[φ] B} (h : ∀ x, f x = g x) : f = g :=\n coe_injective <| funext h\n\ntheorem congr_fun {f g : A →ₛₙₐ[φ] B} (h : f = g) (x : A) : f x = g x :=\n h ▸ rfl\n\n@[simp]\ntheorem coe_mk (f : A → B) (h₁ h₂ h₃ h₄) : ⇑(⟨⟨⟨f, h₁⟩, h₂, h₃⟩, h₄⟩ : A →ₛₙₐ[φ] B) = f :=\n rfl\n\n@[simp]\n\nTarget:\ntheorem mk_coe (f : A →ₛₙₐ[φ] B) (h₁ h₂ h₃ h₄) : (⟨⟨⟨f, h₁⟩, h₂, h₃⟩, h₄⟩ : A →ₛₙₐ[φ] B) = f :=\n\nProof body:\n","proof_body":"by\n rfl","provenance":{"declaration_index":5,"environment_hash":"08dda26699fe1025520aeb9450ff1df6b58e8ef0aa8100ae158997e8a703b831","lean_toolchain":"leanprover/lean4:v4.32.0-rc1","license":"Apache-2.0","original_import_scope":"module-specific","source_revision":"360da6fa66c1273b76b6b2d8c5666fd5ac2e3b56","source_sha256":"929fc720c21b33e33bbf0a692c3be55b0da352771a5dbb4e09a095c80437d1a6","source_uri":"https://github.com/leanprover-community/mathlib4/blob/360da6fa66c1273b76b6b2d8c5666fd5ac2e3b56/Mathlib/Algebra/Algebra/NonUnitalHom.lean"},"sample_id":"e97ba48f8121881421b3500b68856ac7102c032733d54751cdad817ffe39bd7f","schema_version":1,"split":"holdout","theorem_statement":"theorem mk_coe (f : A →ₛₙₐ[φ] B) (h₁ h₂ h₃ h₄) : (⟨⟨⟨f, h₁⟩, h₂, h₃⟩, h₄⟩ : A →ₛₙₐ[φ] B) = f :="} |
| {"completion":"by\n ext a\n exact DistribMulActionHom.congr_fun h a","context_contains_namespace":true,"context_suffix":"end NonUnitalAlgHom","dependency_ids":["import:Mathlib.Algebra.Algebra.Hom","import:Mathlib.Algebra.GroupWithZero.Action.Prod"],"family_id":"to_distribmulactionhom_injective","file_id":"mathlib/Mathlib/Algebra/Algebra/NonUnitalHom.lean","imports":["public import Mathlib.Algebra.Algebra.Hom","public import Mathlib.Algebra.GroupWithZero.Action.Prod"],"local_context":"/-\nCopyright (c) 2021 Oliver Nash. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Oliver Nash\n-/\n/-!\n# Morphisms of non-unital algebras\n\nThis file defines morphisms between two types, each of which carries:\n* an addition,\n* an additive zero,\n* a multiplication,\n* a scalar action.\n\nThe multiplications are not assumed to be associative or unital, or even to be compatible with the\nscalar actions. In a typical application, the operations will satisfy compatibility conditions\nmaking them into algebras (albeit possibly non-associative and/or non-unital) but such conditions\nare not required to make this definition.\n\nThis notion of morphism should be useful for any category of non-unital algebras. The motivating\napplication at the time it was introduced was to be able to state the adjunction property for\nmagma algebras. These are non-unital, non-associative algebras obtained by applying the\ngroup-algebra construction except where we take a type carrying just `Mul` instead of `Group`.\n\nFor a plausible future application, one could take the non-unital algebra of compactly-supported\nfunctions on a non-compact topological space. A proper map between a pair of such spaces\n(contravariantly) induces a morphism between their algebras of compactly-supported functions which\nwill be a `NonUnitalAlgHom`.\n\nTODO: add `NonUnitalAlgEquiv` when needed.\n\n## Main definitions\n\n * `NonUnitalAlgHom`\n * `AlgHom.toNonUnitalAlgHom`\n\n## Tags\n\nnon-unital, algebra, morphism\n-/\n\n@[expose] public section\n\nuniverse u u₁ v w w₁ w₂ w₃\n\nvariable {R : Type u} {S : Type u₁}\n\n/-- A morphism respecting addition, multiplication, and scalar multiplication\n(denoted as `A →ₛₙₐ[φ] B`, or `A →ₙₐ[R] B` when `φ` is the identity on `R`).\nWhen these arise from algebra structures, this is the same\nas a not-necessarily-unital morphism of algebras. -/\nstructure NonUnitalAlgHom [Monoid R] [Monoid S] (φ : R →* S) (A : Type v) (B : Type w)\n [NonUnitalNonAssocSemiring A] [DistribMulAction R A]\n [NonUnitalNonAssocSemiring B] [DistribMulAction S B] extends A →ₑ+[φ] B, A →ₙ* B\n\n@[inherit_doc NonUnitalAlgHom]\ninfixr:25 \" →ₙₐ \" => NonUnitalAlgHom _\n\n@[inherit_doc]\nnotation:25 A \" →ₛₙₐ[\" φ \"] \" B => NonUnitalAlgHom φ A B\n\n@[inherit_doc]\nnotation:25 A \" →ₙₐ[\" R \"] \" B => NonUnitalAlgHom (MonoidHom.id R) A B\n\nattribute [nolint docBlame] NonUnitalAlgHom.toMulHom\n\n/-- `NonUnitalAlgSemiHomClass F φ A B` asserts `F` is a type of bundled algebra homomorphisms\nfrom `A` to `B` which are equivariant with respect to `φ`. -/\nclass NonUnitalAlgSemiHomClass (F : Type*) {R S : outParam Type*} [Monoid R] [Monoid S]\n (φ : outParam (R →* S)) (A B : outParam Type*)\n [NonUnitalNonAssocSemiring A] [NonUnitalNonAssocSemiring B]\n [DistribMulAction R A] [DistribMulAction S B] [FunLike F A B] : Prop\n extends DistribMulActionSemiHomClass F φ A B, MulHomClass F A B\n\n/-- `NonUnitalAlgHomClass F R A B` asserts `F` is a type of bundled algebra homomorphisms\nfrom `A` to `B` which are `R`-linear.\n\n This is an abbreviation to `NonUnitalAlgSemiHomClass F (MonoidHom.id R) A B` -/\nabbrev NonUnitalAlgHomClass (F : Type*) (R A B : outParam Type*)\n [Monoid R] [NonUnitalNonAssocSemiring A] [NonUnitalNonAssocSemiring B]\n [DistribMulAction R A] [DistribMulAction R B] [FunLike F A B] :=\n NonUnitalAlgSemiHomClass F (MonoidHom.id R) A B\n\nnamespace NonUnitalAlgHomClass\n\n-- See note [lower instance priority]\ninstance (priority := 100) toNonUnitalRingHomClass\n {F R S A B : Type*} {_ : Monoid R} {_ : Monoid S} {φ : outParam (R →* S)}\n {_ : NonUnitalNonAssocSemiring A} [DistribMulAction R A]\n {_ : NonUnitalNonAssocSemiring B} [DistribMulAction S B] [FunLike F A B]\n [NonUnitalAlgSemiHomClass F φ A B] : NonUnitalRingHomClass F A B :=\n { ‹NonUnitalAlgSemiHomClass F φ A B› with }\n\nvariable [Semiring R] [Semiring S] {φ : R →+* S}\n {A B : Type*} [NonUnitalNonAssocSemiring A] [Module R A]\n [NonUnitalNonAssocSemiring B] [Module S B]\n\n-- see Note [lower instance priority]\ninstance (priority := 100) {F R S A B : Type*}\n {_ : Semiring R} {_ : Semiring S} {φ : R →+* S}\n {_ : NonUnitalSemiring A} {_ : NonUnitalSemiring B} [Module R A] [Module S B] [FunLike F A B]\n [NonUnitalAlgSemiHomClass (R := R) (S := S) F φ A B] :\n SemilinearMapClass F φ A B :=\n { ‹NonUnitalAlgSemiHomClass F φ A B› with map_smulₛₗ := map_smulₛₗ }\n\ninstance (priority := 100) {F : Type*} [FunLike F A B] [Module R B] [NonUnitalAlgHomClass F R A B] :\n LinearMapClass F R A B :=\n { ‹NonUnitalAlgHomClass F R A B› with map_smulₛₗ := map_smulₛₗ }\n\n/-- Turn an element of a type `F` satisfying `NonUnitalAlgSemiHomClass F φ A B` into an actual\n`NonUnitalAlgHom`. This is declared as the default coercion from `F` to `A →ₛₙₐ[φ] B`. -/\n@[coe]\ndef toNonUnitalAlgSemiHom {F R S : Type*} [Monoid R] [Monoid S] {φ : R →* S} {A B : Type*}\n [NonUnitalNonAssocSemiring A] [DistribMulAction R A]\n [NonUnitalNonAssocSemiring B] [DistribMulAction S B] [FunLike F A B]\n [NonUnitalAlgSemiHomClass F φ A B] (f : F) : A →ₛₙₐ[φ] B :=\n { (f : A →ₙ+* B) with\n toFun := f\n map_smul' := map_smulₛₗ f }\n\ninstance {F R S A B : Type*} [Monoid R] [Monoid S] {φ : R →* S}\n [NonUnitalNonAssocSemiring A] [DistribMulAction R A]\n [NonUnitalNonAssocSemiring B] [DistribMulAction S B] [FunLike F A B]\n [NonUnitalAlgSemiHomClass F φ A B] :\n CoeTC F (A →ₛₙₐ[φ] B) :=\n ⟨toNonUnitalAlgSemiHom⟩\n\n/-- Turn an element of a type `F` satisfying `NonUnitalAlgHomClass F R A B` into an actual\n@[coe]\n`NonUnitalAlgHom`. This is declared as the default coercion from `F` to `A →ₛₙₐ[R] B`. -/\ndef toNonUnitalAlgHom {F R : Type*} [Monoid R] {A B : Type*}\n [NonUnitalNonAssocSemiring A] [DistribMulAction R A]\n [NonUnitalNonAssocSemiring B] [DistribMulAction R B]\n [FunLike F A B] [NonUnitalAlgHomClass F R A B] (f : F) : A →ₙₐ[R] B :=\n { (f : A →ₙ+* B) with\n toFun := f\n map_smul' := map_smulₛₗ f }\n\ninstance {F R : Type*} [Monoid R] {A B : Type*}\n [NonUnitalNonAssocSemiring A] [DistribMulAction R A]\n [NonUnitalNonAssocSemiring B] [DistribMulAction R B]\n [FunLike F A B] [NonUnitalAlgHomClass F R A B] :\n CoeTC F (A →ₙₐ[R] B) :=\n ⟨toNonUnitalAlgHom⟩\n\nend NonUnitalAlgHomClass\n\nnamespace NonUnitalAlgHom\n\nvariable {T : Type*} [Monoid R] [Monoid S] [Monoid T] (φ : R →* S)\nvariable (A : Type v) (B : Type w) (C : Type w₁)\nvariable [NonUnitalNonAssocSemiring A] [DistribMulAction R A]\nvariable [NonUnitalNonAssocSemiring B] [DistribMulAction S B]\nvariable [NonUnitalNonAssocSemiring C] [DistribMulAction T C]\n\ninstance : FunLike (A →ₛₙₐ[φ] B) A B where\n coe f := f.toFun\n coe_injective := by rintro ⟨⟨⟨f, _⟩, _⟩, _⟩ ⟨⟨⟨g, _⟩, _⟩, _⟩ h; congr\n\n@[simp]\ntheorem toFun_eq_coe (f : A →ₛₙₐ[φ] B) : f.toFun = ⇑f :=\n rfl\n\n/-- See Note [custom simps projection] -/\ndef Simps.apply (f : A →ₛₙₐ[φ] B) : A → B := f\n\ninitialize_simps_projections NonUnitalAlgHom\n (toDistribMulActionHom_toMulActionHom_toFun → apply, -toDistribMulActionHom)\n\nvariable {φ A B C}\n@[simp]\nprotected theorem coe_coe {F : Type*} [FunLike F A B]\n [NonUnitalAlgSemiHomClass F φ A B] (f : F) :\n ⇑(f : A →ₛₙₐ[φ] B) = f :=\n rfl\n\ntheorem coe_injective : @Function.Injective (A →ₛₙₐ[φ] B) (A → B) (↑) := by\n rintro ⟨⟨⟨f, _⟩, _⟩, _⟩ ⟨⟨⟨g, _⟩, _⟩, _⟩ h; congr\ninstance : FunLike (A →ₛₙₐ[φ] B) A B where\n coe f := f.toFun\n coe_injective := coe_injective\n\ninstance : NonUnitalAlgSemiHomClass (A →ₛₙₐ[φ] B) φ A B where\n map_add f := f.map_add'\n map_zero f := f.map_zero'\n map_mul f := f.map_mul'\n map_smulₛₗ f := f.map_smul'\n\n@[ext]\ntheorem ext {f g : A →ₛₙₐ[φ] B} (h : ∀ x, f x = g x) : f = g :=\n coe_injective <| funext h\n\ntheorem congr_fun {f g : A →ₛₙₐ[φ] B} (h : f = g) (x : A) : f x = g x :=\n h ▸ rfl\n\n@[simp]\ntheorem coe_mk (f : A → B) (h₁ h₂ h₃ h₄) : ⇑(⟨⟨⟨f, h₁⟩, h₂, h₃⟩, h₄⟩ : A →ₛₙₐ[φ] B) = f :=\n rfl\n\n@[simp]\ntheorem mk_coe (f : A →ₛₙₐ[φ] B) (h₁ h₂ h₃ h₄) : (⟨⟨⟨f, h₁⟩, h₂, h₃⟩, h₄⟩ : A →ₛₙₐ[φ] B) = f := by\n rfl\n\n@[simp] lemma addHomMk_coe (f : A →ₛₙₐ[φ] B) : AddHom.mk f (map_add f) = f := rfl\n\n@[simp]\ntheorem toDistribMulActionHom_eq_coe (f : A →ₛₙₐ[φ] B) : f.toDistribMulActionHom = ↑f :=\n rfl\n\n@[simp]\ntheorem toMulHom_eq_coe (f : A →ₛₙₐ[φ] B) : f.toMulHom = ↑f :=\n rfl\n\n@[simp, norm_cast]\ntheorem coe_to_distribMulActionHom (f : A →ₛₙₐ[φ] B) : ⇑(f : A →ₑ+[φ] B) = f :=\n rfl\n\n@[simp, norm_cast]\ntheorem coe_to_mulHom (f : A →ₛₙₐ[φ] B) : ⇑(f : A →ₙ* B) = f :=\n rfl","module_header":true,"namespace":"NonUnitalAlgHom","prompt":"Return exactly one Lean proof body beginning with `by`. Do not emit prose, fences, declarations, sorry, admit, by?, or warnings.\n\nImports:\npublic import Mathlib.Algebra.Algebra.Hom\npublic import Mathlib.Algebra.GroupWithZero.Action.Prod\n\nNamespace:\nNonUnitalAlgHom\n\nLocal context:\n/-\nCopyright (c) 2021 Oliver Nash. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Oliver Nash\n-/\n/-!\n# Morphisms of non-unital algebras\n\nThis file defines morphisms between two types, each of which carries:\n* an addition,\n* an additive zero,\n* a multiplication,\n* a scalar action.\n\nThe multiplications are not assumed to be associative or unital, or even to be compatible with the\nscalar actions. In a typical application, the operations will satisfy compatibility conditions\nmaking them into algebras (albeit possibly non-associative and/or non-unital) but such conditions\nare not required to make this definition.\n\nThis notion of morphism should be useful for any category of non-unital algebras. The motivating\napplication at the time it was introduced was to be able to state the adjunction property for\nmagma algebras. These are non-unital, non-associative algebras obtained by applying the\ngroup-algebra construction except where we take a type carrying just `Mul` instead of `Group`.\n\nFor a plausible future application, one could take the non-unital algebra of compactly-supported\nfunctions on a non-compact topological space. A proper map between a pair of such spaces\n(contravariantly) induces a morphism between their algebras of compactly-supported functions which\nwill be a `NonUnitalAlgHom`.\n\nTODO: add `NonUnitalAlgEquiv` when needed.\n\n## Main definitions\n\n * `NonUnitalAlgHom`\n * `AlgHom.toNonUnitalAlgHom`\n\n## Tags\n\nnon-unital, algebra, morphism\n-/\n\n@[expose] public section\n\nuniverse u u₁ v w w₁ w₂ w₃\n\nvariable {R : Type u} {S : Type u₁}\n\n/-- A morphism respecting addition, multiplication, and scalar multiplication\n(denoted as `A →ₛₙₐ[φ] B`, or `A →ₙₐ[R] B` when `φ` is the identity on `R`).\nWhen these arise from algebra structures, this is the same\nas a not-necessarily-unital morphism of algebras. -/\nstructure NonUnitalAlgHom [Monoid R] [Monoid S] (φ : R →* S) (A : Type v) (B : Type w)\n [NonUnitalNonAssocSemiring A] [DistribMulAction R A]\n [NonUnitalNonAssocSemiring B] [DistribMulAction S B] extends A →ₑ+[φ] B, A →ₙ* B\n\n@[inherit_doc NonUnitalAlgHom]\ninfixr:25 \" →ₙₐ \" => NonUnitalAlgHom _\n\n@[inherit_doc]\nnotation:25 A \" →ₛₙₐ[\" φ \"] \" B => NonUnitalAlgHom φ A B\n\n@[inherit_doc]\nnotation:25 A \" →ₙₐ[\" R \"] \" B => NonUnitalAlgHom (MonoidHom.id R) A B\n\nattribute [nolint docBlame] NonUnitalAlgHom.toMulHom\n\n/-- `NonUnitalAlgSemiHomClass F φ A B` asserts `F` is a type of bundled algebra homomorphisms\nfrom `A` to `B` which are equivariant with respect to `φ`. -/\nclass NonUnitalAlgSemiHomClass (F : Type*) {R S : outParam Type*} [Monoid R] [Monoid S]\n (φ : outParam (R →* S)) (A B : outParam Type*)\n [NonUnitalNonAssocSemiring A] [NonUnitalNonAssocSemiring B]\n [DistribMulAction R A] [DistribMulAction S B] [FunLike F A B] : Prop\n extends DistribMulActionSemiHomClass F φ A B, MulHomClass F A B\n\n/-- `NonUnitalAlgHomClass F R A B` asserts `F` is a type of bundled algebra homomorphisms\nfrom `A` to `B` which are `R`-linear.\n\n This is an abbreviation to `NonUnitalAlgSemiHomClass F (MonoidHom.id R) A B` -/\nabbrev NonUnitalAlgHomClass (F : Type*) (R A B : outParam Type*)\n [Monoid R] [NonUnitalNonAssocSemiring A] [NonUnitalNonAssocSemiring B]\n [DistribMulAction R A] [DistribMulAction R B] [FunLike F A B] :=\n NonUnitalAlgSemiHomClass F (MonoidHom.id R) A B\n\nnamespace NonUnitalAlgHomClass\n\n-- See note [lower instance priority]\ninstance (priority := 100) toNonUnitalRingHomClass\n {F R S A B : Type*} {_ : Monoid R} {_ : Monoid S} {φ : outParam (R →* S)}\n {_ : NonUnitalNonAssocSemiring A} [DistribMulAction R A]\n {_ : NonUnitalNonAssocSemiring B} [DistribMulAction S B] [FunLike F A B]\n [NonUnitalAlgSemiHomClass F φ A B] : NonUnitalRingHomClass F A B :=\n { ‹NonUnitalAlgSemiHomClass F φ A B› with }\n\nvariable [Semiring R] [Semiring S] {φ : R →+* S}\n {A B : Type*} [NonUnitalNonAssocSemiring A] [Module R A]\n [NonUnitalNonAssocSemiring B] [Module S B]\n\n-- see Note [lower instance priority]\ninstance (priority := 100) {F R S A B : Type*}\n {_ : Semiring R} {_ : Semiring S} {φ : R →+* S}\n {_ : NonUnitalSemiring A} {_ : NonUnitalSemiring B} [Module R A] [Module S B] [FunLike F A B]\n [NonUnitalAlgSemiHomClass (R := R) (S := S) F φ A B] :\n SemilinearMapClass F φ A B :=\n { ‹NonUnitalAlgSemiHomClass F φ A B› with map_smulₛₗ := map_smulₛₗ }\n\ninstance (priority := 100) {F : Type*} [FunLike F A B] [Module R B] [NonUnitalAlgHomClass F R A B] :\n LinearMapClass F R A B :=\n { ‹NonUnitalAlgHomClass F R A B› with map_smulₛₗ := map_smulₛₗ }\n\n/-- Turn an element of a type `F` satisfying `NonUnitalAlgSemiHomClass F φ A B` into an actual\n`NonUnitalAlgHom`. This is declared as the default coercion from `F` to `A →ₛₙₐ[φ] B`. -/\n@[coe]\ndef toNonUnitalAlgSemiHom {F R S : Type*} [Monoid R] [Monoid S] {φ : R →* S} {A B : Type*}\n [NonUnitalNonAssocSemiring A] [DistribMulAction R A]\n [NonUnitalNonAssocSemiring B] [DistribMulAction S B] [FunLike F A B]\n [NonUnitalAlgSemiHomClass F φ A B] (f : F) : A →ₛₙₐ[φ] B :=\n { (f : A →ₙ+* B) with\n toFun := f\n map_smul' := map_smulₛₗ f }\n\ninstance {F R S A B : Type*} [Monoid R] [Monoid S] {φ : R →* S}\n [NonUnitalNonAssocSemiring A] [DistribMulAction R A]\n [NonUnitalNonAssocSemiring B] [DistribMulAction S B] [FunLike F A B]\n [NonUnitalAlgSemiHomClass F φ A B] :\n CoeTC F (A →ₛₙₐ[φ] B) :=\n ⟨toNonUnitalAlgSemiHom⟩\n\n/-- Turn an element of a type `F` satisfying `NonUnitalAlgHomClass F R A B` into an actual\n@[coe]\n`NonUnitalAlgHom`. This is declared as the default coercion from `F` to `A →ₛₙₐ[R] B`. -/\ndef toNonUnitalAlgHom {F R : Type*} [Monoid R] {A B : Type*}\n [NonUnitalNonAssocSemiring A] [DistribMulAction R A]\n [NonUnitalNonAssocSemiring B] [DistribMulAction R B]\n [FunLike F A B] [NonUnitalAlgHomClass F R A B] (f : F) : A →ₙₐ[R] B :=\n { (f : A →ₙ+* B) with\n toFun := f\n map_smul' := map_smulₛₗ f }\n\ninstance {F R : Type*} [Monoid R] {A B : Type*}\n [NonUnitalNonAssocSemiring A] [DistribMulAction R A]\n [NonUnitalNonAssocSemiring B] [DistribMulAction R B]\n [FunLike F A B] [NonUnitalAlgHomClass F R A B] :\n CoeTC F (A →ₙₐ[R] B) :=\n ⟨toNonUnitalAlgHom⟩\n\nend NonUnitalAlgHomClass\n\nnamespace NonUnitalAlgHom\n\nvariable {T : Type*} [Monoid R] [Monoid S] [Monoid T] (φ : R →* S)\nvariable (A : Type v) (B : Type w) (C : Type w₁)\nvariable [NonUnitalNonAssocSemiring A] [DistribMulAction R A]\nvariable [NonUnitalNonAssocSemiring B] [DistribMulAction S B]\nvariable [NonUnitalNonAssocSemiring C] [DistribMulAction T C]\n\ninstance : FunLike (A →ₛₙₐ[φ] B) A B where\n coe f := f.toFun\n coe_injective := by rintro ⟨⟨⟨f, _⟩, _⟩, _⟩ ⟨⟨⟨g, _⟩, _⟩, _⟩ h; congr\n\n@[simp]\ntheorem toFun_eq_coe (f : A →ₛₙₐ[φ] B) : f.toFun = ⇑f :=\n rfl\n\n/-- See Note [custom simps projection] -/\ndef Simps.apply (f : A →ₛₙₐ[φ] B) : A → B := f\n\ninitialize_simps_projections NonUnitalAlgHom\n (toDistribMulActionHom_toMulActionHom_toFun → apply, -toDistribMulActionHom)\n\nvariable {φ A B C}\n@[simp]\nprotected theorem coe_coe {F : Type*} [FunLike F A B]\n [NonUnitalAlgSemiHomClass F φ A B] (f : F) :\n ⇑(f : A →ₛₙₐ[φ] B) = f :=\n rfl\n\ntheorem coe_injective : @Function.Injective (A →ₛₙₐ[φ] B) (A → B) (↑) := by\n rintro ⟨⟨⟨f, _⟩, _⟩, _⟩ ⟨⟨⟨g, _⟩, _⟩, _⟩ h; congr\ninstance : FunLike (A →ₛₙₐ[φ] B) A B where\n coe f := f.toFun\n coe_injective := coe_injective\n\ninstance : NonUnitalAlgSemiHomClass (A →ₛₙₐ[φ] B) φ A B where\n map_add f := f.map_add'\n map_zero f := f.map_zero'\n map_mul f := f.map_mul'\n map_smulₛₗ f := f.map_smul'\n\n@[ext]\ntheorem ext {f g : A →ₛₙₐ[φ] B} (h : ∀ x, f x = g x) : f = g :=\n coe_injective <| funext h\n\ntheorem congr_fun {f g : A →ₛₙₐ[φ] B} (h : f = g) (x : A) : f x = g x :=\n h ▸ rfl\n\n@[simp]\ntheorem coe_mk (f : A → B) (h₁ h₂ h₃ h₄) : ⇑(⟨⟨⟨f, h₁⟩, h₂, h₃⟩, h₄⟩ : A →ₛₙₐ[φ] B) = f :=\n rfl\n\n@[simp]\ntheorem mk_coe (f : A →ₛₙₐ[φ] B) (h₁ h₂ h₃ h₄) : (⟨⟨⟨f, h₁⟩, h₂, h₃⟩, h₄⟩ : A →ₛₙₐ[φ] B) = f := by\n rfl\n\n@[simp] lemma addHomMk_coe (f : A →ₛₙₐ[φ] B) : AddHom.mk f (map_add f) = f := rfl\n\n@[simp]\ntheorem toDistribMulActionHom_eq_coe (f : A →ₛₙₐ[φ] B) : f.toDistribMulActionHom = ↑f :=\n rfl\n\n@[simp]\ntheorem toMulHom_eq_coe (f : A →ₛₙₐ[φ] B) : f.toMulHom = ↑f :=\n rfl\n\n@[simp, norm_cast]\ntheorem coe_to_distribMulActionHom (f : A →ₛₙₐ[φ] B) : ⇑(f : A →ₑ+[φ] B) = f :=\n rfl\n\n@[simp, norm_cast]\ntheorem coe_to_mulHom (f : A →ₛₙₐ[φ] B) : ⇑(f : A →ₙ* B) = f :=\n rfl\n\nTarget:\ntheorem to_distribMulActionHom_injective {f g : A →ₛₙₐ[φ] B}\n (h : (f : A →ₑ+[φ] B) = (g : A →ₑ+[φ] B)) : f = g :=\n\nProof body:\n","proof_body":"by\n ext a\n exact DistribMulActionHom.congr_fun h a","provenance":{"declaration_index":10,"environment_hash":"08dda26699fe1025520aeb9450ff1df6b58e8ef0aa8100ae158997e8a703b831","lean_toolchain":"leanprover/lean4:v4.32.0-rc1","license":"Apache-2.0","original_import_scope":"module-specific","source_revision":"360da6fa66c1273b76b6b2d8c5666fd5ac2e3b56","source_sha256":"929fc720c21b33e33bbf0a692c3be55b0da352771a5dbb4e09a095c80437d1a6","source_uri":"https://github.com/leanprover-community/mathlib4/blob/360da6fa66c1273b76b6b2d8c5666fd5ac2e3b56/Mathlib/Algebra/Algebra/NonUnitalHom.lean"},"sample_id":"61edb107e4410d1c6e3c7d14ba3c27121b18ccb05d2782ec9d08f03ebfc5b362","schema_version":1,"split":"holdout","theorem_statement":"theorem to_distribMulActionHom_injective {f g : A →ₛₙₐ[φ] B}\n (h : (f : A →ₑ+[φ] B) = (g : A →ₑ+[φ] B)) : f = g :="} |
| {"completion":"by\n ext a\n exact DFunLike.congr_fun h a","context_contains_namespace":true,"context_suffix":"end NonUnitalAlgHom","dependency_ids":["import:Mathlib.Algebra.Algebra.Hom","import:Mathlib.Algebra.GroupWithZero.Action.Prod"],"family_id":"to_mulhom_injective","file_id":"mathlib/Mathlib/Algebra/Algebra/NonUnitalHom.lean","imports":["public import Mathlib.Algebra.Algebra.Hom","public import Mathlib.Algebra.GroupWithZero.Action.Prod"],"local_context":"/-\nCopyright (c) 2021 Oliver Nash. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Oliver Nash\n-/\n/-!\n# Morphisms of non-unital algebras\n\nThis file defines morphisms between two types, each of which carries:\n* an addition,\n* an additive zero,\n* a multiplication,\n* a scalar action.\n\nThe multiplications are not assumed to be associative or unital, or even to be compatible with the\nscalar actions. In a typical application, the operations will satisfy compatibility conditions\nmaking them into algebras (albeit possibly non-associative and/or non-unital) but such conditions\nare not required to make this definition.\n\nThis notion of morphism should be useful for any category of non-unital algebras. The motivating\napplication at the time it was introduced was to be able to state the adjunction property for\nmagma algebras. These are non-unital, non-associative algebras obtained by applying the\ngroup-algebra construction except where we take a type carrying just `Mul` instead of `Group`.\n\nFor a plausible future application, one could take the non-unital algebra of compactly-supported\nfunctions on a non-compact topological space. A proper map between a pair of such spaces\n(contravariantly) induces a morphism between their algebras of compactly-supported functions which\nwill be a `NonUnitalAlgHom`.\n\nTODO: add `NonUnitalAlgEquiv` when needed.\n\n## Main definitions\n\n * `NonUnitalAlgHom`\n * `AlgHom.toNonUnitalAlgHom`\n\n## Tags\n\nnon-unital, algebra, morphism\n-/\n\n@[expose] public section\n\nuniverse u u₁ v w w₁ w₂ w₃\n\nvariable {R : Type u} {S : Type u₁}\n\n/-- A morphism respecting addition, multiplication, and scalar multiplication\n(denoted as `A →ₛₙₐ[φ] B`, or `A →ₙₐ[R] B` when `φ` is the identity on `R`).\nWhen these arise from algebra structures, this is the same\nas a not-necessarily-unital morphism of algebras. -/\nstructure NonUnitalAlgHom [Monoid R] [Monoid S] (φ : R →* S) (A : Type v) (B : Type w)\n [NonUnitalNonAssocSemiring A] [DistribMulAction R A]\n [NonUnitalNonAssocSemiring B] [DistribMulAction S B] extends A →ₑ+[φ] B, A →ₙ* B\n\n@[inherit_doc NonUnitalAlgHom]\ninfixr:25 \" →ₙₐ \" => NonUnitalAlgHom _\n\n@[inherit_doc]\nnotation:25 A \" →ₛₙₐ[\" φ \"] \" B => NonUnitalAlgHom φ A B\n\n@[inherit_doc]\nnotation:25 A \" →ₙₐ[\" R \"] \" B => NonUnitalAlgHom (MonoidHom.id R) A B\n\nattribute [nolint docBlame] NonUnitalAlgHom.toMulHom\n\n/-- `NonUnitalAlgSemiHomClass F φ A B` asserts `F` is a type of bundled algebra homomorphisms\nfrom `A` to `B` which are equivariant with respect to `φ`. -/\nclass NonUnitalAlgSemiHomClass (F : Type*) {R S : outParam Type*} [Monoid R] [Monoid S]\n (φ : outParam (R →* S)) (A B : outParam Type*)\n [NonUnitalNonAssocSemiring A] [NonUnitalNonAssocSemiring B]\n [DistribMulAction R A] [DistribMulAction S B] [FunLike F A B] : Prop\n extends DistribMulActionSemiHomClass F φ A B, MulHomClass F A B\n\n/-- `NonUnitalAlgHomClass F R A B` asserts `F` is a type of bundled algebra homomorphisms\nfrom `A` to `B` which are `R`-linear.\n\n This is an abbreviation to `NonUnitalAlgSemiHomClass F (MonoidHom.id R) A B` -/\nabbrev NonUnitalAlgHomClass (F : Type*) (R A B : outParam Type*)\n [Monoid R] [NonUnitalNonAssocSemiring A] [NonUnitalNonAssocSemiring B]\n [DistribMulAction R A] [DistribMulAction R B] [FunLike F A B] :=\n NonUnitalAlgSemiHomClass F (MonoidHom.id R) A B\n\nnamespace NonUnitalAlgHomClass\n\n-- See note [lower instance priority]\ninstance (priority := 100) toNonUnitalRingHomClass\n {F R S A B : Type*} {_ : Monoid R} {_ : Monoid S} {φ : outParam (R →* S)}\n {_ : NonUnitalNonAssocSemiring A} [DistribMulAction R A]\n {_ : NonUnitalNonAssocSemiring B} [DistribMulAction S B] [FunLike F A B]\n [NonUnitalAlgSemiHomClass F φ A B] : NonUnitalRingHomClass F A B :=\n { ‹NonUnitalAlgSemiHomClass F φ A B› with }\n\nvariable [Semiring R] [Semiring S] {φ : R →+* S}\n {A B : Type*} [NonUnitalNonAssocSemiring A] [Module R A]\n [NonUnitalNonAssocSemiring B] [Module S B]\n\n-- see Note [lower instance priority]\ninstance (priority := 100) {F R S A B : Type*}\n {_ : Semiring R} {_ : Semiring S} {φ : R →+* S}\n {_ : NonUnitalSemiring A} {_ : NonUnitalSemiring B} [Module R A] [Module S B] [FunLike F A B]\n [NonUnitalAlgSemiHomClass (R := R) (S := S) F φ A B] :\n SemilinearMapClass F φ A B :=\n { ‹NonUnitalAlgSemiHomClass F φ A B› with map_smulₛₗ := map_smulₛₗ }\n\ninstance (priority := 100) {F : Type*} [FunLike F A B] [Module R B] [NonUnitalAlgHomClass F R A B] :\n LinearMapClass F R A B :=\n { ‹NonUnitalAlgHomClass F R A B› with map_smulₛₗ := map_smulₛₗ }\n\n/-- Turn an element of a type `F` satisfying `NonUnitalAlgSemiHomClass F φ A B` into an actual\n`NonUnitalAlgHom`. This is declared as the default coercion from `F` to `A →ₛₙₐ[φ] B`. -/\n@[coe]\ndef toNonUnitalAlgSemiHom {F R S : Type*} [Monoid R] [Monoid S] {φ : R →* S} {A B : Type*}\n [NonUnitalNonAssocSemiring A] [DistribMulAction R A]\n [NonUnitalNonAssocSemiring B] [DistribMulAction S B] [FunLike F A B]\n [NonUnitalAlgSemiHomClass F φ A B] (f : F) : A →ₛₙₐ[φ] B :=\n { (f : A →ₙ+* B) with\n toFun := f\n map_smul' := map_smulₛₗ f }\n\ninstance {F R S A B : Type*} [Monoid R] [Monoid S] {φ : R →* S}\n [NonUnitalNonAssocSemiring A] [DistribMulAction R A]\n [NonUnitalNonAssocSemiring B] [DistribMulAction S B] [FunLike F A B]\n [NonUnitalAlgSemiHomClass F φ A B] :\n CoeTC F (A →ₛₙₐ[φ] B) :=\n ⟨toNonUnitalAlgSemiHom⟩\n\n/-- Turn an element of a type `F` satisfying `NonUnitalAlgHomClass F R A B` into an actual\n@[coe]\n`NonUnitalAlgHom`. This is declared as the default coercion from `F` to `A →ₛₙₐ[R] B`. -/\ndef toNonUnitalAlgHom {F R : Type*} [Monoid R] {A B : Type*}\n [NonUnitalNonAssocSemiring A] [DistribMulAction R A]\n [NonUnitalNonAssocSemiring B] [DistribMulAction R B]\n [FunLike F A B] [NonUnitalAlgHomClass F R A B] (f : F) : A →ₙₐ[R] B :=\n { (f : A →ₙ+* B) with\n toFun := f\n map_smul' := map_smulₛₗ f }\n\ninstance {F R : Type*} [Monoid R] {A B : Type*}\n [NonUnitalNonAssocSemiring A] [DistribMulAction R A]\n [NonUnitalNonAssocSemiring B] [DistribMulAction R B]\n [FunLike F A B] [NonUnitalAlgHomClass F R A B] :\n CoeTC F (A →ₙₐ[R] B) :=\n ⟨toNonUnitalAlgHom⟩\n\nend NonUnitalAlgHomClass\n\nnamespace NonUnitalAlgHom\n\nvariable {T : Type*} [Monoid R] [Monoid S] [Monoid T] (φ : R →* S)\nvariable (A : Type v) (B : Type w) (C : Type w₁)\nvariable [NonUnitalNonAssocSemiring A] [DistribMulAction R A]\nvariable [NonUnitalNonAssocSemiring B] [DistribMulAction S B]\nvariable [NonUnitalNonAssocSemiring C] [DistribMulAction T C]\n\ninstance : FunLike (A →ₛₙₐ[φ] B) A B where\n coe f := f.toFun\n coe_injective := by rintro ⟨⟨⟨f, _⟩, _⟩, _⟩ ⟨⟨⟨g, _⟩, _⟩, _⟩ h; congr\n\n@[simp]\ntheorem toFun_eq_coe (f : A →ₛₙₐ[φ] B) : f.toFun = ⇑f :=\n rfl\n\n/-- See Note [custom simps projection] -/\ndef Simps.apply (f : A →ₛₙₐ[φ] B) : A → B := f\n\ninitialize_simps_projections NonUnitalAlgHom\n (toDistribMulActionHom_toMulActionHom_toFun → apply, -toDistribMulActionHom)\n\nvariable {φ A B C}\n@[simp]\nprotected theorem coe_coe {F : Type*} [FunLike F A B]\n [NonUnitalAlgSemiHomClass F φ A B] (f : F) :\n ⇑(f : A →ₛₙₐ[φ] B) = f :=\n rfl\n\ntheorem coe_injective : @Function.Injective (A →ₛₙₐ[φ] B) (A → B) (↑) := by\n rintro ⟨⟨⟨f, _⟩, _⟩, _⟩ ⟨⟨⟨g, _⟩, _⟩, _⟩ h; congr\ninstance : FunLike (A →ₛₙₐ[φ] B) A B where\n coe f := f.toFun\n coe_injective := coe_injective\n\ninstance : NonUnitalAlgSemiHomClass (A →ₛₙₐ[φ] B) φ A B where\n map_add f := f.map_add'\n map_zero f := f.map_zero'\n map_mul f := f.map_mul'\n map_smulₛₗ f := f.map_smul'\n\n@[ext]\ntheorem ext {f g : A →ₛₙₐ[φ] B} (h : ∀ x, f x = g x) : f = g :=\n coe_injective <| funext h\n\ntheorem congr_fun {f g : A →ₛₙₐ[φ] B} (h : f = g) (x : A) : f x = g x :=\n h ▸ rfl\n\n@[simp]\ntheorem coe_mk (f : A → B) (h₁ h₂ h₃ h₄) : ⇑(⟨⟨⟨f, h₁⟩, h₂, h₃⟩, h₄⟩ : A →ₛₙₐ[φ] B) = f :=\n rfl\n\n@[simp]\ntheorem mk_coe (f : A →ₛₙₐ[φ] B) (h₁ h₂ h₃ h₄) : (⟨⟨⟨f, h₁⟩, h₂, h₃⟩, h₄⟩ : A →ₛₙₐ[φ] B) = f := by\n rfl\n\n@[simp] lemma addHomMk_coe (f : A →ₛₙₐ[φ] B) : AddHom.mk f (map_add f) = f := rfl\n\n@[simp]\ntheorem toDistribMulActionHom_eq_coe (f : A →ₛₙₐ[φ] B) : f.toDistribMulActionHom = ↑f :=\n rfl\n\n@[simp]\ntheorem toMulHom_eq_coe (f : A →ₛₙₐ[φ] B) : f.toMulHom = ↑f :=\n rfl\n\n@[simp, norm_cast]\ntheorem coe_to_distribMulActionHom (f : A →ₛₙₐ[φ] B) : ⇑(f : A →ₑ+[φ] B) = f :=\n rfl\n\n@[simp, norm_cast]\ntheorem coe_to_mulHom (f : A →ₛₙₐ[φ] B) : ⇑(f : A →ₙ* B) = f :=\n rfl\n\ntheorem to_distribMulActionHom_injective {f g : A →ₛₙₐ[φ] B}\n (h : (f : A →ₑ+[φ] B) = (g : A →ₑ+[φ] B)) : f = g := by\n ext a\n exact DistribMulActionHom.congr_fun h a","module_header":true,"namespace":"NonUnitalAlgHom","prompt":"Return exactly one Lean proof body beginning with `by`. Do not emit prose, fences, declarations, sorry, admit, by?, or warnings.\n\nImports:\npublic import Mathlib.Algebra.Algebra.Hom\npublic import Mathlib.Algebra.GroupWithZero.Action.Prod\n\nNamespace:\nNonUnitalAlgHom\n\nLocal context:\n/-\nCopyright (c) 2021 Oliver Nash. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Oliver Nash\n-/\n/-!\n# Morphisms of non-unital algebras\n\nThis file defines morphisms between two types, each of which carries:\n* an addition,\n* an additive zero,\n* a multiplication,\n* a scalar action.\n\nThe multiplications are not assumed to be associative or unital, or even to be compatible with the\nscalar actions. In a typical application, the operations will satisfy compatibility conditions\nmaking them into algebras (albeit possibly non-associative and/or non-unital) but such conditions\nare not required to make this definition.\n\nThis notion of morphism should be useful for any category of non-unital algebras. The motivating\napplication at the time it was introduced was to be able to state the adjunction property for\nmagma algebras. These are non-unital, non-associative algebras obtained by applying the\ngroup-algebra construction except where we take a type carrying just `Mul` instead of `Group`.\n\nFor a plausible future application, one could take the non-unital algebra of compactly-supported\nfunctions on a non-compact topological space. A proper map between a pair of such spaces\n(contravariantly) induces a morphism between their algebras of compactly-supported functions which\nwill be a `NonUnitalAlgHom`.\n\nTODO: add `NonUnitalAlgEquiv` when needed.\n\n## Main definitions\n\n * `NonUnitalAlgHom`\n * `AlgHom.toNonUnitalAlgHom`\n\n## Tags\n\nnon-unital, algebra, morphism\n-/\n\n@[expose] public section\n\nuniverse u u₁ v w w₁ w₂ w₃\n\nvariable {R : Type u} {S : Type u₁}\n\n/-- A morphism respecting addition, multiplication, and scalar multiplication\n(denoted as `A →ₛₙₐ[φ] B`, or `A →ₙₐ[R] B` when `φ` is the identity on `R`).\nWhen these arise from algebra structures, this is the same\nas a not-necessarily-unital morphism of algebras. -/\nstructure NonUnitalAlgHom [Monoid R] [Monoid S] (φ : R →* S) (A : Type v) (B : Type w)\n [NonUnitalNonAssocSemiring A] [DistribMulAction R A]\n [NonUnitalNonAssocSemiring B] [DistribMulAction S B] extends A →ₑ+[φ] B, A →ₙ* B\n\n@[inherit_doc NonUnitalAlgHom]\ninfixr:25 \" →ₙₐ \" => NonUnitalAlgHom _\n\n@[inherit_doc]\nnotation:25 A \" →ₛₙₐ[\" φ \"] \" B => NonUnitalAlgHom φ A B\n\n@[inherit_doc]\nnotation:25 A \" →ₙₐ[\" R \"] \" B => NonUnitalAlgHom (MonoidHom.id R) A B\n\nattribute [nolint docBlame] NonUnitalAlgHom.toMulHom\n\n/-- `NonUnitalAlgSemiHomClass F φ A B` asserts `F` is a type of bundled algebra homomorphisms\nfrom `A` to `B` which are equivariant with respect to `φ`. -/\nclass NonUnitalAlgSemiHomClass (F : Type*) {R S : outParam Type*} [Monoid R] [Monoid S]\n (φ : outParam (R →* S)) (A B : outParam Type*)\n [NonUnitalNonAssocSemiring A] [NonUnitalNonAssocSemiring B]\n [DistribMulAction R A] [DistribMulAction S B] [FunLike F A B] : Prop\n extends DistribMulActionSemiHomClass F φ A B, MulHomClass F A B\n\n/-- `NonUnitalAlgHomClass F R A B` asserts `F` is a type of bundled algebra homomorphisms\nfrom `A` to `B` which are `R`-linear.\n\n This is an abbreviation to `NonUnitalAlgSemiHomClass F (MonoidHom.id R) A B` -/\nabbrev NonUnitalAlgHomClass (F : Type*) (R A B : outParam Type*)\n [Monoid R] [NonUnitalNonAssocSemiring A] [NonUnitalNonAssocSemiring B]\n [DistribMulAction R A] [DistribMulAction R B] [FunLike F A B] :=\n NonUnitalAlgSemiHomClass F (MonoidHom.id R) A B\n\nnamespace NonUnitalAlgHomClass\n\n-- See note [lower instance priority]\ninstance (priority := 100) toNonUnitalRingHomClass\n {F R S A B : Type*} {_ : Monoid R} {_ : Monoid S} {φ : outParam (R →* S)}\n {_ : NonUnitalNonAssocSemiring A} [DistribMulAction R A]\n {_ : NonUnitalNonAssocSemiring B} [DistribMulAction S B] [FunLike F A B]\n [NonUnitalAlgSemiHomClass F φ A B] : NonUnitalRingHomClass F A B :=\n { ‹NonUnitalAlgSemiHomClass F φ A B› with }\n\nvariable [Semiring R] [Semiring S] {φ : R →+* S}\n {A B : Type*} [NonUnitalNonAssocSemiring A] [Module R A]\n [NonUnitalNonAssocSemiring B] [Module S B]\n\n-- see Note [lower instance priority]\ninstance (priority := 100) {F R S A B : Type*}\n {_ : Semiring R} {_ : Semiring S} {φ : R →+* S}\n {_ : NonUnitalSemiring A} {_ : NonUnitalSemiring B} [Module R A] [Module S B] [FunLike F A B]\n [NonUnitalAlgSemiHomClass (R := R) (S := S) F φ A B] :\n SemilinearMapClass F φ A B :=\n { ‹NonUnitalAlgSemiHomClass F φ A B› with map_smulₛₗ := map_smulₛₗ }\n\ninstance (priority := 100) {F : Type*} [FunLike F A B] [Module R B] [NonUnitalAlgHomClass F R A B] :\n LinearMapClass F R A B :=\n { ‹NonUnitalAlgHomClass F R A B› with map_smulₛₗ := map_smulₛₗ }\n\n/-- Turn an element of a type `F` satisfying `NonUnitalAlgSemiHomClass F φ A B` into an actual\n`NonUnitalAlgHom`. This is declared as the default coercion from `F` to `A →ₛₙₐ[φ] B`. -/\n@[coe]\ndef toNonUnitalAlgSemiHom {F R S : Type*} [Monoid R] [Monoid S] {φ : R →* S} {A B : Type*}\n [NonUnitalNonAssocSemiring A] [DistribMulAction R A]\n [NonUnitalNonAssocSemiring B] [DistribMulAction S B] [FunLike F A B]\n [NonUnitalAlgSemiHomClass F φ A B] (f : F) : A →ₛₙₐ[φ] B :=\n { (f : A →ₙ+* B) with\n toFun := f\n map_smul' := map_smulₛₗ f }\n\ninstance {F R S A B : Type*} [Monoid R] [Monoid S] {φ : R →* S}\n [NonUnitalNonAssocSemiring A] [DistribMulAction R A]\n [NonUnitalNonAssocSemiring B] [DistribMulAction S B] [FunLike F A B]\n [NonUnitalAlgSemiHomClass F φ A B] :\n CoeTC F (A →ₛₙₐ[φ] B) :=\n ⟨toNonUnitalAlgSemiHom⟩\n\n/-- Turn an element of a type `F` satisfying `NonUnitalAlgHomClass F R A B` into an actual\n@[coe]\n`NonUnitalAlgHom`. This is declared as the default coercion from `F` to `A →ₛₙₐ[R] B`. -/\ndef toNonUnitalAlgHom {F R : Type*} [Monoid R] {A B : Type*}\n [NonUnitalNonAssocSemiring A] [DistribMulAction R A]\n [NonUnitalNonAssocSemiring B] [DistribMulAction R B]\n [FunLike F A B] [NonUnitalAlgHomClass F R A B] (f : F) : A →ₙₐ[R] B :=\n { (f : A →ₙ+* B) with\n toFun := f\n map_smul' := map_smulₛₗ f }\n\ninstance {F R : Type*} [Monoid R] {A B : Type*}\n [NonUnitalNonAssocSemiring A] [DistribMulAction R A]\n [NonUnitalNonAssocSemiring B] [DistribMulAction R B]\n [FunLike F A B] [NonUnitalAlgHomClass F R A B] :\n CoeTC F (A →ₙₐ[R] B) :=\n ⟨toNonUnitalAlgHom⟩\n\nend NonUnitalAlgHomClass\n\nnamespace NonUnitalAlgHom\n\nvariable {T : Type*} [Monoid R] [Monoid S] [Monoid T] (φ : R →* S)\nvariable (A : Type v) (B : Type w) (C : Type w₁)\nvariable [NonUnitalNonAssocSemiring A] [DistribMulAction R A]\nvariable [NonUnitalNonAssocSemiring B] [DistribMulAction S B]\nvariable [NonUnitalNonAssocSemiring C] [DistribMulAction T C]\n\ninstance : FunLike (A →ₛₙₐ[φ] B) A B where\n coe f := f.toFun\n coe_injective := by rintro ⟨⟨⟨f, _⟩, _⟩, _⟩ ⟨⟨⟨g, _⟩, _⟩, _⟩ h; congr\n\n@[simp]\ntheorem toFun_eq_coe (f : A →ₛₙₐ[φ] B) : f.toFun = ⇑f :=\n rfl\n\n/-- See Note [custom simps projection] -/\ndef Simps.apply (f : A →ₛₙₐ[φ] B) : A → B := f\n\ninitialize_simps_projections NonUnitalAlgHom\n (toDistribMulActionHom_toMulActionHom_toFun → apply, -toDistribMulActionHom)\n\nvariable {φ A B C}\n@[simp]\nprotected theorem coe_coe {F : Type*} [FunLike F A B]\n [NonUnitalAlgSemiHomClass F φ A B] (f : F) :\n ⇑(f : A →ₛₙₐ[φ] B) = f :=\n rfl\n\ntheorem coe_injective : @Function.Injective (A →ₛₙₐ[φ] B) (A → B) (↑) := by\n rintro ⟨⟨⟨f, _⟩, _⟩, _⟩ ⟨⟨⟨g, _⟩, _⟩, _⟩ h; congr\ninstance : FunLike (A →ₛₙₐ[φ] B) A B where\n coe f := f.toFun\n coe_injective := coe_injective\n\ninstance : NonUnitalAlgSemiHomClass (A →ₛₙₐ[φ] B) φ A B where\n map_add f := f.map_add'\n map_zero f := f.map_zero'\n map_mul f := f.map_mul'\n map_smulₛₗ f := f.map_smul'\n\n@[ext]\ntheorem ext {f g : A →ₛₙₐ[φ] B} (h : ∀ x, f x = g x) : f = g :=\n coe_injective <| funext h\n\ntheorem congr_fun {f g : A →ₛₙₐ[φ] B} (h : f = g) (x : A) : f x = g x :=\n h ▸ rfl\n\n@[simp]\ntheorem coe_mk (f : A → B) (h₁ h₂ h₃ h₄) : ⇑(⟨⟨⟨f, h₁⟩, h₂, h₃⟩, h₄⟩ : A →ₛₙₐ[φ] B) = f :=\n rfl\n\n@[simp]\ntheorem mk_coe (f : A →ₛₙₐ[φ] B) (h₁ h₂ h₃ h₄) : (⟨⟨⟨f, h₁⟩, h₂, h₃⟩, h₄⟩ : A →ₛₙₐ[φ] B) = f := by\n rfl\n\n@[simp] lemma addHomMk_coe (f : A →ₛₙₐ[φ] B) : AddHom.mk f (map_add f) = f := rfl\n\n@[simp]\ntheorem toDistribMulActionHom_eq_coe (f : A →ₛₙₐ[φ] B) : f.toDistribMulActionHom = ↑f :=\n rfl\n\n@[simp]\ntheorem toMulHom_eq_coe (f : A →ₛₙₐ[φ] B) : f.toMulHom = ↑f :=\n rfl\n\n@[simp, norm_cast]\ntheorem coe_to_distribMulActionHom (f : A →ₛₙₐ[φ] B) : ⇑(f : A →ₑ+[φ] B) = f :=\n rfl\n\n@[simp, norm_cast]\ntheorem coe_to_mulHom (f : A →ₛₙₐ[φ] B) : ⇑(f : A →ₙ* B) = f :=\n rfl\n\ntheorem to_distribMulActionHom_injective {f g : A →ₛₙₐ[φ] B}\n (h : (f : A →ₑ+[φ] B) = (g : A →ₑ+[φ] B)) : f = g := by\n ext a\n exact DistribMulActionHom.congr_fun h a\n\nTarget:\ntheorem to_mulHom_injective {f g : A →ₛₙₐ[φ] B} (h : (f : A →ₙ* B) = (g : A →ₙ* B)) : f = g :=\n\nProof body:\n","proof_body":"by\n ext a\n exact DFunLike.congr_fun h a","provenance":{"declaration_index":11,"environment_hash":"08dda26699fe1025520aeb9450ff1df6b58e8ef0aa8100ae158997e8a703b831","lean_toolchain":"leanprover/lean4:v4.32.0-rc1","license":"Apache-2.0","original_import_scope":"module-specific","source_revision":"360da6fa66c1273b76b6b2d8c5666fd5ac2e3b56","source_sha256":"929fc720c21b33e33bbf0a692c3be55b0da352771a5dbb4e09a095c80437d1a6","source_uri":"https://github.com/leanprover-community/mathlib4/blob/360da6fa66c1273b76b6b2d8c5666fd5ac2e3b56/Mathlib/Algebra/Algebra/NonUnitalHom.lean"},"sample_id":"fb88080af6f22f4a9c54def3d9626310c1868fdacdfa6a87155ac0f2ed05a2f6","schema_version":1,"split":"holdout","theorem_statement":"theorem to_mulHom_injective {f g : A →ₛₙₐ[φ] B} (h : (f : A →ₙ* B) = (g : A →ₙ* B)) : f = g :="} |
| {"completion":"by\n rfl","context_contains_namespace":true,"context_suffix":"end NonUnitalAlgHom","dependency_ids":["import:Mathlib.Algebra.Algebra.Hom","import:Mathlib.Algebra.GroupWithZero.Action.Prod"],"family_id":"coe_distribmulactionhom_mk","file_id":"mathlib/Mathlib/Algebra/Algebra/NonUnitalHom.lean","imports":["public import Mathlib.Algebra.Algebra.Hom","public import Mathlib.Algebra.GroupWithZero.Action.Prod"],"local_context":"/-\nCopyright (c) 2021 Oliver Nash. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Oliver Nash\n-/\n/-!\n# Morphisms of non-unital algebras\n\nThis file defines morphisms between two types, each of which carries:\n* an addition,\n* an additive zero,\n* a multiplication,\n* a scalar action.\n\nThe multiplications are not assumed to be associative or unital, or even to be compatible with the\nscalar actions. In a typical application, the operations will satisfy compatibility conditions\nmaking them into algebras (albeit possibly non-associative and/or non-unital) but such conditions\nare not required to make this definition.\n\nThis notion of morphism should be useful for any category of non-unital algebras. The motivating\napplication at the time it was introduced was to be able to state the adjunction property for\nmagma algebras. These are non-unital, non-associative algebras obtained by applying the\ngroup-algebra construction except where we take a type carrying just `Mul` instead of `Group`.\n\nFor a plausible future application, one could take the non-unital algebra of compactly-supported\nfunctions on a non-compact topological space. A proper map between a pair of such spaces\n(contravariantly) induces a morphism between their algebras of compactly-supported functions which\nwill be a `NonUnitalAlgHom`.\n\nTODO: add `NonUnitalAlgEquiv` when needed.\n\n## Main definitions\n\n * `NonUnitalAlgHom`\n * `AlgHom.toNonUnitalAlgHom`\n\n## Tags\n\nnon-unital, algebra, morphism\n-/\n\n@[expose] public section\n\nuniverse u u₁ v w w₁ w₂ w₃\n\nvariable {R : Type u} {S : Type u₁}\n\n/-- A morphism respecting addition, multiplication, and scalar multiplication\n(denoted as `A →ₛₙₐ[φ] B`, or `A →ₙₐ[R] B` when `φ` is the identity on `R`).\nWhen these arise from algebra structures, this is the same\nas a not-necessarily-unital morphism of algebras. -/\nstructure NonUnitalAlgHom [Monoid R] [Monoid S] (φ : R →* S) (A : Type v) (B : Type w)\n [NonUnitalNonAssocSemiring A] [DistribMulAction R A]\n [NonUnitalNonAssocSemiring B] [DistribMulAction S B] extends A →ₑ+[φ] B, A →ₙ* B\n\n@[inherit_doc NonUnitalAlgHom]\ninfixr:25 \" →ₙₐ \" => NonUnitalAlgHom _\n\n@[inherit_doc]\nnotation:25 A \" →ₛₙₐ[\" φ \"] \" B => NonUnitalAlgHom φ A B\n\n@[inherit_doc]\nnotation:25 A \" →ₙₐ[\" R \"] \" B => NonUnitalAlgHom (MonoidHom.id R) A B\n\nattribute [nolint docBlame] NonUnitalAlgHom.toMulHom\n\n/-- `NonUnitalAlgSemiHomClass F φ A B` asserts `F` is a type of bundled algebra homomorphisms\nfrom `A` to `B` which are equivariant with respect to `φ`. -/\nclass NonUnitalAlgSemiHomClass (F : Type*) {R S : outParam Type*} [Monoid R] [Monoid S]\n (φ : outParam (R →* S)) (A B : outParam Type*)\n [NonUnitalNonAssocSemiring A] [NonUnitalNonAssocSemiring B]\n [DistribMulAction R A] [DistribMulAction S B] [FunLike F A B] : Prop\n extends DistribMulActionSemiHomClass F φ A B, MulHomClass F A B\n\n/-- `NonUnitalAlgHomClass F R A B` asserts `F` is a type of bundled algebra homomorphisms\nfrom `A` to `B` which are `R`-linear.\n\n This is an abbreviation to `NonUnitalAlgSemiHomClass F (MonoidHom.id R) A B` -/\nabbrev NonUnitalAlgHomClass (F : Type*) (R A B : outParam Type*)\n [Monoid R] [NonUnitalNonAssocSemiring A] [NonUnitalNonAssocSemiring B]\n [DistribMulAction R A] [DistribMulAction R B] [FunLike F A B] :=\n NonUnitalAlgSemiHomClass F (MonoidHom.id R) A B\n\nnamespace NonUnitalAlgHomClass\n\n-- See note [lower instance priority]\ninstance (priority := 100) toNonUnitalRingHomClass\n {F R S A B : Type*} {_ : Monoid R} {_ : Monoid S} {φ : outParam (R →* S)}\n {_ : NonUnitalNonAssocSemiring A} [DistribMulAction R A]\n {_ : NonUnitalNonAssocSemiring B} [DistribMulAction S B] [FunLike F A B]\n [NonUnitalAlgSemiHomClass F φ A B] : NonUnitalRingHomClass F A B :=\n { ‹NonUnitalAlgSemiHomClass F φ A B› with }\n\nvariable [Semiring R] [Semiring S] {φ : R →+* S}\n {A B : Type*} [NonUnitalNonAssocSemiring A] [Module R A]\n [NonUnitalNonAssocSemiring B] [Module S B]\n\n-- see Note [lower instance priority]\ninstance (priority := 100) {F R S A B : Type*}\n {_ : Semiring R} {_ : Semiring S} {φ : R →+* S}\n {_ : NonUnitalSemiring A} {_ : NonUnitalSemiring B} [Module R A] [Module S B] [FunLike F A B]\n [NonUnitalAlgSemiHomClass (R := R) (S := S) F φ A B] :\n SemilinearMapClass F φ A B :=\n { ‹NonUnitalAlgSemiHomClass F φ A B› with map_smulₛₗ := map_smulₛₗ }\n\ninstance (priority := 100) {F : Type*} [FunLike F A B] [Module R B] [NonUnitalAlgHomClass F R A B] :\n LinearMapClass F R A B :=\n { ‹NonUnitalAlgHomClass F R A B› with map_smulₛₗ := map_smulₛₗ }\n\n/-- Turn an element of a type `F` satisfying `NonUnitalAlgSemiHomClass F φ A B` into an actual\n`NonUnitalAlgHom`. This is declared as the default coercion from `F` to `A →ₛₙₐ[φ] B`. -/\n@[coe]\ndef toNonUnitalAlgSemiHom {F R S : Type*} [Monoid R] [Monoid S] {φ : R →* S} {A B : Type*}\n [NonUnitalNonAssocSemiring A] [DistribMulAction R A]\n [NonUnitalNonAssocSemiring B] [DistribMulAction S B] [FunLike F A B]\n [NonUnitalAlgSemiHomClass F φ A B] (f : F) : A →ₛₙₐ[φ] B :=\n { (f : A →ₙ+* B) with\n toFun := f\n map_smul' := map_smulₛₗ f }\n\ninstance {F R S A B : Type*} [Monoid R] [Monoid S] {φ : R →* S}\n [NonUnitalNonAssocSemiring A] [DistribMulAction R A]\n [NonUnitalNonAssocSemiring B] [DistribMulAction S B] [FunLike F A B]\n [NonUnitalAlgSemiHomClass F φ A B] :\n CoeTC F (A →ₛₙₐ[φ] B) :=\n ⟨toNonUnitalAlgSemiHom⟩\n\n/-- Turn an element of a type `F` satisfying `NonUnitalAlgHomClass F R A B` into an actual\n@[coe]\n`NonUnitalAlgHom`. This is declared as the default coercion from `F` to `A →ₛₙₐ[R] B`. -/\ndef toNonUnitalAlgHom {F R : Type*} [Monoid R] {A B : Type*}\n [NonUnitalNonAssocSemiring A] [DistribMulAction R A]\n [NonUnitalNonAssocSemiring B] [DistribMulAction R B]\n [FunLike F A B] [NonUnitalAlgHomClass F R A B] (f : F) : A →ₙₐ[R] B :=\n { (f : A →ₙ+* B) with\n toFun := f\n map_smul' := map_smulₛₗ f }\n\ninstance {F R : Type*} [Monoid R] {A B : Type*}\n [NonUnitalNonAssocSemiring A] [DistribMulAction R A]\n [NonUnitalNonAssocSemiring B] [DistribMulAction R B]\n [FunLike F A B] [NonUnitalAlgHomClass F R A B] :\n CoeTC F (A →ₙₐ[R] B) :=\n ⟨toNonUnitalAlgHom⟩\n\nend NonUnitalAlgHomClass\n\nnamespace NonUnitalAlgHom\n\nvariable {T : Type*} [Monoid R] [Monoid S] [Monoid T] (φ : R →* S)\nvariable (A : Type v) (B : Type w) (C : Type w₁)\nvariable [NonUnitalNonAssocSemiring A] [DistribMulAction R A]\nvariable [NonUnitalNonAssocSemiring B] [DistribMulAction S B]\nvariable [NonUnitalNonAssocSemiring C] [DistribMulAction T C]\n\ninstance : FunLike (A →ₛₙₐ[φ] B) A B where\n coe f := f.toFun\n coe_injective := by rintro ⟨⟨⟨f, _⟩, _⟩, _⟩ ⟨⟨⟨g, _⟩, _⟩, _⟩ h; congr\n\n@[simp]\ntheorem toFun_eq_coe (f : A →ₛₙₐ[φ] B) : f.toFun = ⇑f :=\n rfl\n\n/-- See Note [custom simps projection] -/\ndef Simps.apply (f : A →ₛₙₐ[φ] B) : A → B := f\n\ninitialize_simps_projections NonUnitalAlgHom\n (toDistribMulActionHom_toMulActionHom_toFun → apply, -toDistribMulActionHom)\n\nvariable {φ A B C}\n@[simp]\nprotected theorem coe_coe {F : Type*} [FunLike F A B]\n [NonUnitalAlgSemiHomClass F φ A B] (f : F) :\n ⇑(f : A →ₛₙₐ[φ] B) = f :=\n rfl\n\ntheorem coe_injective : @Function.Injective (A →ₛₙₐ[φ] B) (A → B) (↑) := by\n rintro ⟨⟨⟨f, _⟩, _⟩, _⟩ ⟨⟨⟨g, _⟩, _⟩, _⟩ h; congr\ninstance : FunLike (A →ₛₙₐ[φ] B) A B where\n coe f := f.toFun\n coe_injective := coe_injective\n\ninstance : NonUnitalAlgSemiHomClass (A →ₛₙₐ[φ] B) φ A B where\n map_add f := f.map_add'\n map_zero f := f.map_zero'\n map_mul f := f.map_mul'\n map_smulₛₗ f := f.map_smul'\n\n@[ext]\ntheorem ext {f g : A →ₛₙₐ[φ] B} (h : ∀ x, f x = g x) : f = g :=\n coe_injective <| funext h\n\ntheorem congr_fun {f g : A →ₛₙₐ[φ] B} (h : f = g) (x : A) : f x = g x :=\n h ▸ rfl\n\n@[simp]\ntheorem coe_mk (f : A → B) (h₁ h₂ h₃ h₄) : ⇑(⟨⟨⟨f, h₁⟩, h₂, h₃⟩, h₄⟩ : A →ₛₙₐ[φ] B) = f :=\n rfl\n\n@[simp]\ntheorem mk_coe (f : A →ₛₙₐ[φ] B) (h₁ h₂ h₃ h₄) : (⟨⟨⟨f, h₁⟩, h₂, h₃⟩, h₄⟩ : A →ₛₙₐ[φ] B) = f := by\n rfl\n\n@[simp] lemma addHomMk_coe (f : A →ₛₙₐ[φ] B) : AddHom.mk f (map_add f) = f := rfl\n\n@[simp]\ntheorem toDistribMulActionHom_eq_coe (f : A →ₛₙₐ[φ] B) : f.toDistribMulActionHom = ↑f :=\n rfl\n\n@[simp]\ntheorem toMulHom_eq_coe (f : A →ₛₙₐ[φ] B) : f.toMulHom = ↑f :=\n rfl\n\n@[simp, norm_cast]\ntheorem coe_to_distribMulActionHom (f : A →ₛₙₐ[φ] B) : ⇑(f : A →ₑ+[φ] B) = f :=\n rfl\n\n@[simp, norm_cast]\ntheorem coe_to_mulHom (f : A →ₛₙₐ[φ] B) : ⇑(f : A →ₙ* B) = f :=\n rfl\n\ntheorem to_distribMulActionHom_injective {f g : A →ₛₙₐ[φ] B}\n (h : (f : A →ₑ+[φ] B) = (g : A →ₑ+[φ] B)) : f = g := by\n ext a\n exact DistribMulActionHom.congr_fun h a\n\ntheorem to_mulHom_injective {f g : A →ₛₙₐ[φ] B} (h : (f : A →ₙ* B) = (g : A →ₙ* B)) : f = g := by\n ext a\n exact DFunLike.congr_fun h a\n\n@[norm_cast]","module_header":true,"namespace":"NonUnitalAlgHom","prompt":"Return exactly one Lean proof body beginning with `by`. Do not emit prose, fences, declarations, sorry, admit, by?, or warnings.\n\nImports:\npublic import Mathlib.Algebra.Algebra.Hom\npublic import Mathlib.Algebra.GroupWithZero.Action.Prod\n\nNamespace:\nNonUnitalAlgHom\n\nLocal context:\n/-\nCopyright (c) 2021 Oliver Nash. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Oliver Nash\n-/\n/-!\n# Morphisms of non-unital algebras\n\nThis file defines morphisms between two types, each of which carries:\n* an addition,\n* an additive zero,\n* a multiplication,\n* a scalar action.\n\nThe multiplications are not assumed to be associative or unital, or even to be compatible with the\nscalar actions. In a typical application, the operations will satisfy compatibility conditions\nmaking them into algebras (albeit possibly non-associative and/or non-unital) but such conditions\nare not required to make this definition.\n\nThis notion of morphism should be useful for any category of non-unital algebras. The motivating\napplication at the time it was introduced was to be able to state the adjunction property for\nmagma algebras. These are non-unital, non-associative algebras obtained by applying the\ngroup-algebra construction except where we take a type carrying just `Mul` instead of `Group`.\n\nFor a plausible future application, one could take the non-unital algebra of compactly-supported\nfunctions on a non-compact topological space. A proper map between a pair of such spaces\n(contravariantly) induces a morphism between their algebras of compactly-supported functions which\nwill be a `NonUnitalAlgHom`.\n\nTODO: add `NonUnitalAlgEquiv` when needed.\n\n## Main definitions\n\n * `NonUnitalAlgHom`\n * `AlgHom.toNonUnitalAlgHom`\n\n## Tags\n\nnon-unital, algebra, morphism\n-/\n\n@[expose] public section\n\nuniverse u u₁ v w w₁ w₂ w₃\n\nvariable {R : Type u} {S : Type u₁}\n\n/-- A morphism respecting addition, multiplication, and scalar multiplication\n(denoted as `A →ₛₙₐ[φ] B`, or `A →ₙₐ[R] B` when `φ` is the identity on `R`).\nWhen these arise from algebra structures, this is the same\nas a not-necessarily-unital morphism of algebras. -/\nstructure NonUnitalAlgHom [Monoid R] [Monoid S] (φ : R →* S) (A : Type v) (B : Type w)\n [NonUnitalNonAssocSemiring A] [DistribMulAction R A]\n [NonUnitalNonAssocSemiring B] [DistribMulAction S B] extends A →ₑ+[φ] B, A →ₙ* B\n\n@[inherit_doc NonUnitalAlgHom]\ninfixr:25 \" →ₙₐ \" => NonUnitalAlgHom _\n\n@[inherit_doc]\nnotation:25 A \" →ₛₙₐ[\" φ \"] \" B => NonUnitalAlgHom φ A B\n\n@[inherit_doc]\nnotation:25 A \" →ₙₐ[\" R \"] \" B => NonUnitalAlgHom (MonoidHom.id R) A B\n\nattribute [nolint docBlame] NonUnitalAlgHom.toMulHom\n\n/-- `NonUnitalAlgSemiHomClass F φ A B` asserts `F` is a type of bundled algebra homomorphisms\nfrom `A` to `B` which are equivariant with respect to `φ`. -/\nclass NonUnitalAlgSemiHomClass (F : Type*) {R S : outParam Type*} [Monoid R] [Monoid S]\n (φ : outParam (R →* S)) (A B : outParam Type*)\n [NonUnitalNonAssocSemiring A] [NonUnitalNonAssocSemiring B]\n [DistribMulAction R A] [DistribMulAction S B] [FunLike F A B] : Prop\n extends DistribMulActionSemiHomClass F φ A B, MulHomClass F A B\n\n/-- `NonUnitalAlgHomClass F R A B` asserts `F` is a type of bundled algebra homomorphisms\nfrom `A` to `B` which are `R`-linear.\n\n This is an abbreviation to `NonUnitalAlgSemiHomClass F (MonoidHom.id R) A B` -/\nabbrev NonUnitalAlgHomClass (F : Type*) (R A B : outParam Type*)\n [Monoid R] [NonUnitalNonAssocSemiring A] [NonUnitalNonAssocSemiring B]\n [DistribMulAction R A] [DistribMulAction R B] [FunLike F A B] :=\n NonUnitalAlgSemiHomClass F (MonoidHom.id R) A B\n\nnamespace NonUnitalAlgHomClass\n\n-- See note [lower instance priority]\ninstance (priority := 100) toNonUnitalRingHomClass\n {F R S A B : Type*} {_ : Monoid R} {_ : Monoid S} {φ : outParam (R →* S)}\n {_ : NonUnitalNonAssocSemiring A} [DistribMulAction R A]\n {_ : NonUnitalNonAssocSemiring B} [DistribMulAction S B] [FunLike F A B]\n [NonUnitalAlgSemiHomClass F φ A B] : NonUnitalRingHomClass F A B :=\n { ‹NonUnitalAlgSemiHomClass F φ A B› with }\n\nvariable [Semiring R] [Semiring S] {φ : R →+* S}\n {A B : Type*} [NonUnitalNonAssocSemiring A] [Module R A]\n [NonUnitalNonAssocSemiring B] [Module S B]\n\n-- see Note [lower instance priority]\ninstance (priority := 100) {F R S A B : Type*}\n {_ : Semiring R} {_ : Semiring S} {φ : R →+* S}\n {_ : NonUnitalSemiring A} {_ : NonUnitalSemiring B} [Module R A] [Module S B] [FunLike F A B]\n [NonUnitalAlgSemiHomClass (R := R) (S := S) F φ A B] :\n SemilinearMapClass F φ A B :=\n { ‹NonUnitalAlgSemiHomClass F φ A B› with map_smulₛₗ := map_smulₛₗ }\n\ninstance (priority := 100) {F : Type*} [FunLike F A B] [Module R B] [NonUnitalAlgHomClass F R A B] :\n LinearMapClass F R A B :=\n { ‹NonUnitalAlgHomClass F R A B› with map_smulₛₗ := map_smulₛₗ }\n\n/-- Turn an element of a type `F` satisfying `NonUnitalAlgSemiHomClass F φ A B` into an actual\n`NonUnitalAlgHom`. This is declared as the default coercion from `F` to `A →ₛₙₐ[φ] B`. -/\n@[coe]\ndef toNonUnitalAlgSemiHom {F R S : Type*} [Monoid R] [Monoid S] {φ : R →* S} {A B : Type*}\n [NonUnitalNonAssocSemiring A] [DistribMulAction R A]\n [NonUnitalNonAssocSemiring B] [DistribMulAction S B] [FunLike F A B]\n [NonUnitalAlgSemiHomClass F φ A B] (f : F) : A →ₛₙₐ[φ] B :=\n { (f : A →ₙ+* B) with\n toFun := f\n map_smul' := map_smulₛₗ f }\n\ninstance {F R S A B : Type*} [Monoid R] [Monoid S] {φ : R →* S}\n [NonUnitalNonAssocSemiring A] [DistribMulAction R A]\n [NonUnitalNonAssocSemiring B] [DistribMulAction S B] [FunLike F A B]\n [NonUnitalAlgSemiHomClass F φ A B] :\n CoeTC F (A →ₛₙₐ[φ] B) :=\n ⟨toNonUnitalAlgSemiHom⟩\n\n/-- Turn an element of a type `F` satisfying `NonUnitalAlgHomClass F R A B` into an actual\n@[coe]\n`NonUnitalAlgHom`. This is declared as the default coercion from `F` to `A →ₛₙₐ[R] B`. -/\ndef toNonUnitalAlgHom {F R : Type*} [Monoid R] {A B : Type*}\n [NonUnitalNonAssocSemiring A] [DistribMulAction R A]\n [NonUnitalNonAssocSemiring B] [DistribMulAction R B]\n [FunLike F A B] [NonUnitalAlgHomClass F R A B] (f : F) : A →ₙₐ[R] B :=\n { (f : A →ₙ+* B) with\n toFun := f\n map_smul' := map_smulₛₗ f }\n\ninstance {F R : Type*} [Monoid R] {A B : Type*}\n [NonUnitalNonAssocSemiring A] [DistribMulAction R A]\n [NonUnitalNonAssocSemiring B] [DistribMulAction R B]\n [FunLike F A B] [NonUnitalAlgHomClass F R A B] :\n CoeTC F (A →ₙₐ[R] B) :=\n ⟨toNonUnitalAlgHom⟩\n\nend NonUnitalAlgHomClass\n\nnamespace NonUnitalAlgHom\n\nvariable {T : Type*} [Monoid R] [Monoid S] [Monoid T] (φ : R →* S)\nvariable (A : Type v) (B : Type w) (C : Type w₁)\nvariable [NonUnitalNonAssocSemiring A] [DistribMulAction R A]\nvariable [NonUnitalNonAssocSemiring B] [DistribMulAction S B]\nvariable [NonUnitalNonAssocSemiring C] [DistribMulAction T C]\n\ninstance : FunLike (A →ₛₙₐ[φ] B) A B where\n coe f := f.toFun\n coe_injective := by rintro ⟨⟨⟨f, _⟩, _⟩, _⟩ ⟨⟨⟨g, _⟩, _⟩, _⟩ h; congr\n\n@[simp]\ntheorem toFun_eq_coe (f : A →ₛₙₐ[φ] B) : f.toFun = ⇑f :=\n rfl\n\n/-- See Note [custom simps projection] -/\ndef Simps.apply (f : A →ₛₙₐ[φ] B) : A → B := f\n\ninitialize_simps_projections NonUnitalAlgHom\n (toDistribMulActionHom_toMulActionHom_toFun → apply, -toDistribMulActionHom)\n\nvariable {φ A B C}\n@[simp]\nprotected theorem coe_coe {F : Type*} [FunLike F A B]\n [NonUnitalAlgSemiHomClass F φ A B] (f : F) :\n ⇑(f : A →ₛₙₐ[φ] B) = f :=\n rfl\n\ntheorem coe_injective : @Function.Injective (A →ₛₙₐ[φ] B) (A → B) (↑) := by\n rintro ⟨⟨⟨f, _⟩, _⟩, _⟩ ⟨⟨⟨g, _⟩, _⟩, _⟩ h; congr\ninstance : FunLike (A →ₛₙₐ[φ] B) A B where\n coe f := f.toFun\n coe_injective := coe_injective\n\ninstance : NonUnitalAlgSemiHomClass (A →ₛₙₐ[φ] B) φ A B where\n map_add f := f.map_add'\n map_zero f := f.map_zero'\n map_mul f := f.map_mul'\n map_smulₛₗ f := f.map_smul'\n\n@[ext]\ntheorem ext {f g : A →ₛₙₐ[φ] B} (h : ∀ x, f x = g x) : f = g :=\n coe_injective <| funext h\n\ntheorem congr_fun {f g : A →ₛₙₐ[φ] B} (h : f = g) (x : A) : f x = g x :=\n h ▸ rfl\n\n@[simp]\ntheorem coe_mk (f : A → B) (h₁ h₂ h₃ h₄) : ⇑(⟨⟨⟨f, h₁⟩, h₂, h₃⟩, h₄⟩ : A →ₛₙₐ[φ] B) = f :=\n rfl\n\n@[simp]\ntheorem mk_coe (f : A →ₛₙₐ[φ] B) (h₁ h₂ h₃ h₄) : (⟨⟨⟨f, h₁⟩, h₂, h₃⟩, h₄⟩ : A →ₛₙₐ[φ] B) = f := by\n rfl\n\n@[simp] lemma addHomMk_coe (f : A →ₛₙₐ[φ] B) : AddHom.mk f (map_add f) = f := rfl\n\n@[simp]\ntheorem toDistribMulActionHom_eq_coe (f : A →ₛₙₐ[φ] B) : f.toDistribMulActionHom = ↑f :=\n rfl\n\n@[simp]\ntheorem toMulHom_eq_coe (f : A →ₛₙₐ[φ] B) : f.toMulHom = ↑f :=\n rfl\n\n@[simp, norm_cast]\ntheorem coe_to_distribMulActionHom (f : A →ₛₙₐ[φ] B) : ⇑(f : A →ₑ+[φ] B) = f :=\n rfl\n\n@[simp, norm_cast]\ntheorem coe_to_mulHom (f : A →ₛₙₐ[φ] B) : ⇑(f : A →ₙ* B) = f :=\n rfl\n\ntheorem to_distribMulActionHom_injective {f g : A →ₛₙₐ[φ] B}\n (h : (f : A →ₑ+[φ] B) = (g : A →ₑ+[φ] B)) : f = g := by\n ext a\n exact DistribMulActionHom.congr_fun h a\n\ntheorem to_mulHom_injective {f g : A →ₛₙₐ[φ] B} (h : (f : A →ₙ* B) = (g : A →ₙ* B)) : f = g := by\n ext a\n exact DFunLike.congr_fun h a\n\n@[norm_cast]\n\nTarget:\ntheorem coe_distribMulActionHom_mk (f : A →ₛₙₐ[φ] B) (h₁ h₂ h₃ h₄) :\n ((⟨⟨⟨f, h₁⟩, h₂, h₃⟩, h₄⟩ : A →ₛₙₐ[φ] B) : A →ₑ+[φ] B) = ⟨⟨f, h₁⟩, h₂, h₃⟩ :=\n\nProof body:\n","proof_body":"by\n rfl","provenance":{"declaration_index":12,"environment_hash":"08dda26699fe1025520aeb9450ff1df6b58e8ef0aa8100ae158997e8a703b831","lean_toolchain":"leanprover/lean4:v4.32.0-rc1","license":"Apache-2.0","original_import_scope":"module-specific","source_revision":"360da6fa66c1273b76b6b2d8c5666fd5ac2e3b56","source_sha256":"929fc720c21b33e33bbf0a692c3be55b0da352771a5dbb4e09a095c80437d1a6","source_uri":"https://github.com/leanprover-community/mathlib4/blob/360da6fa66c1273b76b6b2d8c5666fd5ac2e3b56/Mathlib/Algebra/Algebra/NonUnitalHom.lean"},"sample_id":"8fba53f509cbcaa7077e1b9aaefbeecf912a8e10535c22fd02c1ba65487eb495","schema_version":1,"split":"holdout","theorem_statement":"theorem coe_distribMulActionHom_mk (f : A →ₛₙₐ[φ] B) (h₁ h₂ h₃ h₄) :\n ((⟨⟨⟨f, h₁⟩, h₂, h₃⟩, h₄⟩ : A →ₛₙₐ[φ] B) : A →ₑ+[φ] B) = ⟨⟨f, h₁⟩, h₂, h₃⟩ :="} |
| {"completion":"by\n rfl","context_contains_namespace":true,"context_suffix":"end NonUnitalAlgHom","dependency_ids":["import:Mathlib.Algebra.Algebra.Hom","import:Mathlib.Algebra.GroupWithZero.Action.Prod"],"family_id":"coe_mulhom_mk","file_id":"mathlib/Mathlib/Algebra/Algebra/NonUnitalHom.lean","imports":["public import Mathlib.Algebra.Algebra.Hom","public import Mathlib.Algebra.GroupWithZero.Action.Prod"],"local_context":"/-\nCopyright (c) 2021 Oliver Nash. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Oliver Nash\n-/\n/-!\n# Morphisms of non-unital algebras\n\nThis file defines morphisms between two types, each of which carries:\n* an addition,\n* an additive zero,\n* a multiplication,\n* a scalar action.\n\nThe multiplications are not assumed to be associative or unital, or even to be compatible with the\nscalar actions. In a typical application, the operations will satisfy compatibility conditions\nmaking them into algebras (albeit possibly non-associative and/or non-unital) but such conditions\nare not required to make this definition.\n\nThis notion of morphism should be useful for any category of non-unital algebras. The motivating\napplication at the time it was introduced was to be able to state the adjunction property for\nmagma algebras. These are non-unital, non-associative algebras obtained by applying the\ngroup-algebra construction except where we take a type carrying just `Mul` instead of `Group`.\n\nFor a plausible future application, one could take the non-unital algebra of compactly-supported\nfunctions on a non-compact topological space. A proper map between a pair of such spaces\n(contravariantly) induces a morphism between their algebras of compactly-supported functions which\nwill be a `NonUnitalAlgHom`.\n\nTODO: add `NonUnitalAlgEquiv` when needed.\n\n## Main definitions\n\n * `NonUnitalAlgHom`\n * `AlgHom.toNonUnitalAlgHom`\n\n## Tags\n\nnon-unital, algebra, morphism\n-/\n\n@[expose] public section\n\nuniverse u u₁ v w w₁ w₂ w₃\n\nvariable {R : Type u} {S : Type u₁}\n\n/-- A morphism respecting addition, multiplication, and scalar multiplication\n(denoted as `A →ₛₙₐ[φ] B`, or `A →ₙₐ[R] B` when `φ` is the identity on `R`).\nWhen these arise from algebra structures, this is the same\nas a not-necessarily-unital morphism of algebras. -/\nstructure NonUnitalAlgHom [Monoid R] [Monoid S] (φ : R →* S) (A : Type v) (B : Type w)\n [NonUnitalNonAssocSemiring A] [DistribMulAction R A]\n [NonUnitalNonAssocSemiring B] [DistribMulAction S B] extends A →ₑ+[φ] B, A →ₙ* B\n\n@[inherit_doc NonUnitalAlgHom]\ninfixr:25 \" →ₙₐ \" => NonUnitalAlgHom _\n\n@[inherit_doc]\nnotation:25 A \" →ₛₙₐ[\" φ \"] \" B => NonUnitalAlgHom φ A B\n\n@[inherit_doc]\nnotation:25 A \" →ₙₐ[\" R \"] \" B => NonUnitalAlgHom (MonoidHom.id R) A B\n\nattribute [nolint docBlame] NonUnitalAlgHom.toMulHom\n\n/-- `NonUnitalAlgSemiHomClass F φ A B` asserts `F` is a type of bundled algebra homomorphisms\nfrom `A` to `B` which are equivariant with respect to `φ`. -/\nclass NonUnitalAlgSemiHomClass (F : Type*) {R S : outParam Type*} [Monoid R] [Monoid S]\n (φ : outParam (R →* S)) (A B : outParam Type*)\n [NonUnitalNonAssocSemiring A] [NonUnitalNonAssocSemiring B]\n [DistribMulAction R A] [DistribMulAction S B] [FunLike F A B] : Prop\n extends DistribMulActionSemiHomClass F φ A B, MulHomClass F A B\n\n/-- `NonUnitalAlgHomClass F R A B` asserts `F` is a type of bundled algebra homomorphisms\nfrom `A` to `B` which are `R`-linear.\n\n This is an abbreviation to `NonUnitalAlgSemiHomClass F (MonoidHom.id R) A B` -/\nabbrev NonUnitalAlgHomClass (F : Type*) (R A B : outParam Type*)\n [Monoid R] [NonUnitalNonAssocSemiring A] [NonUnitalNonAssocSemiring B]\n [DistribMulAction R A] [DistribMulAction R B] [FunLike F A B] :=\n NonUnitalAlgSemiHomClass F (MonoidHom.id R) A B\n\nnamespace NonUnitalAlgHomClass\n\n-- See note [lower instance priority]\ninstance (priority := 100) toNonUnitalRingHomClass\n {F R S A B : Type*} {_ : Monoid R} {_ : Monoid S} {φ : outParam (R →* S)}\n {_ : NonUnitalNonAssocSemiring A} [DistribMulAction R A]\n {_ : NonUnitalNonAssocSemiring B} [DistribMulAction S B] [FunLike F A B]\n [NonUnitalAlgSemiHomClass F φ A B] : NonUnitalRingHomClass F A B :=\n { ‹NonUnitalAlgSemiHomClass F φ A B› with }\n\nvariable [Semiring R] [Semiring S] {φ : R →+* S}\n {A B : Type*} [NonUnitalNonAssocSemiring A] [Module R A]\n [NonUnitalNonAssocSemiring B] [Module S B]\n\n-- see Note [lower instance priority]\ninstance (priority := 100) {F R S A B : Type*}\n {_ : Semiring R} {_ : Semiring S} {φ : R →+* S}\n {_ : NonUnitalSemiring A} {_ : NonUnitalSemiring B} [Module R A] [Module S B] [FunLike F A B]\n [NonUnitalAlgSemiHomClass (R := R) (S := S) F φ A B] :\n SemilinearMapClass F φ A B :=\n { ‹NonUnitalAlgSemiHomClass F φ A B› with map_smulₛₗ := map_smulₛₗ }\n\ninstance (priority := 100) {F : Type*} [FunLike F A B] [Module R B] [NonUnitalAlgHomClass F R A B] :\n LinearMapClass F R A B :=\n { ‹NonUnitalAlgHomClass F R A B› with map_smulₛₗ := map_smulₛₗ }\n\n/-- Turn an element of a type `F` satisfying `NonUnitalAlgSemiHomClass F φ A B` into an actual\n`NonUnitalAlgHom`. This is declared as the default coercion from `F` to `A →ₛₙₐ[φ] B`. -/\n@[coe]\ndef toNonUnitalAlgSemiHom {F R S : Type*} [Monoid R] [Monoid S] {φ : R →* S} {A B : Type*}\n [NonUnitalNonAssocSemiring A] [DistribMulAction R A]\n [NonUnitalNonAssocSemiring B] [DistribMulAction S B] [FunLike F A B]\n [NonUnitalAlgSemiHomClass F φ A B] (f : F) : A →ₛₙₐ[φ] B :=\n { (f : A →ₙ+* B) with\n toFun := f\n map_smul' := map_smulₛₗ f }\n\ninstance {F R S A B : Type*} [Monoid R] [Monoid S] {φ : R →* S}\n [NonUnitalNonAssocSemiring A] [DistribMulAction R A]\n [NonUnitalNonAssocSemiring B] [DistribMulAction S B] [FunLike F A B]\n [NonUnitalAlgSemiHomClass F φ A B] :\n CoeTC F (A →ₛₙₐ[φ] B) :=\n ⟨toNonUnitalAlgSemiHom⟩\n\n/-- Turn an element of a type `F` satisfying `NonUnitalAlgHomClass F R A B` into an actual\n@[coe]\n`NonUnitalAlgHom`. This is declared as the default coercion from `F` to `A →ₛₙₐ[R] B`. -/\ndef toNonUnitalAlgHom {F R : Type*} [Monoid R] {A B : Type*}\n [NonUnitalNonAssocSemiring A] [DistribMulAction R A]\n [NonUnitalNonAssocSemiring B] [DistribMulAction R B]\n [FunLike F A B] [NonUnitalAlgHomClass F R A B] (f : F) : A →ₙₐ[R] B :=\n { (f : A →ₙ+* B) with\n toFun := f\n map_smul' := map_smulₛₗ f }\n\ninstance {F R : Type*} [Monoid R] {A B : Type*}\n [NonUnitalNonAssocSemiring A] [DistribMulAction R A]\n [NonUnitalNonAssocSemiring B] [DistribMulAction R B]\n [FunLike F A B] [NonUnitalAlgHomClass F R A B] :\n CoeTC F (A →ₙₐ[R] B) :=\n ⟨toNonUnitalAlgHom⟩\n\nend NonUnitalAlgHomClass\n\nnamespace NonUnitalAlgHom\n\nvariable {T : Type*} [Monoid R] [Monoid S] [Monoid T] (φ : R →* S)\nvariable (A : Type v) (B : Type w) (C : Type w₁)\nvariable [NonUnitalNonAssocSemiring A] [DistribMulAction R A]\nvariable [NonUnitalNonAssocSemiring B] [DistribMulAction S B]\nvariable [NonUnitalNonAssocSemiring C] [DistribMulAction T C]\n\ninstance : FunLike (A →ₛₙₐ[φ] B) A B where\n coe f := f.toFun\n coe_injective := by rintro ⟨⟨⟨f, _⟩, _⟩, _⟩ ⟨⟨⟨g, _⟩, _⟩, _⟩ h; congr\n\n@[simp]\ntheorem toFun_eq_coe (f : A →ₛₙₐ[φ] B) : f.toFun = ⇑f :=\n rfl\n\n/-- See Note [custom simps projection] -/\ndef Simps.apply (f : A →ₛₙₐ[φ] B) : A → B := f\n\ninitialize_simps_projections NonUnitalAlgHom\n (toDistribMulActionHom_toMulActionHom_toFun → apply, -toDistribMulActionHom)\n\nvariable {φ A B C}\n@[simp]\nprotected theorem coe_coe {F : Type*} [FunLike F A B]\n [NonUnitalAlgSemiHomClass F φ A B] (f : F) :\n ⇑(f : A →ₛₙₐ[φ] B) = f :=\n rfl\n\ntheorem coe_injective : @Function.Injective (A →ₛₙₐ[φ] B) (A → B) (↑) := by\n rintro ⟨⟨⟨f, _⟩, _⟩, _⟩ ⟨⟨⟨g, _⟩, _⟩, _⟩ h; congr\ninstance : FunLike (A →ₛₙₐ[φ] B) A B where\n coe f := f.toFun\n coe_injective := coe_injective\n\ninstance : NonUnitalAlgSemiHomClass (A →ₛₙₐ[φ] B) φ A B where\n map_add f := f.map_add'\n map_zero f := f.map_zero'\n map_mul f := f.map_mul'\n map_smulₛₗ f := f.map_smul'\n\n@[ext]\ntheorem ext {f g : A →ₛₙₐ[φ] B} (h : ∀ x, f x = g x) : f = g :=\n coe_injective <| funext h\n\ntheorem congr_fun {f g : A →ₛₙₐ[φ] B} (h : f = g) (x : A) : f x = g x :=\n h ▸ rfl\n\n@[simp]\ntheorem coe_mk (f : A → B) (h₁ h₂ h₃ h₄) : ⇑(⟨⟨⟨f, h₁⟩, h₂, h₃⟩, h₄⟩ : A →ₛₙₐ[φ] B) = f :=\n rfl\n\n@[simp]\ntheorem mk_coe (f : A →ₛₙₐ[φ] B) (h₁ h₂ h₃ h₄) : (⟨⟨⟨f, h₁⟩, h₂, h₃⟩, h₄⟩ : A →ₛₙₐ[φ] B) = f := by\n rfl\n\n@[simp] lemma addHomMk_coe (f : A →ₛₙₐ[φ] B) : AddHom.mk f (map_add f) = f := rfl\n\n@[simp]\ntheorem toDistribMulActionHom_eq_coe (f : A →ₛₙₐ[φ] B) : f.toDistribMulActionHom = ↑f :=\n rfl\n\n@[simp]\ntheorem toMulHom_eq_coe (f : A →ₛₙₐ[φ] B) : f.toMulHom = ↑f :=\n rfl\n\n@[simp, norm_cast]\ntheorem coe_to_distribMulActionHom (f : A →ₛₙₐ[φ] B) : ⇑(f : A →ₑ+[φ] B) = f :=\n rfl\n\n@[simp, norm_cast]\ntheorem coe_to_mulHom (f : A →ₛₙₐ[φ] B) : ⇑(f : A →ₙ* B) = f :=\n rfl\n\ntheorem to_distribMulActionHom_injective {f g : A →ₛₙₐ[φ] B}\n (h : (f : A →ₑ+[φ] B) = (g : A →ₑ+[φ] B)) : f = g := by\n ext a\n exact DistribMulActionHom.congr_fun h a\n\ntheorem to_mulHom_injective {f g : A →ₛₙₐ[φ] B} (h : (f : A →ₙ* B) = (g : A →ₙ* B)) : f = g := by\n ext a\n exact DFunLike.congr_fun h a\n\n@[norm_cast]\ntheorem coe_distribMulActionHom_mk (f : A →ₛₙₐ[φ] B) (h₁ h₂ h₃ h₄) :\n ((⟨⟨⟨f, h₁⟩, h₂, h₃⟩, h₄⟩ : A →ₛₙₐ[φ] B) : A →ₑ+[φ] B) = ⟨⟨f, h₁⟩, h₂, h₃⟩ := by\n rfl\n\n@[norm_cast]","module_header":true,"namespace":"NonUnitalAlgHom","prompt":"Return exactly one Lean proof body beginning with `by`. Do not emit prose, fences, declarations, sorry, admit, by?, or warnings.\n\nImports:\npublic import Mathlib.Algebra.Algebra.Hom\npublic import Mathlib.Algebra.GroupWithZero.Action.Prod\n\nNamespace:\nNonUnitalAlgHom\n\nLocal context:\n/-\nCopyright (c) 2021 Oliver Nash. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Oliver Nash\n-/\n/-!\n# Morphisms of non-unital algebras\n\nThis file defines morphisms between two types, each of which carries:\n* an addition,\n* an additive zero,\n* a multiplication,\n* a scalar action.\n\nThe multiplications are not assumed to be associative or unital, or even to be compatible with the\nscalar actions. In a typical application, the operations will satisfy compatibility conditions\nmaking them into algebras (albeit possibly non-associative and/or non-unital) but such conditions\nare not required to make this definition.\n\nThis notion of morphism should be useful for any category of non-unital algebras. The motivating\napplication at the time it was introduced was to be able to state the adjunction property for\nmagma algebras. These are non-unital, non-associative algebras obtained by applying the\ngroup-algebra construction except where we take a type carrying just `Mul` instead of `Group`.\n\nFor a plausible future application, one could take the non-unital algebra of compactly-supported\nfunctions on a non-compact topological space. A proper map between a pair of such spaces\n(contravariantly) induces a morphism between their algebras of compactly-supported functions which\nwill be a `NonUnitalAlgHom`.\n\nTODO: add `NonUnitalAlgEquiv` when needed.\n\n## Main definitions\n\n * `NonUnitalAlgHom`\n * `AlgHom.toNonUnitalAlgHom`\n\n## Tags\n\nnon-unital, algebra, morphism\n-/\n\n@[expose] public section\n\nuniverse u u₁ v w w₁ w₂ w₃\n\nvariable {R : Type u} {S : Type u₁}\n\n/-- A morphism respecting addition, multiplication, and scalar multiplication\n(denoted as `A →ₛₙₐ[φ] B`, or `A →ₙₐ[R] B` when `φ` is the identity on `R`).\nWhen these arise from algebra structures, this is the same\nas a not-necessarily-unital morphism of algebras. -/\nstructure NonUnitalAlgHom [Monoid R] [Monoid S] (φ : R →* S) (A : Type v) (B : Type w)\n [NonUnitalNonAssocSemiring A] [DistribMulAction R A]\n [NonUnitalNonAssocSemiring B] [DistribMulAction S B] extends A →ₑ+[φ] B, A →ₙ* B\n\n@[inherit_doc NonUnitalAlgHom]\ninfixr:25 \" →ₙₐ \" => NonUnitalAlgHom _\n\n@[inherit_doc]\nnotation:25 A \" →ₛₙₐ[\" φ \"] \" B => NonUnitalAlgHom φ A B\n\n@[inherit_doc]\nnotation:25 A \" →ₙₐ[\" R \"] \" B => NonUnitalAlgHom (MonoidHom.id R) A B\n\nattribute [nolint docBlame] NonUnitalAlgHom.toMulHom\n\n/-- `NonUnitalAlgSemiHomClass F φ A B` asserts `F` is a type of bundled algebra homomorphisms\nfrom `A` to `B` which are equivariant with respect to `φ`. -/\nclass NonUnitalAlgSemiHomClass (F : Type*) {R S : outParam Type*} [Monoid R] [Monoid S]\n (φ : outParam (R →* S)) (A B : outParam Type*)\n [NonUnitalNonAssocSemiring A] [NonUnitalNonAssocSemiring B]\n [DistribMulAction R A] [DistribMulAction S B] [FunLike F A B] : Prop\n extends DistribMulActionSemiHomClass F φ A B, MulHomClass F A B\n\n/-- `NonUnitalAlgHomClass F R A B` asserts `F` is a type of bundled algebra homomorphisms\nfrom `A` to `B` which are `R`-linear.\n\n This is an abbreviation to `NonUnitalAlgSemiHomClass F (MonoidHom.id R) A B` -/\nabbrev NonUnitalAlgHomClass (F : Type*) (R A B : outParam Type*)\n [Monoid R] [NonUnitalNonAssocSemiring A] [NonUnitalNonAssocSemiring B]\n [DistribMulAction R A] [DistribMulAction R B] [FunLike F A B] :=\n NonUnitalAlgSemiHomClass F (MonoidHom.id R) A B\n\nnamespace NonUnitalAlgHomClass\n\n-- See note [lower instance priority]\ninstance (priority := 100) toNonUnitalRingHomClass\n {F R S A B : Type*} {_ : Monoid R} {_ : Monoid S} {φ : outParam (R →* S)}\n {_ : NonUnitalNonAssocSemiring A} [DistribMulAction R A]\n {_ : NonUnitalNonAssocSemiring B} [DistribMulAction S B] [FunLike F A B]\n [NonUnitalAlgSemiHomClass F φ A B] : NonUnitalRingHomClass F A B :=\n { ‹NonUnitalAlgSemiHomClass F φ A B› with }\n\nvariable [Semiring R] [Semiring S] {φ : R →+* S}\n {A B : Type*} [NonUnitalNonAssocSemiring A] [Module R A]\n [NonUnitalNonAssocSemiring B] [Module S B]\n\n-- see Note [lower instance priority]\ninstance (priority := 100) {F R S A B : Type*}\n {_ : Semiring R} {_ : Semiring S} {φ : R →+* S}\n {_ : NonUnitalSemiring A} {_ : NonUnitalSemiring B} [Module R A] [Module S B] [FunLike F A B]\n [NonUnitalAlgSemiHomClass (R := R) (S := S) F φ A B] :\n SemilinearMapClass F φ A B :=\n { ‹NonUnitalAlgSemiHomClass F φ A B› with map_smulₛₗ := map_smulₛₗ }\n\ninstance (priority := 100) {F : Type*} [FunLike F A B] [Module R B] [NonUnitalAlgHomClass F R A B] :\n LinearMapClass F R A B :=\n { ‹NonUnitalAlgHomClass F R A B› with map_smulₛₗ := map_smulₛₗ }\n\n/-- Turn an element of a type `F` satisfying `NonUnitalAlgSemiHomClass F φ A B` into an actual\n`NonUnitalAlgHom`. This is declared as the default coercion from `F` to `A →ₛₙₐ[φ] B`. -/\n@[coe]\ndef toNonUnitalAlgSemiHom {F R S : Type*} [Monoid R] [Monoid S] {φ : R →* S} {A B : Type*}\n [NonUnitalNonAssocSemiring A] [DistribMulAction R A]\n [NonUnitalNonAssocSemiring B] [DistribMulAction S B] [FunLike F A B]\n [NonUnitalAlgSemiHomClass F φ A B] (f : F) : A →ₛₙₐ[φ] B :=\n { (f : A →ₙ+* B) with\n toFun := f\n map_smul' := map_smulₛₗ f }\n\ninstance {F R S A B : Type*} [Monoid R] [Monoid S] {φ : R →* S}\n [NonUnitalNonAssocSemiring A] [DistribMulAction R A]\n [NonUnitalNonAssocSemiring B] [DistribMulAction S B] [FunLike F A B]\n [NonUnitalAlgSemiHomClass F φ A B] :\n CoeTC F (A →ₛₙₐ[φ] B) :=\n ⟨toNonUnitalAlgSemiHom⟩\n\n/-- Turn an element of a type `F` satisfying `NonUnitalAlgHomClass F R A B` into an actual\n@[coe]\n`NonUnitalAlgHom`. This is declared as the default coercion from `F` to `A →ₛₙₐ[R] B`. -/\ndef toNonUnitalAlgHom {F R : Type*} [Monoid R] {A B : Type*}\n [NonUnitalNonAssocSemiring A] [DistribMulAction R A]\n [NonUnitalNonAssocSemiring B] [DistribMulAction R B]\n [FunLike F A B] [NonUnitalAlgHomClass F R A B] (f : F) : A →ₙₐ[R] B :=\n { (f : A →ₙ+* B) with\n toFun := f\n map_smul' := map_smulₛₗ f }\n\ninstance {F R : Type*} [Monoid R] {A B : Type*}\n [NonUnitalNonAssocSemiring A] [DistribMulAction R A]\n [NonUnitalNonAssocSemiring B] [DistribMulAction R B]\n [FunLike F A B] [NonUnitalAlgHomClass F R A B] :\n CoeTC F (A →ₙₐ[R] B) :=\n ⟨toNonUnitalAlgHom⟩\n\nend NonUnitalAlgHomClass\n\nnamespace NonUnitalAlgHom\n\nvariable {T : Type*} [Monoid R] [Monoid S] [Monoid T] (φ : R →* S)\nvariable (A : Type v) (B : Type w) (C : Type w₁)\nvariable [NonUnitalNonAssocSemiring A] [DistribMulAction R A]\nvariable [NonUnitalNonAssocSemiring B] [DistribMulAction S B]\nvariable [NonUnitalNonAssocSemiring C] [DistribMulAction T C]\n\ninstance : FunLike (A →ₛₙₐ[φ] B) A B where\n coe f := f.toFun\n coe_injective := by rintro ⟨⟨⟨f, _⟩, _⟩, _⟩ ⟨⟨⟨g, _⟩, _⟩, _⟩ h; congr\n\n@[simp]\ntheorem toFun_eq_coe (f : A →ₛₙₐ[φ] B) : f.toFun = ⇑f :=\n rfl\n\n/-- See Note [custom simps projection] -/\ndef Simps.apply (f : A →ₛₙₐ[φ] B) : A → B := f\n\ninitialize_simps_projections NonUnitalAlgHom\n (toDistribMulActionHom_toMulActionHom_toFun → apply, -toDistribMulActionHom)\n\nvariable {φ A B C}\n@[simp]\nprotected theorem coe_coe {F : Type*} [FunLike F A B]\n [NonUnitalAlgSemiHomClass F φ A B] (f : F) :\n ⇑(f : A →ₛₙₐ[φ] B) = f :=\n rfl\n\ntheorem coe_injective : @Function.Injective (A →ₛₙₐ[φ] B) (A → B) (↑) := by\n rintro ⟨⟨⟨f, _⟩, _⟩, _⟩ ⟨⟨⟨g, _⟩, _⟩, _⟩ h; congr\ninstance : FunLike (A →ₛₙₐ[φ] B) A B where\n coe f := f.toFun\n coe_injective := coe_injective\n\ninstance : NonUnitalAlgSemiHomClass (A →ₛₙₐ[φ] B) φ A B where\n map_add f := f.map_add'\n map_zero f := f.map_zero'\n map_mul f := f.map_mul'\n map_smulₛₗ f := f.map_smul'\n\n@[ext]\ntheorem ext {f g : A →ₛₙₐ[φ] B} (h : ∀ x, f x = g x) : f = g :=\n coe_injective <| funext h\n\ntheorem congr_fun {f g : A →ₛₙₐ[φ] B} (h : f = g) (x : A) : f x = g x :=\n h ▸ rfl\n\n@[simp]\ntheorem coe_mk (f : A → B) (h₁ h₂ h₃ h₄) : ⇑(⟨⟨⟨f, h₁⟩, h₂, h₃⟩, h₄⟩ : A →ₛₙₐ[φ] B) = f :=\n rfl\n\n@[simp]\ntheorem mk_coe (f : A →ₛₙₐ[φ] B) (h₁ h₂ h₃ h₄) : (⟨⟨⟨f, h₁⟩, h₂, h₃⟩, h₄⟩ : A →ₛₙₐ[φ] B) = f := by\n rfl\n\n@[simp] lemma addHomMk_coe (f : A →ₛₙₐ[φ] B) : AddHom.mk f (map_add f) = f := rfl\n\n@[simp]\ntheorem toDistribMulActionHom_eq_coe (f : A →ₛₙₐ[φ] B) : f.toDistribMulActionHom = ↑f :=\n rfl\n\n@[simp]\ntheorem toMulHom_eq_coe (f : A →ₛₙₐ[φ] B) : f.toMulHom = ↑f :=\n rfl\n\n@[simp, norm_cast]\ntheorem coe_to_distribMulActionHom (f : A →ₛₙₐ[φ] B) : ⇑(f : A →ₑ+[φ] B) = f :=\n rfl\n\n@[simp, norm_cast]\ntheorem coe_to_mulHom (f : A →ₛₙₐ[φ] B) : ⇑(f : A →ₙ* B) = f :=\n rfl\n\ntheorem to_distribMulActionHom_injective {f g : A →ₛₙₐ[φ] B}\n (h : (f : A →ₑ+[φ] B) = (g : A →ₑ+[φ] B)) : f = g := by\n ext a\n exact DistribMulActionHom.congr_fun h a\n\ntheorem to_mulHom_injective {f g : A →ₛₙₐ[φ] B} (h : (f : A →ₙ* B) = (g : A →ₙ* B)) : f = g := by\n ext a\n exact DFunLike.congr_fun h a\n\n@[norm_cast]\ntheorem coe_distribMulActionHom_mk (f : A →ₛₙₐ[φ] B) (h₁ h₂ h₃ h₄) :\n ((⟨⟨⟨f, h₁⟩, h₂, h₃⟩, h₄⟩ : A →ₛₙₐ[φ] B) : A →ₑ+[φ] B) = ⟨⟨f, h₁⟩, h₂, h₃⟩ := by\n rfl\n\n@[norm_cast]\n\nTarget:\ntheorem coe_mulHom_mk (f : A →ₛₙₐ[φ] B) (h₁ h₂ h₃ h₄) :\n ((⟨⟨⟨f, h₁⟩, h₂, h₃⟩, h₄⟩ : A →ₛₙₐ[φ] B) : A →ₙ* B) = ⟨f, h₄⟩ :=\n\nProof body:\n","proof_body":"by\n rfl","provenance":{"declaration_index":13,"environment_hash":"08dda26699fe1025520aeb9450ff1df6b58e8ef0aa8100ae158997e8a703b831","lean_toolchain":"leanprover/lean4:v4.32.0-rc1","license":"Apache-2.0","original_import_scope":"module-specific","source_revision":"360da6fa66c1273b76b6b2d8c5666fd5ac2e3b56","source_sha256":"929fc720c21b33e33bbf0a692c3be55b0da352771a5dbb4e09a095c80437d1a6","source_uri":"https://github.com/leanprover-community/mathlib4/blob/360da6fa66c1273b76b6b2d8c5666fd5ac2e3b56/Mathlib/Algebra/Algebra/NonUnitalHom.lean"},"sample_id":"c693da27c01f2761aed66594d655f978980d479028970c91f11d6603ed2c2d04","schema_version":1,"split":"holdout","theorem_statement":"theorem coe_mulHom_mk (f : A →ₛₙₐ[φ] B) (h₁ h₂ h₃ h₄) :\n ((⟨⟨⟨f, h₁⟩, h₂, h₃⟩, h₄⟩ : A →ₛₙₐ[φ] B) : A →ₙ* B) = ⟨f, h₄⟩ :="} |
| {"completion":"by\n simpa using Monoid.FG.fg_top.finite_irreducible_mem_submonoidClosure","context_contains_namespace":false,"context_suffix":"end CommMonoid","dependency_ids":["import:Mathlib.Algebra.Group.Irreducible.Defs","import:Mathlib.GroupTheory.Finiteness"],"family_id":"finite_irreducible","file_id":"mathlib/Mathlib/Algebra/AffineMonoid/Irreducible.lean","imports":["public import Mathlib.Algebra.Group.Irreducible.Defs","public import Mathlib.GroupTheory.Finiteness"],"local_context":"/-\nCopyright (c) 2025 Yaël Dillies, Patrick Luo. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Yaël Dillies, Patrick Luo\n-/\n/-!\n# An affine monoid with no non-trivial unit is generated by its irreducible elements\n\nThis file proves that an additive cancellative monoid with no non-trivial unit unit is generated by\nits irreducible elements.\n-/\n\npublic section\n\nvariable {M : Type*}\n\nsection CommMonoid\nvariable [CommMonoid M] [Subsingleton Mˣ] {S : Set M}\n\n/-- Any set `S` inside a monoid with a single unit contains the irreducible elements of the\nsubmonoid it generates. -/\n@[to_additive /-- Any set `S` inside an additive monoid with a single unit contains the irreducible\nelements of the submonoid it generates. -/]\nlemma irreducible_mem_submonoidClosure_subset : {p ∈ Submonoid.closure S | Irreducible p} ⊆ S := by\n refine fun x hx ↦\n Submonoid.closure_induction (s := S) (motive := fun x _ ↦ (Irreducible x → x ∈ S))\n (fun _ hx _ ↦ hx) (by simp) (fun a b _ _ ha hb h ↦ ?_) hx.1 hx.2\n obtain rfl | rfl := h.eq_one_or_eq_one <;> simp_all\n\n/-- In a monoid with a single unit, irreducible elements lie in all generating sets. -/\n@[to_additive\n/-- In an additive monoid with a single unit, irreducible elements lie in all generating sets. -/]\nlemma irreducible_subset_of_submonoidClosure_eq_top (hS : Submonoid.closure S = ⊤) :\n {p | Irreducible p} ⊆ S := by\n simpa [hS] using irreducible_mem_submonoidClosure_subset (S := S)\n\n/-- A finitely generated submonoid of a monoid with a single unit has finitely many irreducible\nelements. -/\n@[to_additive\n/-- A finitely generated submonoid of an additive monoid with a single unit has finitely many\nirreducible elements. -/]\nlemma Submonoid.FG.finite_irreducible_mem_submonoidClosure {S : Submonoid M} (hS : S.FG) :\n {p ∈ S | Irreducible p}.Finite := by\n obtain ⟨T, hT⟩ := hS; exact T.finite_toSet.subset <| hT ▸ irreducible_mem_submonoidClosure_subset\n\nvariable [Monoid.FG M]\n\n/-- A finitely generated monoid with a single unit has finitely many irreducible elements. -/\n@[to_additive\n/-- A finitely generated additive monoid with a single unit has finitely many irreducible\nelements. -/]","module_header":true,"namespace":"","prompt":"Return exactly one Lean proof body beginning with `by`. Do not emit prose, fences, declarations, sorry, admit, by?, or warnings.\n\nImports:\npublic import Mathlib.Algebra.Group.Irreducible.Defs\npublic import Mathlib.GroupTheory.Finiteness\n\nNamespace:\n(root)\n\nLocal context:\n/-\nCopyright (c) 2025 Yaël Dillies, Patrick Luo. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Yaël Dillies, Patrick Luo\n-/\n/-!\n# An affine monoid with no non-trivial unit is generated by its irreducible elements\n\nThis file proves that an additive cancellative monoid with no non-trivial unit unit is generated by\nits irreducible elements.\n-/\n\npublic section\n\nvariable {M : Type*}\n\nsection CommMonoid\nvariable [CommMonoid M] [Subsingleton Mˣ] {S : Set M}\n\n/-- Any set `S` inside a monoid with a single unit contains the irreducible elements of the\nsubmonoid it generates. -/\n@[to_additive /-- Any set `S` inside an additive monoid with a single unit contains the irreducible\nelements of the submonoid it generates. -/]\nlemma irreducible_mem_submonoidClosure_subset : {p ∈ Submonoid.closure S | Irreducible p} ⊆ S := by\n refine fun x hx ↦\n Submonoid.closure_induction (s := S) (motive := fun x _ ↦ (Irreducible x → x ∈ S))\n (fun _ hx _ ↦ hx) (by simp) (fun a b _ _ ha hb h ↦ ?_) hx.1 hx.2\n obtain rfl | rfl := h.eq_one_or_eq_one <;> simp_all\n\n/-- In a monoid with a single unit, irreducible elements lie in all generating sets. -/\n@[to_additive\n/-- In an additive monoid with a single unit, irreducible elements lie in all generating sets. -/]\nlemma irreducible_subset_of_submonoidClosure_eq_top (hS : Submonoid.closure S = ⊤) :\n {p | Irreducible p} ⊆ S := by\n simpa [hS] using irreducible_mem_submonoidClosure_subset (S := S)\n\n/-- A finitely generated submonoid of a monoid with a single unit has finitely many irreducible\nelements. -/\n@[to_additive\n/-- A finitely generated submonoid of an additive monoid with a single unit has finitely many\nirreducible elements. -/]\nlemma Submonoid.FG.finite_irreducible_mem_submonoidClosure {S : Submonoid M} (hS : S.FG) :\n {p ∈ S | Irreducible p}.Finite := by\n obtain ⟨T, hT⟩ := hS; exact T.finite_toSet.subset <| hT ▸ irreducible_mem_submonoidClosure_subset\n\nvariable [Monoid.FG M]\n\n/-- A finitely generated monoid with a single unit has finitely many irreducible elements. -/\n@[to_additive\n/-- A finitely generated additive monoid with a single unit has finitely many irreducible\nelements. -/]\n\nTarget:\nlemma finite_irreducible : {p : M | Irreducible p}.Finite :=\n\nProof body:\n","proof_body":"by\n simpa using Monoid.FG.fg_top.finite_irreducible_mem_submonoidClosure","provenance":{"declaration_index":3,"environment_hash":"08dda26699fe1025520aeb9450ff1df6b58e8ef0aa8100ae158997e8a703b831","lean_toolchain":"leanprover/lean4:v4.32.0-rc1","license":"Apache-2.0","original_import_scope":"module-specific","source_revision":"360da6fa66c1273b76b6b2d8c5666fd5ac2e3b56","source_sha256":"664243cc517bfe84fcfa2881fa7e4b33cbb4a93e56372a947fb2d4d35413e37d","source_uri":"https://github.com/leanprover-community/mathlib4/blob/360da6fa66c1273b76b6b2d8c5666fd5ac2e3b56/Mathlib/Algebra/AffineMonoid/Irreducible.lean"},"sample_id":"97745478c40faafd4cfc44e547295322c87fa94f88a62a3b71d18cdea8c1ea36","schema_version":1,"split":"holdout","theorem_statement":"lemma finite_irreducible : {p : M | Irreducible p}.Finite :="} |
| {"completion":"by\n rw [Algebra.smul_def, mul_smul]\n rfl","context_contains_namespace":false,"context_suffix":"end Module","dependency_ids":["import:Mathlib.Algebra.Algebra.Tower"],"family_id":"restrictscalars","file_id":"mathlib/Mathlib/Algebra/Algebra/RestrictScalars.lean","imports":["public import Mathlib.Algebra.Algebra.Tower"],"local_context":"/-\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-/\n/-!\n\n# The `RestrictScalars` type alias\n\nSee the documentation attached to the `RestrictScalars` definition for advice on how and when to\nuse this type alias. As described there, it is often a better choice to use the `IsScalarTower`\ntypeclass instead.\n\n## Main definitions\n\n* `RestrictScalars R S M`: the `S`-module `M` viewed as an `R` module when `S` is an `R`-algebra.\n Note that by default we do *not* have a `Module S (RestrictScalars R S M)` instance\n for the original action.\n This is available as a def `RestrictScalars.moduleOrig` if really needed.\n* `RestrictScalars.addEquiv : RestrictScalars R S M ≃+ M`: the additive equivalence\n between the restricted and original space (in fact, they are definitionally equal,\n but sometimes it is helpful to avoid using this fact, to keep instances from leaking).\n* `RestrictScalars.ringEquiv : RestrictScalars R S A ≃+* A`: the ring equivalence\n between the restricted and original space when the module is an algebra.\n* `Module.restrictScalars R S M`, `Algebra.restrictScalars R S A`: non-instance definitions for\n `Module R M` and `Algebra R A`.\n\n## See also\n\nThere are many similarly-named definitions elsewhere which do not refer to this type alias. These\nrefer to restricting the scalar type in a bundled type, such as from `A →ₗ[R] B` to `A →ₗ[S] B`:\n\n* `LinearMap.restrictScalars`\n* `LinearEquiv.restrictScalars`\n* `AlgHom.restrictScalars`\n* `AlgEquiv.restrictScalars`\n* `Submodule.restrictScalars`\n* `Subalgebra.restrictScalars`\n-/\n\n@[expose] public section\n\n\nvariable (R S M A : Type*)\n\n/-- If we put an `R`-algebra structure on a semiring `S`, we get a natural equivalence from the\ncategory of `S`-modules to the category of representations of the algebra `S` (over `R`). The type\nsynonym `RestrictScalars` is essentially this equivalence.\n\nWarning: use this type synonym judiciously! Consider an example where we want to construct an\n`R`-linear map from `M` to `S`, given:\n```lean\nvariable (R S M : Type*)\nvariable [CommSemiring R] [Semiring S] [Algebra R S] [AddCommMonoid M] [Module S M]\n```\nWith the assumptions above we can't directly state our map as we have no `Module R M` structure, but\n`RestrictScalars` permits it to be written as:\n```lean\n-- an `R`-module structure on `M` is provided by `RestrictScalars` which is compatible\nexample : RestrictScalars R S M →ₗ[R] S := sorry\n```\nHowever, it is usually better just to add this extra structure as an argument:\n```lean\n-- an `R`-module structure on `M` and proof of its compatibility is provided by the user\nexample [Module R M] [IsScalarTower R S M] : M →ₗ[R] S := sorry\n```\nThe advantage of the second approach is that it defers the duty of providing the missing typeclasses\n`[Module R M] [IsScalarTower R S M]`. If some concrete `M` naturally carries these (as is often\nthe case) then we have avoided `RestrictScalars` entirely. If not, we can pass\n`RestrictScalars R S M` later on instead of `M`.\n\nNote that this means we almost always want to state definitions and lemmas in the language of\n`IsScalarTower` rather than `RestrictScalars`.\n\nAn example of when one might want to use `RestrictScalars` would be if one has a vector space\nover a field of characteristic zero and wishes to make use of the `ℚ`-algebra structure. -/\n@[nolint unusedArguments]\ndef RestrictScalars (_R _S M : Type*) : Type _ := M\n\ninstance [I : Inhabited M] : Inhabited (RestrictScalars R S M) := I\n\ninstance [I : AddCommMonoid M] : AddCommMonoid (RestrictScalars R S M) := I\n\ninstance [I : AddCommGroup M] : AddCommGroup (RestrictScalars R S M) := I\n\nsection Module\n\nsection\n\nvariable [Semiring S] [AddCommMonoid M]\n\n/-- We temporarily install an action of the original ring on `RestrictScalars R S M`. -/\n@[instance_reducible]\ndef RestrictScalars.moduleOrig [I : Module S M] : Module S (RestrictScalars R S M) := I\n\nvariable [CommSemiring R] [Algebra R S]\n\nsection\n\nattribute [local instance] RestrictScalars.moduleOrig\n\n/-- When `M` is a module over a ring `S`, and `S` is an algebra over `R`, then `M` inherits a\nmodule structure over `R`. Not an instance because `S` cannot be inferred.\n\nThe preferred way of setting this up is `[Module R M] [Module S M] [IsScalarTower R S M]`.\n-/\nabbrev Module.restrictScalars [Module S M] : Module R M :=\n Module.compHom M (algebraMap R S)\n\n/-- When `M` is a module over a ring `S`, and `S` is an algebra over `R`, then `M` inherits a\nmodule structure over `R`.\n\nThe preferred way of setting this up is `[Module R M] [Module S M] [IsScalarTower R S M]`.\n-/\ninstance RestrictScalars.module [Module S M] : Module R (RestrictScalars R S M) :=\n Module.restrictScalars R S M\n\n/-- `Module.restrictScalars` forms a scalar tower. -/\ntheorem IsScalarTower.restrictScalars [Module S M] :\n letI := Module.restrictScalars R S M\n IsScalarTower R S M :=\n IsScalarTower.of_compHom R S M\n\n/-- This instance is only relevant when `RestrictScalars.moduleOrig` is available as an instance.\n-/\ninstance RestrictScalars.isScalarTower [Module S M] : IsScalarTower R S (RestrictScalars R S M) :=\n IsScalarTower.restrictScalars R S M\n\nend\n\n/-- When `M` is a right-module over a ring `S`, and `S` is an algebra over `R`, then `M` inherits a\nright-module structure over `R`.\nThe preferred way of setting this up is\n`[Module Rᵐᵒᵖ M] [Module Sᵐᵒᵖ M] [IsScalarTower Rᵐᵒᵖ Sᵐᵒᵖ M]`.\n-/\ninstance RestrictScalars.opModule [Module Sᵐᵒᵖ M] : Module Rᵐᵒᵖ (RestrictScalars R S M) :=\n letI : Module Sᵐᵒᵖ (RestrictScalars R S M) := ‹Module Sᵐᵒᵖ M›\n Module.compHom M (RingHom.op <| algebraMap R S)\n\ninstance RestrictScalars.isCentralScalar [Module S M] [Module Sᵐᵒᵖ M] [IsCentralScalar S M] :\n IsCentralScalar R (RestrictScalars R S M) where\n op_smul_eq_smul r _x := (op_smul_eq_smul (algebraMap R S r) (_ : M) :)\n\n/-- The `R`-algebra homomorphism from the original coefficient algebra `S` to endomorphisms\nof `RestrictScalars R S M`.\n-/\ndef RestrictScalars.lsmul [Module S M] : S →ₐ[R] Module.End R (RestrictScalars R S M) :=\n -- We use `RestrictScalars.moduleOrig` in the implementation,\n -- but not in the type.\n letI : Module S (RestrictScalars R S M) := RestrictScalars.moduleOrig R S M\n Algebra.lsmul R R (RestrictScalars R S M)\n\nend\n\nvariable [AddCommMonoid M]\n\n/-- `RestrictScalars.addEquiv` is the additive equivalence with the original module. -/\ndef RestrictScalars.addEquiv : RestrictScalars R S M ≃+ M :=\n AddEquiv.refl M\n\nvariable [CommSemiring R] [Semiring S] [Algebra R S] [Module S M]\n\ntheorem RestrictScalars.smul_def (c : R) (x : RestrictScalars R S M) :\n c • x = (RestrictScalars.addEquiv R S M).symm\n (algebraMap R S c • RestrictScalars.addEquiv R S M x) :=\n rfl\n\n@[simp]\ntheorem RestrictScalars.addEquiv_map_smul (c : R) (x : RestrictScalars R S M) :\n RestrictScalars.addEquiv R S M (c • x) = algebraMap R S c • RestrictScalars.addEquiv R S M x :=\n rfl\n\ntheorem RestrictScalars.addEquiv_symm_map_algebraMap_smul (r : R) (x : M) :\n (RestrictScalars.addEquiv R S M).symm (algebraMap R S r • x) =\n r • (RestrictScalars.addEquiv R S M).symm x :=\n rfl","module_header":true,"namespace":"","prompt":"Return exactly one Lean proof body beginning with `by`. Do not emit prose, fences, declarations, sorry, admit, by?, or warnings.\n\nImports:\npublic import Mathlib.Algebra.Algebra.Tower\n\nNamespace:\n(root)\n\nLocal context:\n/-\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-/\n/-!\n\n# The `RestrictScalars` type alias\n\nSee the documentation attached to the `RestrictScalars` definition for advice on how and when to\nuse this type alias. As described there, it is often a better choice to use the `IsScalarTower`\ntypeclass instead.\n\n## Main definitions\n\n* `RestrictScalars R S M`: the `S`-module `M` viewed as an `R` module when `S` is an `R`-algebra.\n Note that by default we do *not* have a `Module S (RestrictScalars R S M)` instance\n for the original action.\n This is available as a def `RestrictScalars.moduleOrig` if really needed.\n* `RestrictScalars.addEquiv : RestrictScalars R S M ≃+ M`: the additive equivalence\n between the restricted and original space (in fact, they are definitionally equal,\n but sometimes it is helpful to avoid using this fact, to keep instances from leaking).\n* `RestrictScalars.ringEquiv : RestrictScalars R S A ≃+* A`: the ring equivalence\n between the restricted and original space when the module is an algebra.\n* `Module.restrictScalars R S M`, `Algebra.restrictScalars R S A`: non-instance definitions for\n `Module R M` and `Algebra R A`.\n\n## See also\n\nThere are many similarly-named definitions elsewhere which do not refer to this type alias. These\nrefer to restricting the scalar type in a bundled type, such as from `A →ₗ[R] B` to `A →ₗ[S] B`:\n\n* `LinearMap.restrictScalars`\n* `LinearEquiv.restrictScalars`\n* `AlgHom.restrictScalars`\n* `AlgEquiv.restrictScalars`\n* `Submodule.restrictScalars`\n* `Subalgebra.restrictScalars`\n-/\n\n@[expose] public section\n\n\nvariable (R S M A : Type*)\n\n/-- If we put an `R`-algebra structure on a semiring `S`, we get a natural equivalence from the\ncategory of `S`-modules to the category of representations of the algebra `S` (over `R`). The type\nsynonym `RestrictScalars` is essentially this equivalence.\n\nWarning: use this type synonym judiciously! Consider an example where we want to construct an\n`R`-linear map from `M` to `S`, given:\n```lean\nvariable (R S M : Type*)\nvariable [CommSemiring R] [Semiring S] [Algebra R S] [AddCommMonoid M] [Module S M]\n```\nWith the assumptions above we can't directly state our map as we have no `Module R M` structure, but\n`RestrictScalars` permits it to be written as:\n```lean\n-- an `R`-module structure on `M` is provided by `RestrictScalars` which is compatible\nexample : RestrictScalars R S M →ₗ[R] S := sorry\n```\nHowever, it is usually better just to add this extra structure as an argument:\n```lean\n-- an `R`-module structure on `M` and proof of its compatibility is provided by the user\nexample [Module R M] [IsScalarTower R S M] : M →ₗ[R] S := sorry\n```\nThe advantage of the second approach is that it defers the duty of providing the missing typeclasses\n`[Module R M] [IsScalarTower R S M]`. If some concrete `M` naturally carries these (as is often\nthe case) then we have avoided `RestrictScalars` entirely. If not, we can pass\n`RestrictScalars R S M` later on instead of `M`.\n\nNote that this means we almost always want to state definitions and lemmas in the language of\n`IsScalarTower` rather than `RestrictScalars`.\n\nAn example of when one might want to use `RestrictScalars` would be if one has a vector space\nover a field of characteristic zero and wishes to make use of the `ℚ`-algebra structure. -/\n@[nolint unusedArguments]\ndef RestrictScalars (_R _S M : Type*) : Type _ := M\n\ninstance [I : Inhabited M] : Inhabited (RestrictScalars R S M) := I\n\ninstance [I : AddCommMonoid M] : AddCommMonoid (RestrictScalars R S M) := I\n\ninstance [I : AddCommGroup M] : AddCommGroup (RestrictScalars R S M) := I\n\nsection Module\n\nsection\n\nvariable [Semiring S] [AddCommMonoid M]\n\n/-- We temporarily install an action of the original ring on `RestrictScalars R S M`. -/\n@[instance_reducible]\ndef RestrictScalars.moduleOrig [I : Module S M] : Module S (RestrictScalars R S M) := I\n\nvariable [CommSemiring R] [Algebra R S]\n\nsection\n\nattribute [local instance] RestrictScalars.moduleOrig\n\n/-- When `M` is a module over a ring `S`, and `S` is an algebra over `R`, then `M` inherits a\nmodule structure over `R`. Not an instance because `S` cannot be inferred.\n\nThe preferred way of setting this up is `[Module R M] [Module S M] [IsScalarTower R S M]`.\n-/\nabbrev Module.restrictScalars [Module S M] : Module R M :=\n Module.compHom M (algebraMap R S)\n\n/-- When `M` is a module over a ring `S`, and `S` is an algebra over `R`, then `M` inherits a\nmodule structure over `R`.\n\nThe preferred way of setting this up is `[Module R M] [Module S M] [IsScalarTower R S M]`.\n-/\ninstance RestrictScalars.module [Module S M] : Module R (RestrictScalars R S M) :=\n Module.restrictScalars R S M\n\n/-- `Module.restrictScalars` forms a scalar tower. -/\ntheorem IsScalarTower.restrictScalars [Module S M] :\n letI := Module.restrictScalars R S M\n IsScalarTower R S M :=\n IsScalarTower.of_compHom R S M\n\n/-- This instance is only relevant when `RestrictScalars.moduleOrig` is available as an instance.\n-/\ninstance RestrictScalars.isScalarTower [Module S M] : IsScalarTower R S (RestrictScalars R S M) :=\n IsScalarTower.restrictScalars R S M\n\nend\n\n/-- When `M` is a right-module over a ring `S`, and `S` is an algebra over `R`, then `M` inherits a\nright-module structure over `R`.\nThe preferred way of setting this up is\n`[Module Rᵐᵒᵖ M] [Module Sᵐᵒᵖ M] [IsScalarTower Rᵐᵒᵖ Sᵐᵒᵖ M]`.\n-/\ninstance RestrictScalars.opModule [Module Sᵐᵒᵖ M] : Module Rᵐᵒᵖ (RestrictScalars R S M) :=\n letI : Module Sᵐᵒᵖ (RestrictScalars R S M) := ‹Module Sᵐᵒᵖ M›\n Module.compHom M (RingHom.op <| algebraMap R S)\n\ninstance RestrictScalars.isCentralScalar [Module S M] [Module Sᵐᵒᵖ M] [IsCentralScalar S M] :\n IsCentralScalar R (RestrictScalars R S M) where\n op_smul_eq_smul r _x := (op_smul_eq_smul (algebraMap R S r) (_ : M) :)\n\n/-- The `R`-algebra homomorphism from the original coefficient algebra `S` to endomorphisms\nof `RestrictScalars R S M`.\n-/\ndef RestrictScalars.lsmul [Module S M] : S →ₐ[R] Module.End R (RestrictScalars R S M) :=\n -- We use `RestrictScalars.moduleOrig` in the implementation,\n -- but not in the type.\n letI : Module S (RestrictScalars R S M) := RestrictScalars.moduleOrig R S M\n Algebra.lsmul R R (RestrictScalars R S M)\n\nend\n\nvariable [AddCommMonoid M]\n\n/-- `RestrictScalars.addEquiv` is the additive equivalence with the original module. -/\ndef RestrictScalars.addEquiv : RestrictScalars R S M ≃+ M :=\n AddEquiv.refl M\n\nvariable [CommSemiring R] [Semiring S] [Algebra R S] [Module S M]\n\ntheorem RestrictScalars.smul_def (c : R) (x : RestrictScalars R S M) :\n c • x = (RestrictScalars.addEquiv R S M).symm\n (algebraMap R S c • RestrictScalars.addEquiv R S M x) :=\n rfl\n\n@[simp]\ntheorem RestrictScalars.addEquiv_map_smul (c : R) (x : RestrictScalars R S M) :\n RestrictScalars.addEquiv R S M (c • x) = algebraMap R S c • RestrictScalars.addEquiv R S M x :=\n rfl\n\ntheorem RestrictScalars.addEquiv_symm_map_algebraMap_smul (r : R) (x : M) :\n (RestrictScalars.addEquiv R S M).symm (algebraMap R S r • x) =\n r • (RestrictScalars.addEquiv R S M).symm x :=\n rfl\n\nTarget:\ntheorem RestrictScalars.addEquiv_symm_map_smul_smul (r : R) (s : S) (x : M) :\n (RestrictScalars.addEquiv R S M).symm ((r • s) • x) =\n r • (RestrictScalars.addEquiv R S M).symm (s • x) :=\n\nProof body:\n","proof_body":"by\n rw [Algebra.smul_def, mul_smul]\n rfl","provenance":{"declaration_index":4,"environment_hash":"08dda26699fe1025520aeb9450ff1df6b58e8ef0aa8100ae158997e8a703b831","lean_toolchain":"leanprover/lean4:v4.32.0-rc1","license":"Apache-2.0","original_import_scope":"module-specific","source_revision":"360da6fa66c1273b76b6b2d8c5666fd5ac2e3b56","source_sha256":"2c2718794f6ab5e1e4b2caadae5fbbfa623398ededcc8a106c24929950ce1748","source_uri":"https://github.com/leanprover-community/mathlib4/blob/360da6fa66c1273b76b6b2d8c5666fd5ac2e3b56/Mathlib/Algebra/Algebra/RestrictScalars.lean"},"sample_id":"80128840662b22e53d1840a39802444548ca6c793df4148c58e604fe82cb2d91","schema_version":1,"split":"holdout","theorem_statement":"theorem RestrictScalars.addEquiv_symm_map_smul_smul (r : R) (s : S) (x : M) :\n (RestrictScalars.addEquiv R S M).symm ((r • s) • x) =\n r • (RestrictScalars.addEquiv R S M).symm (s • x) :="} |
|
|