File: Mathlib/RingTheory/Localization/Basic.lean

full_name: IsLocalization.exists_of_eq
code: /-- The typeclass `IsLocalization (M : Submonoid R) S` where `S` is an `R`-algebra
expresses that `S` is isomorphic to the localization of `R` at `M`. -/
@[mk_iff] class IsLocalization : Prop where
  -- Porting note: add ' to fields, and made new versions of these with either `S` or `M` explicit.
  /-- Everything in the image of `algebraMap` is a unit -/
  map_units' : ∀ y : M, IsUnit (algebraMap R S y)
  /-- The `algebraMap` is surjective -/
  surj' : ∀ z : S, ∃ x : R × M, z * algebraMap R S x.2 = algebraMap R S x.1
  /-- The kernel of `algebraMap` is contained in the annihilator of `M`;
      it is then equal to the annihilator by `map_units'` -/
  exists_of_eq : ∀ {x y}, algebraMap R S x = algebraMap R S y → ∃ c : M, ↑c * x = ↑c * y
goal: (algebraMap R S) x = (algebraMap R S) y → ∃ c, ↑c * x = ↑c * y

full_name: IsLocalization
code: /-- The typeclass `IsLocalization (M : Submonoid R) S` where `S` is an `R`-algebra
expresses that `S` is isomorphic to the localization of `R` at `M`. -/
@[mk_iff] class IsLocalization : Prop where
  -- Porting note: add ' to fields, and made new versions of these with either `S` or `M` explicit.
  /-- Everything in the image of `algebraMap` is a unit -/
  map_units' : ∀ y : M, IsUnit (algebraMap R S y)
  /-- The `algebraMap` is surjective -/
  surj' : ∀ z : S, ∃ x : R × M, z * algebraMap R S x.2 = algebraMap R S x.1
  /-- The kernel of `algebraMap` is contained in the annihilator of `M`;
      it is then equal to the annihilator by `map_units'` -/
  exists_of_eq : ∀ {x y}, algebraMap R S x = algebraMap R S y → ∃ c : M, ↑c * x = ↑c * y
goal: Prop

full_name: isLocalization_iff
code: /-- The typeclass `IsLocalization (M : Submonoid R) S` where `S` is an `R`-algebra
expresses that `S` is isomorphic to the localization of `R` at `M`. -/
@[mk_iff] class IsLocalization : Prop where
  -- Porting note: add ' to fields, and made new versions of these with either `S` or `M` explicit.
  /-- Everything in the image of `algebraMap` is a unit -/
  map_units' : ∀ y : M, IsUnit (algebraMap R S y)
  /-- The `algebraMap` is surjective -/
  surj' : ∀ z : S, ∃ x : R × M, z * algebraMap R S x.2 = algebraMap R S x.1
  /-- The kernel of `algebraMap` is contained in the annihilator of `M`;
      it is then equal to the annihilator by `map_units'` -/
  exists_of_eq : ∀ {x y}, algebraMap R S x = algebraMap R S y → ∃ c : M, ↑c * x = ↑c * y
goal: IsLocalization M S ↔
  (∀ (y : ↥M), IsUnit ((algebraMap R S) ↑y)) ∧
    (∀ (z : S), ∃ x, z * (algebraMap R S) ↑x.2 = (algebraMap R S) x.1) ∧
      ∀ {x y : R}, (algebraMap R S) x = (algebraMap R S) y → ∃ c, ↑c * x = ↑c * y

full_name: IsLocalization.map_units'
code: /-- The typeclass `IsLocalization (M : Submonoid R) S` where `S` is an `R`-algebra
expresses that `S` is isomorphic to the localization of `R` at `M`. -/
@[mk_iff] class IsLocalization : Prop where
  -- Porting note: add ' to fields, and made new versions of these with either `S` or `M` explicit.
  /-- Everything in the image of `algebraMap` is a unit -/
  map_units' : ∀ y : M, IsUnit (algebraMap R S y)
  /-- The `algebraMap` is surjective -/
  surj' : ∀ z : S, ∃ x : R × M, z * algebraMap R S x.2 = algebraMap R S x.1
  /-- The kernel of `algebraMap` is contained in the annihilator of `M`;
      it is then equal to the annihilator by `map_units'` -/
  exists_of_eq : ∀ {x y}, algebraMap R S x = algebraMap R S y → ∃ c : M, ↑c * x = ↑c * y
goal: IsUnit ((algebraMap R S) ↑y)

full_name: IsLocalization.surj'
code: /-- The typeclass `IsLocalization (M : Submonoid R) S` where `S` is an `R`-algebra
expresses that `S` is isomorphic to the localization of `R` at `M`. -/
@[mk_iff] class IsLocalization : Prop where
  -- Porting note: add ' to fields, and made new versions of these with either `S` or `M` explicit.
  /-- Everything in the image of `algebraMap` is a unit -/
  map_units' : ∀ y : M, IsUnit (algebraMap R S y)
  /-- The `algebraMap` is surjective -/
  surj' : ∀ z : S, ∃ x : R × M, z * algebraMap R S x.2 = algebraMap R S x.1
  /-- The kernel of `algebraMap` is contained in the annihilator of `M`;
      it is then equal to the annihilator by `map_units'` -/
  exists_of_eq : ∀ {x y}, algebraMap R S x = algebraMap R S y → ∃ c : M, ↑c * x = ↑c * y
goal: ∃ x, z * (algebraMap R S) ↑x.2 = (algebraMap R S) x.1

