|
1 | | -module -- shake: keep-all |
| 1 | +/- |
| 2 | +Copyright (c) 2026 Christian Merten. All rights reserved. |
| 3 | +Released under Apache 2.0 license as described in the file LICENSE. |
| 4 | +Authors: Christian Merten |
| 5 | +-/ |
| 6 | +module |
2 | 7 |
|
3 | 8 | public import Mathlib.Algebra.Module.LocalizedModule.Basic |
4 | 9 |
|
5 | | -deprecated_module (since := "2026-04-23") |
| 10 | +/-! |
| 11 | +# API for localized modules away from an element |
| 12 | +
|
| 13 | +We provide some specialized API for the localization of a module away from an element. |
| 14 | +-/ |
| 15 | + |
| 16 | +public section |
| 17 | + |
| 18 | +namespace IsLocalizedModule.Away |
| 19 | + |
| 20 | +variable {R : Type*} [CommSemiring R] {M N : Type*} [AddCommMonoid M] [AddCommMonoid N] |
| 21 | + [Module R M] [Module R N] {f : M →ₗ[R] N} {r : R} |
| 22 | + |
| 23 | +lemma mk (h₁ : IsUnit (algebraMap R (Module.End R N) r)) |
| 24 | + (h₂ : ∀ (x : N), ∃ (n : ℕ) (y : M), r ^ n • x = f y) |
| 25 | + (h₃ : ∀ (x y : M), f x = f y → ∃ (n : ℕ), r ^ n • x = r ^ n • y) : |
| 26 | + IsLocalizedModule.Away r f where |
| 27 | + map_units := fun ⟨_, ⟨n, rfl⟩⟩ ↦ by simp [h₁.pow] |
| 28 | + surj x := by |
| 29 | + obtain ⟨n, y, hy⟩ := h₂ x |
| 30 | + use ⟨y, ⟨_, n, rfl⟩⟩, hy |
| 31 | + exists_of_eq {x y} hxy := by |
| 32 | + obtain ⟨n, hn⟩ := h₃ _ _ hxy |
| 33 | + use ⟨_, n, rfl⟩, hn |
| 34 | + |
| 35 | +lemma mk_of_addCommGroup {M N : Type*} [AddCommGroup M] [AddCommGroup N] [Module R M] [Module R N] |
| 36 | + {f : M →ₗ[R] N} {r : R} (h₁ : IsUnit (algebraMap R (Module.End R N) r)) |
| 37 | + (h₂ : ∀ (x : N), ∃ (n : ℕ) (y : M), r ^ n • x = f y) |
| 38 | + (h₃ : ∀ (x : M), f x = 0 → ∃ (n : ℕ), r ^ n • x = 0) : |
| 39 | + IsLocalizedModule.Away r f := by |
| 40 | + refine IsLocalizedModule.Away.mk h₁ h₂ fun x y hxy ↦ ?_ |
| 41 | + have : f (x - y) = 0 := by simp [hxy] |
| 42 | + obtain ⟨n, hn⟩ := h₃ _ this |
| 43 | + use n |
| 44 | + simpa [smul_sub, sub_eq_zero] using hn |
| 45 | + |
| 46 | +variable (r) [IsLocalizedModule.Away r f] |
| 47 | + |
| 48 | +variable (f) in |
| 49 | +include f in |
| 50 | +lemma isUnit_algebraMap : IsUnit (algebraMap R (Module.End R N) r) := |
| 51 | + IsLocalizedModule.map_units (S := .powers r) f ⟨_, 1, by simp⟩ |
| 52 | + |
| 53 | +lemma exists_of_eq {x y : M} (h : f x = f y) : ∃ (n : ℕ), r ^ n • x = r ^ n • y := by |
| 54 | + obtain ⟨⟨_, n, rfl⟩, hn⟩ := IsLocalizedModule.exists_of_eq (S := .powers r) h |
| 55 | + use n, hn |
| 56 | + |
| 57 | +variable (f) in |
| 58 | +lemma surj (y : N) : ∃ (n : ℕ) (x : M), r ^ n • y = f x := by |
| 59 | + obtain ⟨⟨x, ⟨_, n, rfl⟩⟩, h⟩ := IsLocalizedModule.surj (S := .powers r) f y |
| 60 | + use n, x, h |
| 61 | + |
| 62 | +lemma of_associated {r r' : R} (h : Associated r r') [IsLocalizedModule.Away r f] : |
| 63 | + IsLocalizedModule.Away r' f := by |
| 64 | + obtain ⟨u, rfl⟩ := h |
| 65 | + rw [mul_comm] |
| 66 | + refine .mk ?_ ?_ ?_ |
| 67 | + · simp [IsUnit.mul, isUnit_algebraMap f r, u.isUnit.map _] |
| 68 | + · intro y |
| 69 | + obtain ⟨n, x, hx⟩ := surj f r y |
| 70 | + use n, (u ^ n) • x |
| 71 | + simp [mul_pow, ← hx, mul_smul, Units.smul_def] |
| 72 | + · intro x y hxy |
| 73 | + obtain ⟨n, hn⟩ := exists_of_eq r hxy |
| 74 | + use n |
| 75 | + simp [mul_pow, mul_smul, hn] |
| 76 | + |
| 77 | +lemma iff_of_associated {r r' : R} (h : Associated r r') : |
| 78 | + IsLocalizedModule.Away r f ↔ IsLocalizedModule.Away r' f := |
| 79 | + ⟨fun _ ↦ .of_associated h, fun _ ↦ .of_associated h.symm⟩ |
| 80 | + |
| 81 | +end IsLocalizedModule.Away |
0 commit comments