Skip to content

Commit 41086ad

Browse files
committed
feat: port RingTheory.Localization.Away.AdjoinRoot (#4725)
1 parent a7f98fb commit 41086ad

File tree

3 files changed

+58
-4
lines changed

3 files changed

+58
-4
lines changed

Mathlib.lean

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2279,6 +2279,7 @@ import Mathlib.RingTheory.JacobsonIdeal
22792279
import Mathlib.RingTheory.LaurentSeries
22802280
import Mathlib.RingTheory.Localization.AsSubring
22812281
import Mathlib.RingTheory.Localization.AtPrime
2282+
import Mathlib.RingTheory.Localization.Away.AdjoinRoot
22822283
import Mathlib.RingTheory.Localization.Away.Basic
22832284
import Mathlib.RingTheory.Localization.Basic
22842285
import Mathlib.RingTheory.Localization.Cardinality

Mathlib/RingTheory/AdjoinRoot.lean

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -350,18 +350,18 @@ theorem liftHom_of {x : R} : liftHom f a hfx (of f x) = algebraMap _ _ x :=
350350
section AdjoinInv
351351

352352
@[simp]
353-
theorem root_is_inv (r : R) : of _ r * root (C r * X - 1) = 1 := by
353+
theorem root_isInv (r : R) : of _ r * root (C r * X - 1) = 1 := by
354354
convert sub_eq_zero.1 ((eval₂_sub _).symm.trans <| eval₂_root <| C r * X - 1) <;>
355355
simp only [eval₂_mul, eval₂_C, eval₂_X, eval₂_one]
356-
#align adjoin_root.root_is_inv AdjoinRoot.root_is_inv
356+
#align adjoin_root.root_is_inv AdjoinRoot.root_isInv
357357

358358
theorem algHom_subsingleton {S : Type _} [CommRing S] [Algebra R S] {r : R} :
359359
Subsingleton (AdjoinRoot (C r * X - 1) →ₐ[R] S) :=
360360
fun f g =>
361361
algHom_ext
362362
(@inv_unique _ _ (algebraMap R S r) _ _
363-
(by rw [← f.commutes, ← f.map_mul, algebraMap_eq, root_is_inv, map_one])
364-
(by rw [← g.commutes, ← g.map_mul, algebraMap_eq, root_is_inv, map_one]))⟩
363+
(by rw [← f.commutes, ← f.map_mul, algebraMap_eq, root_isInv, map_one])
364+
(by rw [← g.commutes, ← g.map_mul, algebraMap_eq, root_isInv, map_one]))⟩
365365
#align adjoin_root.alg_hom_subsingleton AdjoinRoot.algHom_subsingleton
366366

367367
end AdjoinInv
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
/-
2+
Copyright (c) 2018 Kenny Lau. All rights reserved.
3+
Released under Apache 2.0 license as described in the file LICENSE.
4+
Authors: Kenny Lau, Mario Carneiro, Johan Commelin, Amelia Livingston, Anne Baanen
5+
6+
! This file was ported from Lean 3 source module ring_theory.localization.away.adjoin_root
7+
! leanprover-community/mathlib commit a7c017d750512a352b623b1824d75da5998457d0
8+
! Please do not edit these lines, except to modify the commit id
9+
! if you have ported upstream changes.
10+
-/
11+
import Mathlib.RingTheory.AdjoinRoot
12+
import Mathlib.RingTheory.Localization.Away.Basic
13+
14+
/-!
15+
The `R`-`AlgEquiv` between the localization of `R` away from `r` and
16+
`R` with an inverse of `r` adjoined.
17+
-/
18+
19+
open Polynomial AdjoinRoot Localization
20+
21+
variable {R : Type _} [CommRing R]
22+
23+
-- Porting note: removed `IsLocalization.algHom_subsingleton` due to
24+
-- `cannot find synthesization order for instance`
25+
attribute [local instance] AdjoinRoot.algHom_subsingleton
26+
27+
/-- The `R`-`AlgEquiv` between the localization of `R` away from `r` and
28+
`R` with an inverse of `r` adjoined. -/
29+
noncomputable def Localization.awayEquivAdjoin (r : R) : Away r ≃ₐ[R] AdjoinRoot (C r * X - 1) :=
30+
AlgEquiv.ofAlgHom
31+
{ awayLift _ r
32+
-- Porting note: This argument used to be found automatically, i.e. `_`
33+
(isUnit_of_mul_eq_one ((algebraMap R (AdjoinRoot (C r * X - 1))) r) (root (C r * X - 1))
34+
(root_isInv r)) with
35+
commutes' :=
36+
IsLocalization.Away.AwayMap.lift_eq r (isUnit_of_mul_eq_one _ _ <| root_isInv r) }
37+
(liftHom _ (IsLocalization.Away.invSelf r) <| by
38+
simp only [map_sub, map_mul, aeval_C, aeval_X, IsLocalization.Away.mul_invSelf, aeval_one,
39+
sub_self])
40+
(Subsingleton.elim _ _)
41+
-- Porting note: fix since `IsLocalization.algHom_subsingleton` is no local instance anymore
42+
(Subsingleton.elim (h := IsLocalization.algHom_subsingleton (Submonoid.powers r)) _ _)
43+
#align localization.away_equiv_adjoin Localization.awayEquivAdjoin
44+
45+
theorem IsLocalization.adjoin_inv (r : R) : IsLocalization.Away r (AdjoinRoot <| C r * X - 1) :=
46+
IsLocalization.isLocalization_of_algEquiv _ (Localization.awayEquivAdjoin r)
47+
#align is_localization.adjoin_inv IsLocalization.adjoin_inv
48+
49+
theorem IsLocalization.Away.finitePresentation (r : R) {S} [CommRing S] [Algebra R S]
50+
[IsLocalization.Away r S] : Algebra.FinitePresentation R S :=
51+
(AdjoinRoot.finitePresentation _).equiv <|
52+
(Localization.awayEquivAdjoin r).symm.trans <| IsLocalization.algEquiv (Submonoid.powers r) _ _
53+
#align is_localization.away.finite_presentation IsLocalization.Away.finitePresentation

0 commit comments

Comments
 (0)