full_name: IsLocalization.map_units
code: @[inherit_doc IsLocalization.map_units']
theorem map_units : ∀ y : M, IsUnit (algebraMap R S y) 
goal: IsUnit ((algebraMap R S) ↑y)

full_name: IsLocalization.surj
code: @[inherit_doc IsLocalization.surj']
theorem surj : ∀ z : S, ∃ x : R × M, z * algebraMap R S x.2 = algebraMap R S x.1 
goal: ∃ x, z * (algebraMap R S) ↑x.2 = (algebraMap R S) x.1

full_name: IsLocalization.eq_iff_exists
code: @[inherit_doc IsLocalization.exists_of_eq]
theorem eq_iff_exists {x y} : algebraMap R S x = algebraMap R S y ↔ ∃ c : M, ↑c * x = ↑c * y 
goal: (algebraMap R S) x = (algebraMap R S) y ↔ ∃ c, ↑c * x = ↑c * y

full_name: IsLocalization.of_le
code: theorem of_le (N : Submonoid R) (h₁ : M ≤ N) (h₂ : ∀ r ∈ N, IsUnit (algebraMap R S r)) :
    IsLocalization N S 
goal: IsLocalization N S

full_name: IsLocalization.toLocalizationWithZeroMap
code: /-- `IsLocalization.toLocalizationWithZeroMap M S` shows `S` is the monoid localization of
`R` at `M`. -/
@[simps]
def toLocalizationWithZeroMap : Submonoid.LocalizationWithZeroMap M S 
goal: M.LocalizationWithZeroMap S

full_name: IsLocalization.toLocalizationWithZeroMap_toFun
code: /-- `IsLocalization.toLocalizationWithZeroMap M S` shows `S` is the monoid localization of
`R` at `M`. -/
@[simps]
def toLocalizationWithZeroMap : Submonoid.LocalizationWithZeroMap M S 
goal: (↑(IsLocalization.toLocalizationWithZeroMap M S).toMonoidHom).toFun a = (algebraMap R S) a

full_name: IsLocalization.toLocalizationMap
code: /-- `IsLocalization.toLocalizationMap M S` shows `S` is the monoid localization of `R` at `M`. -/
abbrev toLocalizationMap : Submonoid.LocalizationMap M S 
goal: M.LocalizationMap S

full_name: IsLocalization.toLocalizationMap_toMap
code: @[simp]
theorem toLocalizationMap_toMap : (toLocalizationMap M S).toMap = (algebraMap R S : R →*₀ S) 
goal: (IsLocalization.toLocalizationMap M S).toMap = ↑↑(algebraMap R S)

full_name: IsLocalization.toLocalizationMap_toMap_apply
code: theorem toLocalizationMap_toMap_apply (x) : (toLocalizationMap M S).toMap x = algebraMap R S x 
goal: (IsLocalization.toLocalizationMap M S).toMap x = (algebraMap R S) x

full_name: IsLocalization.surj₂
code: theorem surj₂ : ∀ z w : S, ∃ z' w' : R, ∃ d : M,
    (z * algebraMap R S d = algebraMap R S z') ∧ (w * algebraMap R S d = algebraMap R S w') 
goal: ∃ z' w' d, z * (algebraMap R S) ↑d = (algebraMap R S) z' ∧ w * (algebraMap R S) ↑d = (algebraMap R S) w'

full_name: IsLocalization.sec
code: /-- 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`. -/
noncomputable def sec (z : S) : R × M 
goal: R × ↥M

full_name: IsLocalization.toLocalizationMap_sec
code: @[simp]
theorem toLocalizationMap_sec : (toLocalizationMap M S).sec = sec M 
goal: (IsLocalization.toLocalizationMap M S).sec = IsLocalization.sec M

full_name: IsLocalization.sec_spec
code: /-- Given `z : S`, `IsLocalization.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). -/
theorem sec_spec (z : S) :
    z * algebraMap R S (IsLocalization.sec M z).2 = algebraMap R S (IsLocalization.sec M z).1 
goal: z * (algebraMap R S) ↑(IsLocalization.sec M z).2 = (algebraMap R S) (IsLocalization.sec M z).1

full_name: IsLocalization.sec_spec'
code: /-- Given `z : S`, `IsLocalization.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. -/
theorem sec_spec' (z : S) :
    algebraMap R S (IsLocalization.sec M z).1 = algebraMap R S (IsLocalization.sec M z).2 * z 
goal: (algebraMap R S) (IsLocalization.sec M z).1 = (algebraMap R S) ↑(IsLocalization.sec M z).2 * z

full_name: IsLocalization.subsingleton
code: /-- If `M` contains `0` then the localization at `M` is trivial. -/
theorem subsingleton (h : 0 ∈ M) : Subsingleton S 
goal: Subsingleton S

full_name: IsLocalization.map_right_cancel
code: theorem map_right_cancel {x y} {c : M} (h : algebraMap R S (c * x) = algebraMap R S (c * y)) :
    algebraMap R S x = algebraMap R S y 
goal: (algebraMap R S) x = (algebraMap R S) y

full_name: IsLocalization.map_left_cancel
code: theorem map_left_cancel {x y} {c : M} (h : algebraMap R S (x * c) = algebraMap R S (y * c)) :
    algebraMap R S x = algebraMap R S y 
goal: (algebraMap R S) x = (algebraMap R S) y

full_name: IsLocalization.eq_zero_of_fst_eq_zero
code: theorem eq_zero_of_fst_eq_zero {z x} {y : M} (h : z * algebraMap R S y = algebraMap R S x)
    (hx : x = 0) : z = 0 
goal: z = 0

full_name: IsLocalization.map_eq_zero_iff
code: theorem map_eq_zero_iff (r : R) : algebraMap R S r = 0 ↔ ∃ m : M, ↑m * r = 0 
goal: (algebraMap R S) r = 0 ↔ ∃ m, ↑m * r = 0

full_name: IsLocalization.mk'
code: /-- `IsLocalization.mk' S` is the surjection sending `(x, y) : R × M` to
`f x * (f y)⁻¹`. -/
noncomputable def mk' (x : R) (y : M) : S 
goal: S

full_name: IsLocalization.mk'_sec
code: @[simp]
theorem mk'_sec (z : S) : mk' S (IsLocalization.sec M z).1 (IsLocalization.sec M z).2 = z 
goal: IsLocalization.mk' S (IsLocalization.sec M z).1 (IsLocalization.sec M z).2 = z

full_name: IsLocalization.mk'_mul
code: theorem mk'_mul (x₁ x₂ : R) (y₁ y₂ : M) : mk' S (x₁ * x₂) (y₁ * y₂) = mk' S x₁ y₁ * mk' S x₂ y₂ 
goal: IsLocalization.mk' S (x₁ * x₂) (y₁ * y₂) = IsLocalization.mk' S x₁ y₁ * IsLocalization.mk' S x₂ y₂

full_name: IsLocalization.mk'_one
code: theorem mk'_one (x) : mk' S x (1 : M) = algebraMap R S x 
goal: IsLocalization.mk' S x 1 = (algebraMap R S) x

full_name: IsLocalization.mk'_spec
code: @[simp]
theorem mk'_spec (x) (y : M) : mk' S x y * algebraMap R S y = algebraMap R S x 
goal: IsLocalization.mk' S x y * (algebraMap R S) ↑y = (algebraMap R S) x

full_name: IsLocalization.mk'_spec'
code: @[simp]
theorem mk'_spec' (x) (y : M) : algebraMap R S y * mk' S x y = algebraMap R S x 
goal: (algebraMap R S) ↑y * IsLocalization.mk' S x y = (algebraMap R S) x

full_name: IsLocalization.mk'_spec_mk
code: @[simp]
theorem mk'_spec_mk (x) (y : R) (hy : y ∈ M) :
    mk' S x ⟨y, hy⟩ * algebraMap R S y = algebraMap R S x 
goal: IsLocalization.mk' S x ⟨y, hy⟩ * (algebraMap R S) y = (algebraMap R S) x

full_name: IsLocalization.mk'_spec'_mk
code: @[simp]
theorem mk'_spec'_mk (x) (y : R) (hy : y ∈ M) :
    algebraMap R S y * mk' S x ⟨y, hy⟩ = algebraMap R S x 
goal: (algebraMap R S) y * IsLocalization.mk' S x ⟨y, hy⟩ = (algebraMap R S) x

full_name: IsLocalization.eq_mk'_iff_mul_eq
code: theorem eq_mk'_iff_mul_eq {x} {y : M} {z} :
    z = mk' S x y ↔ z * algebraMap R S y = algebraMap R S x 
goal: z = IsLocalization.mk' S x y ↔ z * (algebraMap R S) ↑y = (algebraMap R S) x

full_name: IsLocalization.mk'_eq_iff_eq_mul
code: theorem mk'_eq_iff_eq_mul {x} {y : M} {z} :
    mk' S x y = z ↔ algebraMap R S x = z * algebraMap R S y 
goal: IsLocalization.mk' S x y = z ↔ (algebraMap R S) x = z * (algebraMap R S) ↑y

full_name: IsLocalization.mk'_add_eq_iff_add_mul_eq_mul
code: theorem mk'_add_eq_iff_add_mul_eq_mul {x} {y : M} {z₁ z₂} :
    mk' S x y + z₁ = z₂ ↔ algebraMap R S x + z₁ * algebraMap R S y = z₂ * algebraMap R S y 
goal: IsLocalization.mk' S x y + z₁ = z₂ ↔ (algebraMap R S) x + z₁ * (algebraMap R S) ↑y = z₂ * (algebraMap R S) ↑y

full_name: IsLocalization.mk'_pow
code: theorem mk'_pow (x : R) (y : M) (n : ℕ) : mk' S (x ^ n) (y ^ n) = mk' S x y ^ n 
goal: IsLocalization.mk' S (x ^ n) (y ^ n) = IsLocalization.mk' S x y ^ n

full_name: IsLocalization.mk'_surjective
code: theorem mk'_surjective (z : S) : ∃ (x : _) (y : M), mk' S x y = z 
goal: ∃ x y, IsLocalization.mk' S x y = z

full_name: IsLocalization.fintype'
code: /-- The localization of a `Fintype` is a `Fintype`. Cannot be an instance. -/
noncomputable def fintype' [Fintype R] : Fintype S 
goal: Fintype S

full_name: IsLocalization.uniqueOfZeroMem
code: /-- Localizing at a submonoid with 0 inside it leads to the trivial ring. -/
def uniqueOfZeroMem (h : (0 : R) ∈ M) : Unique S 
goal: Unique S

full_name: IsLocalization.mk'_eq_iff_eq
code: theorem mk'_eq_iff_eq {x₁ x₂} {y₁ y₂ : M} :
    mk' S x₁ y₁ = mk' S x₂ y₂ ↔ algebraMap R S (y₂ * x₁) = algebraMap R S (y₁ * x₂) 
goal: IsLocalization.mk' S x₁ y₁ = IsLocalization.mk' S x₂ y₂ ↔ (algebraMap R S) (↑y₂ * x₁) = (algebraMap R S) (↑y₁ * x₂)

full_name: IsLocalization.mk'_eq_iff_eq'
code: theorem mk'_eq_iff_eq' {x₁ x₂} {y₁ y₂ : M} :
    mk' S x₁ y₁ = mk' S x₂ y₂ ↔ algebraMap R S (x₁ * y₂) = algebraMap R S (x₂ * y₁) 
goal: IsLocalization.mk' S x₁ y₁ = IsLocalization.mk' S x₂ y₂ ↔ (algebraMap R S) (x₁ * ↑y₂) = (algebraMap R S) (x₂ * ↑y₁)

full_name: IsLocalization.mk'_mem_iff
code: theorem mk'_mem_iff {x} {y : M} {I : Ideal S} : mk' S x y ∈ I ↔ algebraMap R S x ∈ I 
goal: IsLocalization.mk' S x y ∈ I ↔ (algebraMap R S) x ∈ I

full_name: IsLocalization.eq
code: protected theorem eq {a₁ b₁} {a₂ b₂ : M} :
    mk' S a₁ a₂ = mk' S b₁ b₂ ↔ ∃ c : M, ↑c * (↑b₂ * a₁) = c * (a₂ * b₁) 
goal: IsLocalization.mk' S a₁ a₂ = IsLocalization.mk' S b₁ b₂ ↔ ∃ c, ↑c * (↑b₂ * a₁) = ↑c * (↑a₂ * b₁)

full_name: IsLocalization.mk'_eq_zero_iff
code: theorem mk'_eq_zero_iff (x : R) (s : M) : mk' S x s = 0 ↔ ∃ m : M, ↑m * x = 0 
goal: IsLocalization.mk' S x s = 0 ↔ ∃ m, ↑m * x = 0

full_name: IsLocalization.mk'_zero
code: @[simp]
theorem mk'_zero (s : M) : IsLocalization.mk' S 0 s = 0 
goal: IsLocalization.mk' S 0 s = 0

full_name: IsLocalization.ne_zero_of_mk'_ne_zero
code: theorem ne_zero_of_mk'_ne_zero {x : R} {y : M} (hxy : IsLocalization.mk' S x y ≠ 0) : x ≠ 0 
goal: x ≠ 0

