Localizations of commutative rings #
THIS FILE IS SYNCHRONIZED WITH MATHLIB4. Any changes to this file require a corresponding PR to mathlib4.
We characterize the localization of a commutative ring R
at a submonoid M
up to
isomorphism; that is, a commutative ring S
is the localization of R
at M
iff we can find a
ring homomorphism f : R →+* S
satisfying 3 properties:
- For all
y ∈ M
,f y
is a unit; - For all
z : S
, there exists(x, y) : R × M
such thatz * f y = f x
; - For all
x, y : R
,f x = f y
iff there existsc ∈ M
such thatx * c = y * c
.
In the following, let R, P
be commutative rings, S, Q
be R
- and P
-algebras
and M, T
be submonoids of R
and P
respectively, e.g.:
variables (R S P Q : Type*) [comm_ring R] [comm_ring S] [comm_ring P] [comm_ring Q]
variables [algebra R S] [algebra P Q] (M : submonoid R) (T : submonoid P)
Main definitions #
is_localization (M : submonoid R) (S : Type*)
is a typeclass expressing thatS
is a localization ofR
atM
, i.e. the canonical mapalgebra_map R S : R →+* S
is a localization map (satisfying the above properties).is_localization.mk' S
is a surjection sending(x, y) : R × M
tof x * (f y)⁻¹
is_localization.lift
is the ring homomorphism fromS
induced by a homomorphism fromR
which maps elements ofM
to invertible elements of the codomain.is_localization.map S Q
is the ring homomorphism fromS
toQ
which maps elements ofM
to elements ofT
is_localization.ring_equiv_of_ring_equiv
: ifR
andP
are isomorphic by an isomorphism sendingM
toT
, thenS
andQ
are isomorphicis_localization.alg_equiv
: ifQ
is another localization ofR
atM
, thenS
andQ
are isomorphic asR
-algebras
Main results #
localization M S
, a construction of the localization as a quotient type, defined ingroup_theory.monoid_localization
, hascomm_ring
,algebra R
andis_localization M
instances ifR
is a ring.localization.away
,localization.at_prime
andfraction_ring
are abbreviations forlocalization
s and have their correspondingis_localization
instances
Implementation notes #
In maths it is natural to reason up to isomorphism, but in Lean we cannot naturally rewrite
one
structure with an isomorphic one; one way around this is to isolate a predicate characterizing
a structure up to isomorphism, and reason about things that satisfy the predicate.
A previous version of this file used a fully bundled type of ring localization maps,
then used a type synonym f.codomain
for f : localization_map M S
to instantiate the
R
-algebra structure on S
. This results in defining ad-hoc copies for everything already
defined on S
. By making is_localization
a predicate on the algebra_map R S
,
we can ensure the localization map commutes nicely with other algebra_map
s.
To prove most lemmas about a localization map algebra_map R S
in this file we invoke the
corresponding proof for the underlying comm_monoid
localization map
is_localization.to_localization_map M S
, which can be found in group_theory.monoid_localization
and the namespace submonoid.localization_map
.
To reason about the localization as a quotient type, use mk_eq_of_mk'
and associated lemmas.
These show the quotient map mk : R → M → localization M
equals the surjection
localization_map.mk'
induced by the map algebra_map : R →+* localization M
.
The lemma mk_eq_of_mk'
hence gives you access to the results in the rest of the file,
which are about the localization_map.mk'
induced by any localization map.
The proof that "a comm_ring
K
which is the localization of an integral domain R
at R \ {0}
is a field" is a def
rather than an instance
, so if you want to reason about a field of
fractions K
, assume [field K]
instead of just [comm_ring K]
.
Tags #
localization, ring localization, commutative ring localization, characteristic predicate, commutative ring, field of fractions
- map_units : ∀ (y : ↥M), is_unit (⇑(algebra_map R S) ↑y)
- surj : ∀ (z : S), ∃ (x : R × ↥M), z * ⇑(algebra_map R S) ↑(x.snd) = ⇑(algebra_map R S) x.fst
- eq_iff_exists : ∀ {x y : R}, ⇑(algebra_map R S) x = ⇑(algebra_map R S) y ↔ ∃ (c : ↥M), ↑c * x = ↑c * y
The typeclass is_localization (M : submodule R) S
where S
is an R
-algebra
expresses that S
is isomorphic to the localization of R
at M
.
Instances of this typeclass
is_localization.to_localization_with_zero_map M S
shows S
is the monoid localization of
R
at M
.
Equations
- is_localization.to_localization_with_zero_map M S = {to_localization_map := {to_monoid_hom := {to_fun := ⇑(algebra_map R S), map_one' := _, map_mul' := _}, map_units' := _, surj' := _, eq_iff_exists' := _}, map_zero' := _}
is_localization.to_localization_map M S
shows S
is the monoid localization of R
at M
.
Given a localization map f : M →* N
, a section function sending z : N
to some
(x, y) : M × S
such that f x * (f y)⁻¹ = z
.
Equations
Given z : S
, is_localization.sec M z
is defined to be a pair (x, y) : R × M
such
that z * f y = f x
(so this lemma is true by definition).
Given z : S
, is_localization.sec M z
is defined to be a pair (x, y) : R × M
such
that z * f y = f x
, so this lemma is just an application of S
's commutativity.
is_localization.mk' S
is the surjection sending (x, y) : R × M
to
f x * (f y)⁻¹
.
Equations
- is_localization.mk' S x y = (is_localization.to_localization_map M S).mk' x y
The localization of a fintype
is a fintype
. Cannot be an instance.
Equations
- is_localization.fintype' M S = have this : Π (a : Prop), decidable a, from classical.prop_decidable, fintype.of_surjective (function.uncurry (is_localization.mk' S)) _
Localizing at a submonoid with 0 inside it leads to the trivial ring.
Equations
Given a localization map f : R →+* S
for a submonoid M ⊆ R
and a map of comm_semiring
s
g : R →+* P
such that g(M) ⊆ units P
, f x = f y → g x = g y
for all x y : R
.
Given a localization map f : R →+* S
for a submonoid M ⊆ R
and a map of comm_semiring
s
g : R →+* P
such that g y
is invertible for all y : M
, the homomorphism induced from
S
to P
sending z : S
to g x * (g y)⁻¹
, where (x, y) : R × M
are such that
z = f x * (f y)⁻¹
.
Equations
- is_localization.lift hg = {to_fun := ((is_localization.to_localization_with_zero_map M S).lift g.to_monoid_with_zero_hom hg).to_fun, map_one' := _, map_mul' := _, map_zero' := _, map_add' := _}
Given a localization map f : R →+* S
for a submonoid M ⊆ R
and a map of comm_semiring
s
g : R →* P
such that g y
is invertible for all y : M
, the homomorphism induced from
S
to P
maps f x * (f y)⁻¹
to g x * (g y)⁻¹
for all x : R, y ∈ M
.
To show j
and k
agree on the whole localization, it suffices to show they agree
on the image of the base ring, if they preserve 1
and *
.
Map a homomorphism g : R →+* P
to S →+* Q
, where S
and Q
are
localizations of R
and P
at M
and T
respectively,
such that g(M) ⊆ T
.
We send z : S
to algebra_map P Q (g x) * (algebra_map P Q (g y))⁻¹
, where
(x, y) : R × M
are such that z = f x * (f y)⁻¹
.
Equations
- is_localization.map Q g hy = is_localization.lift _
If comm_semiring
homs g : R →+* P, l : P →+* A
induce maps of localizations, the composition
of the induced maps equals the map of localizations induced by l ∘ g
.
If comm_semiring
homs g : R →+* P, l : P →+* A
induce maps of localizations, the composition
of the induced maps equals the map of localizations induced by l ∘ g
.
If S
, Q
are localizations of R
and P
at submonoids M, T
respectively, an
isomorphism j : R ≃+* P
such that j(M) = T
induces an isomorphism of localizations
S ≃+* Q
.
Equations
- is_localization.ring_equiv_of_ring_equiv S Q h H = have H' : submonoid.map h.symm.to_monoid_hom T = M, from _, {to_fun := ⇑(is_localization.map Q ↑h _), inv_fun := ⇑(is_localization.map S ↑(h.symm) _), left_inv := _, right_inv := _, map_mul' := _, map_add' := _}
If S
, Q
are localizations of R
at the submonoid M
respectively,
there is an isomorphism of localizations S ≃ₐ[R] Q
.
Equations
- is_localization.alg_equiv M S Q = {to_fun := (is_localization.ring_equiv_of_ring_equiv S Q (ring_equiv.refl R) _).to_fun, inv_fun := (is_localization.ring_equiv_of_ring_equiv S Q (ring_equiv.refl R) _).inv_fun, left_inv := _, right_inv := _, map_mul' := _, map_add' := _, commutes' := _}
Constructing a localization at a given submonoid #
Equations
- localization.unique = {to_inhabited := {default := 1}, uniq := _}
Addition in a ring localization is defined as ⟨a, b⟩ + ⟨c, d⟩ = ⟨b * c + d * a, b * d⟩
.
Should not be confused with add_localization.add
, which is defined as
⟨a, b⟩ + ⟨c, d⟩ = ⟨a + c, b + d⟩
.
Equations
Equations
- localization.comm_semiring = {add := has_add.add localization.has_add, add_assoc := _, zero := 0, zero_add := _, add_zero := _, nsmul := has_smul.smul localization.has_smul, nsmul_zero' := _, nsmul_succ' := _, add_comm := _, mul := has_mul.mul (localization.has_mul M), left_distrib := _, right_distrib := _, zero_mul := _, mul_zero := _, mul_assoc := _, one := 1, one_mul := _, mul_one := _, nat_cast := semiring.nat_cast._default 1 has_add.add localization.comm_semiring._proof_15 0 localization.comm_semiring._proof_16 localization.comm_semiring._proof_17 has_smul.smul localization.comm_semiring._proof_18 localization.comm_semiring._proof_19, nat_cast_zero := _, nat_cast_succ := _, npow := localization.npow M, npow_zero' := _, npow_succ' := _, mul_comm := _}
For any given denominator b : M
, the map a ↦ a / b
is an add_monoid_hom
from R
to
localization M
Equations
- localization.mk_add_monoid_hom b = {to_fun := λ (a : R), localization.mk a b, map_zero' := _, map_add' := _}
Equations
- localization.distrib_mul_action = {to_mul_action := localization.mul_action _inst_7, smul_zero := _, smul_add := _}
Equations
- localization.mul_semiring_action = {to_distrib_mul_action := localization.distrib_mul_action _inst_7, smul_one := _, smul_mul := _}
Equations
- localization.module = {to_distrib_mul_action := {to_mul_action := distrib_mul_action.to_mul_action localization.distrib_mul_action, smul_zero := _, smul_add := _}, add_smul := _, zero_smul := _}
Equations
- localization.algebra = {to_has_smul := localization.has_smul localization.algebra._proof_1, to_ring_hom := {to_fun := ⇑((localization.monoid_of M).to_map), map_one' := _, map_mul' := _, map_zero' := _, map_add' := _}.comp (algebra_map S R), commutes' := _, smul_def' := _}
The localization of R
at M
as a quotient type is isomorphic to any other localization.
Equations
- localization.alg_equiv M S = is_localization.alg_equiv M (localization M) S
The localization of a singleton is a singleton. Cannot be an instance due to metavariables.
Negation in a ring localization is defined as -⟨a, b⟩ = ⟨-a, b⟩
.
Equations
Equations
- localization.comm_ring = {add := comm_semiring.add localization.comm_semiring, add_assoc := _, zero := comm_semiring.zero localization.comm_semiring, zero_add := _, add_zero := _, nsmul := comm_semiring.nsmul localization.comm_semiring, nsmul_zero' := _, nsmul_succ' := _, neg := has_neg.neg localization.has_neg, sub := λ (x y : localization M), x + -y, sub_eq_add_neg := _, zsmul := has_smul.smul localization.has_smul, zsmul_zero' := _, zsmul_succ' := _, zsmul_neg' := _, add_left_neg := _, add_comm := _, int_cast := ring.int_cast._default comm_semiring.nat_cast comm_semiring.add localization.comm_ring._proof_13 comm_semiring.zero localization.comm_ring._proof_14 localization.comm_ring._proof_15 comm_semiring.nsmul localization.comm_ring._proof_16 localization.comm_ring._proof_17 comm_semiring.one localization.comm_ring._proof_18 localization.comm_ring._proof_19 has_neg.neg (λ (x y : localization M), x + -y) localization.comm_ring._proof_20 has_smul.smul localization.comm_ring._proof_21 localization.comm_ring._proof_22 localization.comm_ring._proof_23 localization.comm_ring._proof_24, nat_cast := comm_semiring.nat_cast localization.comm_semiring, one := comm_semiring.one localization.comm_semiring, nat_cast_zero := _, nat_cast_succ := _, int_cast_of_nat := _, int_cast_neg_succ_of_nat := _, mul := comm_semiring.mul localization.comm_semiring, mul_assoc := _, one_mul := _, mul_one := _, npow := comm_semiring.npow localization.comm_semiring, npow_zero' := _, npow_succ' := _, left_distrib := _, right_distrib := _, mul_comm := _}
Injectivity of a map descends to the map induced on localizations.
A comm_ring
S
which is the localization of a ring R
without zero divisors at a subset of
non-zero elements does not have zero divisors.
See note [reducible non-instances].
A comm_ring
S
which is the localization of an integral domain R
at a subset of
non-zero elements is an integral domain.
See note [reducible non-instances].
The localization at of an integral domain to a set of non-zero elements is an integral domain. See note [reducible non-instances].
If R
is a field, then localizing at a submonoid not containing 0
adds no new elements.
If R
is a field, then localizing at a submonoid not containing 0
adds no new elements.
Definition of the natural algebra induced by the localization of an algebra.
Given an algebra R → S
, a submonoid R
of M
, and a localization Rₘ
for M
,
let Sₘ
be the localization of S
to the image of M
under algebra_map R S
.
Then this is the natural algebra structure on Rₘ → Sₘ
, such that the entire square commutes,
where localization_map.map_comp
gives the commutativity of the underlying maps.
This instance can be helpful if you define Sₘ := localization (algebra.algebra_map_submonoid S M)
,
however we will instead use the hypotheses [algebra Rₘ Sₘ] [is_scalar_tower R Rₘ Sₘ]
in lemmas
since the algebra structure may arise in different ways.
Equations
- localization_algebra M S = (is_localization.map Sₘ (algebra_map R S) _).to_algebra
If the square below commutes, the bottom map is uniquely specified:
R → S
↓ ↓
Rₘ → Sₘ
If the square below commutes, the bottom map is uniquely specified:
R → S
↓ ↓
Rₘ → Sₘ
Injectivity of the underlying algebra_map
descends to the algebra induced by localization.