File: Mathlib/RingTheory/Localization/FractionRing.lean

full_name: IsFractionRing
code: /-- `IsFractionRing R K` states `K` is the field of fractions of an integral domain `R`. -/
abbrev IsFractionRing [CommRing K] [Algebra R K] 
goal: Prop

full_name: instIsFractionRing
code: instance {R : Type*} [Field R] : IsFractionRing R R 
goal: IsFractionRing R R

full_name: Rat.isFractionRing
code: /-- The cast from `Int` to `Rat` as a `FractionRing`. -/
instance Rat.isFractionRing : IsFractionRing ℤ ℚ 
goal: IsFractionRing ℤ ℚ

full_name: IsFractionRing.to_map_eq_zero_iff
code: theorem to_map_eq_zero_iff {x : R} : algebraMap R K x = 0 ↔ x = 0 
goal: (algebraMap R K) x = 0 ↔ x = 0

full_name: IsFractionRing.injective
code: protected theorem injective : Function.Injective (algebraMap R K) 
goal: Function.Injective ⇑(algebraMap R K)

full_name: IsFractionRing.coe_inj
code: @[norm_cast, simp]
-- Porting note: using `↑` didn't work, so I needed to explicitly put in the cast myself
theorem coe_inj {a b : R} : (Algebra.cast a : K) = Algebra.cast b ↔ a = b 
goal: ↑a = ↑b ↔ a = b

full_name: IsFractionRing.instNoZeroSMulDivisorsOfNoZeroDivisors
code: instance (priority := 100) [NoZeroDivisors K] : NoZeroSMulDivisors R K 
goal: NoZeroSMulDivisors R K

full_name: IsFractionRing.to_map_ne_zero_of_mem_nonZeroDivisors
code: protected theorem to_map_ne_zero_of_mem_nonZeroDivisors [Nontrivial R] {x : R}
    (hx : x ∈ nonZeroDivisors R) : algebraMap R K x ≠ 0 
goal: (algebraMap R K) x ≠ 0

full_name: IsFractionRing.isDomain
code: /-- A `CommRing` `K` which is the localization of an integral domain `R` at `R - {0}` is an
integral domain. -/
protected theorem isDomain : IsDomain K 
goal: IsDomain K

full_name: IsFractionRing.definition._@.Mathlib.RingTheory.Localization.FractionRing._hyg.987
code: /-- The inverse of an element in the field of fractions of an integral domain. -/
protected noncomputable irreducible_def inv (z : K) : K 
goal: K

full_name: IsFractionRing.wrapped._@.Mathlib.RingTheory.Localization.FractionRing._hyg.987
code: /-- The inverse of an element in the field of fractions of an integral domain. -/
protected noncomputable irreducible_def inv (z : K) : K 
goal: Subtype (Eq IsFractionRing.definition✝)

full_name: IsFractionRing.inv_def
code: /-- The inverse of an element in the field of fractions of an integral domain. -/
protected noncomputable irreducible_def inv (z : K) : K 
goal: IsFractionRing.inv A z =
  if h : z = 0 then 0
  else
    IsLocalization.mk' K ↑(IsLocalization.sec (nonZeroDivisors A) z).2 ⟨(IsLocalization.sec (nonZeroDivisors A) z).1, ⋯⟩

full_name: IsFractionRing.inv
code: /-- The inverse of an element in the field of fractions of an integral domain. -/
protected noncomputable irreducible_def inv (z : K) : K 
goal: K

full_name: IsFractionRing.mul_inv_cancel
code: protected theorem mul_inv_cancel (x : K) (hx : x ≠ 0) : x * IsFractionRing.inv A x = 1 
goal: x * IsFractionRing.inv A x = 1

full_name: IsFractionRing.toField
code: /-- A `CommRing` `K` which is the localization of an integral domain `R` at `R - {0}` is a field.
See note [reducible non-instances]. -/
noncomputable abbrev toField : Field K 
goal: Field K

full_name: IsFractionRing.surjective_iff_isField
code: lemma surjective_iff_isField [IsDomain R] : Function.Surjective (algebraMap R K) ↔ IsField R 
goal: Function.Surjective ⇑(algebraMap R K) ↔ IsField R