full_name: IsLocalization.eq_iff_eq
code: theorem eq_iff_eq {x y} :
    algebraMap R S x = algebraMap R S y ↔ algebraMap R P x = algebraMap R P y 
goal: (algebraMap R S) x = (algebraMap R S) y ↔ (algebraMap R P) x = (algebraMap R P) y

full_name: IsLocalization.mk'_eq_iff_mk'_eq
code: theorem mk'_eq_iff_mk'_eq {x₁ x₂} {y₁ y₂ : M} :
    mk' S x₁ y₁ = mk' S x₂ y₂ ↔ mk' P x₁ y₁ = mk' P x₂ y₂ 
goal: IsLocalization.mk' S x₁ y₁ = IsLocalization.mk' S x₂ y₂ ↔ IsLocalization.mk' P x₁ y₁ = IsLocalization.mk' P x₂ y₂

full_name: IsLocalization.mk'_eq_of_eq
code: theorem mk'_eq_of_eq {a₁ b₁ : R} {a₂ b₂ : M} (H : ↑a₂ * b₁ = ↑b₂ * a₁) :
    mk' S a₁ a₂ = mk' S b₁ b₂ 
goal: IsLocalization.mk' S a₁ a₂ = IsLocalization.mk' S b₁ b₂

full_name: IsLocalization.mk'_eq_of_eq'
code: theorem mk'_eq_of_eq' {a₁ b₁ : R} {a₂ b₂ : M} (H : b₁ * ↑a₂ = a₁ * ↑b₂) :
    mk' S a₁ a₂ = mk' S b₁ b₂ 
goal: IsLocalization.mk' S a₁ a₂ = IsLocalization.mk' S b₁ b₂

full_name: IsLocalization.mk'_cancel
code: theorem mk'_cancel (a : R) (b c : M) :
    mk' S (a * c) (b * c) = mk' S a b 
goal: IsLocalization.mk' S (a * ↑c) (b * c) = IsLocalization.mk' S a b

full_name: IsLocalization.mk'_self
code: @[simp]
theorem mk'_self {x : R} (hx : x ∈ M) : mk' S x ⟨x, hx⟩ = 1 
goal: IsLocalization.mk' S x ⟨x, hx⟩ = 1

full_name: IsLocalization.mk'_self'
code: @[simp]
theorem mk'_self' {x : M} : mk' S (x : R) x = 1 
goal: IsLocalization.mk' S (↑x) x = 1

full_name: IsLocalization.mk'_self''
code: theorem mk'_self'' {x : M} : mk' S x.1 x = 1 
goal: IsLocalization.mk' S (↑x) x = 1

full_name: IsLocalization.mul_mk'_eq_mk'_of_mul
code: theorem mul_mk'_eq_mk'_of_mul (x y : R) (z : M) :
    (algebraMap R S) x * mk' S y z = mk' S (x * y) z 
goal: (algebraMap R S) x * IsLocalization.mk' S y z = IsLocalization.mk' S (x * y) z

full_name: IsLocalization.mk'_eq_mul_mk'_one
code: theorem mk'_eq_mul_mk'_one (x : R) (y : M) : mk' S x y = (algebraMap R S) x * mk' S 1 y 
goal: IsLocalization.mk' S x y = (algebraMap R S) x * IsLocalization.mk' S 1 y

full_name: IsLocalization.mk'_mul_cancel_left
code: @[simp]
theorem mk'_mul_cancel_left (x : R) (y : M) : mk' S (y * x : R) y = (algebraMap R S) x 
goal: IsLocalization.mk' S (↑y * x) y = (algebraMap R S) x

