@@ -220,21 +220,65 @@ theorem lflip_apply {R₀ : Type*} [Semiring R₀] [Module R₀ P] [SMulCommClas
220220
221221end Semiring
222222
223+ section Semiring'
224+
225+ variable {R : Type *} [Semiring R] {R₂ : Type *} [Semiring R₂]
226+ variable {A : Type *} [Semiring A] {B : Type *} [Semiring B]
227+ variable {R₃ : Type *} [Semiring R₃] {R₄ : Type *} [Semiring R₄]
228+ variable {M : Type *} {N : Type *} {P : Type *} {Q : Type *}
229+ variable [AddCommMonoid M] [AddCommMonoid N] [AddCommMonoid P] [AddCommMonoid Q]
230+ variable [Module R M] [Module R₂ N] [Module R₃ P] [Module R₄ Q]
231+ variable {σ₁₂ : R →+* R₂} {σ₂₃ : R₂ →+* R₃} {σ₁₃ : R →+* R₃}
232+ variable {σ₄₂ : R₄ →+* R₂} {σ₄₃ : R₄ →+* R₃}
233+ variable [RingHomCompTriple σ₁₂ σ₂₃ σ₁₃] [RingHomCompTriple σ₄₂ σ₂₃ σ₄₃]
234+ variable {R₅ : Type *} [Semiring R₅] [Module R₅ P] [SMulCommClass R₃ R₅ P] {σ₁₅ : R →+* R₅}
235+
236+ variable (P σ₂₃ R₅)
237+
238+ /-- Composing a semilinear map `M → N` and a semilinear map `N → P` to form a semilinear map
239+ `M → P` is itself a linear map. -/
240+ def lcompₛₗ (f : M →ₛₗ[σ₁₂] N) : (N →ₛₗ[σ₂₃] P) →ₗ[R₅] M →ₛₗ[σ₁₃] P :=
241+ letI := SMulCommClass.symm
242+ flip <| LinearMap.comp (flip id) f
243+
244+ variable {P σ₂₃ R₅}
245+
246+ @[simp]
247+ theorem lcompₛₗ_apply (f : M →ₛₗ[σ₁₂] N) (g : N →ₛₗ[σ₂₃] P) (x : M) :
248+ lcompₛₗ P σ₂₃ R₅ f g x = g (f x) := rfl
249+
250+ /-- Composing a linear map `Q → N` and a bilinear map `M → N → P` to
251+ form a bilinear map `M → Q → P`. -/
252+ def compl₂ (h : M →ₛₗ[σ₁₅] N →ₛₗ[σ₂₃] P) (g : Q →ₛₗ[σ₄₂] N) : M →ₛₗ[σ₁₅] Q →ₛₗ[σ₄₃] P where
253+ toFun a := (lcompₛₗ P σ₂₃ R₅ g) (h a)
254+ map_add' _ _ := by
255+ simp [map_add]
256+ map_smul' _ _ := by
257+ simp only [LinearMap.map_smulₛₗ, lcompₛₗ]
258+ rfl
259+
260+ @[simp]
261+ theorem compl₂_apply (h : M →ₛₗ[σ₁₅] N →ₛₗ[σ₂₃] P) (g : Q →ₛₗ[σ₄₂] N) (m : M) (q : Q) :
262+ h.compl₂ g m q = h m (g q) := rfl
263+
264+ @[simp]
265+ theorem compl₂_id (h : M →ₛₗ[σ₁₅] N →ₛₗ[σ₂₃] P) : h.compl₂ LinearMap.id = h := by
266+ ext
267+ rw [compl₂_apply, id_coe, _root_.id]
268+
269+ end Semiring'
270+
223271section CommSemiring
224272
225- variable {R : Type *} [CommSemiring R] {R₂ : Type *} [CommSemiring R₂]
273+ variable {R : Type *} [CommSemiring R] {R₂ : Type *} [Semiring R₂]
226274variable {A : Type *} [Semiring A] {B : Type *} [Semiring B]
227- variable {R₃ : Type *} [CommSemiring R₃] {R₄ : Type *} [CommSemiring R₄]
228275variable {M : Type *} {N : Type *} {P : Type *} {Q : Type *}
229276variable {Mₗ : Type *} {Nₗ : Type *} {Pₗ : Type *} {Qₗ Qₗ' : Type *}
230277variable [AddCommMonoid M] [AddCommMonoid N] [AddCommMonoid P] [AddCommMonoid Q]
231278variable [AddCommMonoid Mₗ] [AddCommMonoid Nₗ] [AddCommMonoid Pₗ]
232279variable [AddCommMonoid Qₗ] [AddCommMonoid Qₗ']
233- variable [Module R M] [Module R₂ N] [Module R₃ P] [Module R₄ Q]
280+ variable [Module R M]
234281variable [Module R Mₗ] [Module R Nₗ] [Module R Pₗ] [Module R Qₗ] [Module R Qₗ']
235- variable {σ₁₂ : R →+* R₂} {σ₂₃ : R₂ →+* R₃} {σ₁₃ : R →+* R₃}
236- variable {σ₄₂ : R₄ →+* R₂} {σ₄₃ : R₄ →+* R₃}
237- variable [RingHomCompTriple σ₁₂ σ₂₃ σ₁₃] [RingHomCompTriple σ₄₂ σ₂₃ σ₄₃]
238282variable (R)
239283
240284/-- Create a bilinear map from a function that is linear in each component.
@@ -252,16 +296,13 @@ theorem mk₂_apply (f : M → Nₗ → Pₗ) {H1 H2 H3 H4} (m : M) (n : Nₗ) :
252296
253297variable {R}
254298
255- variable (f : M →ₛₗ[σ₁₃] N →ₛₗ[σ₂₃] P)
256299
257300variable (A Pₗ)
258301variable [Module A Pₗ] [SMulCommClass R A Pₗ]
259302
260303/-- Composing a given linear map `M → N` with a linear map `N → P` as a linear map from
261304`Nₗ →ₗ[R] Pₗ` to `M →ₗ[R] Pₗ`. -/
262- def lcomp (f : M →ₗ[R] Nₗ) : (Nₗ →ₗ[R] Pₗ) →ₗ[A] M →ₗ[R] Pₗ :=
263- letI := SMulCommClass.symm
264- flip <| LinearMap.comp (flip id) f
305+ def lcomp (f : M →ₗ[R] Nₗ) : (Nₗ →ₗ[R] Pₗ) →ₗ[A] M →ₗ[R] Pₗ := lcompₛₗ Pₗ _ _ f
265306
266307variable {A Pₗ}
267308
@@ -270,19 +311,6 @@ theorem lcomp_apply (f : M →ₗ[R] Nₗ) (g : Nₗ →ₗ[R] Pₗ) (x : M) : l
270311
271312theorem lcomp_apply' (f : M →ₗ[R] Nₗ) (g : Nₗ →ₗ[R] Pₗ) : lcomp A Pₗ f g = g ∘ₗ f := rfl
272313
273- variable (P σ₂₃)
274-
275- /-- Composing a semilinear map `M → N` and a semilinear map `N → P` to form a semilinear map
276- `M → P` is itself a linear map. -/
277- def lcompₛₗ (f : M →ₛₗ[σ₁₂] N) : (N →ₛₗ[σ₂₃] P) →ₗ[R₃] M →ₛₗ[σ₁₃] P :=
278- flip <| LinearMap.comp (flip id) f
279-
280- variable {P σ₂₃}
281-
282- @[simp]
283- theorem lcompₛₗ_apply (f : M →ₛₗ[σ₁₂] N) (g : N →ₛₗ[σ₂₃] P) (x : M) :
284- lcompₛₗ P σ₂₃ f g x = g (f x) := rfl
285-
286314variable (R M Nₗ Pₗ)
287315
288316/-- Composing linear maps as a bilinear map from `(M →ₗ[R] N) × (N →ₗ[R] P)` to `M →ₗ[R] P` -/
@@ -304,28 +332,9 @@ theorem llcomp_apply' (f : Nₗ →ₗ[R] Pₗ) (g : M →ₗ[R] Nₗ) : llcomp
304332
305333end
306334
307- /-- Composing a linear map `Q → N` and a bilinear map `M → N → P` to
308- form a bilinear map `M → Q → P`. -/
309- def compl₂ {R₅ : Type *} [CommSemiring R₅] [Module R₅ P] [SMulCommClass R₃ R₅ P] {σ₁₅ : R →+* R₅}
310- (h : M →ₛₗ[σ₁₅] N →ₛₗ[σ₂₃] P) (g : Q →ₛₗ[σ₄₂] N) : M →ₛₗ[σ₁₅] Q →ₛₗ[σ₄₃] P where
311- toFun a := (lcompₛₗ P σ₂₃ g) (h a)
312- map_add' _ _ := by
313- simp [map_add]
314- map_smul' _ _ := by
315- simp only [LinearMap.map_smulₛₗ, lcompₛₗ]
316- rfl
317-
318- @[simp]
319- theorem compl₂_apply (g : Q →ₛₗ[σ₄₂] N) (m : M) (q : Q) : f.compl₂ g m q = f m (g q) := rfl
320-
321- @[simp]
322- theorem compl₂_id : f.compl₂ LinearMap.id = f := by
323- ext
324- rw [compl₂_apply, id_coe, _root_.id]
325-
326335/-- Composing linear maps `Q → M` and `Q' → N` with a bilinear map `M → N → P` to
327336form a bilinear map `Q → Q' → P`. -/
328- def compl₁₂ {R₁ : Type *} [CommSemiring R₁] [Module R₂ N] [Module R₂ Pₗ] [Module R₁ Pₗ]
337+ def compl₁₂ {R₁ : Type *} [Semiring R₁] [Module R₂ N] [Module R₂ Pₗ] [Module R₁ Pₗ]
329338 [Module R₁ Mₗ] [SMulCommClass R₂ R₁ Pₗ] [Module R₁ Qₗ] [Module R₂ Qₗ']
330339 (f : Mₗ →ₗ[R₁] N →ₗ[R₂] Pₗ) (g : Qₗ →ₗ[R₁] Mₗ) (g' : Qₗ' →ₗ[R₂] N) :
331340 Qₗ →ₗ[R₁] Qₗ' →ₗ[R₂] Pₗ :=
@@ -444,7 +453,7 @@ open Function
444453section restrictScalarsRange
445454
446455variable {R S M P M' P' : Type *}
447- [CommSemiring R] [CommSemiring S] [SMul S R]
456+ [Semiring R] [Semiring S] [SMul S R]
448457 [AddCommMonoid M] [Module R M] [AddCommMonoid P] [Module R P]
449458 [Module S M] [Module S P]
450459 [IsScalarTower S R M] [IsScalarTower S R P]
0 commit comments