|
| 1 | +import Mathlib.RingTheory.OreLocalization.Ring |
| 2 | + |
| 3 | +-- extend localization theory to algebras |
| 4 | + |
| 5 | +/-! |
| 6 | +
|
| 7 | +# Algebra instances of Ore Localizations |
| 8 | +
|
| 9 | +If `R` is a commutative ring with submonoid `S`, and if `A` is a commutative `R`-algebra, |
| 10 | +then my guess is that `A[S⁻¹]` is an `R[S⁻¹]`-algebra. Let's see if I'm right and if so, |
| 11 | +in what generality. |
| 12 | +
|
| 13 | +-/ |
| 14 | + |
| 15 | +namespace OreLocalization |
| 16 | + |
| 17 | +variable {R A : Type*} [CommMonoid R] [CommMagma A] [MulAction R A] [IsScalarTower R A A] |
| 18 | + {S : Submonoid R} |
| 19 | + |
| 20 | +@[to_additive] |
| 21 | +private def mul' (a₁ : A) (s₁ : S) (a₂ : A) (s₂ : S) : A[S⁻¹] := |
| 22 | + a₁ * a₂ /ₒ (s₂ * s₁) |
| 23 | + |
| 24 | +@[to_additive] |
| 25 | +private def mul'' |
| 26 | + (a : A) (s : S) : A[S⁻¹] → A[S⁻¹] := |
| 27 | + liftExpand (mul' a s) fun a₁ r₁ ⟨s₁, hs₁⟩ hr₁s₁ => by |
| 28 | + unfold OreLocalization.mul' |
| 29 | + simp only at hr₁s₁ ⊢ |
| 30 | + rw [oreDiv_eq_iff] |
| 31 | + use ⟨s₁, hs₁⟩, r₁ * s₁ |
| 32 | + simp only [Submonoid.mk_smul, Submonoid.coe_mul] |
| 33 | + constructor |
| 34 | + · rw [← smul_mul_assoc] |
| 35 | + rw [← smul_mul_assoc] |
| 36 | + rw [mul_comm] |
| 37 | + rw [smul_mul_assoc, smul_mul_assoc] |
| 38 | + rw [mul_comm] |
| 39 | + -- it's like a bloody Rubik's cube |
| 40 | + rw [smul_mul_assoc] |
| 41 | + rw [← mul_smul] |
| 42 | + · obtain ⟨s₂, hs₂⟩ := s |
| 43 | + simpa only [Submonoid.mk_smul, Submonoid.coe_mul] using mul_left_comm s₁ (r₁ * s₁) s₂ |
| 44 | + |
| 45 | +@[to_additive] |
| 46 | +protected def mul : A[S⁻¹] → A[S⁻¹] → A[S⁻¹] := |
| 47 | + liftExpand mul'' fun a₁ r₁ s hs => by |
| 48 | + obtain ⟨s₁, hs₁⟩ := s |
| 49 | + simp only at hs |
| 50 | + unfold OreLocalization.mul'' |
| 51 | + simp |
| 52 | + unfold OreLocalization.mul' |
| 53 | + dsimp |
| 54 | + ext sa |
| 55 | + induction sa |
| 56 | + rename_i a s_temp |
| 57 | + obtain ⟨s, hs⟩ := s_temp |
| 58 | + rw [liftExpand_of] |
| 59 | + rw [liftExpand_of] |
| 60 | + rw [oreDiv_eq_iff] |
| 61 | + simp only [Submonoid.mk_smul, Submonoid.coe_mul] |
| 62 | + use ⟨s₁, hs₁⟩, r₁ * s₁ |
| 63 | + simp only [Submonoid.mk_smul, Submonoid.coe_mul] |
| 64 | + constructor |
| 65 | + · rw [smul_mul_assoc] |
| 66 | + rw [← mul_smul] |
| 67 | + rw [mul_comm] |
| 68 | + · repeat rw [mul_assoc] |
| 69 | + repeat rw [mul_left_comm s₁] |
| 70 | + rw [mul_left_comm s] |
| 71 | + |
| 72 | +instance : Mul (A[S⁻¹]) where |
| 73 | + mul := OreLocalization.mul |
| 74 | + |
| 75 | +unseal OreLocalization.smul in |
| 76 | +example (as bt : R[S⁻¹]) : as * bt = as • bt := rfl |
| 77 | + -- fails on mathlib master; |
| 78 | +-- works if irreducibiliy of OreLocalization.smul is removed |
| 79 | + |
| 80 | +-- Next job: make API so I can prove `Algebra (R[S⁻¹]) A[S⁻¹]` |
| 81 | +-- Might also want `numeratorAlgHom : A →ₐ[R] A[S⁻¹]` |
| 82 | +-- Might also want some universal property a la |
| 83 | +/- |
| 84 | +variable {T : Type*} [Semiring T] |
| 85 | +variable (f : R →+* T) (fS : S →* Units T) |
| 86 | +variable (hf : ∀ s : S, f s = fS s) |
| 87 | +
|
| 88 | +/-- The universal lift from a ring homomorphism `f : R →+* T`, which maps elements in `S` to |
| 89 | +units of `T`, to a ring homomorphism `R[S⁻¹] →+* T`. This extends the construction on |
| 90 | +monoids. -/ |
| 91 | +def universalHom : R[S⁻¹] →+* T := |
| 92 | +-/ |
| 93 | +end OreLocalization |
0 commit comments