full_name: IsLocalization.mk'_mul_cancel_right
code: theorem mk'_mul_cancel_right (x : R) (y : M) : mk' S (x * y) y = (algebraMap R S) x 
goal: IsLocalization.mk' S (x * ↑y) y = (algebraMap R S) x

full_name: IsLocalization.mk'_mul_mk'_eq_one
code: @[simp]
theorem mk'_mul_mk'_eq_one (x y : M) : mk' S (x : R) y * mk' S (y : R) x = 1 
goal: IsLocalization.mk' S (↑x) y * IsLocalization.mk' S (↑y) x = 1

full_name: IsLocalization.mk'_mul_mk'_eq_one'
code: theorem mk'_mul_mk'_eq_one' (x : R) (y : M) (h : x ∈ M) : mk' S x y * mk' S (y : R) ⟨x, h⟩ = 1 
goal: IsLocalization.mk' S x y * IsLocalization.mk' S ↑y ⟨x, h⟩ = 1

full_name: IsLocalization.smul_mk'
code: theorem smul_mk' (x y : R) (m : M) : x • mk' S y m = mk' S (x * y) m 
goal: x • IsLocalization.mk' S y m = IsLocalization.mk' S (x * y) m

full_name: IsLocalization.smul_mk'_one
code: @[simp] theorem smul_mk'_one (x : R) (m : M) : x • mk' S 1 m = mk' S x m 
goal: x • IsLocalization.mk' S 1 m = IsLocalization.mk' S x m

full_name: IsLocalization.smul_mk'_self
code: @[simp] lemma smul_mk'_self {m : M} {r : R} :
    (m : R) • mk' S r m = algebraMap R S r 
goal: ↑m • IsLocalization.mk' S r m = (algebraMap R S) r

