|
| 1 | +/- |
| 2 | +Copyright (c) 2025 Christian Merten. All rights reserved. |
| 3 | +Released under Apache 2.0 license as described in the file LICENSE. |
| 4 | +Authors: Christian Merten |
| 5 | +-/ |
| 6 | +import Mathlib.LinearAlgebra.TensorProduct.Pi |
| 7 | +import Mathlib.LinearAlgebra.TensorProduct.Prod |
| 8 | +import Mathlib.RingTheory.Localization.BaseChange |
| 9 | + |
| 10 | +/-! |
| 11 | +# Base change commutes with finite products |
| 12 | +
|
| 13 | +In particular, localization of modules commutes with finite products. We also |
| 14 | +show the binary product versions. |
| 15 | +-/ |
| 16 | + |
| 17 | +variable {R S : Type*} [CommSemiring R] [CommSemiring S] [Algebra R S] |
| 18 | + |
| 19 | +namespace IsBaseChange |
| 20 | + |
| 21 | +/-- Base change commutes with binary products. -/ |
| 22 | +lemma prodMap {M N M' N' : Type*} |
| 23 | + [AddCommMonoid M] [AddCommMonoid N] [Module R M] [Module R N] |
| 24 | + [AddCommMonoid M'] [AddCommMonoid N'] [Module R M'] [Module R N'] |
| 25 | + [Module S M'] [Module S N'] [IsScalarTower R S M'] [IsScalarTower R S N'] |
| 26 | + (f : M →ₗ[R] M') (g : N →ₗ[R] N') (hf : IsBaseChange S f) (hg : IsBaseChange S g) : |
| 27 | + IsBaseChange S (f.prodMap g) := by |
| 28 | + apply of_equiv (TensorProduct.prodRight R _ S M N ≪≫ₗ hf.equiv.prod hg.equiv) |
| 29 | + intro p |
| 30 | + simp [equiv_tmul] |
| 31 | + |
| 32 | +/-- Base change commutes with finite products. -/ |
| 33 | +lemma pi {ι : Type*} [Finite ι] |
| 34 | + {M M' : ι → Type*} [∀ i, AddCommMonoid (M i)] [∀ i, AddCommMonoid (M' i)] |
| 35 | + [∀ i, Module R (M i)] [∀ i, Module R (M' i)] [∀ i, Module S (M' i)] |
| 36 | + [∀ i, IsScalarTower R S (M' i)] |
| 37 | + (f : ∀ i, M i →ₗ[R] M' i) (hf : ∀ i, IsBaseChange S (f i)) : |
| 38 | + IsBaseChange S (.pi fun i ↦ f i ∘ₗ .proj i) := by |
| 39 | + classical |
| 40 | + cases nonempty_fintype ι |
| 41 | + apply of_equiv <| TensorProduct.piRight R S _ M ≪≫ₗ .piCongrRight fun i ↦ (hf i).equiv |
| 42 | + intro x |
| 43 | + ext i |
| 44 | + simp [equiv_tmul] |
| 45 | + |
| 46 | +end IsBaseChange |
| 47 | + |
| 48 | +namespace IsLocalizedModule |
| 49 | + |
| 50 | +variable (S : Submonoid R) |
| 51 | + |
| 52 | +attribute [local instance] IsLocalizedModule.isScalarTower_module |
| 53 | + |
| 54 | +/-- Localization of modules commutes with binary products. -/ |
| 55 | +instance prodMap {M N M' N' : Type*} |
| 56 | + [AddCommMonoid M] [AddCommMonoid N] [Module R M] [Module R N] |
| 57 | + [AddCommMonoid M'] [AddCommMonoid N'] [Module R M'] [Module R N'] |
| 58 | + (f : M →ₗ[R] M') (g : N →ₗ[R] N') |
| 59 | + [IsLocalizedModule S f] [IsLocalizedModule S g] : |
| 60 | + IsLocalizedModule S (f.prodMap g) := by |
| 61 | + letI : Module (Localization S) M' := IsLocalizedModule.module S f |
| 62 | + letI : Module (Localization S) N' := IsLocalizedModule.module S g |
| 63 | + rw [isLocalizedModule_iff_isBaseChange S (Localization S)] |
| 64 | + apply IsBaseChange.prodMap |
| 65 | + · rw [← isLocalizedModule_iff_isBaseChange S] |
| 66 | + infer_instance |
| 67 | + · rw [← isLocalizedModule_iff_isBaseChange S] |
| 68 | + infer_instance |
| 69 | + |
| 70 | +/-- Localization of modules commutes with finite products. -/ |
| 71 | +instance pi {ι : Type*} [Finite ι] |
| 72 | + {M M' : ι → Type*} [∀ i, AddCommMonoid (M i)] [∀ i, AddCommMonoid (M' i)] |
| 73 | + [∀ i, Module R (M i)] [∀ i, Module R (M' i)] |
| 74 | + (f : ∀ i, M i →ₗ[R] M' i) [∀ i, IsLocalizedModule S (f i)] : |
| 75 | + IsLocalizedModule S (.pi fun i ↦ f i ∘ₗ .proj i) := by |
| 76 | + letI (i : ι) : Module (Localization S) (M' i) := IsLocalizedModule.module S (f i) |
| 77 | + rw [isLocalizedModule_iff_isBaseChange S (Localization S)] |
| 78 | + apply IsBaseChange.pi |
| 79 | + intro i |
| 80 | + rw [← isLocalizedModule_iff_isBaseChange S] |
| 81 | + infer_instance |
| 82 | + |
| 83 | +end IsLocalizedModule |
0 commit comments