Skip to content

Commit 0d05f2a

Browse files
committed
feat (LinearAlgebra/BilinearMap): restrict scalars and range of a linear map (#24345)
This PR introduces `restrictScalarsRange`, which is a linear map that restricts the scalars and range of a linear map. The function previously named `restrictScalarsRange` is about bilinear maps, and is renamed `restrictScalarsRange₂`.
1 parent 2b50f1c commit 0d05f2a

File tree

3 files changed

+52
-15
lines changed

3 files changed

+52
-15
lines changed

Mathlib/LinearAlgebra/BilinearMap.lean

Lines changed: 48 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -429,6 +429,43 @@ open Function
429429

430430
section restrictScalarsRange
431431

432+
variable {R S M P M' P' : Type*}
433+
[CommSemiring R] [CommSemiring S] [SMul S R]
434+
[AddCommMonoid M] [Module R M] [AddCommMonoid P] [Module R P]
435+
[Module S M] [Module S P]
436+
[IsScalarTower S R M] [IsScalarTower S R P]
437+
[AddCommMonoid M'] [Module S M'] [AddCommMonoid P'] [Module S P']
438+
439+
variable (i : M' →ₗ[S] M) (k : P' →ₗ[S] P) (hk : Injective k)
440+
(f : M →ₗ[R] P) (hf : ∀ m, f (i m) ∈ LinearMap.range k)
441+
442+
/-- Restrict the scalars and range of a linear map. -/
443+
noncomputable def restrictScalarsRange :
444+
M' →ₗ[S] P' :=
445+
((f.restrictScalars S).comp i).codLift k hk hf
446+
447+
@[simp]
448+
lemma restrictScalarsRange_apply (m : M') :
449+
k (restrictScalarsRange i k hk f hf m) = f (i m) := by
450+
have : k (restrictScalarsRange i k hk f hf m) =
451+
(k ∘ₗ ((f.restrictScalars S).comp i).codLift k hk hf) m :=
452+
rfl
453+
rw [this, comp_codLift, comp_apply, restrictScalars_apply]
454+
455+
@[simp]
456+
lemma eq_restrictScalarsRange_iff (m : M') (p : P') :
457+
p = restrictScalarsRange i k hk f hf m ↔ k p = f (i m) := by
458+
rw [← restrictScalarsRange_apply i k hk f hf m, hk.eq_iff]
459+
460+
@[simp]
461+
lemma restrictScalarsRange_apply_eq_zero_iff (m : M') :
462+
restrictScalarsRange i k hk f hf m = 0 ↔ f (i m) = 0 := by
463+
rw [← hk.eq_iff, restrictScalarsRange_apply, map_zero]
464+
465+
end restrictScalarsRange
466+
467+
section restrictScalarsRange₂
468+
432469
variable {R S M N P M' N' P' : Type*}
433470
[CommSemiring R] [CommSemiring S] [SMul S R]
434471
[AddCommMonoid M] [Module R M] [AddCommMonoid N] [Module R N] [AddCommMonoid P] [Module R P]
@@ -441,25 +478,25 @@ variable (i : M' →ₗ[S] M) (j : N' →ₗ[S] N) (k : P' →ₗ[S] P) (hk : In
441478
(B : M →ₗ[R] N →ₗ[R] P) (hB : ∀ m n, B (i m) (j n) ∈ LinearMap.range k)
442479

443480
/-- Restrict the scalars, domains, and range of a bilinear map. -/
444-
noncomputable def restrictScalarsRange :
481+
noncomputable def restrictScalarsRange :
445482
M' →ₗ[S] N' →ₗ[S] P' :=
446483
(((LinearMap.restrictScalarsₗ S R _ _ _).comp
447484
(B.restrictScalars S)).compl₁₂ i j).codRestrict₂ k hk hB
448485

449-
@[simp] lemma restrictScalarsRange_apply (m : M') (n : N') :
450-
k (restrictScalarsRange i j k hk B hB m n) = B (i m) (j n) := by
451-
simp [restrictScalarsRange]
486+
@[simp] lemma restrictScalarsRange₂_apply (m : M') (n : N') :
487+
k (restrictScalarsRange i j k hk B hB m n) = B (i m) (j n) := by
488+
simp [restrictScalarsRange]
452489

453490
@[simp]
454-
lemma eq_restrictScalarsRange_iff (m : M') (n : N') (p : P') :
455-
p = restrictScalarsRange i j k hk B hB m n ↔ k p = B (i m) (j n) := by
456-
rw [← restrictScalarsRange_apply i j k hk B hB m n, hk.eq_iff]
491+
lemma eq_restrictScalarsRange₂_iff (m : M') (n : N') (p : P') :
492+
p = restrictScalarsRange i j k hk B hB m n ↔ k p = B (i m) (j n) := by
493+
rw [← restrictScalarsRange₂_apply i j k hk B hB m n, hk.eq_iff]
457494

458495
@[simp]
459-
lemma restrictScalarsRange_apply_eq_zero_iff (m : M') (n : N') :
460-
restrictScalarsRange i j k hk B hB m n = 0 ↔ B (i m) (j n) = 0 := by
461-
rw [← hk.eq_iff, restrictScalarsRange_apply, map_zero]
496+
lemma restrictScalarsRange₂_apply_eq_zero_iff (m : M') (n : N') :
497+
restrictScalarsRange i j k hk B hB m n = 0 ↔ B (i m) (j n) = 0 := by
498+
rw [← hk.eq_iff, restrictScalarsRange₂_apply, map_zero]
462499

463-
end restrictScalarsRange
500+
end restrictScalarsRange
464501

465502
end LinearMap

Mathlib/LinearAlgebra/PerfectPairing/Restrict.lean

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,15 +92,15 @@ variable {S M' N' : Type*}
9292
private def restrictScalarsAux
9393
(hp : ∀ m n, p (i m) (j n) ∈ (algebraMap S R).range) :
9494
M' →ₗ[S] N' →ₗ[S] S :=
95-
LinearMap.restrictScalarsRange i j (Algebra.linearMap S R)
95+
LinearMap.restrictScalarsRange i j (Algebra.linearMap S R)
9696
(FaithfulSMul.algebraMap_injective S R) p.toLinearMap hp
9797

9898
private lemma restrictScalarsAux_injective
9999
(hi : Injective i)
100100
(hN : span R (LinearMap.range j : Set N) = ⊤)
101101
(hp : ∀ m n, p (i m) (j n) ∈ (algebraMap S R).range) :
102102
Injective (p.restrictScalarsAux i j hp) := by
103-
let f := LinearMap.restrictScalarsRange i j (Algebra.linearMap S R)
103+
let f := LinearMap.restrictScalarsRange i j (Algebra.linearMap S R)
104104
(FaithfulSMul.algebraMap_injective S R) p.toLinearMap hp
105105
rw [← LinearMap.ker_eq_bot]
106106
refine (Submodule.eq_bot_iff _).mpr fun x (hx : f x = 0) ↦ ?_
@@ -257,7 +257,7 @@ def restrictScalarsField
257257
(hp : ∀ m n, p (i m) (j n) ∈ (algebraMap K L).range)
258258
(x : M') (y : N') :
259259
algebraMap K L (p.restrictScalarsField i j hi hj hij hp x y) = p (i x) (j y) :=
260-
LinearMap.restrictScalarsRange_apply i j (Algebra.linearMap K L)
260+
LinearMap.restrictScalarsRange₂_apply i j (Algebra.linearMap K L)
261261
(FaithfulSMul.algebraMap_injective K L) p.toLinearMap hp x y
262262

263263
end Field

Mathlib/LinearAlgebra/RootSystem/RootPositive.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ lemma two_mul_apply_root_root :
138138
values in `S`, this is the associated `S`-bilinear form on the `S`-span of the roots. -/
139139
def posForm :
140140
LinearMap.BilinForm S (span S (range P.root)) :=
141-
LinearMap.restrictScalarsRange (span S (range P.root)).subtype (span S (range P.root)).subtype
141+
LinearMap.restrictScalarsRange (span S (range P.root)).subtype (span S (range P.root)).subtype
142142
(Algebra.linearMap S R) (FaithfulSMul.algebraMap_injective S R) B.form
143143
(fun ⟨x, hx⟩ ⟨y, hy⟩ ↦ by
144144
apply LinearMap.BilinMap.apply_apply_mem_of_mem_span

0 commit comments

Comments
 (0)