full_name: IsLocalization.invertible_mk'_one_invOf
code: @[simps]
instance invertible_mk'_one (s : M) : Invertible (IsLocalization.mk' S (1 : R) s) 
goal: ⅟(IsLocalization.mk' S 1 s) = (algebraMap R S) ↑s

full_name: IsLocalization.invertible_mk'_one
code: @[simps]
instance invertible_mk'_one (s : M) : Invertible (IsLocalization.mk' S (1 : R) s) 
goal: Invertible (IsLocalization.mk' S 1 s)

full_name: IsLocalization.isUnit_comp
code: theorem isUnit_comp (j : S →+* P) (y : M) : IsUnit (j.comp (algebraMap R S) y) 
goal: IsUnit ((j.comp (algebraMap R S)) ↑y)

full_name: IsLocalization.eq_of_eq
code: /-- Given a localization map `f : R →+* S` for a submonoid `M ⊆ R` and a map of `CommSemiring`s
`g : R →+* P` such that `g(M) ⊆ Units P`, `f x = f y → g x = g y` for all `x y : R`. -/
theorem eq_of_eq {g : R →+* P} (hg : ∀ y : M, IsUnit (g y)) {x y}
    (h : (algebraMap R S) x = (algebraMap R S) y) : g x = g y 
goal: g x = g y

full_name: IsLocalization.mk'_add
code: theorem mk'_add (x₁ x₂ : R) (y₁ y₂ : M) :
    mk' S (x₁ * y₂ + x₂ * y₁) (y₁ * y₂) = mk' S x₁ y₁ + mk' S x₂ y₂ 
goal: IsLocalization.mk' S (x₁ * ↑y₂ + x₂ * ↑y₁) (y₁ * y₂) = IsLocalization.mk' S x₁ y₁ + IsLocalization.mk' S x₂ y₂

full_name: IsLocalization.mul_add_inv_left
code: theorem mul_add_inv_left {g : R →+* P} (h : ∀ y : M, IsUnit (g y)) (y : M) (w z₁ z₂ : P) :
    w * ↑(IsUnit.liftRight (g.toMonoidHom.restrict M) h y)⁻¹ + z₁ =
    z₂ ↔ w + g y * z₁ = g y * z₂ 
goal: w * ↑((IsUnit.liftRight ((↑g).restrict M) h) y)⁻¹ + z₁ = z₂ ↔ w + g ↑y * z₁ = g ↑y * z₂

full_name: IsLocalization.lift_spec_mul_add
code: theorem lift_spec_mul_add {g : R →+* P} (hg : ∀ y : M, IsUnit (g y)) (z w w' v) :
    ((toLocalizationWithZeroMap M S).lift g.toMonoidWithZeroHom hg) z * w + w' = v ↔
      g ((toLocalizationMap M S).sec z).1 * w + g ((toLocalizationMap M S).sec z).2 * w' =
        g ((toLocalizationMap M S).sec z).2 * v 
goal: ((IsLocalization.toLocalizationWithZeroMap M S).lift g.toMonoidWithZeroHom hg) z * w + w' = v ↔
  g ((IsLocalization.toLocalizationMap M S).sec z).1 * w + g ↑((IsLocalization.toLocalizationMap M S).sec z).2 * w' =
    g ↑((IsLocalization.toLocalizationMap M S).sec z).2 * v

full_name: IsLocalization.lift
code: /-- Given a localization map `f : R →+* S` for a submonoid `M ⊆ R` and a map of `CommSemiring`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)⁻¹`. -/
noncomputable def lift {g : R →+* P} (hg : ∀ y : M, IsUnit (g y)) : S →+* P 
goal: S →+* P

full_name: IsLocalization.lift_mk'
code: /-- Given a localization map `f : R →+* S` for a submonoid `M ⊆ R` and a map of `CommSemiring`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`. -/
theorem lift_mk' (x y) :
    lift hg (mk' S x y) = g x * ↑(IsUnit.liftRight (g.toMonoidHom.restrict M) hg y)⁻¹ 
goal: (IsLocalization.lift hg) (IsLocalization.mk' S x y) = g x * ↑((IsUnit.liftRight ((↑g).restrict M) hg) y)⁻¹

full_name: IsLocalization.lift_mk'_spec
code: theorem lift_mk'_spec (x v) (y : M) : lift hg (mk' S x y) = v ↔ g x = g y * v 
goal: (IsLocalization.lift hg) (IsLocalization.mk' S x y) = v ↔ g x = g ↑y * v

full_name: IsLocalization.lift_eq
code: @[simp]
theorem lift_eq (x : R) : lift hg ((algebraMap R S) x) = g x 
goal: (IsLocalization.lift hg) ((algebraMap R S) x) = g x

full_name: IsLocalization.lift_eq_iff
code: theorem lift_eq_iff {x y : R × M} :
    lift hg (mk' S x.1 x.2) = lift hg (mk' S y.1 y.2) ↔ g (x.1 * y.2) = g (y.1 * x.2) 
goal: (IsLocalization.lift hg) (IsLocalization.mk' S x.1 x.2) = (IsLocalization.lift hg) (IsLocalization.mk' S y.1 y.2) ↔
  g (x.1 * ↑y.2) = g (y.1 * ↑x.2)

full_name: IsLocalization.lift_comp
code: @[simp]
theorem lift_comp : (lift hg).comp (algebraMap R S) = g 
goal: (IsLocalization.lift hg).comp (algebraMap R S) = g

full_name: IsLocalization.lift_of_comp
code: @[simp]
theorem lift_of_comp (j : S →+* P) : lift (isUnit_comp M j) = j 
goal: IsLocalization.lift ⋯ = j

full_name: IsLocalization.monoidHom_ext
code: /-- See note [partially-applied ext lemmas] -/
theorem monoidHom_ext ⦃j k : S →* P⦄
    (h : j.comp (algebraMap R S : R →* S) = k.comp (algebraMap R S)) : j = k 
goal: j = k

full_name: IsLocalization.ringHom_ext
code: /-- See note [partially-applied ext lemmas] -/
theorem ringHom_ext ⦃j k : S →+* P⦄ (h : j.comp (algebraMap R S) = k.comp (algebraMap R S)) :
    j = k 
goal: j = k

full_name: IsLocalization.algHom_subsingleton
code: theorem algHom_subsingleton [Algebra R P] : Subsingleton (S →ₐ[R] P) 
goal: Subsingleton (S →ₐ[R] P)

full_name: IsLocalization.ext
code: /-- 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 `*`. -/
protected theorem ext (j k : S → P) (hj1 : j 1 = 1) (hk1 : k 1 = 1)
    (hjm : ∀ a b, j (a * b) = j a * j b) (hkm : ∀ a b, k (a * b) = k a * k b)
    (h : ∀ a, j (algebraMap R S a) = k (algebraMap R S a)) : j = k 
goal: j = k

full_name: IsLocalization.lift_unique
code: theorem lift_unique {j : S →+* P} (hj : ∀ x, j ((algebraMap R S) x) = g x) : lift hg = j 
goal: IsLocalization.lift hg = j

full_name: IsLocalization.lift_id
code: @[simp]
theorem lift_id (x) : lift (map_units S : ∀ _ : M, IsUnit _) x = x 
goal: (IsLocalization.lift ⋯) x = x

full_name: IsLocalization.lift_surjective_iff
code: theorem lift_surjective_iff :
    Surjective (lift hg : S → P) ↔ ∀ v : P, ∃ x : R × M, v * g x.2 = g x.1 
goal: Function.Surjective ⇑(IsLocalization.lift hg) ↔ ∀ (v : P), ∃ x, v * g ↑x.2 = g x.1

full_name: IsLocalization.lift_injective_iff
code: theorem lift_injective_iff :
    Injective (lift hg : S → P) ↔ ∀ x y, algebraMap R S x = algebraMap R S y ↔ g x = g y 
goal: Function.Injective ⇑(IsLocalization.lift hg) ↔ ∀ (x y : R), (algebraMap R S) x = (algebraMap R S) y ↔ g x = g y

full_name: IsLocalization.map
code: /-- 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 `algebraMap P Q (g x) * (algebraMap P Q (g y))⁻¹`, where
`(x, y) : R × M` are such that `z = f x * (f y)⁻¹`. -/
noncomputable def map (g : R →+* P) (hy : M ≤ T.comap g) : S →+* Q 
goal: S →+* Q

full_name: IsLocalization.map_eq
code: @[simp]
theorem map_eq (x) : map Q g hy ((algebraMap R S) x) = algebraMap P Q (g x) 
goal: (IsLocalization.map Q g hy) ((algebraMap R S) x) = (algebraMap P Q) (g x)

full_name: IsLocalization.map_comp
code: @[simp]
theorem map_comp : (map Q g hy).comp (algebraMap R S) = (algebraMap P Q).comp g 
goal: (IsLocalization.map Q g hy).comp (algebraMap R S) = (algebraMap P Q).comp g

full_name: IsLocalization.map_mk'
code: theorem map_mk' (x) (y : M) : map Q g hy (mk' S x y) = mk' Q (g x) ⟨g y, hy y.2⟩ 
goal: (IsLocalization.map Q g hy) (IsLocalization.mk' S x y) = IsLocalization.mk' Q (g x) ⟨g ↑y, ⋯⟩

full_name: IsLocalization.map_id_mk'
code: @[simp]
theorem map_id_mk' {Q : Type*} [CommSemiring Q] [Algebra R Q] [IsLocalization M Q] (x) (y : M) :
    map Q (RingHom.id R) (le_refl M) (mk' S x y) = mk' Q x y 
goal: (IsLocalization.map Q (RingHom.id R) ⋯) (IsLocalization.mk' S x y) = IsLocalization.mk' Q x y

full_name: IsLocalization.map_id
code: @[simp]
theorem map_id (z : S) (h : M ≤ M.comap (RingHom.id R) := le_refl M) :
    map S (RingHom.id _) h z = z 
goal: (IsLocalization.map S (RingHom.id R) h) z = z

full_name: IsLocalization.map_unique
code: theorem map_unique (j : S →+* Q) (hj : ∀ x : R, j (algebraMap R S x) = algebraMap P Q (g x)) :
    map Q g hy = j 
goal: IsLocalization.map Q g hy = j

full_name: IsLocalization.map_comp_map
code: /-- If `CommSemiring` 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`. -/
theorem map_comp_map {A : Type*} [CommSemiring A] {U : Submonoid A} {W} [CommSemiring W]
    [Algebra A W] [IsLocalization U W] {l : P →+* A} (hl : T ≤ U.comap l) :
    (map W l hl).comp (map Q g hy : S →+* _) = map W (l.comp g) fun _ hx => hl (hy hx) 
goal: (IsLocalization.map W l hl).comp (IsLocalization.map Q g hy) = IsLocalization.map W (l.comp g) ⋯

full_name: IsLocalization.map_map
code: /-- If `CommSemiring` 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`. -/
theorem map_map {A : Type*} [CommSemiring A] {U : Submonoid A} {W} [CommSemiring W] [Algebra A W]
    [IsLocalization U W] {l : P →+* A} (hl : T ≤ U.comap l) (x : S) :
    map W l hl (map Q g hy x) = map W (l.comp g) (fun x hx => hl (hy hx)) x 
goal: (IsLocalization.map W l hl) ((IsLocalization.map Q g hy) x) = (IsLocalization.map W (l.comp g) ⋯) x

full_name: IsLocalization.map_smul
code: theorem map_smul (x : S) (z : R) : map Q g hy (z • x : S) = g z • map Q g hy x 
goal: (IsLocalization.map Q g hy) (z • x) = g z • (IsLocalization.map Q g hy) x

full_name: IsLocalization.ringEquivOfRingEquiv_apply
code: /-- 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`. -/
@[simps]
noncomputable def ringEquivOfRingEquiv (h : R ≃+* P) (H : M.map h.toMonoidHom = T) : S ≃+* Q 
goal: (IsLocalization.ringEquivOfRingEquiv S Q h H) a = (IsLocalization.map Q ↑h ⋯) a

full_name: IsLocalization.ringEquivOfRingEquiv
code: /-- 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`. -/
@[simps]
noncomputable def ringEquivOfRingEquiv (h : R ≃+* P) (H : M.map h.toMonoidHom = T) : S ≃+* Q 
goal: S ≃+* Q

full_name: IsLocalization.ringEquivOfRingEquiv_symm_apply
code: /-- 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`. -/
@[simps]
noncomputable def ringEquivOfRingEquiv (h : R ≃+* P) (H : M.map h.toMonoidHom = T) : S ≃+* Q 
goal: (IsLocalization.ringEquivOfRingEquiv S Q h H).symm a = (IsLocalization.map S ↑h.symm ⋯) a

full_name: IsLocalization.ringEquivOfRingEquiv_eq_map
code: theorem ringEquivOfRingEquiv_eq_map {j : R ≃+* P} (H : M.map j.toMonoidHom = T) :
    (ringEquivOfRingEquiv S Q j H : S →+* Q) =
      map Q (j : R →+* P) (M.le_comap_of_map_le (le_of_eq H)) 
goal: ↑(IsLocalization.ringEquivOfRingEquiv S Q j H) = IsLocalization.map Q ↑j ⋯

full_name: IsLocalization.ringEquivOfRingEquiv_eq
code: theorem ringEquivOfRingEquiv_eq {j : R ≃+* P} (H : M.map j.toMonoidHom = T) (x) :
    ringEquivOfRingEquiv S Q j H ((algebraMap R S) x) = algebraMap P Q (j x) 
goal: (IsLocalization.ringEquivOfRingEquiv S Q j H) ((algebraMap R S) x) = (algebraMap P Q) (j x)

full_name: IsLocalization.ringEquivOfRingEquiv_mk'
code: theorem ringEquivOfRingEquiv_mk' {j : R ≃+* P} (H : M.map j.toMonoidHom = T) (x : R) (y : M) :
    ringEquivOfRingEquiv S Q j H (mk' S x y) =
      mk' Q (j x) ⟨j y, show j y ∈ T from H ▸ Set.mem_image_of_mem j y.2⟩ 
goal: (IsLocalization.ringEquivOfRingEquiv S Q j H) (IsLocalization.mk' S x y) = IsLocalization.mk' Q (j x) ⟨j ↑y, ⋯⟩

full_name: IsLocalization.algEquiv_apply
code: /-- If `S`, `Q` are localizations of `R` at the submonoid `M` respectively,
there is an isomorphism of localizations `S ≃ₐ[R] Q`. -/
@[simps!]
noncomputable def algEquiv : S ≃ₐ[R] Q 
goal: (IsLocalization.algEquiv M S Q) a = (IsLocalization.map Q (RingHom.id R) ⋯) a

full_name: IsLocalization.algEquiv
code: /-- If `S`, `Q` are localizations of `R` at the submonoid `M` respectively,
there is an isomorphism of localizations `S ≃ₐ[R] Q`. -/
@[simps!]
noncomputable def algEquiv : S ≃ₐ[R] Q 
goal: S ≃ₐ[R] Q

full_name: IsLocalization.algEquiv_symm_apply
code: /-- If `S`, `Q` are localizations of `R` at the submonoid `M` respectively,
there is an isomorphism of localizations `S ≃ₐ[R] Q`. -/
@[simps!]
noncomputable def algEquiv : S ≃ₐ[R] Q 
goal: (IsLocalization.algEquiv M S Q).symm a = (IsLocalization.map S (RingHom.id R) ⋯) a

full_name: IsLocalization.algEquiv_mk'
code: theorem algEquiv_mk' (x : R) (y : M) : algEquiv M S Q (mk' S x y) = mk' Q x y 
goal: (IsLocalization.algEquiv M S Q) (IsLocalization.mk' S x y) = IsLocalization.mk' Q x y

full_name: IsLocalization.algEquiv_symm_mk'
code: theorem algEquiv_symm_mk' (x : R) (y : M) : (algEquiv M S Q).symm (mk' Q x y) = mk' S x y 
goal: (IsLocalization.algEquiv M S Q).symm (IsLocalization.mk' Q x y) = IsLocalization.mk' S x y

full_name: IsLocalization.bijective
code: protected lemma bijective (f : S →+* Q) (hf : f.comp (algebraMap R S) = algebraMap R Q) :
    Function.Bijective f 
goal: Function.Bijective ⇑f

full_name: IsLocalization.at_units
code: lemma at_units {R : Type*} [CommSemiring R] (S : Submonoid R)
    (hS : S ≤ IsUnit.submonoid R) : IsLocalization S R 
goal: IsLocalization S R

full_name: IsLocalization.atUnits
code: /-- The localization at a module of units is isomorphic to the ring. -/
noncomputable def atUnits (H : M ≤ IsUnit.submonoid R) : R ≃ₐ[R] S 
goal: R ≃ₐ[R] S

full_name: IsLocalization.map_injective_of_injective
code: /-- Injectivity of a map descends to the map induced on localizations. -/
theorem map_injective_of_injective (h : Function.Injective g) [IsLocalization (M.map g) Q] :
    Function.Injective (map Q g M.le_comap_map : S → Q) 
goal: Function.Injective ⇑(IsLocalization.map Q g ⋯)

full_name: IsLocalization.map_surjective_of_surjective
code: /-- Surjectivity of a map descends to the map induced on localizations. -/
theorem map_surjective_of_surjective (h : Function.Surjective g) [IsLocalization (M.map g) Q] :
    Function.Surjective (map Q g M.le_comap_map : S → Q) 
goal: Function.Surjective ⇑(IsLocalization.map Q g ⋯)

full_name: IsLocalization.isLocalization_of_algEquiv
code: theorem isLocalization_of_algEquiv [Algebra R P] [IsLocalization M S] (h : S ≃ₐ[R] P) :
    IsLocalization M P 
goal: IsLocalization M P

full_name: IsLocalization.isLocalization_iff_of_algEquiv
code: theorem isLocalization_iff_of_algEquiv [Algebra R P] (h : S ≃ₐ[R] P) :
    IsLocalization M S ↔ IsLocalization M P 
goal: IsLocalization M S ↔ IsLocalization M P

full_name: IsLocalization.isLocalization_iff_of_ringEquiv
code: theorem isLocalization_iff_of_ringEquiv (h : S ≃+* P) :
    IsLocalization M S ↔
      haveI := (h.toRingHom.comp <| algebraMap R S).toAlgebra; IsLocalization M P 
goal: IsLocalization M S ↔ IsLocalization M P

full_name: IsLocalization.isLocalization_of_base_ringEquiv
code: theorem isLocalization_of_base_ringEquiv [IsLocalization M S] (h : R ≃+* P) :
    haveI := ((algebraMap R S).comp h.symm.toRingHom).toAlgebra
    IsLocalization (M.map h.toMonoidHom) S 
goal: IsLocalization (Submonoid.map h.toMonoidHom M) S

full_name: IsLocalization.isLocalization_iff_of_base_ringEquiv
code: theorem isLocalization_iff_of_base_ringEquiv (h : R ≃+* P) :
    IsLocalization M S ↔
      haveI := ((algebraMap R S).comp h.symm.toRingHom).toAlgebra
      IsLocalization (M.map h.toMonoidHom) S 
goal: IsLocalization M S ↔ IsLocalization (Submonoid.map h.toMonoidHom M) S

full_name: IsLocalization.nonZeroDivisors_le_comap
code: theorem nonZeroDivisors_le_comap [IsLocalization M S] :
    nonZeroDivisors R ≤ (nonZeroDivisors S).comap (algebraMap R S) 
goal: nonZeroDivisors R ≤ Submonoid.comap (algebraMap R S) (nonZeroDivisors S)

full_name: IsLocalization.map_nonZeroDivisors_le
code: theorem map_nonZeroDivisors_le [IsLocalization M S] :
    (nonZeroDivisors R).map (algebraMap R S) ≤ nonZeroDivisors S 
goal: Submonoid.map (algebraMap R S) (nonZeroDivisors R) ≤ nonZeroDivisors S

full_name: Localization.instUniqueLocalization
code: instance instUniqueLocalization [Subsingleton R] : Unique (Localization M) 
goal: Unique (Localization M)

full_name: Localization.add_mk
code: theorem add_mk (a b c d) : (mk a b : Localization M) + mk c d =
    mk ((b : R) * c + (d : R) * a) (b * d) 
goal: Localization.mk a b + Localization.mk c d = Localization.mk (↑b * c + ↑d * a) (b * d)

full_name: Localization.add_mk_self
code: theorem add_mk_self (a b c) : (mk a b : Localization M) + mk c b = mk (a + c) b 
goal: Localization.mk a b + Localization.mk c b = Localization.mk (a + c) b

full_name: Localization.mkAddMonoidHom
code: /-- For any given denominator `b : M`, the map `a ↦ a / b` is an `AddMonoidHom` from `R` to
  `Localization M`-/
@[simps]
def mkAddMonoidHom (b : M) : R →+ Localization M 
goal: R →+ Localization M

full_name: Localization.mkAddMonoidHom_apply
code: /-- For any given denominator `b : M`, the map `a ↦ a / b` is an `AddMonoidHom` from `R` to
  `Localization M`-/
@[simps]
def mkAddMonoidHom (b : M) : R →+ Localization M 
goal: (Localization.mkAddMonoidHom b) a = Localization.mk a b

full_name: Localization.mk_sum
code: theorem mk_sum {ι : Type*} (f : ι → R) (s : Finset ι) (b : M) :
    mk (∑ i ∈ s, f i) b = ∑ i ∈ s, mk (f i) b 
goal: Localization.mk (∑ i ∈ s, f i) b = ∑ i ∈ s, Localization.mk (f i) b

full_name: Localization.mk_list_sum
code: theorem mk_list_sum (l : List R) (b : M) : mk l.sum b = (l.map fun a => mk a b).sum 
goal: Localization.mk l.sum b = (List.map (fun a => Localization.mk a b) l).sum

full_name: Localization.mk_multiset_sum
code: theorem mk_multiset_sum (l : Multiset R) (b : M) : mk l.sum b = (l.map fun a => mk a b).sum 
goal: Localization.mk l.sum b = (Multiset.map (fun a => Localization.mk a b) l).sum

full_name: Localization.isLocalization
code: instance isLocalization : IsLocalization M (Localization M) 
goal: IsLocalization M (Localization M)

full_name: Localization.toLocalizationMap_eq_monoidOf
code: @[simp]
theorem toLocalizationMap_eq_monoidOf : toLocalizationMap M (Localization M) = monoidOf M 
goal: IsLocalization.toLocalizationMap M (Localization M) = Localization.monoidOf M

full_name: Localization.monoidOf_eq_algebraMap
code: theorem monoidOf_eq_algebraMap (x) : (monoidOf M).toMap x = algebraMap R (Localization M) x 
goal: (Localization.monoidOf M).toMap x = (algebraMap R (Localization M)) x

full_name: Localization.mk_one_eq_algebraMap
code: theorem mk_one_eq_algebraMap (x) : mk x 1 = algebraMap R (Localization M) x 
goal: Localization.mk x 1 = (algebraMap R (Localization M)) x

full_name: Localization.mk_eq_mk'_apply
code: theorem mk_eq_mk'_apply (x y) : mk x y = IsLocalization.mk' (Localization M) x y 
goal: Localization.mk x y = IsLocalization.mk' (Localization M) x y

full_name: Localization.mk_eq_mk'
code: theorem mk_eq_mk' : (mk : R → M → Localization M) = IsLocalization.mk' (Localization M) 
goal: Localization.mk = IsLocalization.mk' (Localization M)

full_name: Localization.mk_algebraMap
code: theorem mk_algebraMap {A : Type*} [CommSemiring A] [Algebra A R] (m : A) :
    mk (algebraMap A R m) 1 = algebraMap A (Localization M) m 
goal: Localization.mk ((algebraMap A R) m) 1 = (algebraMap A (Localization M)) m

full_name: Localization.mk_natCast
code: theorem mk_natCast (m : ℕ) : (mk m 1 : Localization M) = m 
goal: Localization.mk (↑m) 1 = ↑m

full_name: Localization.algEquiv_apply
code: /-- The localization of `R` at `M` as a quotient type is isomorphic to any other localization. -/
@[simps!]
noncomputable def algEquiv : Localization M ≃ₐ[R] S 
goal: (Localization.algEquiv M S) a = (IsLocalization.map S (RingHom.id R) ⋯) a

full_name: Localization.algEquiv_symm_apply
code: /-- The localization of `R` at `M` as a quotient type is isomorphic to any other localization. -/
@[simps!]
noncomputable def algEquiv : Localization M ≃ₐ[R] S 
goal: (Localization.algEquiv M S).symm a = (IsLocalization.map (Localization M) (RingHom.id R) ⋯) a

full_name: Localization.algEquiv
code: /-- The localization of `R` at `M` as a quotient type is isomorphic to any other localization. -/
@[simps!]
noncomputable def algEquiv : Localization M ≃ₐ[R] S 
goal: Localization M ≃ₐ[R] S

full_name: IsLocalization.unique
code: /-- The localization of a singleton is a singleton. Cannot be an instance due to metavariables. -/
noncomputable def _root_.IsLocalization.unique (R Rₘ) [CommSemiring R] [CommSemiring Rₘ]
    (M : Submonoid R) [Subsingleton R] [Algebra R Rₘ] [IsLocalization M Rₘ] : Unique Rₘ 
goal: Unique Rₘ

full_name: Localization.algEquiv_mk'
code: nonrec theorem algEquiv_mk' (x : R) (y : M) : algEquiv M S (mk' (Localization M) x y) = mk' S x y 
goal: (Localization.algEquiv M S) (IsLocalization.mk' (Localization M) x y) = IsLocalization.mk' S x y

full_name: Localization.algEquiv_symm_mk'
code: nonrec theorem algEquiv_symm_mk' (x : R) (y : M) :
    (algEquiv M S).symm (mk' S x y) = mk' (Localization M) x y 
goal: (Localization.algEquiv M S).symm (IsLocalization.mk' S x y) = IsLocalization.mk' (Localization M) x y

full_name: Localization.algEquiv_mk
code: theorem algEquiv_mk (x y) : algEquiv M S (mk x y) = mk' S x y 
goal: (Localization.algEquiv M S) (Localization.mk x y) = IsLocalization.mk' S x y

full_name: Localization.algEquiv_symm_mk
code: theorem algEquiv_symm_mk (x : R) (y : M) : (algEquiv M S).symm (mk' S x y) = mk x y 
goal: (Localization.algEquiv M S).symm (IsLocalization.mk' S x y) = Localization.mk x y

full_name: Localization.coe_algEquiv
code: lemma coe_algEquiv :
    (Localization.algEquiv M S : Localization M →+* S) =
    IsLocalization.map (M := M) (T := M) _ (RingHom.id R) le_rfl 
goal: ↑(Localization.algEquiv M S) = IsLocalization.map S (RingHom.id R) ⋯

full_name: Localization.coe_algEquiv_symm
code: lemma coe_algEquiv_symm :
    ((Localization.algEquiv M S).symm : S →+* Localization M) =
    IsLocalization.map (M := M) (T := M) _ (RingHom.id R) le_rfl 
goal: ↑(Localization.algEquiv M S).symm = IsLocalization.map (Localization M) (RingHom.id R) ⋯

full_name: Localization.neg_mk
code: theorem neg_mk (a b) : -(mk a b : Localization M) = mk (-a) b 
goal: -Localization.mk a b = Localization.mk (-a) b

full_name: Localization.sub_mk
code: theorem sub_mk (a c) (b d) : (mk a b : Localization M) - mk c d =
    mk ((d : R) * a - b * c) (b * d) 
goal: Localization.mk a b - Localization.mk c d = Localization.mk (↑d * a - ↑b * c) (b * d)

full_name: Localization.mk_intCast
code: theorem mk_intCast (m : ℤ) : (mk m 1 : Localization M) = m 
goal: Localization.mk (↑m) 1 = ↑m

full_name: IsLocalization.to_map_eq_zero_iff
code: theorem to_map_eq_zero_iff {x : R} (hM : M ≤ nonZeroDivisors R) : algebraMap R S x = 0 ↔ x = 0 
goal: (algebraMap R S) x = 0 ↔ x = 0

full_name: IsLocalization.injective
code: protected theorem injective (hM : M ≤ nonZeroDivisors R) : Injective (algebraMap R S) 
goal: Function.Injective ⇑(algebraMap R S)

full_name: IsLocalization.to_map_ne_zero_of_mem_nonZeroDivisors
code: protected theorem to_map_ne_zero_of_mem_nonZeroDivisors [Nontrivial R] (hM : M ≤ nonZeroDivisors R)
    {x : R} (hx : x ∈ nonZeroDivisors R) : algebraMap R S x ≠ 0 
goal: (algebraMap R S) x ≠ 0

full_name: IsLocalization.sec_snd_ne_zero
code: theorem sec_snd_ne_zero [Nontrivial R] (hM : M ≤ nonZeroDivisors R) (x : S) :
    ((sec M x).snd : R) ≠ 0 
goal: ↑(IsLocalization.sec M x).2 ≠ 0

full_name: IsLocalization.sec_fst_ne_zero
code: theorem sec_fst_ne_zero [Nontrivial R] [NoZeroDivisors S] (hM : M ≤ nonZeroDivisors R) {x : S}
    (hx : x ≠ 0) : (sec M x).fst ≠ 0 
goal: (IsLocalization.sec M x).1 ≠ 0

full_name: IsLocalization.noZeroDivisors_of_le_nonZeroDivisors
code: /-- A `CommRing` `S` which is the localization of a ring `R` without zero divisors at a subset of
non-zero elements does not have zero divisors. -/
theorem noZeroDivisors_of_le_nonZeroDivisors [Algebra A S] {M : Submonoid A} [IsLocalization M S]
    (hM : M ≤ nonZeroDivisors A) : NoZeroDivisors S 
goal: NoZeroDivisors S

full_name: IsLocalization.isDomain_of_le_nonZeroDivisors
code: /-- A `CommRing` `S` which is the localization of an integral domain `R` at a subset of
non-zero elements is an integral domain. -/
theorem isDomain_of_le_nonZeroDivisors [Algebra A S] {M : Submonoid A} [IsLocalization M S]
    (hM : M ≤ nonZeroDivisors A) : IsDomain S 
goal: IsDomain S

full_name: IsLocalization.isDomain_localization
code: /-- The localization of an integral domain to a set of non-zero elements is an integral domain. -/
theorem isDomain_localization {M : Submonoid A} (hM : M ≤ nonZeroDivisors A) :
    IsDomain (Localization M) 
goal: IsDomain (Localization M)

full_name: IsField.localization_map_bijective
code: /-- If `R` is a field, then localizing at a submonoid not containing `0` adds no new elements. -/
theorem IsField.localization_map_bijective {R Rₘ : Type*} [CommRing R] [CommRing Rₘ]
    {M : Submonoid R} (hM : (0 : R) ∉ M) (hR : IsField R) [Algebra R Rₘ] [IsLocalization M Rₘ] :
    Function.Bijective (algebraMap R Rₘ) 
goal: Function.Bijective ⇑(algebraMap R Rₘ)

full_name: Field.localization_map_bijective
code: /-- If `R` is a field, then localizing at a submonoid not containing `0` adds no new elements. -/
theorem Field.localization_map_bijective {K Kₘ : Type*} [Field K] [CommRing Kₘ] {M : Submonoid K}
    (hM : (0 : K) ∉ M) [Algebra K Kₘ] [IsLocalization M Kₘ] :
    Function.Bijective (algebraMap K Kₘ) 
goal: Function.Bijective ⇑(algebraMap K Kₘ)

full_name: localizationAlgebra
code: /-- 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 `algebraMap 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.algebraMapSubmonoid S M)`,
however we will instead use the hypotheses `[Algebra Rₘ Sₘ] [IsScalarTower R Rₘ Sₘ]` in lemmas
since the algebra structure may arise in different ways.
-/
noncomputable def localizationAlgebra : Algebra Rₘ Sₘ 
goal: Algebra Rₘ Sₘ

full_name: IsLocalization.map_units_map_submonoid
code: theorem IsLocalization.map_units_map_submonoid
    [IsLocalization (Algebra.algebraMapSubmonoid S M) Sₘ] (y : M) :
    IsUnit (algebraMap R Sₘ y) 
goal: IsUnit ((algebraMap R Sₘ) ↑y)

full_name: IsLocalization.algebraMap_mk'
code: theorem IsLocalization.algebraMap_mk' (x : R) (y : M) :
    algebraMap Rₘ Sₘ (IsLocalization.mk' Rₘ x y) =
      IsLocalization.mk' Sₘ (algebraMap R S x)
        ⟨algebraMap R S y, Algebra.mem_algebraMapSubmonoid_of_mem y⟩ 
goal: (algebraMap Rₘ Sₘ) (IsLocalization.mk' Rₘ x y) = IsLocalization.mk' Sₘ ((algebraMap R S) x) ⟨(algebraMap R S) ↑y, ⋯⟩

full_name: IsLocalization.algebraMap_eq_map_map_submonoid
code: /-- If the square below commutes, the bottom map is uniquely specified:
```
R  →  S
↓     ↓
Rₘ → Sₘ
```
-/
theorem IsLocalization.algebraMap_eq_map_map_submonoid :
    algebraMap Rₘ Sₘ =
      map Sₘ (algebraMap R S)
        (show _ ≤ (Algebra.algebraMapSubmonoid S M).comap _ from M.le_comap_map) 
goal: algebraMap Rₘ Sₘ = IsLocalization.map Sₘ (algebraMap R S) ⋯

full_name: IsLocalization.algebraMap_apply_eq_map_map_submonoid
code: /-- If the square below commutes, the bottom map is uniquely specified:
```
R  →  S
↓     ↓
Rₘ → Sₘ
```
-/
theorem IsLocalization.algebraMap_apply_eq_map_map_submonoid (x) :
    algebraMap Rₘ Sₘ x =
      map Sₘ (algebraMap R S)
        (show _ ≤ (Algebra.algebraMapSubmonoid S M).comap _ from M.le_comap_map) x 
goal: (algebraMap Rₘ Sₘ) x = (IsLocalization.map Sₘ (algebraMap R S) ⋯) x

full_name: IsLocalization.lift_algebraMap_eq_algebraMap
code: theorem IsLocalization.lift_algebraMap_eq_algebraMap :
    IsLocalization.lift (M := M) (IsLocalization.map_units_map_submonoid S Sₘ) =
      algebraMap Rₘ Sₘ 
goal: IsLocalization.lift ⋯ = algebraMap Rₘ Sₘ

full_name: localizationAlgebra_injective
code: /-- Injectivity of the underlying `algebraMap` descends to the algebra induced by localization. -/
theorem localizationAlgebra_injective (hRS : Function.Injective (algebraMap R S)) :
    Function.Injective (@algebraMap Rₘ Sₘ _ _ (localizationAlgebra M S)) 
goal: Function.Injective ⇑(algebraMap Rₘ Sₘ)