full_name: IsFractionRing.mk'_mk_eq_div
code: theorem mk'_mk_eq_div {r s} (hs : s ∈ nonZeroDivisors A) :
    mk' K r ⟨s, hs⟩ = algebraMap A K r / algebraMap A K s 
goal: IsLocalization.mk' K r ⟨s, hs⟩ = (algebraMap A K) r / (algebraMap A K) s

full_name: IsFractionRing.mk'_eq_div
code: @[simp]
theorem mk'_eq_div {r} (s : nonZeroDivisors A) : mk' K r s = algebraMap A K r / algebraMap A K s 
goal: IsLocalization.mk' K r s = (algebraMap A K) r / (algebraMap A K) ↑s

full_name: IsFractionRing.div_surjective
code: theorem div_surjective (z : K) :
    ∃ x y : A, y ∈ nonZeroDivisors A ∧ algebraMap _ _ x / algebraMap _ _ y = z 
goal: ∃ x, ∃ y ∈ nonZeroDivisors A, (algebraMap A K) x / (algebraMap A K) y = z

full_name: IsFractionRing.isUnit_map_of_injective
code: theorem isUnit_map_of_injective (hg : Function.Injective g) (y : nonZeroDivisors A) :
    IsUnit (g y) 
goal: IsUnit (g ↑y)

full_name: IsFractionRing.mk'_eq_zero_iff_eq_zero
code: @[simp]
theorem mk'_eq_zero_iff_eq_zero [Algebra R K] [IsFractionRing R K] {x : R} {y : nonZeroDivisors R} :
    mk' K x y = 0 ↔ x = 0 
goal: IsLocalization.mk' K x y = 0 ↔ x = 0

full_name: IsFractionRing.mk'_eq_one_iff_eq
code: theorem mk'_eq_one_iff_eq {x : A} {y : nonZeroDivisors A} : mk' K x y = 1 ↔ x = y 
goal: IsLocalization.mk' K x y = 1 ↔ x = ↑y

full_name: IsFractionRing.lift
code: /-- Given an integral domain `A` with field of fractions `K`,
and an injective ring hom `g : A →+* L` where `L` is a field, we get a
field hom sending `z : K` to `g x * (g y)⁻¹`, where `(x, y) : A × (NonZeroDivisors A)` are
such that `z = f x * (f y)⁻¹`. -/
noncomputable def lift (hg : Injective g) : K →+* L 
goal: K →+* L

full_name: IsFractionRing.lift_algebraMap
code: /-- Given an integral domain `A` with field of fractions `K`,
and an injective ring hom `g : A →+* L` where `L` is a field,
the field hom induced from `K` to `L` maps `x` to `g x` for all
`x : A`. -/
@[simp]
theorem lift_algebraMap (hg : Injective g) (x) : lift hg (algebraMap A K x) = g x 
goal: (IsFractionRing.lift hg) ((algebraMap A K) x) = g x

