Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(LinearAlgeba/BilinearMap): Weaken CommSemiring to SMulCommClass #7538

Closed
wants to merge 6 commits into from
Closed
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions Mathlib/LinearAlgebra/BilinearMap.lean
Original file line number Diff line number Diff line change
Expand Up @@ -205,11 +205,11 @@ theorem domRestrict₁₂_apply (f : M →ₛₗ[ρ₁₂] N →ₛₗ[σ₁₂]

end Semiring

section CommSemiring
section SMulCommSemiring

variable {R : Type*} [CommSemiring R] {R₂ : Type*} [CommSemiring R₂]
variable {R : Type*} [Semiring R] {R₂ : Type*} [Semiring R₂]

variable {R₃ : Type*} [CommSemiring R₃] {R₄ : Type*} [CommSemiring R₄]
variable {R₃ : Type*} [Semiring R₃] {R₄ : Type*} [Semiring R₄]

variable {M : Type*} {N : Type*} {P : Type*} {Q : Type*}

Expand All @@ -225,6 +225,10 @@ variable [Module R M] [Module R₂ N] [Module R₃ P] [Module R₄ Q]

variable [Module R Mₗ] [Module R Nₗ] [Module R Pₗ] [Module R Qₗ] [Module R Qₗ']

variable [SMulCommClass R R M] [SMulCommClass R R Mₗ] [SMulCommClass R R Nₗ] [SMulCommClass R R Pₗ]
[SMulCommClass R R Qₗ] [SMulCommClass R R Qₗ'] [SMulCommClass R₃ R₃ P]
[SMulCommClass R₄ R₄ Q]

variable {σ₁₂ : R →+* R₂} {σ₂₃ : R₂ →+* R₃} {σ₁₃ : R →+* R₃}

variable {σ₄₂ : R₄ →+* R₂} {σ₄₃ : R₄ →+* R₃}
Expand Down Expand Up @@ -385,7 +389,8 @@ variable (R M)
/-- Scalar multiplication as a bilinear map `R → M → M`. -/
def lsmul : R →ₗ[R] M →ₗ[R] M :=
mk₂ R (· • ·) add_smul (fun _ _ _ => mul_smul _ _ _) smul_add fun r s m => by
simp only [smul_smul, smul_eq_mul, mul_comm]
simp only
rw [smul_comm]
mans0954 marked this conversation as resolved.
Show resolved Hide resolved
#align linear_map.lsmul LinearMap.lsmul

variable {R M}
Expand All @@ -394,7 +399,7 @@ variable {R M}
theorem lsmul_apply (r : R) (m : M) : lsmul R M r m = r • m := rfl
#align linear_map.lsmul_apply LinearMap.lsmul_apply

end CommSemiring
end SMulCommSemiring

section CommRing

Expand Down