Skip to content

Commit a9d07e8

Browse files
committed
feat(RingTheory/IsTensorProduct): cancel pushout square on the left (#17028)
Given a commutative diagram of rings ``` R → S → T ↓ ↓ ↓ R' → S' → T' ``` where the left-hand square is a pushout and the big rectangle is a pushout, we show that then also the right-hand square is a pushout.
1 parent f73be5b commit a9d07e8

File tree

2 files changed

+75
-4
lines changed

2 files changed

+75
-4
lines changed

Mathlib/Algebra/Module/LinearMap/Defs.lean

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -933,9 +933,8 @@ end Actions
933933

934934
section RestrictScalarsAsLinearMap
935935

936-
variable {R S M N : Type*} [Semiring R] [Semiring S] [AddCommGroup M] [AddCommGroup N] [Module R M]
937-
[Module R N] [Module S M] [Module S N]
938-
[LinearMap.CompatibleSMul M N R S]
936+
variable {R S M N P : Type*} [Semiring R] [Semiring S] [AddCommMonoid M] [AddCommMonoid N]
937+
[Module R M] [Module R N] [Module S M] [Module S N] [CompatibleSMul M N R S]
939938

940939
variable (R S M N) in
941940
@[simp]
@@ -948,7 +947,9 @@ theorem restrictScalars_add (f g : M →ₗ[S] N) :
948947
rfl
949948

950949
@[simp]
951-
theorem restrictScalars_neg (f : M →ₗ[S] N) : (-f).restrictScalars R = -f.restrictScalars R :=
950+
theorem restrictScalars_neg {M N : Type*} [AddCommGroup M] [AddCommGroup N]
951+
[Module R M] [Module R N] [Module S M] [Module S N] [CompatibleSMul M N R S]
952+
(f : M →ₗ[S] N) : (-f).restrictScalars R = -f.restrictScalars R :=
952953
rfl
953954

954955
variable {R₁ : Type*} [Semiring R₁] [Module R₁ N] [SMulCommClass S R₁ N] [SMulCommClass R R₁ N]
@@ -958,6 +959,18 @@ theorem restrictScalars_smul (c : R₁) (f : M →ₗ[S] N) :
958959
(c • f).restrictScalars R = c • f.restrictScalars R :=
959960
rfl
960961

962+
@[simp]
963+
lemma restrictScalars_comp [AddCommMonoid P] [Module S P] [Module R P]
964+
[CompatibleSMul N P R S] [CompatibleSMul M P R S] (f : N →ₗ[S] P) (g : M →ₗ[S] N) :
965+
(f ∘ₗ g).restrictScalars R = f.restrictScalars R ∘ₗ g.restrictScalars R := by
966+
rfl
967+
968+
@[simp]
969+
lemma restrictScalars_trans {T : Type*} [CommSemiring T] [Module T M] [Module T N]
970+
[CompatibleSMul M N S T] [CompatibleSMul M N R T] (f : M →ₗ[T] N) :
971+
(f.restrictScalars S).restrictScalars R = f.restrictScalars R :=
972+
rfl
973+
961974
variable (S M N R R₁)
962975

963976
/-- `LinearMap.restrictScalars` as a `LinearMap`. -/

Mathlib/RingTheory/IsTensorProduct.lean

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -318,11 +318,40 @@ theorem IsBaseChange.comp {f : M →ₗ[R] N} (hf : IsBaseChange S f) {g : N →
318318
ext
319319
rfl
320320

321+
/-- If `N` is the base change of `M` to `S` and `O` the base change of `M` to `T`, then
322+
`O` is the base change of `N` to `T`. -/
323+
lemma IsBaseChange.of_comp {f : M →ₗ[R] N} (hf : IsBaseChange S f) {h : N →ₗ[S] O}
324+
(hc : IsBaseChange T ((h : N →ₗ[R] O) ∘ₗ f)) :
325+
IsBaseChange T h := by
326+
apply IsBaseChange.of_lift_unique
327+
intro Q _ _ _ _ r
328+
letI : Module R Q := inferInstanceAs (Module R (RestrictScalars R S Q))
329+
haveI : IsScalarTower R S Q := IsScalarTower.of_algebraMap_smul fun r ↦ congrFun rfl
330+
haveI : IsScalarTower R T Q := IsScalarTower.of_algebraMap_smul fun r x ↦ by
331+
simp [IsScalarTower.algebraMap_apply R S T]
332+
let r' : M →ₗ[R] Q := r ∘ₗ f
333+
let q : O →ₗ[T] Q := hc.lift r'
334+
refine ⟨q, ?_, ?_⟩
335+
· apply hf.algHom_ext'
336+
simp [LinearMap.comp_assoc, hc.lift_comp]
337+
· intro q' hq'
338+
apply hc.algHom_ext'
339+
apply_fun LinearMap.restrictScalars R at hq'
340+
rw [← LinearMap.comp_assoc]
341+
rw [show q'.restrictScalars R ∘ₗ h.restrictScalars R = _ from hq', hc.lift_comp]
342+
343+
/-- If `N` is the base change `M` to `S`, then `O` is the base change of `M` to `T` if and
344+
only if `O` is the base change of `N` to `T`. -/
345+
lemma IsBaseChange.comp_iff {f : M →ₗ[R] N} (hf : IsBaseChange S f) {h : N →ₗ[S] O} :
346+
IsBaseChange T ((h : N →ₗ[R] O) ∘ₗ f) ↔ IsBaseChange T h :=
347+
fun hc ↦ IsBaseChange.of_comp hf hc, fun hh ↦ IsBaseChange.comp hf hh⟩
348+
321349
variable {R' S' : Type*} [CommSemiring R'] [CommSemiring S']
322350
variable [Algebra R R'] [Algebra S S'] [Algebra R' S'] [Algebra R S']
323351
variable [IsScalarTower R R' S'] [IsScalarTower R S S']
324352

325353
open IsScalarTower (toAlgHom)
354+
open IsScalarTower (algebraMap_apply)
326355

327356
variable (R S R' S')
328357

@@ -471,4 +500,33 @@ theorem Algebra.IsPushout.algHom_ext [H : Algebra.IsPushout R S R' S'] {A : Type
471500
· intro s₁ s₂ e₁ e₂
472501
rw [map_add, map_add, e₁, e₂]
473502

503+
/--
504+
Let the following be a commutative diagram of rings
505+
```
506+
R → S → T
507+
↓ ↓ ↓
508+
R' → S' → T'
509+
```
510+
where the left-hand square is a pushout. Then the following are equivalent:
511+
- the big rectangle is a pushout.
512+
- the right-hand square is a pushout.
513+
514+
Note that this is essentially the isomorphism `T ⊗[S] (S ⊗[R] R') ≃ₐ[T] T ⊗[R] R'`.
515+
-/
516+
lemma Algebra.IsPushout.comp_iff {T' : Type*} [CommRing T'] [Algebra R T']
517+
[Algebra S' T'] [Algebra S T'] [Algebra T T'] [Algebra R' T']
518+
[IsScalarTower R T T'] [IsScalarTower S T T'] [IsScalarTower S S' T']
519+
[IsScalarTower R R' T'] [IsScalarTower R S' T'] [IsScalarTower R' S' T']
520+
[Algebra.IsPushout R S R' S'] :
521+
Algebra.IsPushout R T R' T' ↔ Algebra.IsPushout S T S' T' := by
522+
let f : R' →ₗ[R] S' := (IsScalarTower.toAlgHom R R' S').toLinearMap
523+
haveI : IsScalarTower R S T' := IsScalarTower.of_algebraMap_eq <| fun x ↦ by
524+
rw [algebraMap_apply R S' T', algebraMap_apply R S S', ← algebraMap_apply S S' T']
525+
have heq : (toAlgHom S S' T').toLinearMap.restrictScalars R ∘ₗ f =
526+
(toAlgHom R R' T').toLinearMap := by
527+
ext x
528+
simp [f, ← IsScalarTower.algebraMap_apply]
529+
rw [isPushout_iff, isPushout_iff, ← heq, IsBaseChange.comp_iff]
530+
exact Algebra.IsPushout.out
531+
474532
end IsBaseChange

0 commit comments

Comments
 (0)