full_name: IsFractionRing.lift_mk'
code: /-- Given an integral domain `A` with field of fractions `K`,
and an injective ring hom `g : A →+* L` where `L` is a field,
field hom induced from `K` to `L` maps `f x / f y` to `g x / g y` for all
`x : A, y ∈ NonZeroDivisors A`. -/
theorem lift_mk' (hg : Injective g) (x) (y : nonZeroDivisors A) :
    lift hg (mk' K x y) = g x / g y 
goal: (IsFractionRing.lift hg) (IsLocalization.mk' K x y) = g x / g ↑y

full_name: IsFractionRing.map
code: /-- Given integral domains `A, B` with fields of fractions `K`, `L`
and an injective ring hom `j : A →+* B`, we get a field hom
sending `z : K` to `g (j x) * (g (j y))⁻¹`, where `(x, y) : A × (NonZeroDivisors A)` are
such that `z = f x * (f y)⁻¹`. -/
noncomputable def map {A B K L : Type*} [CommRing A] [CommRing B] [IsDomain B] [CommRing K]
    [Algebra A K] [IsFractionRing A K] [CommRing L] [Algebra B L] [IsFractionRing B L] {j : A →+* B}
    (hj : Injective j) : K →+* L 
goal: K →+* L

full_name: IsFractionRing.fieldEquivOfRingEquiv
code: /-- Given integral domains `A, B` and localization maps to their fields of fractions
`f : A →+* K, g : B →+* L`, an isomorphism `j : A ≃+* B` induces an isomorphism of
fields of fractions `K ≃+* L`. -/
noncomputable def fieldEquivOfRingEquiv [Algebra B L] [IsFractionRing B L] (h : A ≃+* B) :
    K ≃+* L 
goal: K ≃+* L

full_name: IsFractionRing.isFractionRing_iff_of_base_ringEquiv
code: theorem isFractionRing_iff_of_base_ringEquiv (h : R ≃+* P) :
    IsFractionRing R S ↔
      @IsFractionRing P _ S _ ((algebraMap R S).comp h.symm.toRingHom).toAlgebra 
goal: IsFractionRing R S ↔ IsFractionRing P S

full_name: IsFractionRing.nontrivial
code: protected theorem nontrivial (R S : Type*) [CommRing R] [Nontrivial R] [CommRing S] [Algebra R S]
    [IsFractionRing R S] : Nontrivial S 
goal: Nontrivial S

full_name: FractionRing
code: /-- The fraction ring of a commutative ring `R` as a quotient type.

We instantiate this definition as generally as possible, and assume that the
commutative ring `R` is an integral domain only when this is needed for proving.

In this generality, this construction is also known as the *total fraction ring* of `R`.
-/
abbrev FractionRing 
goal: Type u_1

full_name: FractionRing.unique
code: instance unique [Subsingleton R] : Unique (FractionRing R) 
goal: Unique (FractionRing R)

full_name: FractionRing.instNontrivial
code: instance [Nontrivial R] : Nontrivial (FractionRing R) 
goal: Nontrivial (FractionRing R)

full_name: FractionRing.field
code: /-- Porting note: if the fields of this instance are explicitly defined as they were
in mathlib3, the last instance in this file suffers a TC timeout -/
noncomputable instance field : Field (FractionRing A) 
goal: Field (FractionRing A)

full_name: FractionRing.mk_eq_div
code: @[simp]
theorem mk_eq_div {r s} :
    (Localization.mk r s : FractionRing A) =
      (algebraMap _ _ r / algebraMap A _ s : FractionRing A) 
goal: Localization.mk r s = (algebraMap A (FractionRing A)) r / (algebraMap A (FractionRing A)) ↑s

full_name: FractionRing.liftAlgebra
code: /-- This is not an instance because it creates a diamond when `K = FractionRing R`.
Should usually be introduced locally along with `isScalarTower_liftAlgebra`
See note [reducible non-instances]. -/
noncomputable abbrev liftAlgebra [IsDomain R] [Field K] [Algebra R K]
    [NoZeroSMulDivisors R K] : Algebra (FractionRing R) K 
goal: Algebra (FractionRing R) K

full_name: FractionRing.isScalarTower_liftAlgebra
code: instance isScalarTower_liftAlgebra [IsDomain R] [Field K] [Algebra R K] [NoZeroSMulDivisors R K] :
    by letI := liftAlgebra R K; exact IsScalarTower R (FractionRing R) K 
goal: IsScalarTower R (FractionRing R) K

full_name: FractionRing.algEquiv
code: /-- Given an integral domain `A` and a localization map to a field of fractions
`f : A →+* K`, we get an `A`-isomorphism between the field of fractions of `A` as a quotient
type and `K`. -/
noncomputable def algEquiv (K : Type*) [Field K] [Algebra A K] [IsFractionRing A K] :
    FractionRing A ≃ₐ[A] K 
goal: FractionRing A ≃ₐ[A] K

full_name: FractionRing.instNoZeroSMulDivisors
code: instance [Algebra R A] [NoZeroSMulDivisors R A] : NoZeroSMulDivisors R (FractionRing A) 
goal: NoZeroSMulDivisors R (FractionRing A)