Skip to content

Commit 5ddf243

Browse files
committed
refactor(LinearAlgebra/BilinearMap): Left composition, bilinear over different rings (#13042)
Generalise `compl₂` and `compl₁₂` for left composition with maps which are linear over different rings in the first and second variable. Needed for #9334 Co-authored-by: Christopher Hoskin <mans0954@users.noreply.github.com>
1 parent c995db1 commit 5ddf243

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

Mathlib/LinearAlgebra/BilinearMap.lean

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -325,8 +325,14 @@ end
325325

326326
/-- Composing a linear map `Q → N` and a bilinear map `M → N → P` to
327327
form a bilinear map `M → Q → P`. -/
328-
def compl₂ (g : Q →ₛₗ[σ₄₂] N) : M →ₛₗ[σ₁₃] Q →ₛₗ[σ₄₃] P :=
329-
(lcompₛₗ _ _ g).comp f
328+
def compl₂ {R₅ : Type*} [CommSemiring R₅] [Module R₅ P] [SMulCommClass R₃ R₅ P] {σ₁₅ : R →+* R₅}
329+
(h : M →ₛₗ[σ₁₅] N →ₛₗ[σ₂₃] P) (g : Q →ₛₗ[σ₄₂] N) : M →ₛₗ[σ₁₅] Q →ₛₗ[σ₄₃] P where
330+
toFun a := (lcompₛₗ P σ₂₃ g) (h a)
331+
map_add' _ _ := by
332+
simp [map_add]
333+
map_smul' _ _ := by
334+
simp only [LinearMap.map_smulₛₗ, lcompₛₗ]
335+
rfl
330336
#align linear_map.compl₂ LinearMap.compl₂
331337

332338
@[simp]
@@ -341,8 +347,10 @@ theorem compl₂_id : f.compl₂ LinearMap.id = f := by
341347

342348
/-- Composing linear maps `Q → M` and `Q' → N` with a bilinear map `M → N → P` to
343349
form a bilinear map `Q → Q' → P`. -/
344-
def compl₁₂ (f : Mₗ →ₗ[R] Nₗ →ₗ[R] Pₗ) (g : Qₗ →ₗ[R] Mₗ) (g' : Qₗ' →ₗ[R] Nₗ) :
345-
Qₗ →ₗ[R] Qₗ' →ₗ[R] Pₗ :=
350+
def compl₁₂ {R₁ : Type*} [CommSemiring R₁] [Module R₂ N] [Module R₂ Pₗ] [Module R₁ Pₗ]
351+
[Module R₁ Mₗ] [SMulCommClass R₂ R₁ Pₗ] [Module R₁ Qₗ] [Module R₂ Qₗ']
352+
(f : Mₗ →ₗ[R₁] N →ₗ[R₂] Pₗ) (g : Qₗ →ₗ[R₁] Mₗ) (g' : Qₗ' →ₗ[R₂] N) :
353+
Qₗ →ₗ[R₁] Qₗ' →ₗ[R₂] Pₗ :=
346354
(f.comp g).compl₂ g'
347355
#align linear_map.compl₁₂ LinearMap.compl₁₂
348356

0 commit comments

Comments
 (0)