/-
Copyright (c) 2018 Kenny Lau. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Kenny Lau, Mario Carneiro, Johan Commelin, Amelia Livingston, Anne Baanen

! This file was ported from Lean 3 source module ring_theory.localization.fraction_ring
! leanprover-community/mathlib commit 8ef6f08ff8c781c5c07a8b12843710e1a0d8a688
! Please do not edit these lines, except to modify the commit id
! if you have ported upstream changes.
-/
import Mathbin.Algebra.Algebra.Tower
import Mathbin.RingTheory.Localization.Basic

/-!
# Fraction ring / fraction field Frac(R) as localization

> THIS FILE IS SYNCHRONIZED WITH MATHLIB4.
> Any changes to this file require a corresponding PR to mathlib4.

## Main definitions

 * `is_fraction_ring R K` expresses that `K` is a field of fractions of `R`, as an abbreviation of
   `is_localization (non_zero_divisors R) K`

## Main results

 * `is_fraction_ring.field`: a definition (not an instance) stating the localization of an integral
   domain `R` at `R \ {0}` is a field
 * `rat.is_fraction_ring` is an instance stating `ℚ` is the field of fractions of `ℤ`

## Implementation notes

See `src/ring_theory/localization/basic.lean` for a design overview.

## Tags
localization, ring localization, commutative ring localization, characteristic predicate,
commutative ring, field of fractions
-/

variable (R : Type _) [CommRing R] {M : Submonoid R} (S : Type _) [CommRing S]

variable [Algebra R S] {P : Type _} [CommRing P]

variable {A : Type _} [CommRing A] [IsDomain A] (K : Type _)

#print IsFractionRing /-
-- TODO: should this extend `algebra` instead of assuming it?
/-- `is_fraction_ring R K` states `K` is the field of fractions of an integral domain `R`. -/
abbrev IsFractionRing [CommRing K] [Algebra R K] :=
  IsLocalization (nonZeroDivisors R) K
#align is_fraction_ring IsFractionRing
-/

/- warning: rat.is_fraction_ring -> Rat.isFractionRing is a dubious translation:
lean 3 declaration is
  IsFractionRing.{0, 0} Int Int.commRing Rat Rat.commRing (algebraInt.{0} Rat (DivisionRing.toRing.{0} Rat Rat.divisionRing))
but is expected to have type
  IsFractionRing.{0, 0} Int Int.instCommRingInt Rat Rat.commRing (algebraInt.{0} Rat (StrictOrderedRing.toRing.{0} Rat (LinearOrderedRing.toStrictOrderedRing.{0} Rat Rat.instLinearOrderedRingRat)))
Case conversion may be inaccurate. Consider using '#align rat.is_fraction_ring Rat.isFractionRingₓ'. -/
/-- The cast from `int` to `rat` as a `fraction_ring`. -/
instance Rat.isFractionRing : IsFractionRing ℤ ℚ
    where
  map_units := by
    rintro ⟨x, hx⟩
    rw [mem_nonZeroDivisors_iff_ne_zero] at hx
    simpa only [eq_intCast, isUnit_iff_ne_zero, Int.cast_eq_zero, Ne.def, Subtype.coe_mk] using hx
  surj := by
    rintro ⟨n, d, hd, h⟩
    refine' ⟨⟨n, ⟨d, _⟩⟩, Rat.mul_den_eq_num⟩
    rwa [mem_nonZeroDivisors_iff_ne_zero, Int.coe_nat_ne_zero_iff_pos]
  eq_iff_exists := by
    intro x y
    rw [eq_intCast, eq_intCast, Int.cast_inj]
    refine'
      ⟨by
        rintro rfl
        use 1, _⟩
    rintro ⟨⟨c, hc⟩, h⟩
    apply mul_left_cancel₀ _ h
    rwa [mem_nonZeroDivisors_iff_ne_zero] at hc
#align rat.is_fraction_ring Rat.isFractionRing

namespace IsFractionRing

open IsLocalization

variable {R K}

section CommRing

variable [CommRing K] [Algebra R K] [IsFractionRing R K] [Algebra A K] [IsFractionRing A K]

/- warning: is_fraction_ring.to_map_eq_zero_iff -> IsFractionRing.to_map_eq_zero_iff is a dubious translation:
lean 3 declaration is
  forall {R : Type.{u1}} [_inst_1 : CommRing.{u1} R] {K : Type.{u2}} [_inst_7 : CommRing.{u2} K] [_inst_8 : Algebra.{u1, u2} R K (CommRing.toCommSemiring.{u1} R _inst_1) (Ring.toSemiring.{u2} K (CommRing.toRing.{u2} K _inst_7))] [_inst_9 : IsFractionRing.{u1, u2} R _inst_1 K _inst_7 _inst_8] {x : R}, Iff (Eq.{succ u2} K (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RingHom.{u1, u2} R K (Semiring.toNonAssocSemiring.{u1} R (CommSemiring.toSemiring.{u1} R (CommRing.toCommSemiring.{u1} R _inst_1))) (Semiring.toNonAssocSemiring.{u2} K (Ring.toSemiring.{u2} K (CommRing.toRing.{u2} K _inst_7)))) (fun (_x : RingHom.{u1, u2} R K (Semiring.toNonAssocSemiring.{u1} R (CommSemiring.toSemiring.{u1} R (CommRing.toCommSemiring.{u1} R _inst_1))) (Semiring.toNonAssocSemiring.{u2} K (Ring.toSemiring.{u2} K (CommRing.toRing.{u2} K _inst_7)))) => R -> K) (RingHom.hasCoeToFun.{u1, u2} R K (Semiring.toNonAssocSemiring.{u1} R (CommSemiring.toSemiring.{u1} R (CommRing.toCommSemiring.{u1} R _inst_1))) (Semiring.toNonAssocSemiring.{u2} K (Ring.toSemiring.{u2} K (CommRing.toRing.{u2} K _inst_7)))) (algebraMap.{u1, u2} R K (CommRing.toCommSemiring.{u1} R _inst_1) (Ring.toSemiring.{u2} K (CommRing.toRing.{u2} K _inst_7)) _inst_8) x) (OfNat.ofNat.{u2} K 0 (OfNat.mk.{u2} K 0 (Zero.zero.{u2} K (MulZeroClass.toHasZero.{u2} K (NonUnitalNonAssocSemiring.toMulZeroClass.{u2} K (NonUnitalNonAssocRing.toNonUnitalNonAssocSemiring.{u2} K (NonAssocRing.toNonUnitalNonAssocRing.{u2} K (Ring.toNonAssocRing.{u2} K (CommRing.toRing.{u2} K _inst_7)))))))))) (Eq.{succ u1} R x (OfNat.ofNat.{u1} R 0 (OfNat.mk.{u1} R 0 (Zero.zero.{u1} R (MulZeroClass.toHasZero.{u1} R (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} R (NonUnitalNonAssocRing.toNonUnitalNonAssocSemiring.{u1} R (NonAssocRing.toNonUnitalNonAssocRing.{u1} R (Ring.toNonAssocRing.{u1} R (CommRing.toRing.{u1} R _inst_1))))))))))
but is expected to have type
  forall {R : Type.{u1}} [_inst_1 : CommRing.{u1} R] {K : Type.{u2}} [_inst_7 : CommRing.{u2} K] [_inst_8 : Algebra.{u1, u2} R K (CommRing.toCommSemiring.{u1} R _inst_1) (Ring.toSemiring.{u2} K (CommRing.toRing.{u2} K _inst_7))] [_inst_9 : IsFractionRing.{u1, u2} R _inst_1 K _inst_7 _inst_8] {x : R}, Iff (Eq.{succ u2} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : R) => K) x) (FunLike.coe.{max (succ u1) (succ u2), succ u1, succ u2} (RingHom.{u1, u2} R K (Semiring.toNonAssocSemiring.{u1} R (CommSemiring.toSemiring.{u1} R (CommRing.toCommSemiring.{u1} R _inst_1))) (Semiring.toNonAssocSemiring.{u2} K (Ring.toSemiring.{u2} K (CommRing.toRing.{u2} K _inst_7)))) R (fun (_x : R) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : R) => K) _x) (MulHomClass.toFunLike.{max u1 u2, u1, u2} (RingHom.{u1, u2} R K (Semiring.toNonAssocSemiring.{u1} R (CommSemiring.toSemiring.{u1} R (CommRing.toCommSemiring.{u1} R _inst_1))) (Semiring.toNonAssocSemiring.{u2} K (Ring.toSemiring.{u2} K (CommRing.toRing.{u2} K _inst_7)))) R K (NonUnitalNonAssocSemiring.toMul.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R (CommSemiring.toSemiring.{u1} R (CommRing.toCommSemiring.{u1} R _inst_1))))) (NonUnitalNonAssocSemiring.toMul.{u2} K (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} K (Semiring.toNonAssocSemiring.{u2} K (Ring.toSemiring.{u2} K (CommRing.toRing.{u2} K _inst_7))))) (NonUnitalRingHomClass.toMulHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} R K (Semiring.toNonAssocSemiring.{u1} R (CommSemiring.toSemiring.{u1} R (CommRing.toCommSemiring.{u1} R _inst_1))) (Semiring.toNonAssocSemiring.{u2} K (Ring.toSemiring.{u2} K (CommRing.toRing.{u2} K _inst_7)))) R K (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R (CommSemiring.toSemiring.{u1} R (CommRing.toCommSemiring.{u1} R _inst_1)))) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} K (Semiring.toNonAssocSemiring.{u2} K (Ring.toSemiring.{u2} K (CommRing.toRing.{u2} K _inst_7)))) (RingHomClass.toNonUnitalRingHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} R K (Semiring.toNonAssocSemiring.{u1} R (CommSemiring.toSemiring.{u1} R (CommRing.toCommSemiring.{u1} R _inst_1))) (Semiring.toNonAssocSemiring.{u2} K (Ring.toSemiring.{u2} K (CommRing.toRing.{u2} K _inst_7)))) R K (Semiring.toNonAssocSemiring.{u1} R (CommSemiring.toSemiring.{u1} R (CommRing.toCommSemiring.{u1} R _inst_1))) (Semiring.toNonAssocSemiring.{u2} K (Ring.toSemiring.{u2} K (CommRing.toRing.{u2} K _inst_7))) (RingHom.instRingHomClassRingHom.{u1, u2} R K (Semiring.toNonAssocSemiring.{u1} R (CommSemiring.toSemiring.{u1} R (CommRing.toCommSemiring.{u1} R _inst_1))) (Semiring.toNonAssocSemiring.{u2} K (Ring.toSemiring.{u2} K (CommRing.toRing.{u2} K _inst_7))))))) (algebraMap.{u1, u2} R K (CommRing.toCommSemiring.{u1} R _inst_1) (Ring.toSemiring.{u2} K (CommRing.toRing.{u2} K _inst_7)) _inst_8) x) (OfNat.ofNat.{u2} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : R) => K) x) 0 (Zero.toOfNat0.{u2} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : R) => K) x) (CommMonoidWithZero.toZero.{u2} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : R) => K) x) (CommSemiring.toCommMonoidWithZero.{u2} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : R) => K) x) (CommRing.toCommSemiring.{u2} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : R) => K) x) _inst_7)))))) (Eq.{succ u1} R x (OfNat.ofNat.{u1} R 0 (Zero.toOfNat0.{u1} R (CommMonoidWithZero.toZero.{u1} R (CommSemiring.toCommMonoidWithZero.{u1} R (CommRing.toCommSemiring.{u1} R _inst_1))))))
Case conversion may be inaccurate. Consider using '#align is_fraction_ring.to_map_eq_zero_iff IsFractionRing.to_map_eq_zero_iffₓ'. -/
theorem to_map_eq_zero_iff {x : R} : algebraMap R K x = 0 ↔ x = 0 :=
  to_map_eq_zero_iff _ (le_of_eq rfl)
#align is_fraction_ring.to_map_eq_zero_iff IsFractionRing.to_map_eq_zero_iff

variable (R K)

/- warning: is_fraction_ring.injective -> IsFractionRing.injective is a dubious translation:
lean 3 declaration is
  forall (R : Type.{u1}) [_inst_1 : CommRing.{u1} R] (K : Type.{u2}) [_inst_7 : CommRing.{u2} K] [_inst_8 : Algebra.{u1, u2} R K (CommRing.toCommSemiring.{u1} R _inst_1) (Ring.toSemiring.{u2} K (CommRing.toRing.{u2} K _inst_7))] [_inst_9 : IsFractionRing.{u1, u2} R _inst_1 K _inst_7 _inst_8], Function.Injective.{succ u1, succ u2} R K (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RingHom.{u1, u2} R K (Semiring.toNonAssocSemiring.{u1} R (CommSemiring.toSemiring.{u1} R (CommRing.toCommSemiring.{u1} R _inst_1))) (Semiring.toNonAssocSemiring.{u2} K (Ring.toSemiring.{u2} K (CommRing.toRing.{u2} K _inst_7)))) (fun (_x : RingHom.{u1, u2} R K (Semiring.toNonAssocSemiring.{u1} R (CommSemiring.toSemiring.{u1} R (CommRing.toCommSemiring.{u1} R _inst_1))) (Semiring.toNonAssocSemiring.{u2} K (Ring.toSemiring.{u2} K (CommRing.toRing.{u2} K _inst_7)))) => R -> K) (RingHom.hasCoeToFun.{u1, u2} R K (Semiring.toNonAssocSemiring.{u1} R (CommSemiring.toSemiring.{u1} R (CommRing.toCommSemiring.{u1} R _inst_1))) (Semiring.toNonAssocSemiring.{u2} K (Ring.toSemiring.{u2} K (CommRing.toRing.{u2} K _inst_7)))) (algebraMap.{u1, u2} R K (CommRing.toCommSemiring.{u1} R _inst_1) (Ring.toSemiring.{u2} K (CommRing.toRing.{u2} K _inst_7)) _inst_8))
but is expected to have type
  forall (R : Type.{u2}) [_inst_1 : CommRing.{u2} R] (K : Type.{u1}) [_inst_7 : CommRing.{u1} K] [_inst_8 : Algebra.{u2, u1} R K (CommRing.toCommSemiring.{u2} R _inst_1) (Ring.toSemiring.{u1} K (CommRing.toRing.{u1} K _inst_7))] [_inst_9 : IsFractionRing.{u2, u1} R _inst_1 K _inst_7 _inst_8], Function.Injective.{succ u2, succ u1} R K (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (RingHom.{u2, u1} R K (Semiring.toNonAssocSemiring.{u2} R (CommSemiring.toSemiring.{u2} R (CommRing.toCommSemiring.{u2} R _inst_1))) (Semiring.toNonAssocSemiring.{u1} K (Ring.toSemiring.{u1} K (CommRing.toRing.{u1} K _inst_7)))) R (fun (_x : R) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : R) => K) _x) (MulHomClass.toFunLike.{max u2 u1, u2, u1} (RingHom.{u2, u1} R K (Semiring.toNonAssocSemiring.{u2} R (CommSemiring.toSemiring.{u2} R (CommRing.toCommSemiring.{u2} R _inst_1))) (Semiring.toNonAssocSemiring.{u1} K (Ring.toSemiring.{u1} K (CommRing.toRing.{u1} K _inst_7)))) R K (NonUnitalNonAssocSemiring.toMul.{u2} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} R (Semiring.toNonAssocSemiring.{u2} R (CommSemiring.toSemiring.{u2} R (CommRing.toCommSemiring.{u2} R _inst_1))))) (NonUnitalNonAssocSemiring.toMul.{u1} K (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} K (Semiring.toNonAssocSemiring.{u1} K (Ring.toSemiring.{u1} K (CommRing.toRing.{u1} K _inst_7))))) (NonUnitalRingHomClass.toMulHomClass.{max u2 u1, u2, u1} (RingHom.{u2, u1} R K (Semiring.toNonAssocSemiring.{u2} R (CommSemiring.toSemiring.{u2} R (CommRing.toCommSemiring.{u2} R _inst_1))) (Semiring.toNonAssocSemiring.{u1} K (Ring.toSemiring.{u1} K (CommRing.toRing.{u1} K _inst_7)))) R K (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} R (Semiring.toNonAssocSemiring.{u2} R (CommSemiring.toSemiring.{u2} R (CommRing.toCommSemiring.{u2} R _inst_1)))) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} K (Semiring.toNonAssocSemiring.{u1} K (Ring.toSemiring.{u1} K (CommRing.toRing.{u1} K _inst_7)))) (RingHomClass.toNonUnitalRingHomClass.{max u2 u1, u2, u1} (RingHom.{u2, u1} R K (Semiring.toNonAssocSemiring.{u2} R (CommSemiring.toSemiring.{u2} R (CommRing.toCommSemiring.{u2} R _inst_1))) (Semiring.toNonAssocSemiring.{u1} K (Ring.toSemiring.{u1} K (CommRing.toRing.{u1} K _inst_7)))) R K (Semiring.toNonAssocSemiring.{u2} R (CommSemiring.toSemiring.{u2} R (CommRing.toCommSemiring.{u2} R _inst_1))) (Semiring.toNonAssocSemiring.{u1} K (Ring.toSemiring.{u1} K (CommRing.toRing.{u1} K _inst_7))) (RingHom.instRingHomClassRingHom.{u2, u1} R K (Semiring.toNonAssocSemiring.{u2} R (CommSemiring.toSemiring.{u2} R (CommRing.toCommSemiring.{u2} R _inst_1))) (Semiring.toNonAssocSemiring.{u1} K (Ring.toSemiring.{u1} K (CommRing.toRing.{u1} K _inst_7))))))) (algebraMap.{u2, u1} R K (CommRing.toCommSemiring.{u2} R _inst_1) (Ring.toSemiring.{u1} K (CommRing.toRing.{u1} K _inst_7)) _inst_8))
Case conversion may be inaccurate. Consider using '#align is_fraction_ring.injective IsFractionRing.injectiveₓ'. -/
protected theorem injective : Function.Injective (algebraMap R K) :=
  IsLocalization.injective _ (le_of_eq rfl)
#align is_fraction_ring.injective IsFractionRing.injective

variable {R K}

#print IsFractionRing.coe_inj /-
@[norm_cast, simp]
theorem coe_inj {a b : R} : (↑a : K) = ↑b ↔ a = b :=
  (IsFractionRing.injective R K).eq_iff
#align is_fraction_ring.coe_inj IsFractionRing.coe_inj
-/

instance (priority := 100) [NoZeroDivisors K] : NoZeroSMulDivisors R K :=
  NoZeroSMulDivisors.of_algebraMap_injective <| IsFractionRing.injective R K

variable {R K}

/- warning: is_fraction_ring.to_map_ne_zero_of_mem_non_zero_divisors -> IsFractionRing.to_map_ne_zero_of_mem_nonZeroDivisors is a dubious translation:
lean 3 declaration is
  forall {R : Type.{u1}} [_inst_1 : CommRing.{u1} R] {K : Type.{u2}} [_inst_7 : CommRing.{u2} K] [_inst_8 : Algebra.{u1, u2} R K (CommRing.toCommSemiring.{u1} R _inst_1) (Ring.toSemiring.{u2} K (CommRing.toRing.{u2} K _inst_7))] [_inst_9 : IsFractionRing.{u1, u2} R _inst_1 K _inst_7 _inst_8] [_inst_12 : Nontrivial.{u1} R] {x : R}, (Membership.Mem.{u1, u1} R (Submonoid.{u1} R (MulZeroOneClass.toMulOneClass.{u1} R (MonoidWithZero.toMulZeroOneClass.{u1} R (Semiring.toMonoidWithZero.{u1} R (Ring.toSemiring.{u1} R (CommRing.toRing.{u1} R _inst_1)))))) (SetLike.hasMem.{u1, u1} (Submonoid.{u1} R (MulZeroOneClass.toMulOneClass.{u1} R (MonoidWithZero.toMulZeroOneClass.{u1} R (Semiring.toMonoidWithZero.{u1} R (Ring.toSemiring.{u1} R (CommRing.toRing.{u1} R _inst_1)))))) R (Submonoid.setLike.{u1} R (MulZeroOneClass.toMulOneClass.{u1} R (MonoidWithZero.toMulZeroOneClass.{u1} R (Semiring.toMonoidWithZero.{u1} R (Ring.toSemiring.{u1} R (CommRing.toRing.{u1} R _inst_1))))))) x (nonZeroDivisors.{u1} R (Semiring.toMonoidWithZero.{u1} R (Ring.toSemiring.{u1} R (CommRing.toRing.{u1} R _inst_1))))) -> (Ne.{succ u2} K (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RingHom.{u1, u2} R K (Semiring.toNonAssocSemiring.{u1} R (CommSemiring.toSemiring.{u1} R (CommRing.toCommSemiring.{u1} R _inst_1))) (Semiring.toNonAssocSemiring.{u2} K (Ring.toSemiring.{u2} K (CommRing.toRing.{u2} K _inst_7)))) (fun (_x : RingHom.{u1, u2} R K (Semiring.toNonAssocSemiring.{u1} R (CommSemiring.toSemiring.{u1} R (CommRing.toCommSemiring.{u1} R _inst_1))) (Semiring.toNonAssocSemiring.{u2} K (Ring.toSemiring.{u2} K (CommRing.toRing.{u2} K _inst_7)))) => R -> K) (RingHom.hasCoeToFun.{u1, u2} R K (Semiring.toNonAssocSemiring.{u1} R (CommSemiring.toSemiring.{u1} R (CommRing.toCommSemiring.{u1} R _inst_1))) (Semiring.toNonAssocSemiring.{u2} K (Ring.toSemiring.{u2} K (CommRing.toRing.{u2} K _inst_7)))) (algebraMap.{u1, u2} R K (CommRing.toCommSemiring.{u1} R _inst_1) (Ring.toSemiring.{u2} K (CommRing.toRing.{u2} K _inst_7)) _inst_8) x) (OfNat.ofNat.{u2} K 0 (OfNat.mk.{u2} K 0 (Zero.zero.{u2} K (MulZeroClass.toHasZero.{u2} K (NonUnitalNonAssocSemiring.toMulZeroClass.{u2} K (NonUnitalNonAssocRing.toNonUnitalNonAssocSemiring.{u2} K (NonAssocRing.toNonUnitalNonAssocRing.{u2} K (Ring.toNonAssocRing.{u2} K (CommRing.toRing.{u2} K _inst_7))))))))))
but is expected to have type
  forall {R : Type.{u2}} [_inst_1 : CommRing.{u2} R] {K : Type.{u1}} [_inst_7 : CommRing.{u1} K] [_inst_8 : Algebra.{u2, u1} R K (CommRing.toCommSemiring.{u2} R _inst_1) (Ring.toSemiring.{u1} K (CommRing.toRing.{u1} K _inst_7))] [_inst_9 : IsFractionRing.{u2, u1} R _inst_1 K _inst_7 _inst_8] [_inst_12 : Nontrivial.{u2} R] {x : R}, (Membership.mem.{u2, u2} R (Submonoid.{u2} R (MulZeroOneClass.toMulOneClass.{u2} R (MonoidWithZero.toMulZeroOneClass.{u2} R (Semiring.toMonoidWithZero.{u2} R (Ring.toSemiring.{u2} R (CommRing.toRing.{u2} R _inst_1)))))) (SetLike.instMembership.{u2, u2} (Submonoid.{u2} R (MulZeroOneClass.toMulOneClass.{u2} R (MonoidWithZero.toMulZeroOneClass.{u2} R (Semiring.toMonoidWithZero.{u2} R (Ring.toSemiring.{u2} R (CommRing.toRing.{u2} R _inst_1)))))) R (Submonoid.instSetLikeSubmonoid.{u2} R (MulZeroOneClass.toMulOneClass.{u2} R (MonoidWithZero.toMulZeroOneClass.{u2} R (Semiring.toMonoidWithZero.{u2} R (Ring.toSemiring.{u2} R (CommRing.toRing.{u2} R _inst_1))))))) x (nonZeroDivisors.{u2} R (Semiring.toMonoidWithZero.{u2} R (Ring.toSemiring.{u2} R (CommRing.toRing.{u2} R _inst_1))))) -> (Ne.{succ u1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : R) => K) x) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (RingHom.{u2, u1} R K (Semiring.toNonAssocSemiring.{u2} R (CommSemiring.toSemiring.{u2} R (CommRing.toCommSemiring.{u2} R _inst_1))) (Semiring.toNonAssocSemiring.{u1} K (Ring.toSemiring.{u1} K (CommRing.toRing.{u1} K _inst_7)))) R (fun (_x : R) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : R) => K) _x) (MulHomClass.toFunLike.{max u2 u1, u2, u1} (RingHom.{u2, u1} R K (Semiring.toNonAssocSemiring.{u2} R (CommSemiring.toSemiring.{u2} R (CommRing.toCommSemiring.{u2} R _inst_1))) (Semiring.toNonAssocSemiring.{u1} K (Ring.toSemiring.{u1} K (CommRing.toRing.{u1} K _inst_7)))) R K (NonUnitalNonAssocSemiring.toMul.{u2} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} R (Semiring.toNonAssocSemiring.{u2} R (CommSemiring.toSemiring.{u2} R (CommRing.toCommSemiring.{u2} R _inst_1))))) (NonUnitalNonAssocSemiring.toMul.{u1} K (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} K (Semiring.toNonAssocSemiring.{u1} K (Ring.toSemiring.{u1} K (CommRing.toRing.{u1} K _inst_7))))) (NonUnitalRingHomClass.toMulHomClass.{max u2 u1, u2, u1} (RingHom.{u2, u1} R K (Semiring.toNonAssocSemiring.{u2} R (CommSemiring.toSemiring.{u2} R (CommRing.toCommSemiring.{u2} R _inst_1))) (Semiring.toNonAssocSemiring.{u1} K (Ring.toSemiring.{u1} K (CommRing.toRing.{u1} K _inst_7)))) R K (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} R (Semiring.toNonAssocSemiring.{u2} R (CommSemiring.toSemiring.{u2} R (CommRing.toCommSemiring.{u2} R _inst_1)))) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} K (Semiring.toNonAssocSemiring.{u1} K (Ring.toSemiring.{u1} K (CommRing.toRing.{u1} K _inst_7)))) (RingHomClass.toNonUnitalRingHomClass.{max u2 u1, u2, u1} (RingHom.{u2, u1} R K (Semiring.toNonAssocSemiring.{u2} R (CommSemiring.toSemiring.{u2} R (CommRing.toCommSemiring.{u2} R _inst_1))) (Semiring.toNonAssocSemiring.{u1} K (Ring.toSemiring.{u1} K (CommRing.toRing.{u1} K _inst_7)))) R K (Semiring.toNonAssocSemiring.{u2} R (CommSemiring.toSemiring.{u2} R (CommRing.toCommSemiring.{u2} R _inst_1))) (Semiring.toNonAssocSemiring.{u1} K (Ring.toSemiring.{u1} K (CommRing.toRing.{u1} K _inst_7))) (RingHom.instRingHomClassRingHom.{u2, u1} R K (Semiring.toNonAssocSemiring.{u2} R (CommSemiring.toSemiring.{u2} R (CommRing.toCommSemiring.{u2} R _inst_1))) (Semiring.toNonAssocSemiring.{u1} K (Ring.toSemiring.{u1} K (CommRing.toRing.{u1} K _inst_7))))))) (algebraMap.{u2, u1} R K (CommRing.toCommSemiring.{u2} R _inst_1) (Ring.toSemiring.{u1} K (CommRing.toRing.{u1} K _inst_7)) _inst_8) x) (OfNat.ofNat.{u1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : R) => K) x) 0 (Zero.toOfNat0.{u1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : R) => K) x) (CommMonoidWithZero.toZero.{u1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : R) => K) x) (CommSemiring.toCommMonoidWithZero.{u1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : R) => K) x) (CommRing.toCommSemiring.{u1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : R) => K) x) _inst_7))))))
Case conversion may be inaccurate. Consider using '#align is_fraction_ring.to_map_ne_zero_of_mem_non_zero_divisors IsFractionRing.to_map_ne_zero_of_mem_nonZeroDivisorsₓ'. -/
protected theorem to_map_ne_zero_of_mem_nonZeroDivisors [Nontrivial R] {x : R}
    (hx : x ∈ nonZeroDivisors R) : algebraMap R K x ≠ 0 :=
  IsLocalization.to_map_ne_zero_of_mem_nonZeroDivisors _ le_rfl hx
#align is_fraction_ring.to_map_ne_zero_of_mem_non_zero_divisors IsFractionRing.to_map_ne_zero_of_mem_nonZeroDivisors

variable (A)

/- warning: is_fraction_ring.is_domain -> IsFractionRing.isDomain is a dubious translation:
lean 3 declaration is
  forall (A : Type.{u1}) [_inst_5 : CommRing.{u1} A] [_inst_6 : IsDomain.{u1} A (Ring.toSemiring.{u1} A (CommRing.toRing.{u1} A _inst_5))] {K : Type.{u2}} [_inst_7 : CommRing.{u2} K] [_inst_10 : Algebra.{u1, u2} A K (CommRing.toCommSemiring.{u1} A _inst_5) (Ring.toSemiring.{u2} K (CommRing.toRing.{u2} K _inst_7))] [_inst_11 : IsFractionRing.{u1, u2} A _inst_5 K _inst_7 _inst_10], IsDomain.{u2} K (Ring.toSemiring.{u2} K (CommRing.toRing.{u2} K _inst_7))
but is expected to have type
  forall (A : Type.{u2}) [_inst_5 : CommRing.{u2} A] [_inst_6 : IsDomain.{u2} A (Ring.toSemiring.{u2} A (CommRing.toRing.{u2} A _inst_5))] {K : Type.{u1}} [_inst_7 : CommRing.{u1} K] [_inst_10 : Algebra.{u2, u1} A K (CommRing.toCommSemiring.{u2} A _inst_5) (Ring.toSemiring.{u1} K (CommRing.toRing.{u1} K _inst_7))] [_inst_11 : IsFractionRing.{u2, u1} A _inst_5 K _inst_7 _inst_10], IsDomain.{u1} K (Ring.toSemiring.{u1} K (CommRing.toRing.{u1} K _inst_7))
Case conversion may be inaccurate. Consider using '#align is_fraction_ring.is_domain IsFractionRing.isDomainₓ'. -/
/-- A `comm_ring` `K` which is the localization of an integral domain `R` at `R - {0}` is an
integral domain. -/
protected theorem isDomain : IsDomain K :=
  isDomain_of_le_nonZeroDivisors _ (le_refl (nonZeroDivisors A))
#align is_fraction_ring.is_domain IsFractionRing.isDomain

attribute [local instance] Classical.decEq

#print IsFractionRing.inv /-
/-- The inverse of an element in the field of fractions of an integral domain. -/
protected noncomputable irreducible_def inv (z : K) : K :=
  if h : z = 0 then 0
  else
    mk' K ↑(sec (nonZeroDivisors A) z).2
      ⟨(sec _ z).1,
        mem_nonZeroDivisors_iff_ne_zero.2 fun h0 =>
          h <| eq_zero_of_fst_eq_zero (sec_spec (nonZeroDivisors A) z) h0⟩
#align is_fraction_ring.inv IsFractionRing.inv
-/

/- warning: is_fraction_ring.mul_inv_cancel -> IsFractionRing.mul_inv_cancel is a dubious translation:
lean 3 declaration is
  forall (A : Type.{u1}) [_inst_5 : CommRing.{u1} A] [_inst_6 : IsDomain.{u1} A (Ring.toSemiring.{u1} A (CommRing.toRing.{u1} A _inst_5))] {K : Type.{u2}} [_inst_7 : CommRing.{u2} K] [_inst_10 : Algebra.{u1, u2} A K (CommRing.toCommSemiring.{u1} A _inst_5) (Ring.toSemiring.{u2} K (CommRing.toRing.{u2} K _inst_7))] [_inst_11 : IsFractionRing.{u1, u2} A _inst_5 K _inst_7 _inst_10] (x : K), (Ne.{succ u2} K x (OfNat.ofNat.{u2} K 0 (OfNat.mk.{u2} K 0 (Zero.zero.{u2} K (MulZeroClass.toHasZero.{u2} K (NonUnitalNonAssocSemiring.toMulZeroClass.{u2} K (NonUnitalNonAssocRing.toNonUnitalNonAssocSemiring.{u2} K (NonAssocRing.toNonUnitalNonAssocRing.{u2} K (Ring.toNonAssocRing.{u2} K (CommRing.toRing.{u2} K _inst_7)))))))))) -> (Eq.{succ u2} K (HMul.hMul.{u2, u2, u2} K K K (instHMul.{u2} K (Distrib.toHasMul.{u2} K (Ring.toDistrib.{u2} K (CommRing.toRing.{u2} K _inst_7)))) x (IsFractionRing.inv.{u1, u2} A _inst_5 _inst_6 K _inst_7 _inst_10 _inst_11 x)) (OfNat.ofNat.{u2} K 1 (OfNat.mk.{u2} K 1 (One.one.{u2} K (AddMonoidWithOne.toOne.{u2} K (AddGroupWithOne.toAddMonoidWithOne.{u2} K (AddCommGroupWithOne.toAddGroupWithOne.{u2} K (Ring.toAddCommGroupWithOne.{u2} K (CommRing.toRing.{u2} K _inst_7)))))))))
but is expected to have type
  forall (A : Type.{u1}) [_inst_5 : CommRing.{u1} A] [_inst_6 : IsDomain.{u1} A (Ring.toSemiring.{u1} A (CommRing.toRing.{u1} A _inst_5))] {K : Type.{u2}} [_inst_7 : CommRing.{u2} K] [_inst_10 : Algebra.{u1, u2} A K (CommRing.toCommSemiring.{u1} A _inst_5) (Ring.toSemiring.{u2} K (CommRing.toRing.{u2} K _inst_7))] [_inst_11 : IsFractionRing.{u1, u2} A _inst_5 K _inst_7 _inst_10] (x : K), (Ne.{succ u2} K x (OfNat.ofNat.{u2} K 0 (Zero.toOfNat0.{u2} K (CommMonoidWithZero.toZero.{u2} K (CommSemiring.toCommMonoidWithZero.{u2} K (CommRing.toCommSemiring.{u2} K _inst_7)))))) -> (Eq.{succ u2} K (HMul.hMul.{u2, u2, u2} K K K (instHMul.{u2} K (NonUnitalNonAssocRing.toMul.{u2} K (NonAssocRing.toNonUnitalNonAssocRing.{u2} K (Ring.toNonAssocRing.{u2} K (CommRing.toRing.{u2} K _inst_7))))) x (IsFractionRing.inv.{u1, u2} A _inst_5 _inst_6 K _inst_7 _inst_10 _inst_11 x)) (OfNat.ofNat.{u2} K 1 (One.toOfNat1.{u2} K (NonAssocRing.toOne.{u2} K (Ring.toNonAssocRing.{u2} K (CommRing.toRing.{u2} K _inst_7))))))
Case conversion may be inaccurate. Consider using '#align is_fraction_ring.mul_inv_cancel IsFractionRing.mul_inv_cancelₓ'. -/
protected theorem mul_inv_cancel (x : K) (hx : x ≠ 0) : x * IsFractionRing.inv A x = 1 :=
  by
  rw [IsFractionRing.inv, dif_neg hx, ←
    IsUnit.mul_left_inj
      (map_units K
        ⟨(sec _ x).1,
          mem_nonZeroDivisors_iff_ne_zero.2 fun h0 =>
            hx <| eq_zero_of_fst_eq_zero (sec_spec (nonZeroDivisors A) x) h0⟩),
    one_mul, mul_assoc]
  rw [mk'_spec, ← eq_mk'_iff_mul_eq]
  exact (mk'_sec _ x).symm
#align is_fraction_ring.mul_inv_cancel IsFractionRing.mul_inv_cancel

#print IsFractionRing.toField /-
/-- A `comm_ring` `K` which is the localization of an integral domain `R` at `R - {0}` is a field.
See note [reducible non-instances]. -/
@[reducible]
noncomputable def toField : Field K :=
  { IsFractionRing.isDomain A,
    show CommRing K by infer_instance with
    inv := IsFractionRing.inv A
    mul_inv_cancel := IsFractionRing.mul_inv_cancel A
    inv_zero := by
      change IsFractionRing.inv A (0 : K) = 0
      rw [IsFractionRing.inv]
      exact dif_pos rfl }
#align is_fraction_ring.to_field IsFractionRing.toField
-/

end CommRing

variable {B : Type _} [CommRing B] [IsDomain B] [Field K] {L : Type _} [Field L] [Algebra A K]
  [IsFractionRing A K] {g : A →+* L}

/- warning: is_fraction_ring.mk'_mk_eq_div -> IsFractionRing.mk'_mk_eq_div is a dubious translation:
lean 3 declaration is
  forall {A : Type.{u1}} [_inst_5 : CommRing.{u1} A] [_inst_6 : IsDomain.{u1} A (Ring.toSemiring.{u1} A (CommRing.toRing.{u1} A _inst_5))] {K : Type.{u2}} [_inst_9 : Field.{u2} K] [_inst_11 : Algebra.{u1, u2} A K (CommRing.toCommSemiring.{u1} A _inst_5) (Ring.toSemiring.{u2} K (DivisionRing.toRing.{u2} K (Field.toDivisionRing.{u2} K _inst_9)))] [_inst_12 : IsFractionRing.{u1, u2} A _inst_5 K (Field.toCommRing.{u2} K _inst_9) _inst_11] {r : A} {s : A} (hs : Membership.Mem.{u1, u1} A (Submonoid.{u1} A (MulZeroOneClass.toMulOneClass.{u1} A (MonoidWithZero.toMulZeroOneClass.{u1} A (Semiring.toMonoidWithZero.{u1} A (Ring.toSemiring.{u1} A (CommRing.toRing.{u1} A _inst_5)))))) (SetLike.hasMem.{u1, u1} (Submonoid.{u1} A (MulZeroOneClass.toMulOneClass.{u1} A (MonoidWithZero.toMulZeroOneClass.{u1} A (Semiring.toMonoidWithZero.{u1} A (Ring.toSemiring.{u1} A (CommRing.toRing.{u1} A _inst_5)))))) A (Submonoid.setLike.{u1} A (MulZeroOneClass.toMulOneClass.{u1} A (MonoidWithZero.toMulZeroOneClass.{u1} A (Semiring.toMonoidWithZero.{u1} A (Ring.toSemiring.{u1} A (CommRing.toRing.{u1} A _inst_5))))))) s (nonZeroDivisors.{u1} A (Semiring.toMonoidWithZero.{u1} A (Ring.toSemiring.{u1} A (CommRing.toRing.{u1} A _inst_5))))), Eq.{succ u2} K (IsLocalization.mk'.{u1, u2} A (CommRing.toCommSemiring.{u1} A _inst_5) (nonZeroDivisors.{u1} A (Semiring.toMonoidWithZero.{u1} A (Ring.toSemiring.{u1} A (CommRing.toRing.{u1} A _inst_5)))) K (Semifield.toCommSemiring.{u2} K (Field.toSemifield.{u2} K _inst_9)) _inst_11 _inst_12 r (Subtype.mk.{succ u1} A (fun (x : A) => Membership.Mem.{u1, u1} A (Submonoid.{u1} A (MulZeroOneClass.toMulOneClass.{u1} A (NonAssocSemiring.toMulZeroOneClass.{u1} A (Semiring.toNonAssocSemiring.{u1} A (CommSemiring.toSemiring.{u1} A (CommRing.toCommSemiring.{u1} A _inst_5)))))) (SetLike.hasMem.{u1, u1} (Submonoid.{u1} A (MulZeroOneClass.toMulOneClass.{u1} A (NonAssocSemiring.toMulZeroOneClass.{u1} A (Semiring.toNonAssocSemiring.{u1} A (CommSemiring.toSemiring.{u1} A (CommRing.toCommSemiring.{u1} A _inst_5)))))) A (Submonoid.setLike.{u1} A (MulZeroOneClass.toMulOneClass.{u1} A (NonAssocSemiring.toMulZeroOneClass.{u1} A (Semiring.toNonAssocSemiring.{u1} A (CommSemiring.toSemiring.{u1} A (CommRing.toCommSemiring.{u1} A _inst_5))))))) x (nonZeroDivisors.{u1} A (Semiring.toMonoidWithZero.{u1} A (Ring.toSemiring.{u1} A (CommRing.toRing.{u1} A _inst_5))))) s hs)) (HDiv.hDiv.{u2, u2, u2} K K K (instHDiv.{u2} K (DivInvMonoid.toHasDiv.{u2} K (DivisionRing.toDivInvMonoid.{u2} K (Field.toDivisionRing.{u2} K _inst_9)))) (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RingHom.{u1, u2} A K (Semiring.toNonAssocSemiring.{u1} A (CommSemiring.toSemiring.{u1} A (CommRing.toCommSemiring.{u1} A _inst_5))) (Semiring.toNonAssocSemiring.{u2} K (Ring.toSemiring.{u2} K (DivisionRing.toRing.{u2} K (Field.toDivisionRing.{u2} K _inst_9))))) (fun (_x : RingHom.{u1, u2} A K (Semiring.toNonAssocSemiring.{u1} A (CommSemiring.toSemiring.{u1} A (CommRing.toCommSemiring.{u1} A _inst_5))) (Semiring.toNonAssocSemiring.{u2} K (Ring.toSemiring.{u2} K (DivisionRing.toRing.{u2} K (Field.toDivisionRing.{u2} K _inst_9))))) => A -> K) (RingHom.hasCoeToFun.{u1, u2} A K (Semiring.toNonAssocSemiring.{u1} A (CommSemiring.toSemiring.{u1} A (CommRing.toCommSemiring.{u1} A _inst_5))) (Semiring.toNonAssocSemiring.{u2} K (Ring.toSemiring.{u2} K (DivisionRing.toRing.{u2} K (Field.toDivisionRing.{u2} K _inst_9))))) (algebraMap.{u1, u2} A K (CommRing.toCommSemiring.{u1} A _inst_5) (Ring.toSemiring.{u2} K (DivisionRing.toRing.{u2} K (Field.toDivisionRing.{u2} K _inst_9))) _inst_11) r) (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RingHom.{u1, u2} A K (Semiring.toNonAssocSemiring.{u1} A (CommSemiring.toSemiring.{u1} A (CommRing.toCommSemiring.{u1} A _inst_5))) (Semiring.toNonAssocSemiring.{u2} K (Ring.toSemiring.{u2} K (DivisionRing.toRing.{u2} K (Field.toDivisionRing.{u2} K _inst_9))))) (fun (_x : RingHom.{u1, u2} A K (Semiring.toNonAssocSemiring.{u1} A (CommSemiring.toSemiring.{u1} A (CommRing.toCommSemiring.{u1} A _inst_5))) (Semiring.toNonAssocSemiring.{u2} K (Ring.toSemiring.{u2} K (DivisionRing.toRing.{u2} K (Field.toDivisionRing.{u2} K _inst_9))))) => A -> K) (RingHom.hasCoeToFun.{u1, u2} A K (Semiring.toNonAssocSemiring.{u1} A (CommSemiring.toSemiring.{u1} A (CommRing.toCommSemiring.{u1} A _inst_5))) (Semiring.toNonAssocSemiring.{u2} K (Ring.toSemiring.{u2} K (DivisionRing.toRing.{u2} K (Field.toDivisionRing.{u2} K _inst_9))))) (algebraMap.{u1, u2} A K (CommRing.toCommSemiring.{u1} A _inst_5) (Ring.toSemiring.{u2} K (DivisionRing.toRing.{u2} K (Field.toDivisionRing.{u2} K _inst_9))) _inst_11) s))
but is expected to have type
  forall {A : Type.{u2}} [_inst_5 : CommRing.{u2} A] [_inst_6 : IsDomain.{u2} A (Ring.toSemiring.{u2} A (CommRing.toRing.{u2} A _inst_5))] {K : Type.{u1}} [_inst_9 : Field.{u1} K] [_inst_11 : Algebra.{u2, u1} A K (CommRing.toCommSemiring.{u2} A _inst_5) (DivisionSemiring.toSemiring.{u1} K (Semifield.toDivisionSemiring.{u1} K (Field.toSemifield.{u1} K _inst_9)))] [_inst_12 : IsFractionRing.{u2, u1} A _inst_5 K (Field.toCommRing.{u1} K _inst_9) _inst_11] {r : A} {s : A} (hs : Membership.mem.{u2, u2} A (Submonoid.{u2} A (MulZeroOneClass.toMulOneClass.{u2} A (MonoidWithZero.toMulZeroOneClass.{u2} A (Semiring.toMonoidWithZero.{u2} A (Ring.toSemiring.{u2} A (CommRing.toRing.{u2} A _inst_5)))))) (SetLike.instMembership.{u2, u2} (Submonoid.{u2} A (MulZeroOneClass.toMulOneClass.{u2} A (MonoidWithZero.toMulZeroOneClass.{u2} A (Semiring.toMonoidWithZero.{u2} A (Ring.toSemiring.{u2} A (CommRing.toRing.{u2} A _inst_5)))))) A (Submonoid.instSetLikeSubmonoid.{u2} A (MulZeroOneClass.toMulOneClass.{u2} A (MonoidWithZero.toMulZeroOneClass.{u2} A (Semiring.toMonoidWithZero.{u2} A (Ring.toSemiring.{u2} A (CommRing.toRing.{u2} A _inst_5))))))) s (nonZeroDivisors.{u2} A (Semiring.toMonoidWithZero.{u2} A (Ring.toSemiring.{u2} A (CommRing.toRing.{u2} A _inst_5))))), Eq.{succ u1} K (IsLocalization.mk'.{u2, u1} A (CommRing.toCommSemiring.{u2} A _inst_5) (nonZeroDivisors.{u2} A (Semiring.toMonoidWithZero.{u2} A (Ring.toSemiring.{u2} A (CommRing.toRing.{u2} A _inst_5)))) K (Semifield.toCommSemiring.{u1} K (Field.toSemifield.{u1} K _inst_9)) _inst_11 _inst_12 r (Subtype.mk.{succ u2} A (fun (x : A) => Membership.mem.{u2, u2} A (Submonoid.{u2} A (MulZeroOneClass.toMulOneClass.{u2} A (NonAssocSemiring.toMulZeroOneClass.{u2} A (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A (CommRing.toCommSemiring.{u2} A _inst_5)))))) (SetLike.instMembership.{u2, u2} (Submonoid.{u2} A (MulZeroOneClass.toMulOneClass.{u2} A (NonAssocSemiring.toMulZeroOneClass.{u2} A (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A (CommRing.toCommSemiring.{u2} A _inst_5)))))) A (Submonoid.instSetLikeSubmonoid.{u2} A (MulZeroOneClass.toMulOneClass.{u2} A (NonAssocSemiring.toMulZeroOneClass.{u2} A (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A (CommRing.toCommSemiring.{u2} A _inst_5))))))) x (nonZeroDivisors.{u2} A (Semiring.toMonoidWithZero.{u2} A (Ring.toSemiring.{u2} A (CommRing.toRing.{u2} A _inst_5))))) s hs)) (HDiv.hDiv.{u1, u1, u1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : A) => K) r) ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : A) => K) s) ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : A) => K) r) (instHDiv.{u1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : A) => K) r) (Field.toDiv.{u1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : A) => K) r) _inst_9)) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (RingHom.{u2, u1} A K (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A (CommRing.toCommSemiring.{u2} A _inst_5))) (Semiring.toNonAssocSemiring.{u1} K (DivisionSemiring.toSemiring.{u1} K (Semifield.toDivisionSemiring.{u1} K (Field.toSemifield.{u1} K _inst_9))))) A (fun (_x : A) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : A) => K) _x) (MulHomClass.toFunLike.{max u2 u1, u2, u1} (RingHom.{u2, u1} A K (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A (CommRing.toCommSemiring.{u2} A _inst_5))) (Semiring.toNonAssocSemiring.{u1} K (DivisionSemiring.toSemiring.{u1} K (Semifield.toDivisionSemiring.{u1} K (Field.toSemifield.{u1} K _inst_9))))) A K (NonUnitalNonAssocSemiring.toMul.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A (CommRing.toCommSemiring.{u2} A _inst_5))))) (NonUnitalNonAssocSemiring.toMul.{u1} K (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} K (Semiring.toNonAssocSemiring.{u1} K (DivisionSemiring.toSemiring.{u1} K (Semifield.toDivisionSemiring.{u1} K (Field.toSemifield.{u1} K _inst_9)))))) (NonUnitalRingHomClass.toMulHomClass.{max u2 u1, u2, u1} (RingHom.{u2, u1} A K (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A (CommRing.toCommSemiring.{u2} A _inst_5))) (Semiring.toNonAssocSemiring.{u1} K (DivisionSemiring.toSemiring.{u1} K (Semifield.toDivisionSemiring.{u1} K (Field.toSemifield.{u1} K _inst_9))))) A K (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A (CommRing.toCommSemiring.{u2} A _inst_5)))) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} K (Semiring.toNonAssocSemiring.{u1} K (DivisionSemiring.toSemiring.{u1} K (Semifield.toDivisionSemiring.{u1} K (Field.toSemifield.{u1} K _inst_9))))) (RingHomClass.toNonUnitalRingHomClass.{max u2 u1, u2, u1} (RingHom.{u2, u1} A K (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A (CommRing.toCommSemiring.{u2} A _inst_5))) (Semiring.toNonAssocSemiring.{u1} K (DivisionSemiring.toSemiring.{u1} K (Semifield.toDivisionSemiring.{u1} K (Field.toSemifield.{u1} K _inst_9))))) A K (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A (CommRing.toCommSemiring.{u2} A _inst_5))) (Semiring.toNonAssocSemiring.{u1} K (DivisionSemiring.toSemiring.{u1} K (Semifield.toDivisionSemiring.{u1} K (Field.toSemifield.{u1} K _inst_9)))) (RingHom.instRingHomClassRingHom.{u2, u1} A K (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A (CommRing.toCommSemiring.{u2} A _inst_5))) (Semiring.toNonAssocSemiring.{u1} K (DivisionSemiring.toSemiring.{u1} K (Semifield.toDivisionSemiring.{u1} K (Field.toSemifield.{u1} K _inst_9)))))))) (algebraMap.{u2, u1} A K (CommRing.toCommSemiring.{u2} A _inst_5) (DivisionSemiring.toSemiring.{u1} K (Semifield.toDivisionSemiring.{u1} K (Field.toSemifield.{u1} K _inst_9))) _inst_11) r) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (RingHom.{u2, u1} A K (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A (CommRing.toCommSemiring.{u2} A _inst_5))) (Semiring.toNonAssocSemiring.{u1} K (DivisionSemiring.toSemiring.{u1} K (Semifield.toDivisionSemiring.{u1} K (Field.toSemifield.{u1} K _inst_9))))) A (fun (_x : A) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : A) => K) _x) (MulHomClass.toFunLike.{max u2 u1, u2, u1} (RingHom.{u2, u1} A K (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A (CommRing.toCommSemiring.{u2} A _inst_5))) (Semiring.toNonAssocSemiring.{u1} K (DivisionSemiring.toSemiring.{u1} K (Semifield.toDivisionSemiring.{u1} K (Field.toSemifield.{u1} K _inst_9))))) A K (NonUnitalNonAssocSemiring.toMul.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A (CommRing.toCommSemiring.{u2} A _inst_5))))) (NonUnitalNonAssocSemiring.toMul.{u1} K (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} K (Semiring.toNonAssocSemiring.{u1} K (DivisionSemiring.toSemiring.{u1} K (Semifield.toDivisionSemiring.{u1} K (Field.toSemifield.{u1} K _inst_9)))))) (NonUnitalRingHomClass.toMulHomClass.{max u2 u1, u2, u1} (RingHom.{u2, u1} A K (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A (CommRing.toCommSemiring.{u2} A _inst_5))) (Semiring.toNonAssocSemiring.{u1} K (DivisionSemiring.toSemiring.{u1} K (Semifield.toDivisionSemiring.{u1} K (Field.toSemifield.{u1} K _inst_9))))) A K (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A (CommRing.toCommSemiring.{u2} A _inst_5)))) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} K (Semiring.toNonAssocSemiring.{u1} K (DivisionSemiring.toSemiring.{u1} K (Semifield.toDivisionSemiring.{u1} K (Field.toSemifield.{u1} K _inst_9))))) (RingHomClass.toNonUnitalRingHomClass.{max u2 u1, u2, u1} (RingHom.{u2, u1} A K (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A (CommRing.toCommSemiring.{u2} A _inst_5))) (Semiring.toNonAssocSemiring.{u1} K (DivisionSemiring.toSemiring.{u1} K (Semifield.toDivisionSemiring.{u1} K (Field.toSemifield.{u1} K _inst_9))))) A K (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A (CommRing.toCommSemiring.{u2} A _inst_5))) (Semiring.toNonAssocSemiring.{u1} K (DivisionSemiring.toSemiring.{u1} K (Semifield.toDivisionSemiring.{u1} K (Field.toSemifield.{u1} K _inst_9)))) (RingHom.instRingHomClassRingHom.{u2, u1} A K (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A (CommRing.toCommSemiring.{u2} A _inst_5))) (Semiring.toNonAssocSemiring.{u1} K (DivisionSemiring.toSemiring.{u1} K (Semifield.toDivisionSemiring.{u1} K (Field.toSemifield.{u1} K _inst_9)))))))) (algebraMap.{u2, u1} A K (CommRing.toCommSemiring.{u2} A _inst_5) (DivisionSemiring.toSemiring.{u1} K (Semifield.toDivisionSemiring.{u1} K (Field.toSemifield.{u1} K _inst_9))) _inst_11) s))
Case conversion may be inaccurate. Consider using '#align is_fraction_ring.mk'_mk_eq_div IsFractionRing.mk'_mk_eq_divₓ'. -/
theorem mk'_mk_eq_div {r s} (hs : s ∈ nonZeroDivisors A) :
    mk' K r ⟨s, hs⟩ = algebraMap A K r / algebraMap A K s :=
  mk'_eq_iff_eq_mul.2 <|
    (div_mul_cancel (algebraMap A K r)
        (IsFractionRing.to_map_ne_zero_of_mem_nonZeroDivisors hs)).symm
#align is_fraction_ring.mk'_mk_eq_div IsFractionRing.mk'_mk_eq_div

/- warning: is_fraction_ring.mk'_eq_div -> IsFractionRing.mk'_eq_div is a dubious translation:
lean 3 declaration is
  forall {A : Type.{u1}} [_inst_5 : CommRing.{u1} A] [_inst_6 : IsDomain.{u1} A (Ring.toSemiring.{u1} A (CommRing.toRing.{u1} A _inst_5))] {K : Type.{u2}} [_inst_9 : Field.{u2} K] [_inst_11 : Algebra.{u1, u2} A K (CommRing.toCommSemiring.{u1} A _inst_5) (Ring.toSemiring.{u2} K (DivisionRing.toRing.{u2} K (Field.toDivisionRing.{u2} K _inst_9)))] [_inst_12 : IsFractionRing.{u1, u2} A _inst_5 K (Field.toCommRing.{u2} K _inst_9) _inst_11] {r : A} (s : coeSort.{succ u1, succ (succ u1)} (Submonoid.{u1} A (MulZeroOneClass.toMulOneClass.{u1} A (MonoidWithZero.toMulZeroOneClass.{u1} A (Semiring.toMonoidWithZero.{u1} A (Ring.toSemiring.{u1} A (CommRing.toRing.{u1} A _inst_5)))))) Type.{u1} (SetLike.hasCoeToSort.{u1, u1} (Submonoid.{u1} A (MulZeroOneClass.toMulOneClass.{u1} A (MonoidWithZero.toMulZeroOneClass.{u1} A (Semiring.toMonoidWithZero.{u1} A (Ring.toSemiring.{u1} A (CommRing.toRing.{u1} A _inst_5)))))) A (Submonoid.setLike.{u1} A (MulZeroOneClass.toMulOneClass.{u1} A (MonoidWithZero.toMulZeroOneClass.{u1} A (Semiring.toMonoidWithZero.{u1} A (Ring.toSemiring.{u1} A (CommRing.toRing.{u1} A _inst_5))))))) (nonZeroDivisors.{u1} A (Semiring.toMonoidWithZero.{u1} A (Ring.toSemiring.{u1} A (CommRing.toRing.{u1} A _inst_5))))), Eq.{succ u2} K (IsLocalization.mk'.{u1, u2} A (CommRing.toCommSemiring.{u1} A _inst_5) (nonZeroDivisors.{u1} A (Semiring.toMonoidWithZero.{u1} A (Ring.toSemiring.{u1} A (CommRing.toRing.{u1} A _inst_5)))) K (Semifield.toCommSemiring.{u2} K (Field.toSemifield.{u2} K _inst_9)) _inst_11 _inst_12 r s) (HDiv.hDiv.{u2, u2, u2} K K K (instHDiv.{u2} K (DivInvMonoid.toHasDiv.{u2} K (DivisionRing.toDivInvMonoid.{u2} K (Field.toDivisionRing.{u2} K _inst_9)))) (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RingHom.{u1, u2} A K (Semiring.toNonAssocSemiring.{u1} A (CommSemiring.toSemiring.{u1} A (CommRing.toCommSemiring.{u1} A _inst_5))) (Semiring.toNonAssocSemiring.{u2} K (Ring.toSemiring.{u2} K (DivisionRing.toRing.{u2} K (Field.toDivisionRing.{u2} K _inst_9))))) (fun (_x : RingHom.{u1, u2} A K (Semiring.toNonAssocSemiring.{u1} A (CommSemiring.toSemiring.{u1} A (CommRing.toCommSemiring.{u1} A _inst_5))) (Semiring.toNonAssocSemiring.{u2} K (Ring.toSemiring.{u2} K (DivisionRing.toRing.{u2} K (Field.toDivisionRing.{u2} K _inst_9))))) => A -> K) (RingHom.hasCoeToFun.{u1, u2} A K (Semiring.toNonAssocSemiring.{u1} A (CommSemiring.toSemiring.{u1} A (CommRing.toCommSemiring.{u1} A _inst_5))) (Semiring.toNonAssocSemiring.{u2} K (Ring.toSemiring.{u2} K (DivisionRing.toRing.{u2} K (Field.toDivisionRing.{u2} K _inst_9))))) (algebraMap.{u1, u2} A K (CommRing.toCommSemiring.{u1} A _inst_5) (Ring.toSemiring.{u2} K (DivisionRing.toRing.{u2} K (Field.toDivisionRing.{u2} K _inst_9))) _inst_11) r) (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RingHom.{u1, u2} A K (Semiring.toNonAssocSemiring.{u1} A (CommSemiring.toSemiring.{u1} A (CommRing.toCommSemiring.{u1} A _inst_5))) (Semiring.toNonAssocSemiring.{u2} K (Ring.toSemiring.{u2} K (DivisionRing.toRing.{u2} K (Field.toDivisionRing.{u2} K _inst_9))))) (fun (_x : RingHom.{u1, u2} A K (Semiring.toNonAssocSemiring.{u1} A (CommSemiring.toSemiring.{u1} A (CommRing.toCommSemiring.{u1} A _inst_5))) (Semiring.toNonAssocSemiring.{u2} K (Ring.toSemiring.{u2} K (DivisionRing.toRing.{u2} K (Field.toDivisionRing.{u2} K _inst_9))))) => A -> K) (RingHom.hasCoeToFun.{u1, u2} A K (Semiring.toNonAssocSemiring.{u1} A (CommSemiring.toSemiring.{u1} A (CommRing.toCommSemiring.{u1} A _inst_5))) (Semiring.toNonAssocSemiring.{u2} K (Ring.toSemiring.{u2} K (DivisionRing.toRing.{u2} K (Field.toDivisionRing.{u2} K _inst_9))))) (algebraMap.{u1, u2} A K (CommRing.toCommSemiring.{u1} A _inst_5) (Ring.toSemiring.{u2} K (DivisionRing.toRing.{u2} K (Field.toDivisionRing.{u2} K _inst_9))) _inst_11) ((fun (a : Type.{u1}) (b : Type.{u1}) [self : HasLiftT.{succ u1, succ u1} a b] => self.0) (coeSort.{succ u1, succ (succ u1)} (Submonoid.{u1} A (MulZeroOneClass.toMulOneClass.{u1} A (MonoidWithZero.toMulZeroOneClass.{u1} A (Semiring.toMonoidWithZero.{u1} A (Ring.toSemiring.{u1} A (CommRing.toRing.{u1} A _inst_5)))))) Type.{u1} (SetLike.hasCoeToSort.{u1, u1} (Submonoid.{u1} A (MulZeroOneClass.toMulOneClass.{u1} A (MonoidWithZero.toMulZeroOneClass.{u1} A (Semiring.toMonoidWithZero.{u1} A (Ring.toSemiring.{u1} A (CommRing.toRing.{u1} A _inst_5)))))) A (Submonoid.setLike.{u1} A (MulZeroOneClass.toMulOneClass.{u1} A (MonoidWithZero.toMulZeroOneClass.{u1} A (Semiring.toMonoidWithZero.{u1} A (Ring.toSemiring.{u1} A (CommRing.toRing.{u1} A _inst_5))))))) (nonZeroDivisors.{u1} A (Semiring.toMonoidWithZero.{u1} A (Ring.toSemiring.{u1} A (CommRing.toRing.{u1} A _inst_5))))) A (HasLiftT.mk.{succ u1, succ u1} (coeSort.{succ u1, succ (succ u1)} (Submonoid.{u1} A (MulZeroOneClass.toMulOneClass.{u1} A (MonoidWithZero.toMulZeroOneClass.{u1} A (Semiring.toMonoidWithZero.{u1} A (Ring.toSemiring.{u1} A (CommRing.toRing.{u1} A _inst_5)))))) Type.{u1} (SetLike.hasCoeToSort.{u1, u1} (Submonoid.{u1} A (MulZeroOneClass.toMulOneClass.{u1} A (MonoidWithZero.toMulZeroOneClass.{u1} A (Semiring.toMonoidWithZero.{u1} A (Ring.toSemiring.{u1} A (CommRing.toRing.{u1} A _inst_5)))))) A (Submonoid.setLike.{u1} A (MulZeroOneClass.toMulOneClass.{u1} A (MonoidWithZero.toMulZeroOneClass.{u1} A (Semiring.toMonoidWithZero.{u1} A (Ring.toSemiring.{u1} A (CommRing.toRing.{u1} A _inst_5))))))) (nonZeroDivisors.{u1} A (Semiring.toMonoidWithZero.{u1} A (Ring.toSemiring.{u1} A (CommRing.toRing.{u1} A _inst_5))))) A (CoeTCₓ.coe.{succ u1, succ u1} (coeSort.{succ u1, succ (succ u1)} (Submonoid.{u1} A (MulZeroOneClass.toMulOneClass.{u1} A (MonoidWithZero.toMulZeroOneClass.{u1} A (Semiring.toMonoidWithZero.{u1} A (Ring.toSemiring.{u1} A (CommRing.toRing.{u1} A _inst_5)))))) Type.{u1} (SetLike.hasCoeToSort.{u1, u1} (Submonoid.{u1} A (MulZeroOneClass.toMulOneClass.{u1} A (MonoidWithZero.toMulZeroOneClass.{u1} A (Semiring.toMonoidWithZero.{u1} A (Ring.toSemiring.{u1} A (CommRing.toRing.{u1} A _inst_5)))))) A (Submonoid.setLike.{u1} A (MulZeroOneClass.toMulOneClass.{u1} A (MonoidWithZero.toMulZeroOneClass.{u1} A (Semiring.toMonoidWithZero.{u1} A (Ring.toSemiring.{u1} A (CommRing.toRing.{u1} A _inst_5))))))) (nonZeroDivisors.{u1} A (Semiring.toMonoidWithZero.{u1} A (Ring.toSemiring.{u1} A (CommRing.toRing.{u1} A _inst_5))))) A (coeBase.{succ u1, succ u1} (coeSort.{succ u1, succ (succ u1)} (Submonoid.{u1} A (MulZeroOneClass.toMulOneClass.{u1} A (MonoidWithZero.toMulZeroOneClass.{u1} A (Semiring.toMonoidWithZero.{u1} A (Ring.toSemiring.{u1} A (CommRing.toRing.{u1} A _inst_5)))))) Type.{u1} (SetLike.hasCoeToSort.{u1, u1} (Submonoid.{u1} A (MulZeroOneClass.toMulOneClass.{u1} A (MonoidWithZero.toMulZeroOneClass.{u1} A (Semiring.toMonoidWithZero.{u1} A (Ring.toSemiring.{u1} A (CommRing.toRing.{u1} A _inst_5)))))) A (Submonoid.setLike.{u1} A (MulZeroOneClass.toMulOneClass.{u1} A (MonoidWithZero.toMulZeroOneClass.{u1} A (Semiring.toMonoidWithZero.{u1} A (Ring.toSemiring.{u1} A (CommRing.toRing.{u1} A _inst_5))))))) (nonZeroDivisors.{u1} A (Semiring.toMonoidWithZero.{u1} A (Ring.toSemiring.{u1} A (CommRing.toRing.{u1} A _inst_5))))) A (coeSubtype.{succ u1} A (fun (x : A) => Membership.Mem.{u1, u1} A (Submonoid.{u1} A (MulZeroOneClass.toMulOneClass.{u1} A (MonoidWithZero.toMulZeroOneClass.{u1} A (Semiring.toMonoidWithZero.{u1} A (Ring.toSemiring.{u1} A (CommRing.toRing.{u1} A _inst_5)))))) (SetLike.hasMem.{u1, u1} (Submonoid.{u1} A (MulZeroOneClass.toMulOneClass.{u1} A (MonoidWithZero.toMulZeroOneClass.{u1} A (Semiring.toMonoidWithZero.{u1} A (Ring.toSemiring.{u1} A (CommRing.toRing.{u1} A _inst_5)))))) A (Submonoid.setLike.{u1} A (MulZeroOneClass.toMulOneClass.{u1} A (MonoidWithZero.toMulZeroOneClass.{u1} A (Semiring.toMonoidWithZero.{u1} A (Ring.toSemiring.{u1} A (CommRing.toRing.{u1} A _inst_5))))))) x (nonZeroDivisors.{u1} A (Semiring.toMonoidWithZero.{u1} A (Ring.toSemiring.{u1} A (CommRing.toRing.{u1} A _inst_5))))))))) s)))
but is expected to have type
  forall {A : Type.{u2}} [_inst_5 : CommRing.{u2} A] [_inst_6 : IsDomain.{u2} A (Ring.toSemiring.{u2} A (CommRing.toRing.{u2} A _inst_5))] {K : Type.{u1}} [_inst_9 : Field.{u1} K] [_inst_11 : Algebra.{u2, u1} A K (CommRing.toCommSemiring.{u2} A _inst_5) (DivisionSemiring.toSemiring.{u1} K (Semifield.toDivisionSemiring.{u1} K (Field.toSemifield.{u1} K _inst_9)))] [_inst_12 : IsFractionRing.{u2, u1} A _inst_5 K (Field.toCommRing.{u1} K _inst_9) _inst_11] {r : A} (s : Subtype.{succ u2} A (fun (x : A) => Membership.mem.{u2, u2} A (Submonoid.{u2} A (MulZeroOneClass.toMulOneClass.{u2} A (MonoidWithZero.toMulZeroOneClass.{u2} A (Semiring.toMonoidWithZero.{u2} A (Ring.toSemiring.{u2} A (CommRing.toRing.{u2} A _inst_5)))))) (SetLike.instMembership.{u2, u2} (Submonoid.{u2} A (MulZeroOneClass.toMulOneClass.{u2} A (MonoidWithZero.toMulZeroOneClass.{u2} A (Semiring.toMonoidWithZero.{u2} A (Ring.toSemiring.{u2} A (CommRing.toRing.{u2} A _inst_5)))))) A (Submonoid.instSetLikeSubmonoid.{u2} A (MulZeroOneClass.toMulOneClass.{u2} A (MonoidWithZero.toMulZeroOneClass.{u2} A (Semiring.toMonoidWithZero.{u2} A (Ring.toSemiring.{u2} A (CommRing.toRing.{u2} A _inst_5))))))) x (nonZeroDivisors.{u2} A (Semiring.toMonoidWithZero.{u2} A (Ring.toSemiring.{u2} A (CommRing.toRing.{u2} A _inst_5)))))), Eq.{succ u1} K (IsLocalization.mk'.{u2, u1} A (CommRing.toCommSemiring.{u2} A _inst_5) (nonZeroDivisors.{u2} A (Semiring.toMonoidWithZero.{u2} A (Ring.toSemiring.{u2} A (CommRing.toRing.{u2} A _inst_5)))) K (Semifield.toCommSemiring.{u1} K (Field.toSemifield.{u1} K _inst_9)) _inst_11 _inst_12 r s) (HDiv.hDiv.{u1, u1, u1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : A) => K) r) ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : A) => K) (Subtype.val.{succ u2} A (fun (x : A) => Membership.mem.{u2, u2} A (Set.{u2} A) (Set.instMembershipSet.{u2} A) x (SetLike.coe.{u2, u2} (Submonoid.{u2} A (MulZeroOneClass.toMulOneClass.{u2} A (MonoidWithZero.toMulZeroOneClass.{u2} A (Semiring.toMonoidWithZero.{u2} A (Ring.toSemiring.{u2} A (CommRing.toRing.{u2} A _inst_5)))))) A (Submonoid.instSetLikeSubmonoid.{u2} A (MulZeroOneClass.toMulOneClass.{u2} A (MonoidWithZero.toMulZeroOneClass.{u2} A (Semiring.toMonoidWithZero.{u2} A (Ring.toSemiring.{u2} A (CommRing.toRing.{u2} A _inst_5)))))) (nonZeroDivisors.{u2} A (Semiring.toMonoidWithZero.{u2} A (Ring.toSemiring.{u2} A (CommRing.toRing.{u2} A _inst_5)))))) s)) ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : A) => K) r) (instHDiv.{u1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : A) => K) r) (Field.toDiv.{u1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : A) => K) r) _inst_9)) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (RingHom.{u2, u1} A K (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A (CommRing.toCommSemiring.{u2} A _inst_5))) (Semiring.toNonAssocSemiring.{u1} K (DivisionSemiring.toSemiring.{u1} K (Semifield.toDivisionSemiring.{u1} K (Field.toSemifield.{u1} K _inst_9))))) A (fun (_x : A) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : A) => K) _x) (MulHomClass.toFunLike.{max u2 u1, u2, u1} (RingHom.{u2, u1} A K (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A (CommRing.toCommSemiring.{u2} A _inst_5))) (Semiring.toNonAssocSemiring.{u1} K (DivisionSemiring.toSemiring.{u1} K (Semifield.toDivisionSemiring.{u1} K (Field.toSemifield.{u1} K _inst_9))))) A K (NonUnitalNonAssocSemiring.toMul.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A (CommRing.toCommSemiring.{u2} A _inst_5))))) (NonUnitalNonAssocSemiring.toMul.{u1} K (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} K (Semiring.toNonAssocSemiring.{u1} K (DivisionSemiring.toSemiring.{u1} K (Semifield.toDivisionSemiring.{u1} K (Field.toSemifield.{u1} K _inst_9)))))) (NonUnitalRingHomClass.toMulHomClass.{max u2 u1, u2, u1} (RingHom.{u2, u1} A K (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A (CommRing.toCommSemiring.{u2} A _inst_5))) (Semiring.toNonAssocSemiring.{u1} K (DivisionSemiring.toSemiring.{u1} K (Semifield.toDivisionSemiring.{u1} K (Field.toSemifield.{u1} K _inst_9))))) A K (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A (CommRing.toCommSemiring.{u2} A _inst_5)))) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} K (Semiring.toNonAssocSemiring.{u1} K (DivisionSemiring.toSemiring.{u1} K (Semifield.toDivisionSemiring.{u1} K (Field.toSemifield.{u1} K _inst_9))))) (RingHomClass.toNonUnitalRingHomClass.{max u2 u1, u2, u1} (RingHom.{u2, u1} A K (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A (CommRing.toCommSemiring.{u2} A _inst_5))) (Semiring.toNonAssocSemiring.{u1} K (DivisionSemiring.toSemiring.{u1} K (Semifield.toDivisionSemiring.{u1} K (Field.toSemifield.{u1} K _inst_9))))) A K (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A (CommRing.toCommSemiring.{u2} A _inst_5))) (Semiring.toNonAssocSemiring.{u1} K (DivisionSemiring.toSemiring.{u1} K (Semifield.toDivisionSemiring.{u1} K (Field.toSemifield.{u1} K _inst_9)))) (RingHom.instRingHomClassRingHom.{u2, u1} A K (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A (CommRing.toCommSemiring.{u2} A _inst_5))) (Semiring.toNonAssocSemiring.{u1} K (DivisionSemiring.toSemiring.{u1} K (Semifield.toDivisionSemiring.{u1} K (Field.toSemifield.{u1} K _inst_9)))))))) (algebraMap.{u2, u1} A K (CommRing.toCommSemiring.{u2} A _inst_5) (DivisionSemiring.toSemiring.{u1} K (Semifield.toDivisionSemiring.{u1} K (Field.toSemifield.{u1} K _inst_9))) _inst_11) r) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (RingHom.{u2, u1} A K (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A (CommRing.toCommSemiring.{u2} A _inst_5))) (Semiring.toNonAssocSemiring.{u1} K (DivisionSemiring.toSemiring.{u1} K (Semifield.toDivisionSemiring.{u1} K (Field.toSemifield.{u1} K _inst_9))))) A (fun (_x : A) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : A) => K) _x) (MulHomClass.toFunLike.{max u2 u1, u2, u1} (RingHom.{u2, u1} A K (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A (CommRing.toCommSemiring.{u2} A _inst_5))) (Semiring.toNonAssocSemiring.{u1} K (DivisionSemiring.toSemiring.{u1} K (Semifield.toDivisionSemiring.{u1} K (Field.toSemifield.{u1} K _inst_9))))) A K (NonUnitalNonAssocSemiring.toMul.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A (CommRing.toCommSemiring.{u2} A _inst_5))))) (NonUnitalNonAssocSemiring.toMul.{u1} K (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} K (Semiring.toNonAssocSemiring.{u1} K (DivisionSemiring.toSemiring.{u1} K (Semifield.toDivisionSemiring.{u1} K (Field.toSemifield.{u1} K _inst_9)))))) (NonUnitalRingHomClass.toMulHomClass.{max u2 u1, u2, u1} (RingHom.{u2, u1} A K (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A (CommRing.toCommSemiring.{u2} A _inst_5))) (Semiring.toNonAssocSemiring.{u1} K (DivisionSemiring.toSemiring.{u1} K (Semifield.toDivisionSemiring.{u1} K (Field.toSemifield.{u1} K _inst_9))))) A K (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A (CommRing.toCommSemiring.{u2} A _inst_5)))) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} K (Semiring.toNonAssocSemiring.{u1} K (DivisionSemiring.toSemiring.{u1} K (Semifield.toDivisionSemiring.{u1} K (Field.toSemifield.{u1} K _inst_9))))) (RingHomClass.toNonUnitalRingHomClass.{max u2 u1, u2, u1} (RingHom.{u2, u1} A K (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A (CommRing.toCommSemiring.{u2} A _inst_5))) (Semiring.toNonAssocSemiring.{u1} K (DivisionSemiring.toSemiring.{u1} K (Semifield.toDivisionSemiring.{u1} K (Field.toSemifield.{u1} K _inst_9))))) A K (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A (CommRing.toCommSemiring.{u2} A _inst_5))) (Semiring.toNonAssocSemiring.{u1} K (DivisionSemiring.toSemiring.{u1} K (Semifield.toDivisionSemiring.{u1} K (Field.toSemifield.{u1} K _inst_9)))) (RingHom.instRingHomClassRingHom.{u2, u1} A K (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A (CommRing.toCommSemiring.{u2} A _inst_5))) (Semiring.toNonAssocSemiring.{u1} K (DivisionSemiring.toSemiring.{u1} K (Semifield.toDivisionSemiring.{u1} K (Field.toSemifield.{u1} K _inst_9)))))))) (algebraMap.{u2, u1} A K (CommRing.toCommSemiring.{u2} A _inst_5) (DivisionSemiring.toSemiring.{u1} K (Semifield.toDivisionSemiring.{u1} K (Field.toSemifield.{u1} K _inst_9))) _inst_11) (Subtype.val.{succ u2} A (fun (x : A) => Membership.mem.{u2, u2} A (Set.{u2} A) (Set.instMembershipSet.{u2} A) x (SetLike.coe.{u2, u2} (Submonoid.{u2} A (MulZeroOneClass.toMulOneClass.{u2} A (MonoidWithZero.toMulZeroOneClass.{u2} A (Semiring.toMonoidWithZero.{u2} A (Ring.toSemiring.{u2} A (CommRing.toRing.{u2} A _inst_5)))))) A (Submonoid.instSetLikeSubmonoid.{u2} A (MulZeroOneClass.toMulOneClass.{u2} A (MonoidWithZero.toMulZeroOneClass.{u2} A (Semiring.toMonoidWithZero.{u2} A (Ring.toSemiring.{u2} A (CommRing.toRing.{u2} A _inst_5)))))) (nonZeroDivisors.{u2} A (Semiring.toMonoidWithZero.{u2} A (Ring.toSemiring.{u2} A (CommRing.toRing.{u2} A _inst_5)))))) s)))
Case conversion may be inaccurate. Consider using '#align is_fraction_ring.mk'_eq_div IsFractionRing.mk'_eq_divₓ'. -/
@[simp]
theorem mk'_eq_div {r} (s : nonZeroDivisors A) : mk' K r s = algebraMap A K r / algebraMap A K s :=
  mk'_mk_eq_div s.2
#align is_fraction_ring.mk'_eq_div IsFractionRing.mk'_eq_div

/- warning: is_fraction_ring.div_surjective -> IsFractionRing.div_surjective is a dubious translation:
lean 3 declaration is
  forall {A : Type.{u1}} [_inst_5 : CommRing.{u1} A] [_inst_6 : IsDomain.{u1} A (Ring.toSemiring.{u1} A (CommRing.toRing.{u1} A _inst_5))] {K : Type.{u2}} [_inst_9 : Field.{u2} K] [_inst_11 : Algebra.{u1, u2} A K (CommRing.toCommSemiring.{u1} A _inst_5) (Ring.toSemiring.{u2} K (DivisionRing.toRing.{u2} K (Field.toDivisionRing.{u2} K _inst_9)))] [_inst_12 : IsFractionRing.{u1, u2} A _inst_5 K (Field.toCommRing.{u2} K _inst_9) _inst_11] (z : K), Exists.{succ u1} A (fun (x : A) => Exists.{succ u1} A (fun (y : A) => Exists.{0} (Membership.Mem.{u1, u1} A (Submonoid.{u1} A (MulZeroOneClass.toMulOneClass.{u1} A (MonoidWithZero.toMulZeroOneClass.{u1} A (Semiring.toMonoidWithZero.{u1} A (Ring.toSemiring.{u1} A (CommRing.toRing.{u1} A _inst_5)))))) (SetLike.hasMem.{u1, u1} (Submonoid.{u1} A (MulZeroOneClass.toMulOneClass.{u1} A (MonoidWithZero.toMulZeroOneClass.{u1} A (Semiring.toMonoidWithZero.{u1} A (Ring.toSemiring.{u1} A (CommRing.toRing.{u1} A _inst_5)))))) A (Submonoid.setLike.{u1} A (MulZeroOneClass.toMulOneClass.{u1} A (MonoidWithZero.toMulZeroOneClass.{u1} A (Semiring.toMonoidWithZero.{u1} A (Ring.toSemiring.{u1} A (CommRing.toRing.{u1} A _inst_5))))))) y (nonZeroDivisors.{u1} A (Semiring.toMonoidWithZero.{u1} A (Ring.toSemiring.{u1} A (CommRing.toRing.{u1} A _inst_5))))) (fun (hy : Membership.Mem.{u1, u1} A (Submonoid.{u1} A (MulZeroOneClass.toMulOneClass.{u1} A (MonoidWithZero.toMulZeroOneClass.{u1} A (Semiring.toMonoidWithZero.{u1} A (Ring.toSemiring.{u1} A (CommRing.toRing.{u1} A _inst_5)))))) (SetLike.hasMem.{u1, u1} (Submonoid.{u1} A (MulZeroOneClass.toMulOneClass.{u1} A (MonoidWithZero.toMulZeroOneClass.{u1} A (Semiring.toMonoidWithZero.{u1} A (Ring.toSemiring.{u1} A (CommRing.toRing.{u1} A _inst_5)))))) A (Submonoid.setLike.{u1} A (MulZeroOneClass.toMulOneClass.{u1} A (MonoidWithZero.toMulZeroOneClass.{u1} A (Semiring.toMonoidWithZero.{u1} A (Ring.toSemiring.{u1} A (CommRing.toRing.{u1} A _inst_5))))))) y (nonZeroDivisors.{u1} A (Semiring.toMonoidWithZero.{u1} A (Ring.toSemiring.{u1} A (CommRing.toRing.{u1} A _inst_5))))) => Eq.{succ u2} K (HDiv.hDiv.{u2, u2, u2} K K K (instHDiv.{u2} K (DivInvMonoid.toHasDiv.{u2} K (DivisionRing.toDivInvMonoid.{u2} K (Field.toDivisionRing.{u2} K _inst_9)))) (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RingHom.{u1, u2} A K (Semiring.toNonAssocSemiring.{u1} A (CommSemiring.toSemiring.{u1} A (CommRing.toCommSemiring.{u1} A _inst_5))) (Semiring.toNonAssocSemiring.{u2} K (Ring.toSemiring.{u2} K (DivisionRing.toRing.{u2} K (Field.toDivisionRing.{u2} K _inst_9))))) (fun (_x : RingHom.{u1, u2} A K (Semiring.toNonAssocSemiring.{u1} A (CommSemiring.toSemiring.{u1} A (CommRing.toCommSemiring.{u1} A _inst_5))) (Semiring.toNonAssocSemiring.{u2} K (Ring.toSemiring.{u2} K (DivisionRing.toRing.{u2} K (Field.toDivisionRing.{u2} K _inst_9))))) => A -> K) (RingHom.hasCoeToFun.{u1, u2} A K (Semiring.toNonAssocSemiring.{u1} A (CommSemiring.toSemiring.{u1} A (CommRing.toCommSemiring.{u1} A _inst_5))) (Semiring.toNonAssocSemiring.{u2} K (Ring.toSemiring.{u2} K (DivisionRing.toRing.{u2} K (Field.toDivisionRing.{u2} K _inst_9))))) (algebraMap.{u1, u2} A K (CommRing.toCommSemiring.{u1} A _inst_5) (Ring.toSemiring.{u2} K (DivisionRing.toRing.{u2} K (Field.toDivisionRing.{u2} K _inst_9))) _inst_11) x) (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RingHom.{u1, u2} A K (Semiring.toNonAssocSemiring.{u1} A (CommSemiring.toSemiring.{u1} A (CommRing.toCommSemiring.{u1} A _inst_5))) (Semiring.toNonAssocSemiring.{u2} K (Ring.toSemiring.{u2} K (DivisionRing.toRing.{u2} K (Field.toDivisionRing.{u2} K _inst_9))))) (fun (_x : RingHom.{u1, u2} A K (Semiring.toNonAssocSemiring.{u1} A (CommSemiring.toSemiring.{u1} A (CommRing.toCommSemiring.{u1} A _inst_5))) (Semiring.toNonAssocSemiring.{u2} K (Ring.toSemiring.{u2} K (DivisionRing.toRing.{u2} K (Field.toDivisionRing.{u2} K _inst_9))))) => A -> K) (RingHom.hasCoeToFun.{u1, u2} A K (Semiring.toNonAssocSemiring.{u1} A (CommSemiring.toSemiring.{u1} A (CommRing.toCommSemiring.{u1} A _inst_5))) (Semiring.toNonAssocSemiring.{u2} K (Ring.toSemiring.{u2} K (DivisionRing.toRing.{u2} K (Field.toDivisionRing.{u2} K _inst_9))))) (algebraMap.{u1, u2} A K (CommRing.toCommSemiring.{u1} A _inst_5) (Ring.toSemiring.{u2} K (DivisionRing.toRing.{u2} K (Field.toDivisionRing.{u2} K _inst_9))) _inst_11) y)) z)))
but is expected to have type
  forall {A : Type.{u2}} [_inst_5 : CommRing.{u2} A] [_inst_6 : IsDomain.{u2} A (Ring.toSemiring.{u2} A (CommRing.toRing.{u2} A _inst_5))] {K : Type.{u1}} [_inst_9 : Field.{u1} K] [_inst_11 : Algebra.{u2, u1} A K (CommRing.toCommSemiring.{u2} A _inst_5) (DivisionSemiring.toSemiring.{u1} K (Semifield.toDivisionSemiring.{u1} K (Field.toSemifield.{u1} K _inst_9)))] [_inst_12 : IsFractionRing.{u2, u1} A _inst_5 K (Field.toCommRing.{u1} K _inst_9) _inst_11] (z : K), Exists.{succ u2} A (fun (x : A) => Exists.{succ u2} A (fun (y : A) => Exists.{0} (Membership.mem.{u2, u2} A (Submonoid.{u2} A (MulZeroOneClass.toMulOneClass.{u2} A (MonoidWithZero.toMulZeroOneClass.{u2} A (Semiring.toMonoidWithZero.{u2} A (Ring.toSemiring.{u2} A (CommRing.toRing.{u2} A _inst_5)))))) (SetLike.instMembership.{u2, u2} (Submonoid.{u2} A (MulZeroOneClass.toMulOneClass.{u2} A (MonoidWithZero.toMulZeroOneClass.{u2} A (Semiring.toMonoidWithZero.{u2} A (Ring.toSemiring.{u2} A (CommRing.toRing.{u2} A _inst_5)))))) A (Submonoid.instSetLikeSubmonoid.{u2} A (MulZeroOneClass.toMulOneClass.{u2} A (MonoidWithZero.toMulZeroOneClass.{u2} A (Semiring.toMonoidWithZero.{u2} A (Ring.toSemiring.{u2} A (CommRing.toRing.{u2} A _inst_5))))))) y (nonZeroDivisors.{u2} A (Semiring.toMonoidWithZero.{u2} A (Ring.toSemiring.{u2} A (CommRing.toRing.{u2} A _inst_5))))) (fun (hy : Membership.mem.{u2, u2} A (Submonoid.{u2} A (MulZeroOneClass.toMulOneClass.{u2} A (MonoidWithZero.toMulZeroOneClass.{u2} A (Semiring.toMonoidWithZero.{u2} A (Ring.toSemiring.{u2} A (CommRing.toRing.{u2} A _inst_5)))))) (SetLike.instMembership.{u2, u2} (Submonoid.{u2} A (MulZeroOneClass.toMulOneClass.{u2} A (MonoidWithZero.toMulZeroOneClass.{u2} A (Semiring.toMonoidWithZero.{u2} A (Ring.toSemiring.{u2} A (CommRing.toRing.{u2} A _inst_5)))))) A (Submonoid.instSetLikeSubmonoid.{u2} A (MulZeroOneClass.toMulOneClass.{u2} A (MonoidWithZero.toMulZeroOneClass.{u2} A (Semiring.toMonoidWithZero.{u2} A (Ring.toSemiring.{u2} A (CommRing.toRing.{u2} A _inst_5))))))) y (nonZeroDivisors.{u2} A (Semiring.toMonoidWithZero.{u2} A (Ring.toSemiring.{u2} A (CommRing.toRing.{u2} A _inst_5))))) => Eq.{succ u1} K (HDiv.hDiv.{u1, u1, u1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : A) => K) x) ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : A) => K) y) K (instHDiv.{u1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : A) => K) x) (Field.toDiv.{u1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : A) => K) x) _inst_9)) (FunLike.coe.{max (succ u1) (succ u2), succ u2, succ u1} (RingHom.{u2, u1} A K (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A (CommRing.toCommSemiring.{u2} A _inst_5))) (Semiring.toNonAssocSemiring.{u1} K (DivisionSemiring.toSemiring.{u1} K (Semifield.toDivisionSemiring.{u1} K (Field.toSemifield.{u1} K _inst_9))))) A (fun (_x : A) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : A) => K) _x) (MulHomClass.toFunLike.{max u1 u2, u2, u1} (RingHom.{u2, u1} A K (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A (CommRing.toCommSemiring.{u2} A _inst_5))) (Semiring.toNonAssocSemiring.{u1} K (DivisionSemiring.toSemiring.{u1} K (Semifield.toDivisionSemiring.{u1} K (Field.toSemifield.{u1} K _inst_9))))) A K (NonUnitalNonAssocSemiring.toMul.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A (CommRing.toCommSemiring.{u2} A _inst_5))))) (NonUnitalNonAssocSemiring.toMul.{u1} K (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} K (Semiring.toNonAssocSemiring.{u1} K (DivisionSemiring.toSemiring.{u1} K (Semifield.toDivisionSemiring.{u1} K (Field.toSemifield.{u1} K _inst_9)))))) (NonUnitalRingHomClass.toMulHomClass.{max u1 u2, u2, u1} (RingHom.{u2, u1} A K (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A (CommRing.toCommSemiring.{u2} A _inst_5))) (Semiring.toNonAssocSemiring.{u1} K (DivisionSemiring.toSemiring.{u1} K (Semifield.toDivisionSemiring.{u1} K (Field.toSemifield.{u1} K _inst_9))))) A K (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A (CommRing.toCommSemiring.{u2} A _inst_5)))) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} K (Semiring.toNonAssocSemiring.{u1} K (DivisionSemiring.toSemiring.{u1} K (Semifield.toDivisionSemiring.{u1} K (Field.toSemifield.{u1} K _inst_9))))) (RingHomClass.toNonUnitalRingHomClass.{max u1 u2, u2, u1} (RingHom.{u2, u1} A K (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A (CommRing.toCommSemiring.{u2} A _inst_5))) (Semiring.toNonAssocSemiring.{u1} K (DivisionSemiring.toSemiring.{u1} K (Semifield.toDivisionSemiring.{u1} K (Field.toSemifield.{u1} K _inst_9))))) A K (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A (CommRing.toCommSemiring.{u2} A _inst_5))) (Semiring.toNonAssocSemiring.{u1} K (DivisionSemiring.toSemiring.{u1} K (Semifield.toDivisionSemiring.{u1} K (Field.toSemifield.{u1} K _inst_9)))) (RingHom.instRingHomClassRingHom.{u2, u1} A K (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A (CommRing.toCommSemiring.{u2} A _inst_5))) (Semiring.toNonAssocSemiring.{u1} K (DivisionSemiring.toSemiring.{u1} K (Semifield.toDivisionSemiring.{u1} K (Field.toSemifield.{u1} K _inst_9)))))))) (algebraMap.{u2, u1} A K (CommRing.toCommSemiring.{u2} A _inst_5) (DivisionSemiring.toSemiring.{u1} K (Semifield.toDivisionSemiring.{u1} K (Field.toSemifield.{u1} K _inst_9))) _inst_11) x) (FunLike.coe.{max (succ u1) (succ u2), succ u2, succ u1} (RingHom.{u2, u1} A K (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A (CommRing.toCommSemiring.{u2} A _inst_5))) (Semiring.toNonAssocSemiring.{u1} K (DivisionSemiring.toSemiring.{u1} K (Semifield.toDivisionSemiring.{u1} K (Field.toSemifield.{u1} K _inst_9))))) A (fun (_x : A) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : A) => K) _x) (MulHomClass.toFunLike.{max u1 u2, u2, u1} (RingHom.{u2, u1} A K (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A (CommRing.toCommSemiring.{u2} A _inst_5))) (Semiring.toNonAssocSemiring.{u1} K (DivisionSemiring.toSemiring.{u1} K (Semifield.toDivisionSemiring.{u1} K (Field.toSemifield.{u1} K _inst_9))))) A K (NonUnitalNonAssocSemiring.toMul.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A (CommRing.toCommSemiring.{u2} A _inst_5))))) (NonUnitalNonAssocSemiring.toMul.{u1} K (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} K (Semiring.toNonAssocSemiring.{u1} K (DivisionSemiring.toSemiring.{u1} K (Semifield.toDivisionSemiring.{u1} K (Field.toSemifield.{u1} K _inst_9)))))) (NonUnitalRingHomClass.toMulHomClass.{max u1 u2, u2, u1} (RingHom.{u2, u1} A K (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A (CommRing.toCommSemiring.{u2} A _inst_5))) (Semiring.toNonAssocSemiring.{u1} K (DivisionSemiring.toSemiring.{u1} K (Semifield.toDivisionSemiring.{u1} K (Field.toSemifield.{u1} K _inst_9))))) A K (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A (CommRing.toCommSemiring.{u2} A _inst_5)))) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} K (Semiring.toNonAssocSemiring.{u1} K (DivisionSemiring.toSemiring.{u1} K (Semifield.toDivisionSemiring.{u1} K (Field.toSemifield.{u1} K _inst_9))))) (RingHomClass.toNonUnitalRingHomClass.{max u1 u2, u2, u1} (RingHom.{u2, u1} A K (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A (CommRing.toCommSemiring.{u2} A _inst_5))) (Semiring.toNonAssocSemiring.{u1} K (DivisionSemiring.toSemiring.{u1} K (Semifield.toDivisionSemiring.{u1} K (Field.toSemifield.{u1} K _inst_9))))) A K (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A (CommRing.toCommSemiring.{u2} A _inst_5))) (Semiring.toNonAssocSemiring.{u1} K (DivisionSemiring.toSemiring.{u1} K (Semifield.toDivisionSemiring.{u1} K (Field.toSemifield.{u1} K _inst_9)))) (RingHom.instRingHomClassRingHom.{u2, u1} A K (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A (CommRing.toCommSemiring.{u2} A _inst_5))) (Semiring.toNonAssocSemiring.{u1} K (DivisionSemiring.toSemiring.{u1} K (Semifield.toDivisionSemiring.{u1} K (Field.toSemifield.{u1} K _inst_9)))))))) (algebraMap.{u2, u1} A K (CommRing.toCommSemiring.{u2} A _inst_5) (DivisionSemiring.toSemiring.{u1} K (Semifield.toDivisionSemiring.{u1} K (Field.toSemifield.{u1} K _inst_9))) _inst_11) y)) z)))
Case conversion may be inaccurate. Consider using '#align is_fraction_ring.div_surjective IsFractionRing.div_surjectiveₓ'. -/
theorem div_surjective (z : K) :
    ∃ (x y : A)(hy : y ∈ nonZeroDivisors A), algebraMap _ _ x / algebraMap _ _ y = z :=
  let ⟨x, ⟨y, hy⟩, h⟩ := mk'_surjective (nonZeroDivisors A) z
  ⟨x, y, hy, by rwa [mk'_eq_div] at h⟩
#align is_fraction_ring.div_surjective IsFractionRing.div_surjective

/- warning: is_fraction_ring.is_unit_map_of_injective -> IsFractionRing.isUnit_map_of_injective is a dubious translation:
lean 3 declaration is
  forall {A : Type.{u1}} [_inst_5 : CommRing.{u1} A] [_inst_6 : IsDomain.{u1} A (Ring.toSemiring.{u1} A (CommRing.toRing.{u1} A _inst_5))] {L : Type.{u2}} [_inst_10 : Field.{u2} L] {g : RingHom.{u1, u2} A L (NonAssocRing.toNonAssocSemiring.{u1} A (Ring.toNonAssocRing.{u1} A (CommRing.toRing.{u1} A _inst_5))) (NonAssocRing.toNonAssocSemiring.{u2} L (Ring.toNonAssocRing.{u2} L (DivisionRing.toRing.{u2} L (Field.toDivisionRing.{u2} L _inst_10))))}, (Function.Injective.{succ u1, succ u2} A L (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RingHom.{u1, u2} A L (NonAssocRing.toNonAssocSemiring.{u1} A (Ring.toNonAssocRing.{u1} A (CommRing.toRing.{u1} A _inst_5))) (NonAssocRing.toNonAssocSemiring.{u2} L (Ring.toNonAssocRing.{u2} L (DivisionRing.toRing.{u2} L (Field.toDivisionRing.{u2} L _inst_10))))) (fun (_x : RingHom.{u1, u2} A L (NonAssocRing.toNonAssocSemiring.{u1} A (Ring.toNonAssocRing.{u1} A (CommRing.toRing.{u1} A _inst_5))) (NonAssocRing.toNonAssocSemiring.{u2} L (Ring.toNonAssocRing.{u2} L (DivisionRing.toRing.{u2} L (Field.toDivisionRing.{u2} L _inst_10))))) => A -> L) (RingHom.hasCoeToFun.{u1, u2} A L (NonAssocRing.toNonAssocSemiring.{u1} A (Ring.toNonAssocRing.{u1} A (CommRing.toRing.{u1} A _inst_5))) (NonAssocRing.toNonAssocSemiring.{u2} L (Ring.toNonAssocRing.{u2} L (DivisionRing.toRing.{u2} L (Field.toDivisionRing.{u2} L _inst_10))))) g)) -> (forall (y : coeSort.{succ u1, succ (succ u1)} (Submonoid.{u1} A (MulZeroOneClass.toMulOneClass.{u1} A (MonoidWithZero.toMulZeroOneClass.{u1} A (Semiring.toMonoidWithZero.{u1} A (Ring.toSemiring.{u1} A (CommRing.toRing.{u1} A _inst_5)))))) Type.{u1} (SetLike.hasCoeToSort.{u1, u1} (Submonoid.{u1} A (MulZeroOneClass.toMulOneClass.{u1} A (MonoidWithZero.toMulZeroOneClass.{u1} A (Semiring.toMonoidWithZero.{u1} A (Ring.toSemiring.{u1} A (CommRing.toRing.{u1} A _inst_5)))))) A (Submonoid.setLike.{u1} A (MulZeroOneClass.toMulOneClass.{u1} A (MonoidWithZero.toMulZeroOneClass.{u1} A (Semiring.toMonoidWithZero.{u1} A (Ring.toSemiring.{u1} A (CommRing.toRing.{u1} A _inst_5))))))) (nonZeroDivisors.{u1} A (Semiring.toMonoidWithZero.{u1} A (Ring.toSemiring.{u1} A (CommRing.toRing.{u1} A _inst_5))))), IsUnit.{u2} L (Ring.toMonoid.{u2} L (DivisionRing.toRing.{u2} L (Field.toDivisionRing.{u2} L _inst_10))) (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RingHom.{u1, u2} A L (NonAssocRing.toNonAssocSemiring.{u1} A (Ring.toNonAssocRing.{u1} A (CommRing.toRing.{u1} A _inst_5))) (NonAssocRing.toNonAssocSemiring.{u2} L (Ring.toNonAssocRing.{u2} L (DivisionRing.toRing.{u2} L (Field.toDivisionRing.{u2} L _inst_10))))) (fun (_x : RingHom.{u1, u2} A L (NonAssocRing.toNonAssocSemiring.{u1} A (Ring.toNonAssocRing.{u1} A (CommRing.toRing.{u1} A _inst_5))) (NonAssocRing.toNonAssocSemiring.{u2} L (Ring.toNonAssocRing.{u2} L (DivisionRing.toRing.{u2} L (Field.toDivisionRing.{u2} L _inst_10))))) => A -> L) (RingHom.hasCoeToFun.{u1, u2} A L (NonAssocRing.toNonAssocSemiring.{u1} A (Ring.toNonAssocRing.{u1} A (CommRing.toRing.{u1} A _inst_5))) (NonAssocRing.toNonAssocSemiring.{u2} L (Ring.toNonAssocRing.{u2} L (DivisionRing.toRing.{u2} L (Field.toDivisionRing.{u2} L _inst_10))))) g ((fun (a : Type.{u1}) (b : Type.{u1}) [self : HasLiftT.{succ u1, succ u1} a b] => self.0) (coeSort.{succ u1, succ (succ u1)} (Submonoid.{u1} A (MulZeroOneClass.toMulOneClass.{u1} A (MonoidWithZero.toMulZeroOneClass.{u1} A (Semiring.toMonoidWithZero.{u1} A (Ring.toSemiring.{u1} A (CommRing.toRing.{u1} A _inst_5)))))) Type.{u1} (SetLike.hasCoeToSort.{u1, u1} (Submonoid.{u1} A (MulZeroOneClass.toMulOneClass.{u1} A (MonoidWithZero.toMulZeroOneClass.{u1} A (Semiring.toMonoidWithZero.{u1} A (Ring.toSemiring.{u1} A (CommRing.toRing.{u1} A _inst_5)))))) A (Submonoid.setLike.{u1} A (MulZeroOneClass.toMulOneClass.{u1} A (MonoidWithZero.toMulZeroOneClass.{u1} A (Semiring.toMonoidWithZero.{u1} A (Ring.toSemiring.{u1} A (CommRing.toRing.{u1} A _inst_5))))))) (nonZeroDivisors.{u1} A (Semiring.toMonoidWithZero.{u1} A (Ring.toSemiring.{u1} A (CommRing.toRing.{u1} A _inst_5))))) A (HasLiftT.mk.{succ u1, succ u1} (coeSort.{succ u1, succ (succ u1)} (Submonoid.{u1} A (MulZeroOneClass.toMulOneClass.{u1} A (MonoidWithZero.toMulZeroOneClass.{u1} A (Semiring.toMonoidWithZero.{u1} A (Ring.toSemiring.{u1} A (CommRing.toRing.{u1} A _inst_5)))))) Type.{u1} (SetLike.hasCoeToSort.{u1, u1} (Submonoid.{u1} A (MulZeroOneClass.toMulOneClass.{u1} A (MonoidWithZero.toMulZeroOneClass.{u1} A (Semiring.toMonoidWithZero.{u1} A (Ring.toSemiring.{u1} A (CommRing.toRing.{u1} A _inst_5)))))) A (Submonoid.setLike.{u1} A (MulZeroOneClass.toMulOneClass.{u1} A (MonoidWithZero.toMulZeroOneClass.{u1} A (Semiring.toMonoidWithZero.{u1} A (Ring.toSemiring.{u1} A (CommRing.toRing.{u1} A _inst_5))))))) (nonZeroDivisors.{u1} A (Semiring.toMonoidWithZero.{u1} A (Ring.toSemiring.{u1} A (CommRing.toRing.{u1} A _inst_5))))) A (CoeTCₓ.coe.{succ u1, succ u1} (coeSort.{succ u1, succ (succ u1)} (Submonoid.{u1} A (MulZeroOneClass.toMulOneClass.{u1} A (MonoidWithZero.toMulZeroOneClass.{u1} A (Semiring.toMonoidWithZero.{u1} A (Ring.toSemiring.{u1} A (CommRing.toRing.{u1} A _inst_5)))))) Type.{u1} (SetLike.hasCoeToSort.{u1, u1} (Submonoid.{u1} A (MulZeroOneClass.toMulOneClass.{u1} A (MonoidWithZero.toMulZeroOneClass.{u1} A (Semiring.toMonoidWithZero.{u1} A (Ring.toSemiring.{u1} A (CommRing.toRing.{u1} A _inst_5)))))) A (Submonoid.setLike.{u1} A (MulZeroOneClass.toMulOneClass.{u1} A (MonoidWithZero.toMulZeroOneClass.{u1} A (Semiring.toMonoidWithZero.{u1} A (Ring.toSemiring.{u1} A (CommRing.toRing.{u1} A _inst_5))))))) (nonZeroDivisors.{u1} A (Semiring.toMonoidWithZero.{u1} A (Ring.toSemiring.{u1} A (CommRing.toRing.{u1} A _inst_5))))) A (coeBase.{succ u1, succ u1} (coeSort.{succ u1, succ (succ u1)} (Submonoid.{u1} A (MulZeroOneClass.toMulOneClass.{u1} A (MonoidWithZero.toMulZeroOneClass.{u1} A (Semiring.toMonoidWithZero.{u1} A (Ring.toSemiring.{u1} A (CommRing.toRing.{u1} A _inst_5)))))) Type.{u1} (SetLike.hasCoeToSort.{u1, u1} (Submonoid.{u1} A (MulZeroOneClass.toMulOneClass.{u1} A (MonoidWithZero.toMulZeroOneClass.{u1} A (Semiring.toMonoidWithZero.{u1} A (Ring.toSemiring.{u1} A (CommRing.toRing.{u1} A _inst_5)))))) A (Submonoid.setLike.{u1} A (MulZeroOneClass.toMulOneClass.{u1} A (MonoidWithZero.toMulZeroOneClass.{u1} A (Semiring.toMonoidWithZero.{u1} A (Ring.toSemiring.{u1} A (CommRing.toRing.{u1} A _inst_5))))))) (nonZeroDivisors.{u1} A (Semiring.toMonoidWithZero.{u1} A (Ring.toSemiring.{u1} A (CommRing.toRing.{u1} A _inst_5))))) A (coeSubtype.{succ u1} A (fun (x : A) => Membership.Mem.{u1, u1} A (Submonoid.{u1} A (MulZeroOneClass.toMulOneClass.{u1} A (MonoidWithZero.toMulZeroOneClass.{u1} A (Semiring.toMonoidWithZero.{u1} A (Ring.toSemiring.{u1} A (CommRing.toRing.{u1} A _inst_5)))))) (SetLike.hasMem.{u1, u1} (Submonoid.{u1} A (MulZeroOneClass.toMulOneClass.{u1} A (MonoidWithZero.toMulZeroOneClass.{u1} A (Semiring.toMonoidWithZero.{u1} A (Ring.toSemiring.{u1} A (CommRing.toRing.{u1} A _inst_5)))))) A (Submonoid.setLike.{u1} A (MulZeroOneClass.toMulOneClass.{u1} A (MonoidWithZero.toMulZeroOneClass.{u1} A (Semiring.toMonoidWithZero.{u1} A (Ring.toSemiring.{u1} A (CommRing.toRing.{u1} A _inst_5))))))) x (nonZeroDivisors.{u1} A (Semiring.toMonoidWithZero.{u1} A (Ring.toSemiring.{u1} A (CommRing.toRing.{u1} A _inst_5))))))))) y)))
but is expected to have type
  forall {A : Type.{u2}} [_inst_5 : CommRing.{u2} A] [_inst_6 : IsDomain.{u2} A (Ring.toSemiring.{u2} A (CommRing.toRing.{u2} A _inst_5))] {L : Type.{u1}} [_inst_10 : Field.{u1} L] {g : RingHom.{u2, u1} A L (NonAssocRing.toNonAssocSemiring.{u2} A (Ring.toNonAssocRing.{u2} A (CommRing.toRing.{u2} A _inst_5))) (NonAssocRing.toNonAssocSemiring.{u1} L (Ring.toNonAssocRing.{u1} L (DivisionRing.toRing.{u1} L (Field.toDivisionRing.{u1} L _inst_10))))}, (Function.Injective.{succ u2, succ u1} A L (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (RingHom.{u2, u1} A L (NonAssocRing.toNonAssocSemiring.{u2} A (Ring.toNonAssocRing.{u2} A (CommRing.toRing.{u2} A _inst_5))) (NonAssocRing.toNonAssocSemiring.{u1} L (Ring.toNonAssocRing.{u1} L (DivisionRing.toRing.{u1} L (Field.toDivisionRing.{u1} L _inst_10))))) A (fun (_x : A) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : A) => L) _x) (MulHomClass.toFunLike.{max u2 u1, u2, u1} (RingHom.{u2, u1} A L (NonAssocRing.toNonAssocSemiring.{u2} A (Ring.toNonAssocRing.{u2} A (CommRing.toRing.{u2} A _inst_5))) (NonAssocRing.toNonAssocSemiring.{u1} L (Ring.toNonAssocRing.{u1} L (DivisionRing.toRing.{u1} L (Field.toDivisionRing.{u1} L _inst_10))))) A L (NonUnitalNonAssocSemiring.toMul.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (NonAssocRing.toNonAssocSemiring.{u2} A (Ring.toNonAssocRing.{u2} A (CommRing.toRing.{u2} A _inst_5))))) (NonUnitalNonAssocSemiring.toMul.{u1} L (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} L (NonAssocRing.toNonAssocSemiring.{u1} L (Ring.toNonAssocRing.{u1} L (DivisionRing.toRing.{u1} L (Field.toDivisionRing.{u1} L _inst_10)))))) (NonUnitalRingHomClass.toMulHomClass.{max u2 u1, u2, u1} (RingHom.{u2, u1} A L (NonAssocRing.toNonAssocSemiring.{u2} A (Ring.toNonAssocRing.{u2} A (CommRing.toRing.{u2} A _inst_5))) (NonAssocRing.toNonAssocSemiring.{u1} L (Ring.toNonAssocRing.{u1} L (DivisionRing.toRing.{u1} L (Field.toDivisionRing.{u1} L _inst_10))))) A L (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (NonAssocRing.toNonAssocSemiring.{u2} A (Ring.toNonAssocRing.{u2} A (CommRing.toRing.{u2} A _inst_5)))) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} L (NonAssocRing.toNonAssocSemiring.{u1} L (Ring.toNonAssocRing.{u1} L (DivisionRing.toRing.{u1} L (Field.toDivisionRing.{u1} L _inst_10))))) (RingHomClass.toNonUnitalRingHomClass.{max u2 u1, u2, u1} (RingHom.{u2, u1} A L (NonAssocRing.toNonAssocSemiring.{u2} A (Ring.toNonAssocRing.{u2} A (CommRing.toRing.{u2} A _inst_5))) (NonAssocRing.toNonAssocSemiring.{u1} L (Ring.toNonAssocRing.{u1} L (DivisionRing.toRing.{u1} L (Field.toDivisionRing.{u1} L _inst_10))))) A L (NonAssocRing.toNonAssocSemiring.{u2} A (Ring.toNonAssocRing.{u2} A (CommRing.toRing.{u2} A _inst_5))) (NonAssocRing.toNonAssocSemiring.{u1} L (Ring.toNonAssocRing.{u1} L (DivisionRing.toRing.{u1} L (Field.toDivisionRing.{u1} L _inst_10)))) (RingHom.instRingHomClassRingHom.{u2, u1} A L (NonAssocRing.toNonAssocSemiring.{u2} A (Ring.toNonAssocRing.{u2} A (CommRing.toRing.{u2} A _inst_5))) (NonAssocRing.toNonAssocSemiring.{u1} L (Ring.toNonAssocRing.{u1} L (DivisionRing.toRing.{u1} L (Field.toDivisionRing.{u1} L _inst_10)))))))) g)) -> (forall (y : Subtype.{succ u2} A (fun (x : A) => Membership.mem.{u2, u2} A (Submonoid.{u2} A (MulZeroOneClass.toMulOneClass.{u2} A (MonoidWithZero.toMulZeroOneClass.{u2} A (Semiring.toMonoidWithZero.{u2} A (Ring.toSemiring.{u2} A (CommRing.toRing.{u2} A _inst_5)))))) (SetLike.instMembership.{u2, u2} (Submonoid.{u2} A (MulZeroOneClass.toMulOneClass.{u2} A (MonoidWithZero.toMulZeroOneClass.{u2} A (Semiring.toMonoidWithZero.{u2} A (Ring.toSemiring.{u2} A (CommRing.toRing.{u2} A _inst_5)))))) A (Submonoid.instSetLikeSubmonoid.{u2} A (MulZeroOneClass.toMulOneClass.{u2} A (MonoidWithZero.toMulZeroOneClass.{u2} A (Semiring.toMonoidWithZero.{u2} A (Ring.toSemiring.{u2} A (CommRing.toRing.{u2} A _inst_5))))))) x (nonZeroDivisors.{u2} A (Semiring.toMonoidWithZero.{u2} A (Ring.toSemiring.{u2} A (CommRing.toRing.{u2} A _inst_5)))))), IsUnit.{u1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : A) => L) (Subtype.val.{succ u2} A (fun (x : A) => Membership.mem.{u2, u2} A (Set.{u2} A) (Set.instMembershipSet.{u2} A) x (SetLike.coe.{u2, u2} (Submonoid.{u2} A (MulZeroOneClass.toMulOneClass.{u2} A (MonoidWithZero.toMulZeroOneClass.{u2} A (Semiring.toMonoidWithZero.{u2} A (Ring.toSemiring.{u2} A (CommRing.toRing.{u2} A _inst_5)))))) A (Submonoid.instSetLikeSubmonoid.{u2} A (MulZeroOneClass.toMulOneClass.{u2} A (MonoidWithZero.toMulZeroOneClass.{u2} A (Semiring.toMonoidWithZero.{u2} A (Ring.toSemiring.{u2} A (CommRing.toRing.{u2} A _inst_5)))))) (nonZeroDivisors.{u2} A (Semiring.toMonoidWithZero.{u2} A (Ring.toSemiring.{u2} A (CommRing.toRing.{u2} A _inst_5)))))) y)) (MonoidWithZero.toMonoid.{u1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : A) => L) (Subtype.val.{succ u2} A (fun (x : A) => Membership.mem.{u2, u2} A (Set.{u2} A) (Set.instMembershipSet.{u2} A) x (SetLike.coe.{u2, u2} (Submonoid.{u2} A (MulZeroOneClass.toMulOneClass.{u2} A (MonoidWithZero.toMulZeroOneClass.{u2} A (Semiring.toMonoidWithZero.{u2} A (Ring.toSemiring.{u2} A (CommRing.toRing.{u2} A _inst_5)))))) A (Submonoid.instSetLikeSubmonoid.{u2} A (MulZeroOneClass.toMulOneClass.{u2} A (MonoidWithZero.toMulZeroOneClass.{u2} A (Semiring.toMonoidWithZero.{u2} A (Ring.toSemiring.{u2} A (CommRing.toRing.{u2} A _inst_5)))))) (nonZeroDivisors.{u2} A (Semiring.toMonoidWithZero.{u2} A (Ring.toSemiring.{u2} A (CommRing.toRing.{u2} A _inst_5)))))) y)) (Semiring.toMonoidWithZero.{u1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : A) => L) (Subtype.val.{succ u2} A (fun (x : A) => Membership.mem.{u2, u2} A (Set.{u2} A) (Set.instMembershipSet.{u2} A) x (SetLike.coe.{u2, u2} (Submonoid.{u2} A (MulZeroOneClass.toMulOneClass.{u2} A (MonoidWithZero.toMulZeroOneClass.{u2} A (Semiring.toMonoidWithZero.{u2} A (Ring.toSemiring.{u2} A (CommRing.toRing.{u2} A _inst_5)))))) A (Submonoid.instSetLikeSubmonoid.{u2} A (MulZeroOneClass.toMulOneClass.{u2} A (MonoidWithZero.toMulZeroOneClass.{u2} A (Semiring.toMonoidWithZero.{u2} A (Ring.toSemiring.{u2} A (CommRing.toRing.{u2} A _inst_5)))))) (nonZeroDivisors.{u2} A (Semiring.toMonoidWithZero.{u2} A (Ring.toSemiring.{u2} A (CommRing.toRing.{u2} A _inst_5)))))) y)) (DivisionSemiring.toSemiring.{u1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : A) => L) (Subtype.val.{succ u2} A (fun (x : A) => Membership.mem.{u2, u2} A (Set.{u2} A) (Set.instMembershipSet.{u2} A) x (SetLike.coe.{u2, u2} (Submonoid.{u2} A (MulZeroOneClass.toMulOneClass.{u2} A (MonoidWithZero.toMulZeroOneClass.{u2} A (Semiring.toMonoidWithZero.{u2} A (Ring.toSemiring.{u2} A (CommRing.toRing.{u2} A _inst_5)))))) A (Submonoid.instSetLikeSubmonoid.{u2} A (MulZeroOneClass.toMulOneClass.{u2} A (MonoidWithZero.toMulZeroOneClass.{u2} A (Semiring.toMonoidWithZero.{u2} A (Ring.toSemiring.{u2} A (CommRing.toRing.{u2} A _inst_5)))))) (nonZeroDivisors.{u2} A (Semiring.toMonoidWithZero.{u2} A (Ring.toSemiring.{u2} A (CommRing.toRing.{u2} A _inst_5)))))) y)) (Semifield.toDivisionSemiring.{u1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : A) => L) (Subtype.val.{succ u2} A (fun (x : A) => Membership.mem.{u2, u2} A (Set.{u2} A) (Set.instMembershipSet.{u2} A) x (SetLike.coe.{u2, u2} (Submonoid.{u2} A (MulZeroOneClass.toMulOneClass.{u2} A (MonoidWithZero.toMulZeroOneClass.{u2} A (Semiring.toMonoidWithZero.{u2} A (Ring.toSemiring.{u2} A (CommRing.toRing.{u2} A _inst_5)))))) A (Submonoid.instSetLikeSubmonoid.{u2} A (MulZeroOneClass.toMulOneClass.{u2} A (MonoidWithZero.toMulZeroOneClass.{u2} A (Semiring.toMonoidWithZero.{u2} A (Ring.toSemiring.{u2} A (CommRing.toRing.{u2} A _inst_5)))))) (nonZeroDivisors.{u2} A (Semiring.toMonoidWithZero.{u2} A (Ring.toSemiring.{u2} A (CommRing.toRing.{u2} A _inst_5)))))) y)) (Field.toSemifield.{u1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : A) => L) (Subtype.val.{succ u2} A (fun (x : A) => Membership.mem.{u2, u2} A (Set.{u2} A) (Set.instMembershipSet.{u2} A) x (SetLike.coe.{u2, u2} (Submonoid.{u2} A (MulZeroOneClass.toMulOneClass.{u2} A (MonoidWithZero.toMulZeroOneClass.{u2} A (Semiring.toMonoidWithZero.{u2} A (Ring.toSemiring.{u2} A (CommRing.toRing.{u2} A _inst_5)))))) A (Submonoid.instSetLikeSubmonoid.{u2} A (MulZeroOneClass.toMulOneClass.{u2} A (MonoidWithZero.toMulZeroOneClass.{u2} A (Semiring.toMonoidWithZero.{u2} A (Ring.toSemiring.{u2} A (CommRing.toRing.{u2} A _inst_5)))))) (nonZeroDivisors.{u2} A (Semiring.toMonoidWithZero.{u2} A (Ring.toSemiring.{u2} A (CommRing.toRing.{u2} A _inst_5)))))) y)) _inst_10))))) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (RingHom.{u2, u1} A L (NonAssocRing.toNonAssocSemiring.{u2} A (Ring.toNonAssocRing.{u2} A (CommRing.toRing.{u2} A _inst_5))) (NonAssocRing.toNonAssocSemiring.{u1} L (Ring.toNonAssocRing.{u1} L (DivisionRing.toRing.{u1} L (Field.toDivisionRing.{u1} L _inst_10))))) A (fun (_x : A) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : A) => L) _x) (MulHomClass.toFunLike.{max u2 u1, u2, u1} (RingHom.{u2, u1} A L (NonAssocRing.toNonAssocSemiring.{u2} A (Ring.toNonAssocRing.{u2} A (CommRing.toRing.{u2} A _inst_5))) (NonAssocRing.toNonAssocSemiring.{u1} L (Ring.toNonAssocRing.{u1} L (DivisionRing.toRing.{u1} L (Field.toDivisionRing.{u1} L _inst_10))))) A L (NonUnitalNonAssocSemiring.toMul.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (NonAssocRing.toNonAssocSemiring.{u2} A (Ring.toNonAssocRing.{u2} A (CommRing.toRing.{u2} A _inst_5))))) (NonUnitalNonAssocSemiring.toMul.{u1} L (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} L (NonAssocRing.toNonAssocSemiring.{u1} L (Ring.toNonAssocRing.{u1} L (DivisionRing.toRing.{u1} L (Field.toDivisionRing.{u1} L _inst_10)))))) (NonUnitalRingHomClass.toMulHomClass.{max u2 u1, u2, u1} (RingHom.{u2, u1} A L (NonAssocRing.toNonAssocSemiring.{u2} A (Ring.toNonAssocRing.{u2} A (CommRing.toRing.{u2} A _inst_5))) (NonAssocRing.toNonAssocSemiring.{u1} L (Ring.toNonAssocRing.{u1} L (DivisionRing.toRing.{u1} L (Field.toDivisionRing.{u1} L _inst_10))))) A L (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (NonAssocRing.toNonAssocSemiring.{u2} A (Ring.toNonAssocRing.{u2} A (CommRing.toRing.{u2} A _inst_5)))) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} L (NonAssocRing.toNonAssocSemiring.{u1} L (Ring.toNonAssocRing.{u1} L (DivisionRing.toRing.{u1} L (Field.toDivisionRing.{u1} L _inst_10))))) (RingHomClass.toNonUnitalRingHomClass.{max u2 u1, u2, u1} (RingHom.{u2, u1} A L (NonAssocRing.toNonAssocSemiring.{u2} A (Ring.toNonAssocRing.{u2} A (CommRing.toRing.{u2} A _inst_5))) (NonAssocRing.toNonAssocSemiring.{u1} L (Ring.toNonAssocRing.{u1} L (DivisionRing.toRing.{u1} L (Field.toDivisionRing.{u1} L _inst_10))))) A L (NonAssocRing.toNonAssocSemiring.{u2} A (Ring.toNonAssocRing.{u2} A (CommRing.toRing.{u2} A _inst_5))) (NonAssocRing.toNonAssocSemiring.{u1} L (Ring.toNonAssocRing.{u1} L (DivisionRing.toRing.{u1} L (Field.toDivisionRing.{u1} L _inst_10)))) (RingHom.instRingHomClassRingHom.{u2, u1} A L (NonAssocRing.toNonAssocSemiring.{u2} A (Ring.toNonAssocRing.{u2} A (CommRing.toRing.{u2} A _inst_5))) (NonAssocRing.toNonAssocSemiring.{u1} L (Ring.toNonAssocRing.{u1} L (DivisionRing.toRing.{u1} L (Field.toDivisionRing.{u1} L _inst_10)))))))) g (Subtype.val.{succ u2} A (fun (x : A) => Membership.mem.{u2, u2} A (Set.{u2} A) (Set.instMembershipSet.{u2} A) x (SetLike.coe.{u2, u2} (Submonoid.{u2} A (MulZeroOneClass.toMulOneClass.{u2} A (MonoidWithZero.toMulZeroOneClass.{u2} A (Semiring.toMonoidWithZero.{u2} A (Ring.toSemiring.{u2} A (CommRing.toRing.{u2} A _inst_5)))))) A (Submonoid.instSetLikeSubmonoid.{u2} A (MulZeroOneClass.toMulOneClass.{u2} A (MonoidWithZero.toMulZeroOneClass.{u2} A (Semiring.toMonoidWithZero.{u2} A (Ring.toSemiring.{u2} A (CommRing.toRing.{u2} A _inst_5)))))) (nonZeroDivisors.{u2} A (Semiring.toMonoidWithZero.{u2} A (Ring.toSemiring.{u2} A (CommRing.toRing.{u2} A _inst_5)))))) y)))
Case conversion may be inaccurate. Consider using '#align is_fraction_ring.is_unit_map_of_injective IsFractionRing.isUnit_map_of_injectiveₓ'. -/
theorem isUnit_map_of_injective (hg : Function.Injective g) (y : nonZeroDivisors A) :
    IsUnit (g y) :=
  IsUnit.mk0 (g y) <|
    show g.toMonoidWithZeroHom y ≠ 0 from map_ne_zero_of_mem_nonZeroDivisors g hg y.2
#align is_fraction_ring.is_unit_map_of_injective IsFractionRing.isUnit_map_of_injective

/- warning: is_fraction_ring.mk'_eq_zero_iff_eq_zero -> IsFractionRing.mk'_eq_zero_iff_eq_zero is a dubious translation:
lean 3 declaration is
  forall {R : Type.{u1}} [_inst_1 : CommRing.{u1} R] {K : Type.{u2}} [_inst_9 : Field.{u2} K] [_inst_13 : Algebra.{u1, u2} R K (CommRing.toCommSemiring.{u1} R _inst_1) (Ring.toSemiring.{u2} K (DivisionRing.toRing.{u2} K (Field.toDivisionRing.{u2} K _inst_9)))] [_inst_14 : IsFractionRing.{u1, u2} R _inst_1 K (Field.toCommRing.{u2} K _inst_9) _inst_13] {x : R} {y : coeSort.{succ u1, succ (succ u1)} (Submonoid.{u1} R (MulZeroOneClass.toMulOneClass.{u1} R (MonoidWithZero.toMulZeroOneClass.{u1} R (Semiring.toMonoidWithZero.{u1} R (Ring.toSemiring.{u1} R (CommRing.toRing.{u1} R _inst_1)))))) Type.{u1} (SetLike.hasCoeToSort.{u1, u1} (Submonoid.{u1} R (MulZeroOneClass.toMulOneClass.{u1} R (MonoidWithZero.toMulZeroOneClass.{u1} R (Semiring.toMonoidWithZero.{u1} R (Ring.toSemiring.{u1} R (CommRing.toRing.{u1} R _inst_1)))))) R (Submonoid.setLike.{u1} R (MulZeroOneClass.toMulOneClass.{u1} R (MonoidWithZero.toMulZeroOneClass.{u1} R (Semiring.toMonoidWithZero.{u1} R (Ring.toSemiring.{u1} R (CommRing.toRing.{u1} R _inst_1))))))) (nonZeroDivisors.{u1} R (Semiring.toMonoidWithZero.{u1} R (Ring.toSemiring.{u1} R (CommRing.toRing.{u1} R _inst_1))))}, Iff (Eq.{succ u2} K (IsLocalization.mk'.{u1, u2} R (CommRing.toCommSemiring.{u1} R _inst_1) (nonZeroDivisors.{u1} R (Semiring.toMonoidWithZero.{u1} R (Ring.toSemiring.{u1} R (CommRing.toRing.{u1} R _inst_1)))) K (Semifield.toCommSemiring.{u2} K (Field.toSemifield.{u2} K _inst_9)) _inst_13 _inst_14 x y) (OfNat.ofNat.{u2} K 0 (OfNat.mk.{u2} K 0 (Zero.zero.{u2} K (MulZeroClass.toHasZero.{u2} K (NonUnitalNonAssocSemiring.toMulZeroClass.{u2} K (NonUnitalNonAssocRing.toNonUnitalNonAssocSemiring.{u2} K (NonAssocRing.toNonUnitalNonAssocRing.{u2} K (Ring.toNonAssocRing.{u2} K (DivisionRing.toRing.{u2} K (Field.toDivisionRing.{u2} K _inst_9))))))))))) (Eq.{succ u1} R x (OfNat.ofNat.{u1} R 0 (OfNat.mk.{u1} R 0 (Zero.zero.{u1} R (MulZeroClass.toHasZero.{u1} R (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} R (NonUnitalNonAssocRing.toNonUnitalNonAssocSemiring.{u1} R (NonAssocRing.toNonUnitalNonAssocRing.{u1} R (Ring.toNonAssocRing.{u1} R (CommRing.toRing.{u1} R _inst_1))))))))))
but is expected to have type
  forall {R : Type.{u2}} [_inst_1 : CommRing.{u2} R] {K : Type.{u1}} [_inst_9 : Field.{u1} K] [_inst_13 : Algebra.{u2, u1} R K (CommRing.toCommSemiring.{u2} R _inst_1) (DivisionSemiring.toSemiring.{u1} K (Semifield.toDivisionSemiring.{u1} K (Field.toSemifield.{u1} K _inst_9)))] [_inst_14 : IsFractionRing.{u2, u1} R _inst_1 K (Field.toCommRing.{u1} K _inst_9) _inst_13] {x : R} {y : Subtype.{succ u2} R (fun (x : R) => Membership.mem.{u2, u2} R (Submonoid.{u2} R (MulZeroOneClass.toMulOneClass.{u2} R (MonoidWithZero.toMulZeroOneClass.{u2} R (Semiring.toMonoidWithZero.{u2} R (Ring.toSemiring.{u2} R (CommRing.toRing.{u2} R _inst_1)))))) (SetLike.instMembership.{u2, u2} (Submonoid.{u2} R (MulZeroOneClass.toMulOneClass.{u2} R (MonoidWithZero.toMulZeroOneClass.{u2} R (Semiring.toMonoidWithZero.{u2} R (Ring.toSemiring.{u2} R (CommRing.toRing.{u2} R _inst_1)))))) R (Submonoid.instSetLikeSubmonoid.{u2} R (MulZeroOneClass.toMulOneClass.{u2} R (MonoidWithZero.toMulZeroOneClass.{u2} R (Semiring.toMonoidWithZero.{u2} R (Ring.toSemiring.{u2} R (CommRing.toRing.{u2} R _inst_1))))))) x (nonZeroDivisors.{u2} R (Semiring.toMonoidWithZero.{u2} R (Ring.toSemiring.{u2} R (CommRing.toRing.{u2} R _inst_1)))))}, Iff (Eq.{succ u1} K (IsLocalization.mk'.{u2, u1} R (CommRing.toCommSemiring.{u2} R _inst_1) (nonZeroDivisors.{u2} R (Semiring.toMonoidWithZero.{u2} R (Ring.toSemiring.{u2} R (CommRing.toRing.{u2} R _inst_1)))) K (Semifield.toCommSemiring.{u1} K (Field.toSemifield.{u1} K _inst_9)) _inst_13 _inst_14 x y) (OfNat.ofNat.{u1} K 0 (Zero.toOfNat0.{u1} K (CommMonoidWithZero.toZero.{u1} K (CommGroupWithZero.toCommMonoidWithZero.{u1} K (Semifield.toCommGroupWithZero.{u1} K (Field.toSemifield.{u1} K _inst_9))))))) (Eq.{succ u2} R x (OfNat.ofNat.{u2} R 0 (Zero.toOfNat0.{u2} R (CommMonoidWithZero.toZero.{u2} R (CommSemiring.toCommMonoidWithZero.{u2} R (CommRing.toCommSemiring.{u2} R _inst_1))))))
Case conversion may be inaccurate. Consider using '#align is_fraction_ring.mk'_eq_zero_iff_eq_zero IsFractionRing.mk'_eq_zero_iff_eq_zeroₓ'. -/
@[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 :=
  by
  refine' ⟨fun hxy => _, fun h => by rw [h, mk'_zero]⟩
  · simp_rw [mk'_eq_zero_iff, mul_left_coe_nonZeroDivisors_eq_zero_iff] at hxy
    exact (exists_const _).mp hxy
#align is_fraction_ring.mk'_eq_zero_iff_eq_zero IsFractionRing.mk'_eq_zero_iff_eq_zero

/- warning: is_fraction_ring.mk'_eq_one_iff_eq -> IsFractionRing.mk'_eq_one_iff_eq is a dubious translation:
lean 3 declaration is
  forall {A : Type.{u1}} [_inst_5 : CommRing.{u1} A] [_inst_6 : IsDomain.{u1} A (Ring.toSemiring.{u1} A (CommRing.toRing.{u1} A _inst_5))] {K : Type.{u2}} [_inst_9 : Field.{u2} K] [_inst_11 : Algebra.{u1, u2} A K (CommRing.toCommSemiring.{u1} A _inst_5) (Ring.toSemiring.{u2} K (DivisionRing.toRing.{u2} K (Field.toDivisionRing.{u2} K _inst_9)))] [_inst_12 : IsFractionRing.{u1, u2} A _inst_5 K (Field.toCommRing.{u2} K _inst_9) _inst_11] {x : A} {y : coeSort.{succ u1, succ (succ u1)} (Submonoid.{u1} A (MulZeroOneClass.toMulOneClass.{u1} A (MonoidWithZero.toMulZeroOneClass.{u1} A (Semiring.toMonoidWithZero.{u1} A (Ring.toSemiring.{u1} A (CommRing.toRing.{u1} A _inst_5)))))) Type.{u1} (SetLike.hasCoeToSort.{u1, u1} (Submonoid.{u1} A (MulZeroOneClass.toMulOneClass.{u1} A (MonoidWithZero.toMulZeroOneClass.{u1} A (Semiring.toMonoidWithZero.{u1} A (Ring.toSemiring.{u1} A (CommRing.toRing.{u1} A _inst_5)))))) A (Submonoid.setLike.{u1} A (MulZeroOneClass.toMulOneClass.{u1} A (MonoidWithZero.toMulZeroOneClass.{u1} A (Semiring.toMonoidWithZero.{u1} A (Ring.toSemiring.{u1} A (CommRing.toRing.{u1} A _inst_5))))))) (nonZeroDivisors.{u1} A (Semiring.toMonoidWithZero.{u1} A (Ring.toSemiring.{u1} A (CommRing.toRing.{u1} A _inst_5))))}, Iff (Eq.{succ u2} K (IsLocalization.mk'.{u1, u2} A (CommRing.toCommSemiring.{u1} A _inst_5) (nonZeroDivisors.{u1} A (Semiring.toMonoidWithZero.{u1} A (Ring.toSemiring.{u1} A (CommRing.toRing.{u1} A _inst_5)))) K (Semifield.toCommSemiring.{u2} K (Field.toSemifield.{u2} K _inst_9)) _inst_11 _inst_12 x y) (OfNat.ofNat.{u2} K 1 (OfNat.mk.{u2} K 1 (One.one.{u2} K (AddMonoidWithOne.toOne.{u2} K (AddGroupWithOne.toAddMonoidWithOne.{u2} K (AddCommGroupWithOne.toAddGroupWithOne.{u2} K (Ring.toAddCommGroupWithOne.{u2} K (DivisionRing.toRing.{u2} K (Field.toDivisionRing.{u2} K _inst_9)))))))))) (Eq.{succ u1} A x ((fun (a : Type.{u1}) (b : Type.{u1}) [self : HasLiftT.{succ u1, succ u1} a b] => self.0) (coeSort.{succ u1, succ (succ u1)} (Submonoid.{u1} A (MulZeroOneClass.toMulOneClass.{u1} A (MonoidWithZero.toMulZeroOneClass.{u1} A (Semiring.toMonoidWithZero.{u1} A (Ring.toSemiring.{u1} A (CommRing.toRing.{u1} A _inst_5)))))) Type.{u1} (SetLike.hasCoeToSort.{u1, u1} (Submonoid.{u1} A (MulZeroOneClass.toMulOneClass.{u1} A (MonoidWithZero.toMulZeroOneClass.{u1} A (Semiring.toMonoidWithZero.{u1} A (Ring.toSemiring.{u1} A (CommRing.toRing.{u1} A _inst_5)))))) A (Submonoid.setLike.{u1} A (MulZeroOneClass.toMulOneClass.{u1} A (MonoidWithZero.toMulZeroOneClass.{u1} A (Semiring.toMonoidWithZero.{u1} A (Ring.toSemiring.{u1} A (CommRing.toRing.{u1} A _inst_5))))))) (nonZeroDivisors.{u1} A (Semiring.toMonoidWithZero.{u1} A (Ring.toSemiring.{u1} A (CommRing.toRing.{u1} A _inst_5))))) A (HasLiftT.mk.{succ u1, succ u1} (coeSort.{succ u1, succ (succ u1)} (Submonoid.{u1} A (MulZeroOneClass.toMulOneClass.{u1} A (MonoidWithZero.toMulZeroOneClass.{u1} A (Semiring.toMonoidWithZero.{u1} A (Ring.toSemiring.{u1} A (CommRing.toRing.{u1} A _inst_5)))))) Type.{u1} (SetLike.hasCoeToSort.{u1, u1} (Submonoid.{u1} A (MulZeroOneClass.toMulOneClass.{u1} A (MonoidWithZero.toMulZeroOneClass.{u1} A (Semiring.toMonoidWithZero.{u1} A (Ring.toSemiring.{u1} A (CommRing.toRing.{u1} A _inst_5)))))) A (Submonoid.setLike.{u1} A (MulZeroOneClass.toMulOneClass.{u1} A (MonoidWithZero.toMulZeroOneClass.{u1} A (Semiring.toMonoidWithZero.{u1} A (Ring.toSemiring.{u1} A (CommRing.toRing.{u1} A _inst_5))))))) (nonZeroDivisors.{u1} A (Semiring.toMonoidWithZero.{u1} A (Ring.toSemiring.{u1} A (CommRing.toRing.{u1} A _inst_5))))) A (CoeTCₓ.coe.{succ u1, succ u1} (coeSort.{succ u1, succ (succ u1)} (Submonoid.{u1} A (MulZeroOneClass.toMulOneClass.{u1} A (MonoidWithZero.toMulZeroOneClass.{u1} A (Semiring.toMonoidWithZero.{u1} A (Ring.toSemiring.{u1} A (CommRing.toRing.{u1} A _inst_5)))))) Type.{u1} (SetLike.hasCoeToSort.{u1, u1} (Submonoid.{u1} A (MulZeroOneClass.toMulOneClass.{u1} A (MonoidWithZero.toMulZeroOneClass.{u1} A (Semiring.toMonoidWithZero.{u1} A (Ring.toSemiring.{u1} A (CommRing.toRing.{u1} A _inst_5)))))) A (Submonoid.setLike.{u1} A (MulZeroOneClass.toMulOneClass.{u1} A (MonoidWithZero.toMulZeroOneClass.{u1} A (Semiring.toMonoidWithZero.{u1} A (Ring.toSemiring.{u1} A (CommRing.toRing.{u1} A _inst_5))))))) (nonZeroDivisors.{u1} A (Semiring.toMonoidWithZero.{u1} A (Ring.toSemiring.{u1} A (CommRing.toRing.{u1} A _inst_5))))) A (coeBase.{succ u1, succ u1} (coeSort.{succ u1, succ (succ u1)} (Submonoid.{u1} A (MulZeroOneClass.toMulOneClass.{u1} A (MonoidWithZero.toMulZeroOneClass.{u1} A (Semiring.toMonoidWithZero.{u1} A (Ring.toSemiring.{u1} A (CommRing.toRing.{u1} A _inst_5)))))) Type.{u1} (SetLike.hasCoeToSort.{u1, u1} (Submonoid.{u1} A (MulZeroOneClass.toMulOneClass.{u1} A (MonoidWithZero.toMulZeroOneClass.{u1} A (Semiring.toMonoidWithZero.{u1} A (Ring.toSemiring.{u1} A (CommRing.toRing.{u1} A _inst_5)))))) A (Submonoid.setLike.{u1} A (MulZeroOneClass.toMulOneClass.{u1} A (MonoidWithZero.toMulZeroOneClass.{u1} A (Semiring.toMonoidWithZero.{u1} A (Ring.toSemiring.{u1} A (CommRing.toRing.{u1} A _inst_5))))))) (nonZeroDivisors.{u1} A (Semiring.toMonoidWithZero.{u1} A (Ring.toSemiring.{u1} A (CommRing.toRing.{u1} A _inst_5))))) A (coeSubtype.{succ u1} A (fun (x : A) => Membership.Mem.{u1, u1} A (Submonoid.{u1} A (MulZeroOneClass.toMulOneClass.{u1} A (MonoidWithZero.toMulZeroOneClass.{u1} A (Semiring.toMonoidWithZero.{u1} A (Ring.toSemiring.{u1} A (CommRing.toRing.{u1} A _inst_5)))))) (SetLike.hasMem.{u1, u1} (Submonoid.{u1} A (MulZeroOneClass.toMulOneClass.{u1} A (MonoidWithZero.toMulZeroOneClass.{u1} A (Semiring.toMonoidWithZero.{u1} A (Ring.toSemiring.{u1} A (CommRing.toRing.{u1} A _inst_5)))))) A (Submonoid.setLike.{u1} A (MulZeroOneClass.toMulOneClass.{u1} A (MonoidWithZero.toMulZeroOneClass.{u1} A (Semiring.toMonoidWithZero.{u1} A (Ring.toSemiring.{u1} A (CommRing.toRing.{u1} A _inst_5))))))) x (nonZeroDivisors.{u1} A (Semiring.toMonoidWithZero.{u1} A (Ring.toSemiring.{u1} A (CommRing.toRing.{u1} A _inst_5))))))))) y))
but is expected to have type
  forall {A : Type.{u2}} [_inst_5 : CommRing.{u2} A] [_inst_6 : IsDomain.{u2} A (Ring.toSemiring.{u2} A (CommRing.toRing.{u2} A _inst_5))] {K : Type.{u1}} [_inst_9 : Field.{u1} K] [_inst_11 : Algebra.{u2, u1} A K (CommRing.toCommSemiring.{u2} A _inst_5) (DivisionSemiring.toSemiring.{u1} K (Semifield.toDivisionSemiring.{u1} K (Field.toSemifield.{u1} K _inst_9)))] [_inst_12 : IsFractionRing.{u2, u1} A _inst_5 K (Field.toCommRing.{u1} K _inst_9) _inst_11] {x : A} {y : Subtype.{succ u2} A (fun (x : A) => Membership.mem.{u2, u2} A (Submonoid.{u2} A (MulZeroOneClass.toMulOneClass.{u2} A (MonoidWithZero.toMulZeroOneClass.{u2} A (Semiring.toMonoidWithZero.{u2} A (Ring.toSemiring.{u2} A (CommRing.toRing.{u2} A _inst_5)))))) (SetLike.instMembership.{u2, u2} (Submonoid.{u2} A (MulZeroOneClass.toMulOneClass.{u2} A (MonoidWithZero.toMulZeroOneClass.{u2} A (Semiring.toMonoidWithZero.{u2} A (Ring.toSemiring.{u2} A (CommRing.toRing.{u2} A _inst_5)))))) A (Submonoid.instSetLikeSubmonoid.{u2} A (MulZeroOneClass.toMulOneClass.{u2} A (MonoidWithZero.toMulZeroOneClass.{u2} A (Semiring.toMonoidWithZero.{u2} A (Ring.toSemiring.{u2} A (CommRing.toRing.{u2} A _inst_5))))))) x (nonZeroDivisors.{u2} A (Semiring.toMonoidWithZero.{u2} A (Ring.toSemiring.{u2} A (CommRing.toRing.{u2} A _inst_5)))))}, Iff (Eq.{succ u1} K (IsLocalization.mk'.{u2, u1} A (CommRing.toCommSemiring.{u2} A _inst_5) (nonZeroDivisors.{u2} A (Semiring.toMonoidWithZero.{u2} A (Ring.toSemiring.{u2} A (CommRing.toRing.{u2} A _inst_5)))) K (Semifield.toCommSemiring.{u1} K (Field.toSemifield.{u1} K _inst_9)) _inst_11 _inst_12 x y) (OfNat.ofNat.{u1} K 1 (One.toOfNat1.{u1} K (NonAssocRing.toOne.{u1} K (Ring.toNonAssocRing.{u1} K (DivisionRing.toRing.{u1} K (Field.toDivisionRing.{u1} K _inst_9))))))) (Eq.{succ u2} A x (Subtype.val.{succ u2} A (fun (x : A) => Membership.mem.{u2, u2} A (Set.{u2} A) (Set.instMembershipSet.{u2} A) x (SetLike.coe.{u2, u2} (Submonoid.{u2} A (MulZeroOneClass.toMulOneClass.{u2} A (MonoidWithZero.toMulZeroOneClass.{u2} A (Semiring.toMonoidWithZero.{u2} A (Ring.toSemiring.{u2} A (CommRing.toRing.{u2} A _inst_5)))))) A (Submonoid.instSetLikeSubmonoid.{u2} A (MulZeroOneClass.toMulOneClass.{u2} A (MonoidWithZero.toMulZeroOneClass.{u2} A (Semiring.toMonoidWithZero.{u2} A (Ring.toSemiring.{u2} A (CommRing.toRing.{u2} A _inst_5)))))) (nonZeroDivisors.{u2} A (Semiring.toMonoidWithZero.{u2} A (Ring.toSemiring.{u2} A (CommRing.toRing.{u2} A _inst_5)))))) y))
Case conversion may be inaccurate. Consider using '#align is_fraction_ring.mk'_eq_one_iff_eq IsFractionRing.mk'_eq_one_iff_eqₓ'. -/
theorem mk'_eq_one_iff_eq {x : A} {y : nonZeroDivisors A} : mk' K x y = 1 ↔ x = y :=
  by
  refine' ⟨_, fun hxy => by rw [hxy, mk'_self']⟩
  · intro hxy
    have hy : (algebraMap A K) ↑y ≠ (0 : K) :=
      IsFractionRing.to_map_ne_zero_of_mem_nonZeroDivisors y.property
    rw [IsFractionRing.mk'_eq_div, div_eq_one_iff_eq hy] at hxy
    exact IsFractionRing.injective A K hxy
#align is_fraction_ring.mk'_eq_one_iff_eq IsFractionRing.mk'_eq_one_iff_eq

open Function

/- warning: is_fraction_ring.lift -> IsFractionRing.lift is a dubious translation:
lean 3 declaration is
  forall {A : Type.{u1}} [_inst_5 : CommRing.{u1} A] [_inst_6 : IsDomain.{u1} A (Ring.toSemiring.{u1} A (CommRing.toRing.{u1} A _inst_5))] {K : Type.{u2}} [_inst_9 : Field.{u2} K] {L : Type.{u3}} [_inst_10 : Field.{u3} L] [_inst_11 : Algebra.{u1, u2} A K (CommRing.toCommSemiring.{u1} A _inst_5) (Ring.toSemiring.{u2} K (DivisionRing.toRing.{u2} K (Field.toDivisionRing.{u2} K _inst_9)))] [_inst_12 : IsFractionRing.{u1, u2} A _inst_5 K (Field.toCommRing.{u2} K _inst_9) _inst_11] {g : RingHom.{u1, u3} A L (NonAssocRing.toNonAssocSemiring.{u1} A (Ring.toNonAssocRing.{u1} A (CommRing.toRing.{u1} A _inst_5))) (NonAssocRing.toNonAssocSemiring.{u3} L (Ring.toNonAssocRing.{u3} L (DivisionRing.toRing.{u3} L (Field.toDivisionRing.{u3} L _inst_10))))}, (Function.Injective.{succ u1, succ u3} A L (coeFn.{max (succ u1) (succ u3), max (succ u1) (succ u3)} (RingHom.{u1, u3} A L (NonAssocRing.toNonAssocSemiring.{u1} A (Ring.toNonAssocRing.{u1} A (CommRing.toRing.{u1} A _inst_5))) (NonAssocRing.toNonAssocSemiring.{u3} L (Ring.toNonAssocRing.{u3} L (DivisionRing.toRing.{u3} L (Field.toDivisionRing.{u3} L _inst_10))))) (fun (_x : RingHom.{u1, u3} A L (NonAssocRing.toNonAssocSemiring.{u1} A (Ring.toNonAssocRing.{u1} A (CommRing.toRing.{u1} A _inst_5))) (NonAssocRing.toNonAssocSemiring.{u3} L (Ring.toNonAssocRing.{u3} L (DivisionRing.toRing.{u3} L (Field.toDivisionRing.{u3} L _inst_10))))) => A -> L) (RingHom.hasCoeToFun.{u1, u3} A L (NonAssocRing.toNonAssocSemiring.{u1} A (Ring.toNonAssocRing.{u1} A (CommRing.toRing.{u1} A _inst_5))) (NonAssocRing.toNonAssocSemiring.{u3} L (Ring.toNonAssocRing.{u3} L (DivisionRing.toRing.{u3} L (Field.toDivisionRing.{u3} L _inst_10))))) g)) -> (RingHom.{u2, u3} K L (NonAssocRing.toNonAssocSemiring.{u2} K (Ring.toNonAssocRing.{u2} K (DivisionRing.toRing.{u2} K (Field.toDivisionRing.{u2} K _inst_9)))) (NonAssocRing.toNonAssocSemiring.{u3} L (Ring.toNonAssocRing.{u3} L (DivisionRing.toRing.{u3} L (Field.toDivisionRing.{u3} L _inst_10)))))
but is expected to have type
  forall {A : Type.{u1}} [_inst_5 : CommRing.{u1} A] [_inst_6 : IsDomain.{u1} A (Ring.toSemiring.{u1} A (CommRing.toRing.{u1} A _inst_5))] {K : Type.{u2}} [_inst_9 : Field.{u2} K] {L : Type.{u3}} [_inst_10 : Field.{u3} L] [_inst_11 : Algebra.{u1, u2} A K (CommRing.toCommSemiring.{u1} A _inst_5) (DivisionSemiring.toSemiring.{u2} K (Semifield.toDivisionSemiring.{u2} K (Field.toSemifield.{u2} K _inst_9)))] [_inst_12 : IsFractionRing.{u1, u2} A _inst_5 K (Field.toCommRing.{u2} K _inst_9) _inst_11] {g : RingHom.{u1, u3} A L (NonAssocRing.toNonAssocSemiring.{u1} A (Ring.toNonAssocRing.{u1} A (CommRing.toRing.{u1} A _inst_5))) (NonAssocRing.toNonAssocSemiring.{u3} L (Ring.toNonAssocRing.{u3} L (DivisionRing.toRing.{u3} L (Field.toDivisionRing.{u3} L _inst_10))))}, (Function.Injective.{succ u1, succ u3} A L (FunLike.coe.{max (succ u1) (succ u3), succ u1, succ u3} (RingHom.{u1, u3} A L (NonAssocRing.toNonAssocSemiring.{u1} A (Ring.toNonAssocRing.{u1} A (CommRing.toRing.{u1} A _inst_5))) (NonAssocRing.toNonAssocSemiring.{u3} L (Ring.toNonAssocRing.{u3} L (DivisionRing.toRing.{u3} L (Field.toDivisionRing.{u3} L _inst_10))))) A (fun (_x : A) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : A) => L) _x) (MulHomClass.toFunLike.{max u1 u3, u1, u3} (RingHom.{u1, u3} A L (NonAssocRing.toNonAssocSemiring.{u1} A (Ring.toNonAssocRing.{u1} A (CommRing.toRing.{u1} A _inst_5))) (NonAssocRing.toNonAssocSemiring.{u3} L (Ring.toNonAssocRing.{u3} L (DivisionRing.toRing.{u3} L (Field.toDivisionRing.{u3} L _inst_10))))) A L (NonUnitalNonAssocSemiring.toMul.{u1} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} A (NonAssocRing.toNonAssocSemiring.{u1} A (Ring.toNonAssocRing.{u1} A (CommRing.toRing.{u1} A _inst_5))))) (NonUnitalNonAssocSemiring.toMul.{u3} L (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} L (NonAssocRing.toNonAssocSemiring.{u3} L (Ring.toNonAssocRing.{u3} L (DivisionRing.toRing.{u3} L (Field.toDivisionRing.{u3} L _inst_10)))))) (NonUnitalRingHomClass.toMulHomClass.{max u1 u3, u1, u3} (RingHom.{u1, u3} A L (NonAssocRing.toNonAssocSemiring.{u1} A (Ring.toNonAssocRing.{u1} A (CommRing.toRing.{u1} A _inst_5))) (NonAssocRing.toNonAssocSemiring.{u3} L (Ring.toNonAssocRing.{u3} L (DivisionRing.toRing.{u3} L (Field.toDivisionRing.{u3} L _inst_10))))) A L (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} A (NonAssocRing.toNonAssocSemiring.{u1} A (Ring.toNonAssocRing.{u1} A (CommRing.toRing.{u1} A _inst_5)))) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} L (NonAssocRing.toNonAssocSemiring.{u3} L (Ring.toNonAssocRing.{u3} L (DivisionRing.toRing.{u3} L (Field.toDivisionRing.{u3} L _inst_10))))) (RingHomClass.toNonUnitalRingHomClass.{max u1 u3, u1, u3} (RingHom.{u1, u3} A L (NonAssocRing.toNonAssocSemiring.{u1} A (Ring.toNonAssocRing.{u1} A (CommRing.toRing.{u1} A _inst_5))) (NonAssocRing.toNonAssocSemiring.{u3} L (Ring.toNonAssocRing.{u3} L (DivisionRing.toRing.{u3} L (Field.toDivisionRing.{u3} L _inst_10))))) A L (NonAssocRing.toNonAssocSemiring.{u1} A (Ring.toNonAssocRing.{u1} A (CommRing.toRing.{u1} A _inst_5))) (NonAssocRing.toNonAssocSemiring.{u3} L (Ring.toNonAssocRing.{u3} L (DivisionRing.toRing.{u3} L (Field.toDivisionRing.{u3} L _inst_10)))) (RingHom.instRingHomClassRingHom.{u1, u3} A L (NonAssocRing.toNonAssocSemiring.{u1} A (Ring.toNonAssocRing.{u1} A (CommRing.toRing.{u1} A _inst_5))) (NonAssocRing.toNonAssocSemiring.{u3} L (Ring.toNonAssocRing.{u3} L (DivisionRing.toRing.{u3} L (Field.toDivisionRing.{u3} L _inst_10)))))))) g)) -> (RingHom.{u2, u3} K L (NonAssocRing.toNonAssocSemiring.{u2} K (Ring.toNonAssocRing.{u2} K (DivisionRing.toRing.{u2} K (Field.toDivisionRing.{u2} K _inst_9)))) (NonAssocRing.toNonAssocSemiring.{u3} L (Ring.toNonAssocRing.{u3} L (DivisionRing.toRing.{u3} L (Field.toDivisionRing.{u3} L _inst_10)))))
Case conversion may be inaccurate. Consider using '#align is_fraction_ring.lift IsFractionRing.liftₓ'. -/
/-- 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 × (non_zero_divisors A)` are
such that `z = f x * (f y)⁻¹`. -/
noncomputable def lift (hg : Injective g) : K →+* L :=
  lift fun y : nonZeroDivisors A => isUnit_map_of_injective hg y
#align is_fraction_ring.lift IsFractionRing.lift

/- warning: is_fraction_ring.lift_algebra_map -> IsFractionRing.lift_algebraMap is a dubious translation:
lean 3 declaration is
  forall {A : Type.{u1}} [_inst_5 : CommRing.{u1} A] [_inst_6 : IsDomain.{u1} A (Ring.toSemiring.{u1} A (CommRing.toRing.{u1} A _inst_5))] {K : Type.{u2}} [_inst_9 : Field.{u2} K] {L : Type.{u3}} [_inst_10 : Field.{u3} L] [_inst_11 : Algebra.{u1, u2} A K (CommRing.toCommSemiring.{u1} A _inst_5) (Ring.toSemiring.{u2} K (DivisionRing.toRing.{u2} K (Field.toDivisionRing.{u2} K _inst_9)))] [_inst_12 : IsFractionRing.{u1, u2} A _inst_5 K (Field.toCommRing.{u2} K _inst_9) _inst_11] {g : RingHom.{u1, u3} A L (NonAssocRing.toNonAssocSemiring.{u1} A (Ring.toNonAssocRing.{u1} A (CommRing.toRing.{u1} A _inst_5))) (NonAssocRing.toNonAssocSemiring.{u3} L (Ring.toNonAssocRing.{u3} L (DivisionRing.toRing.{u3} L (Field.toDivisionRing.{u3} L _inst_10))))} (hg : Function.Injective.{succ u1, succ u3} A L (coeFn.{max (succ u1) (succ u3), max (succ u1) (succ u3)} (RingHom.{u1, u3} A L (NonAssocRing.toNonAssocSemiring.{u1} A (Ring.toNonAssocRing.{u1} A (CommRing.toRing.{u1} A _inst_5))) (NonAssocRing.toNonAssocSemiring.{u3} L (Ring.toNonAssocRing.{u3} L (DivisionRing.toRing.{u3} L (Field.toDivisionRing.{u3} L _inst_10))))) (fun (_x : RingHom.{u1, u3} A L (NonAssocRing.toNonAssocSemiring.{u1} A (Ring.toNonAssocRing.{u1} A (CommRing.toRing.{u1} A _inst_5))) (NonAssocRing.toNonAssocSemiring.{u3} L (Ring.toNonAssocRing.{u3} L (DivisionRing.toRing.{u3} L (Field.toDivisionRing.{u3} L _inst_10))))) => A -> L) (RingHom.hasCoeToFun.{u1, u3} A L (NonAssocRing.toNonAssocSemiring.{u1} A (Ring.toNonAssocRing.{u1} A (CommRing.toRing.{u1} A _inst_5))) (NonAssocRing.toNonAssocSemiring.{u3} L (Ring.toNonAssocRing.{u3} L (DivisionRing.toRing.{u3} L (Field.toDivisionRing.{u3} L _inst_10))))) g)) (x : A), Eq.{succ u3} L (coeFn.{max (succ u2) (succ u3), max (succ u2) (succ u3)} (RingHom.{u2, u3} K L (NonAssocRing.toNonAssocSemiring.{u2} K (Ring.toNonAssocRing.{u2} K (DivisionRing.toRing.{u2} K (Field.toDivisionRing.{u2} K _inst_9)))) (NonAssocRing.toNonAssocSemiring.{u3} L (Ring.toNonAssocRing.{u3} L (DivisionRing.toRing.{u3} L (Field.toDivisionRing.{u3} L _inst_10))))) (fun (_x : RingHom.{u2, u3} K L (NonAssocRing.toNonAssocSemiring.{u2} K (Ring.toNonAssocRing.{u2} K (DivisionRing.toRing.{u2} K (Field.toDivisionRing.{u2} K _inst_9)))) (NonAssocRing.toNonAssocSemiring.{u3} L (Ring.toNonAssocRing.{u3} L (DivisionRing.toRing.{u3} L (Field.toDivisionRing.{u3} L _inst_10))))) => K -> L) (RingHom.hasCoeToFun.{u2, u3} K L (NonAssocRing.toNonAssocSemiring.{u2} K (Ring.toNonAssocRing.{u2} K (DivisionRing.toRing.{u2} K (Field.toDivisionRing.{u2} K _inst_9)))) (NonAssocRing.toNonAssocSemiring.{u3} L (Ring.toNonAssocRing.{u3} L (DivisionRing.toRing.{u3} L (Field.toDivisionRing.{u3} L _inst_10))))) (IsFractionRing.lift.{u1, u2, u3} A _inst_5 _inst_6 K _inst_9 L _inst_10 _inst_11 _inst_12 g hg) (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RingHom.{u1, u2} A K (Semiring.toNonAssocSemiring.{u1} A (CommSemiring.toSemiring.{u1} A (CommRing.toCommSemiring.{u1} A _inst_5))) (Semiring.toNonAssocSemiring.{u2} K (Ring.toSemiring.{u2} K (DivisionRing.toRing.{u2} K (Field.toDivisionRing.{u2} K _inst_9))))) (fun (_x : RingHom.{u1, u2} A K (Semiring.toNonAssocSemiring.{u1} A (CommSemiring.toSemiring.{u1} A (CommRing.toCommSemiring.{u1} A _inst_5))) (Semiring.toNonAssocSemiring.{u2} K (Ring.toSemiring.{u2} K (DivisionRing.toRing.{u2} K (Field.toDivisionRing.{u2} K _inst_9))))) => A -> K) (RingHom.hasCoeToFun.{u1, u2} A K (Semiring.toNonAssocSemiring.{u1} A (CommSemiring.toSemiring.{u1} A (CommRing.toCommSemiring.{u1} A _inst_5))) (Semiring.toNonAssocSemiring.{u2} K (Ring.toSemiring.{u2} K (DivisionRing.toRing.{u2} K (Field.toDivisionRing.{u2} K _inst_9))))) (algebraMap.{u1, u2} A K (CommRing.toCommSemiring.{u1} A _inst_5) (Ring.toSemiring.{u2} K (DivisionRing.toRing.{u2} K (Field.toDivisionRing.{u2} K _inst_9))) _inst_11) x)) (coeFn.{max (succ u1) (succ u3), max (succ u1) (succ u3)} (RingHom.{u1, u3} A L (NonAssocRing.toNonAssocSemiring.{u1} A (Ring.toNonAssocRing.{u1} A (CommRing.toRing.{u1} A _inst_5))) (NonAssocRing.toNonAssocSemiring.{u3} L (Ring.toNonAssocRing.{u3} L (DivisionRing.toRing.{u3} L (Field.toDivisionRing.{u3} L _inst_10))))) (fun (_x : RingHom.{u1, u3} A L (NonAssocRing.toNonAssocSemiring.{u1} A (Ring.toNonAssocRing.{u1} A (CommRing.toRing.{u1} A _inst_5))) (NonAssocRing.toNonAssocSemiring.{u3} L (Ring.toNonAssocRing.{u3} L (DivisionRing.toRing.{u3} L (Field.toDivisionRing.{u3} L _inst_10))))) => A -> L) (RingHom.hasCoeToFun.{u1, u3} A L (NonAssocRing.toNonAssocSemiring.{u1} A (Ring.toNonAssocRing.{u1} A (CommRing.toRing.{u1} A _inst_5))) (NonAssocRing.toNonAssocSemiring.{u3} L (Ring.toNonAssocRing.{u3} L (DivisionRing.toRing.{u3} L (Field.toDivisionRing.{u3} L _inst_10))))) g x)
but is expected to have type
  forall {A : Type.{u3}} [_inst_5 : CommRing.{u3} A] [_inst_6 : IsDomain.{u3} A (Ring.toSemiring.{u3} A (CommRing.toRing.{u3} A _inst_5))] {K : Type.{u1}} [_inst_9 : Field.{u1} K] {L : Type.{u2}} [_inst_10 : Field.{u2} L] [_inst_11 : Algebra.{u3, u1} A K (CommRing.toCommSemiring.{u3} A _inst_5) (DivisionSemiring.toSemiring.{u1} K (Semifield.toDivisionSemiring.{u1} K (Field.toSemifield.{u1} K _inst_9)))] [_inst_12 : IsFractionRing.{u3, u1} A _inst_5 K (Field.toCommRing.{u1} K _inst_9) _inst_11] {g : RingHom.{u3, u2} A L (NonAssocRing.toNonAssocSemiring.{u3} A (Ring.toNonAssocRing.{u3} A (CommRing.toRing.{u3} A _inst_5))) (NonAssocRing.toNonAssocSemiring.{u2} L (Ring.toNonAssocRing.{u2} L (DivisionRing.toRing.{u2} L (Field.toDivisionRing.{u2} L _inst_10))))} (hg : Function.Injective.{succ u3, succ u2} A L (FunLike.coe.{max (succ u3) (succ u2), succ u3, succ u2} (RingHom.{u3, u2} A L (NonAssocRing.toNonAssocSemiring.{u3} A (Ring.toNonAssocRing.{u3} A (CommRing.toRing.{u3} A _inst_5))) (NonAssocRing.toNonAssocSemiring.{u2} L (Ring.toNonAssocRing.{u2} L (DivisionRing.toRing.{u2} L (Field.toDivisionRing.{u2} L _inst_10))))) A (fun (_x : A) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : A) => L) _x) (MulHomClass.toFunLike.{max u3 u2, u3, u2} (RingHom.{u3, u2} A L (NonAssocRing.toNonAssocSemiring.{u3} A (Ring.toNonAssocRing.{u3} A (CommRing.toRing.{u3} A _inst_5))) (NonAssocRing.toNonAssocSemiring.{u2} L (Ring.toNonAssocRing.{u2} L (DivisionRing.toRing.{u2} L (Field.toDivisionRing.{u2} L _inst_10))))) A L (NonUnitalNonAssocSemiring.toMul.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (NonAssocRing.toNonAssocSemiring.{u3} A (Ring.toNonAssocRing.{u3} A (CommRing.toRing.{u3} A _inst_5))))) (NonUnitalNonAssocSemiring.toMul.{u2} L (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} L (NonAssocRing.toNonAssocSemiring.{u2} L (Ring.toNonAssocRing.{u2} L (DivisionRing.toRing.{u2} L (Field.toDivisionRing.{u2} L _inst_10)))))) (NonUnitalRingHomClass.toMulHomClass.{max u3 u2, u3, u2} (RingHom.{u3, u2} A L (NonAssocRing.toNonAssocSemiring.{u3} A (Ring.toNonAssocRing.{u3} A (CommRing.toRing.{u3} A _inst_5))) (NonAssocRing.toNonAssocSemiring.{u2} L (Ring.toNonAssocRing.{u2} L (DivisionRing.toRing.{u2} L (Field.toDivisionRing.{u2} L _inst_10))))) A L (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (NonAssocRing.toNonAssocSemiring.{u3} A (Ring.toNonAssocRing.{u3} A (CommRing.toRing.{u3} A _inst_5)))) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} L (NonAssocRing.toNonAssocSemiring.{u2} L (Ring.toNonAssocRing.{u2} L (DivisionRing.toRing.{u2} L (Field.toDivisionRing.{u2} L _inst_10))))) (RingHomClass.toNonUnitalRingHomClass.{max u3 u2, u3, u2} (RingHom.{u3, u2} A L (NonAssocRing.toNonAssocSemiring.{u3} A (Ring.toNonAssocRing.{u3} A (CommRing.toRing.{u3} A _inst_5))) (NonAssocRing.toNonAssocSemiring.{u2} L (Ring.toNonAssocRing.{u2} L (DivisionRing.toRing.{u2} L (Field.toDivisionRing.{u2} L _inst_10))))) A L (NonAssocRing.toNonAssocSemiring.{u3} A (Ring.toNonAssocRing.{u3} A (CommRing.toRing.{u3} A _inst_5))) (NonAssocRing.toNonAssocSemiring.{u2} L (Ring.toNonAssocRing.{u2} L (DivisionRing.toRing.{u2} L (Field.toDivisionRing.{u2} L _inst_10)))) (RingHom.instRingHomClassRingHom.{u3, u2} A L (NonAssocRing.toNonAssocSemiring.{u3} A (Ring.toNonAssocRing.{u3} A (CommRing.toRing.{u3} A _inst_5))) (NonAssocRing.toNonAssocSemiring.{u2} L (Ring.toNonAssocRing.{u2} L (DivisionRing.toRing.{u2} L (Field.toDivisionRing.{u2} L _inst_10)))))))) g)) (x : A), Eq.{succ u2} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : A) => K) x) => L) (FunLike.coe.{max (succ u3) (succ u1), succ u3, succ u1} (RingHom.{u3, u1} A K (Semiring.toNonAssocSemiring.{u3} A (CommSemiring.toSemiring.{u3} A (CommRing.toCommSemiring.{u3} A _inst_5))) (Semiring.toNonAssocSemiring.{u1} K (DivisionSemiring.toSemiring.{u1} K (Semifield.toDivisionSemiring.{u1} K (Field.toSemifield.{u1} K _inst_9))))) A (fun (a : A) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : A) => K) a) (MulHomClass.toFunLike.{max u3 u1, u3, u1} (RingHom.{u3, u1} A K (Semiring.toNonAssocSemiring.{u3} A (CommSemiring.toSemiring.{u3} A (CommRing.toCommSemiring.{u3} A _inst_5))) (Semiring.toNonAssocSemiring.{u1} K (DivisionSemiring.toSemiring.{u1} K (Semifield.toDivisionSemiring.{u1} K (Field.toSemifield.{u1} K _inst_9))))) A K (NonUnitalNonAssocSemiring.toMul.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A (CommSemiring.toSemiring.{u3} A (CommRing.toCommSemiring.{u3} A _inst_5))))) (NonUnitalNonAssocSemiring.toMul.{u1} K (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} K (Semiring.toNonAssocSemiring.{u1} K (DivisionSemiring.toSemiring.{u1} K (Semifield.toDivisionSemiring.{u1} K (Field.toSemifield.{u1} K _inst_9)))))) (NonUnitalRingHomClass.toMulHomClass.{max u3 u1, u3, u1} (RingHom.{u3, u1} A K (Semiring.toNonAssocSemiring.{u3} A (CommSemiring.toSemiring.{u3} A (CommRing.toCommSemiring.{u3} A _inst_5))) (Semiring.toNonAssocSemiring.{u1} K (DivisionSemiring.toSemiring.{u1} K (Semifield.toDivisionSemiring.{u1} K (Field.toSemifield.{u1} K _inst_9))))) A K (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A (CommSemiring.toSemiring.{u3} A (CommRing.toCommSemiring.{u3} A _inst_5)))) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} K (Semiring.toNonAssocSemiring.{u1} K (DivisionSemiring.toSemiring.{u1} K (Semifield.toDivisionSemiring.{u1} K (Field.toSemifield.{u1} K _inst_9))))) (RingHomClass.toNonUnitalRingHomClass.{max u3 u1, u3, u1} (RingHom.{u3, u1} A K (Semiring.toNonAssocSemiring.{u3} A (CommSemiring.toSemiring.{u3} A (CommRing.toCommSemiring.{u3} A _inst_5))) (Semiring.toNonAssocSemiring.{u1} K (DivisionSemiring.toSemiring.{u1} K (Semifield.toDivisionSemiring.{u1} K (Field.toSemifield.{u1} K _inst_9))))) A K (Semiring.toNonAssocSemiring.{u3} A (CommSemiring.toSemiring.{u3} A (CommRing.toCommSemiring.{u3} A _inst_5))) (Semiring.toNonAssocSemiring.{u1} K (DivisionSemiring.toSemiring.{u1} K (Semifield.toDivisionSemiring.{u1} K (Field.toSemifield.{u1} K _inst_9)))) (RingHom.instRingHomClassRingHom.{u3, u1} A K (Semiring.toNonAssocSemiring.{u3} A (CommSemiring.toSemiring.{u3} A (CommRing.toCommSemiring.{u3} A _inst_5))) (Semiring.toNonAssocSemiring.{u1} K (DivisionSemiring.toSemiring.{u1} K (Semifield.toDivisionSemiring.{u1} K (Field.toSemifield.{u1} K _inst_9)))))))) (algebraMap.{u3, u1} A K (CommRing.toCommSemiring.{u3} A _inst_5) (DivisionSemiring.toSemiring.{u1} K (Semifield.toDivisionSemiring.{u1} K (Field.toSemifield.{u1} K _inst_9))) _inst_11) x)) (FunLike.coe.{max (succ u2) (succ u1), succ u1, succ u2} (RingHom.{u1, u2} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : A) => K) x) L (NonAssocRing.toNonAssocSemiring.{u1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : A) => K) x) (Ring.toNonAssocRing.{u1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : A) => K) x) (DivisionRing.toRing.{u1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : A) => K) x) (Field.toDivisionRing.{u1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : A) => K) x) _inst_9)))) (NonAssocRing.toNonAssocSemiring.{u2} L (Ring.toNonAssocRing.{u2} L (DivisionRing.toRing.{u2} L (Field.toDivisionRing.{u2} L _inst_10))))) ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : A) => K) x) (fun (_x : (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : A) => K) x) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : A) => K) x) => L) _x) (MulHomClass.toFunLike.{max u2 u1, u1, u2} (RingHom.{u1, u2} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : A) => K) x) L (NonAssocRing.toNonAssocSemiring.{u1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : A) => K) x) (Ring.toNonAssocRing.{u1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : A) => K) x) (DivisionRing.toRing.{u1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : A) => K) x) (Field.toDivisionRing.{u1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : A) => K) x) _inst_9)))) (NonAssocRing.toNonAssocSemiring.{u2} L (Ring.toNonAssocRing.{u2} L (DivisionRing.toRing.{u2} L (Field.toDivisionRing.{u2} L _inst_10))))) ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : A) => K) x) L (NonUnitalNonAssocSemiring.toMul.{u1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : A) => K) x) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : A) => K) x) (NonAssocRing.toNonAssocSemiring.{u1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : A) => K) x) (Ring.toNonAssocRing.{u1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : A) => K) x) (DivisionRing.toRing.{u1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : A) => K) x) (Field.toDivisionRing.{u1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : A) => K) x) _inst_9)))))) (NonUnitalNonAssocSemiring.toMul.{u2} L (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} L (NonAssocRing.toNonAssocSemiring.{u2} L (Ring.toNonAssocRing.{u2} L (DivisionRing.toRing.{u2} L (Field.toDivisionRing.{u2} L _inst_10)))))) (NonUnitalRingHomClass.toMulHomClass.{max u2 u1, u1, u2} (RingHom.{u1, u2} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : A) => K) x) L (NonAssocRing.toNonAssocSemiring.{u1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : A) => K) x) (Ring.toNonAssocRing.{u1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : A) => K) x) (DivisionRing.toRing.{u1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : A) => K) x) (Field.toDivisionRing.{u1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : A) => K) x) _inst_9)))) (NonAssocRing.toNonAssocSemiring.{u2} L (Ring.toNonAssocRing.{u2} L (DivisionRing.toRing.{u2} L (Field.toDivisionRing.{u2} L _inst_10))))) ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : A) => K) x) L (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : A) => K) x) (NonAssocRing.toNonAssocSemiring.{u1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : A) => K) x) (Ring.toNonAssocRing.{u1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : A) => K) x) (DivisionRing.toRing.{u1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : A) => K) x) (Field.toDivisionRing.{u1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : A) => K) x) _inst_9))))) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} L (NonAssocRing.toNonAssocSemiring.{u2} L (Ring.toNonAssocRing.{u2} L (DivisionRing.toRing.{u2} L (Field.toDivisionRing.{u2} L _inst_10))))) (RingHomClass.toNonUnitalRingHomClass.{max u2 u1, u1, u2} (RingHom.{u1, u2} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : A) => K) x) L (NonAssocRing.toNonAssocSemiring.{u1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : A) => K) x) (Ring.toNonAssocRing.{u1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : A) => K) x) (DivisionRing.toRing.{u1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : A) => K) x) (Field.toDivisionRing.{u1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : A) => K) x) _inst_9)))) (NonAssocRing.toNonAssocSemiring.{u2} L (Ring.toNonAssocRing.{u2} L (DivisionRing.toRing.{u2} L (Field.toDivisionRing.{u2} L _inst_10))))) ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : A) => K) x) L (NonAssocRing.toNonAssocSemiring.{u1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : A) => K) x) (Ring.toNonAssocRing.{u1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : A) => K) x) (DivisionRing.toRing.{u1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : A) => K) x) (Field.toDivisionRing.{u1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : A) => K) x) _inst_9)))) (NonAssocRing.toNonAssocSemiring.{u2} L (Ring.toNonAssocRing.{u2} L (DivisionRing.toRing.{u2} L (Field.toDivisionRing.{u2} L _inst_10)))) (RingHom.instRingHomClassRingHom.{u1, u2} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : A) => K) x) L (NonAssocRing.toNonAssocSemiring.{u1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : A) => K) x) (Ring.toNonAssocRing.{u1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : A) => K) x) (DivisionRing.toRing.{u1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : A) => K) x) (Field.toDivisionRing.{u1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : A) => K) x) _inst_9)))) (NonAssocRing.toNonAssocSemiring.{u2} L (Ring.toNonAssocRing.{u2} L (DivisionRing.toRing.{u2} L (Field.toDivisionRing.{u2} L _inst_10)))))))) (IsFractionRing.lift.{u3, u1, u2} A _inst_5 _inst_6 ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : A) => K) x) _inst_9 L _inst_10 _inst_11 _inst_12 g hg) (FunLike.coe.{max (succ u3) (succ u1), succ u3, succ u1} (RingHom.{u3, u1} A K (Semiring.toNonAssocSemiring.{u3} A (CommSemiring.toSemiring.{u3} A (CommRing.toCommSemiring.{u3} A _inst_5))) (Semiring.toNonAssocSemiring.{u1} K (DivisionSemiring.toSemiring.{u1} K (Semifield.toDivisionSemiring.{u1} K (Field.toSemifield.{u1} K _inst_9))))) A (fun (_x : A) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : A) => K) _x) (MulHomClass.toFunLike.{max u3 u1, u3, u1} (RingHom.{u3, u1} A K (Semiring.toNonAssocSemiring.{u3} A (CommSemiring.toSemiring.{u3} A (CommRing.toCommSemiring.{u3} A _inst_5))) (Semiring.toNonAssocSemiring.{u1} K (DivisionSemiring.toSemiring.{u1} K (Semifield.toDivisionSemiring.{u1} K (Field.toSemifield.{u1} K _inst_9))))) A K (NonUnitalNonAssocSemiring.toMul.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A (CommSemiring.toSemiring.{u3} A (CommRing.toCommSemiring.{u3} A _inst_5))))) (NonUnitalNonAssocSemiring.toMul.{u1} K (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} K (Semiring.toNonAssocSemiring.{u1} K (DivisionSemiring.toSemiring.{u1} K (Semifield.toDivisionSemiring.{u1} K (Field.toSemifield.{u1} K _inst_9)))))) (NonUnitalRingHomClass.toMulHomClass.{max u3 u1, u3, u1} (RingHom.{u3, u1} A K (Semiring.toNonAssocSemiring.{u3} A (CommSemiring.toSemiring.{u3} A (CommRing.toCommSemiring.{u3} A _inst_5))) (Semiring.toNonAssocSemiring.{u1} K (DivisionSemiring.toSemiring.{u1} K (Semifield.toDivisionSemiring.{u1} K (Field.toSemifield.{u1} K _inst_9))))) A K (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A (CommSemiring.toSemiring.{u3} A (CommRing.toCommSemiring.{u3} A _inst_5)))) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} K (Semiring.toNonAssocSemiring.{u1} K (DivisionSemiring.toSemiring.{u1} K (Semifield.toDivisionSemiring.{u1} K (Field.toSemifield.{u1} K _inst_9))))) (RingHomClass.toNonUnitalRingHomClass.{max u3 u1, u3, u1} (RingHom.{u3, u1} A K (Semiring.toNonAssocSemiring.{u3} A (CommSemiring.toSemiring.{u3} A (CommRing.toCommSemiring.{u3} A _inst_5))) (Semiring.toNonAssocSemiring.{u1} K (DivisionSemiring.toSemiring.{u1} K (Semifield.toDivisionSemiring.{u1} K (Field.toSemifield.{u1} K _inst_9))))) A K (Semiring.toNonAssocSemiring.{u3} A (CommSemiring.toSemiring.{u3} A (CommRing.toCommSemiring.{u3} A _inst_5))) (Semiring.toNonAssocSemiring.{u1} K (DivisionSemiring.toSemiring.{u1} K (Semifield.toDivisionSemiring.{u1} K (Field.toSemifield.{u1} K _inst_9)))) (RingHom.instRingHomClassRingHom.{u3, u1} A K (Semiring.toNonAssocSemiring.{u3} A (CommSemiring.toSemiring.{u3} A (CommRing.toCommSemiring.{u3} A _inst_5))) (Semiring.toNonAssocSemiring.{u1} K (DivisionSemiring.toSemiring.{u1} K (Semifield.toDivisionSemiring.{u1} K (Field.toSemifield.{u1} K _inst_9)))))))) (algebraMap.{u3, u1} A K (CommRing.toCommSemiring.{u3} A _inst_5) (DivisionSemiring.toSemiring.{u1} K (Semifield.toDivisionSemiring.{u1} K (Field.toSemifield.{u1} K _inst_9))) _inst_11) x)) (FunLike.coe.{max (succ u3) (succ u2), succ u3, succ u2} (RingHom.{u3, u2} A L (NonAssocRing.toNonAssocSemiring.{u3} A (Ring.toNonAssocRing.{u3} A (CommRing.toRing.{u3} A _inst_5))) (NonAssocRing.toNonAssocSemiring.{u2} L (Ring.toNonAssocRing.{u2} L (DivisionRing.toRing.{u2} L (Field.toDivisionRing.{u2} L _inst_10))))) A (fun (_x : A) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : A) => L) _x) (MulHomClass.toFunLike.{max u3 u2, u3, u2} (RingHom.{u3, u2} A L (NonAssocRing.toNonAssocSemiring.{u3} A (Ring.toNonAssocRing.{u3} A (CommRing.toRing.{u3} A _inst_5))) (NonAssocRing.toNonAssocSemiring.{u2} L (Ring.toNonAssocRing.{u2} L (DivisionRing.toRing.{u2} L (Field.toDivisionRing.{u2} L _inst_10))))) A L (NonUnitalNonAssocSemiring.toMul.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (NonAssocRing.toNonAssocSemiring.{u3} A (Ring.toNonAssocRing.{u3} A (CommRing.toRing.{u3} A _inst_5))))) (NonUnitalNonAssocSemiring.toMul.{u2} L (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} L (NonAssocRing.toNonAssocSemiring.{u2} L (Ring.toNonAssocRing.{u2} L (DivisionRing.toRing.{u2} L (Field.toDivisionRing.{u2} L _inst_10)))))) (NonUnitalRingHomClass.toMulHomClass.{max u3 u2, u3, u2} (RingHom.{u3, u2} A L (NonAssocRing.toNonAssocSemiring.{u3} A (Ring.toNonAssocRing.{u3} A (CommRing.toRing.{u3} A _inst_5))) (NonAssocRing.toNonAssocSemiring.{u2} L (Ring.toNonAssocRing.{u2} L (DivisionRing.toRing.{u2} L (Field.toDivisionRing.{u2} L _inst_10))))) A L (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (NonAssocRing.toNonAssocSemiring.{u3} A (Ring.toNonAssocRing.{u3} A (CommRing.toRing.{u3} A _inst_5)))) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} L (NonAssocRing.toNonAssocSemiring.{u2} L (Ring.toNonAssocRing.{u2} L (DivisionRing.toRing.{u2} L (Field.toDivisionRing.{u2} L _inst_10))))) (RingHomClass.toNonUnitalRingHomClass.{max u3 u2, u3, u2} (RingHom.{u3, u2} A L (NonAssocRing.toNonAssocSemiring.{u3} A (Ring.toNonAssocRing.{u3} A (CommRing.toRing.{u3} A _inst_5))) (NonAssocRing.toNonAssocSemiring.{u2} L (Ring.toNonAssocRing.{u2} L (DivisionRing.toRing.{u2} L (Field.toDivisionRing.{u2} L _inst_10))))) A L (NonAssocRing.toNonAssocSemiring.{u3} A (Ring.toNonAssocRing.{u3} A (CommRing.toRing.{u3} A _inst_5))) (NonAssocRing.toNonAssocSemiring.{u2} L (Ring.toNonAssocRing.{u2} L (DivisionRing.toRing.{u2} L (Field.toDivisionRing.{u2} L _inst_10)))) (RingHom.instRingHomClassRingHom.{u3, u2} A L (NonAssocRing.toNonAssocSemiring.{u3} A (Ring.toNonAssocRing.{u3} A (CommRing.toRing.{u3} A _inst_5))) (NonAssocRing.toNonAssocSemiring.{u2} L (Ring.toNonAssocRing.{u2} L (DivisionRing.toRing.{u2} L (Field.toDivisionRing.{u2} L _inst_10)))))))) g x)
Case conversion may be inaccurate. Consider using '#align is_fraction_ring.lift_algebra_map IsFractionRing.lift_algebraMapₓ'. -/
/-- 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 :=
  lift_eq _ _
#align is_fraction_ring.lift_algebra_map IsFractionRing.lift_algebraMap

/- warning: is_fraction_ring.lift_mk' -> IsFractionRing.lift_mk' is a dubious translation:
lean 3 declaration is
  forall {A : Type.{u1}} [_inst_5 : CommRing.{u1} A] [_inst_6 : IsDomain.{u1} A (Ring.toSemiring.{u1} A (CommRing.toRing.{u1} A _inst_5))] {K : Type.{u2}} [_inst_9 : Field.{u2} K] {L : Type.{u3}} [_inst_10 : Field.{u3} L] [_inst_11 : Algebra.{u1, u2} A K (CommRing.toCommSemiring.{u1} A _inst_5) (Ring.toSemiring.{u2} K (DivisionRing.toRing.{u2} K (Field.toDivisionRing.{u2} K _inst_9)))] [_inst_12 : IsFractionRing.{u1, u2} A _inst_5 K (Field.toCommRing.{u2} K _inst_9) _inst_11] {g : RingHom.{u1, u3} A L (NonAssocRing.toNonAssocSemiring.{u1} A (Ring.toNonAssocRing.{u1} A (CommRing.toRing.{u1} A _inst_5))) (NonAssocRing.toNonAssocSemiring.{u3} L (Ring.toNonAssocRing.{u3} L (DivisionRing.toRing.{u3} L (Field.toDivisionRing.{u3} L _inst_10))))} (hg : Function.Injective.{succ u1, succ u3} A L (coeFn.{max (succ u1) (succ u3), max (succ u1) (succ u3)} (RingHom.{u1, u3} A L (NonAssocRing.toNonAssocSemiring.{u1} A (Ring.toNonAssocRing.{u1} A (CommRing.toRing.{u1} A _inst_5))) (NonAssocRing.toNonAssocSemiring.{u3} L (Ring.toNonAssocRing.{u3} L (DivisionRing.toRing.{u3} L (Field.toDivisionRing.{u3} L _inst_10))))) (fun (_x : RingHom.{u1, u3} A L (NonAssocRing.toNonAssocSemiring.{u1} A (Ring.toNonAssocRing.{u1} A (CommRing.toRing.{u1} A _inst_5))) (NonAssocRing.toNonAssocSemiring.{u3} L (Ring.toNonAssocRing.{u3} L (DivisionRing.toRing.{u3} L (Field.toDivisionRing.{u3} L _inst_10))))) => A -> L) (RingHom.hasCoeToFun.{u1, u3} A L (NonAssocRing.toNonAssocSemiring.{u1} A (Ring.toNonAssocRing.{u1} A (CommRing.toRing.{u1} A _inst_5))) (NonAssocRing.toNonAssocSemiring.{u3} L (Ring.toNonAssocRing.{u3} L (DivisionRing.toRing.{u3} L (Field.toDivisionRing.{u3} L _inst_10))))) g)) (x : A) (y : coeSort.{succ u1, succ (succ u1)} (Submonoid.{u1} A (MulZeroOneClass.toMulOneClass.{u1} A (MonoidWithZero.toMulZeroOneClass.{u1} A (Semiring.toMonoidWithZero.{u1} A (Ring.toSemiring.{u1} A (CommRing.toRing.{u1} A _inst_5)))))) Type.{u1} (SetLike.hasCoeToSort.{u1, u1} (Submonoid.{u1} A (MulZeroOneClass.toMulOneClass.{u1} A (MonoidWithZero.toMulZeroOneClass.{u1} A (Semiring.toMonoidWithZero.{u1} A (Ring.toSemiring.{u1} A (CommRing.toRing.{u1} A _inst_5)))))) A (Submonoid.setLike.{u1} A (MulZeroOneClass.toMulOneClass.{u1} A (MonoidWithZero.toMulZeroOneClass.{u1} A (Semiring.toMonoidWithZero.{u1} A (Ring.toSemiring.{u1} A (CommRing.toRing.{u1} A _inst_5))))))) (nonZeroDivisors.{u1} A (Semiring.toMonoidWithZero.{u1} A (Ring.toSemiring.{u1} A (CommRing.toRing.{u1} A _inst_5))))), Eq.{succ u3} L (coeFn.{max (succ u2) (succ u3), max (succ u2) (succ u3)} (RingHom.{u2, u3} K L (NonAssocRing.toNonAssocSemiring.{u2} K (Ring.toNonAssocRing.{u2} K (DivisionRing.toRing.{u2} K (Field.toDivisionRing.{u2} K _inst_9)))) (NonAssocRing.toNonAssocSemiring.{u3} L (Ring.toNonAssocRing.{u3} L (DivisionRing.toRing.{u3} L (Field.toDivisionRing.{u3} L _inst_10))))) (fun (_x : RingHom.{u2, u3} K L (NonAssocRing.toNonAssocSemiring.{u2} K (Ring.toNonAssocRing.{u2} K (DivisionRing.toRing.{u2} K (Field.toDivisionRing.{u2} K _inst_9)))) (NonAssocRing.toNonAssocSemiring.{u3} L (Ring.toNonAssocRing.{u3} L (DivisionRing.toRing.{u3} L (Field.toDivisionRing.{u3} L _inst_10))))) => K -> L) (RingHom.hasCoeToFun.{u2, u3} K L (NonAssocRing.toNonAssocSemiring.{u2} K (Ring.toNonAssocRing.{u2} K (DivisionRing.toRing.{u2} K (Field.toDivisionRing.{u2} K _inst_9)))) (NonAssocRing.toNonAssocSemiring.{u3} L (Ring.toNonAssocRing.{u3} L (DivisionRing.toRing.{u3} L (Field.toDivisionRing.{u3} L _inst_10))))) (IsFractionRing.lift.{u1, u2, u3} A _inst_5 _inst_6 K _inst_9 L _inst_10 _inst_11 _inst_12 g hg) (IsLocalization.mk'.{u1, u2} A (CommRing.toCommSemiring.{u1} A _inst_5) (nonZeroDivisors.{u1} A (Semiring.toMonoidWithZero.{u1} A (Ring.toSemiring.{u1} A (CommRing.toRing.{u1} A _inst_5)))) K (Semifield.toCommSemiring.{u2} K (Field.toSemifield.{u2} K _inst_9)) _inst_11 _inst_12 x y)) (HDiv.hDiv.{u3, u3, u3} L L L (instHDiv.{u3} L (DivInvMonoid.toHasDiv.{u3} L (DivisionRing.toDivInvMonoid.{u3} L (Field.toDivisionRing.{u3} L _inst_10)))) (coeFn.{max (succ u1) (succ u3), max (succ u1) (succ u3)} (RingHom.{u1, u3} A L (NonAssocRing.toNonAssocSemiring.{u1} A (Ring.toNonAssocRing.{u1} A (CommRing.toRing.{u1} A _inst_5))) (NonAssocRing.toNonAssocSemiring.{u3} L (Ring.toNonAssocRing.{u3} L (DivisionRing.toRing.{u3} L (Field.toDivisionRing.{u3} L _inst_10))))) (fun (_x : RingHom.{u1, u3} A L (NonAssocRing.toNonAssocSemiring.{u1} A (Ring.toNonAssocRing.{u1} A (CommRing.toRing.{u1} A _inst_5))) (NonAssocRing.toNonAssocSemiring.{u3} L (Ring.toNonAssocRing.{u3} L (DivisionRing.toRing.{u3} L (Field.toDivisionRing.{u3} L _inst_10))))) => A -> L) (RingHom.hasCoeToFun.{u1, u3} A L (NonAssocRing.toNonAssocSemiring.{u1} A (Ring.toNonAssocRing.{u1} A (CommRing.toRing.{u1} A _inst_5))) (NonAssocRing.toNonAssocSemiring.{u3} L (Ring.toNonAssocRing.{u3} L (DivisionRing.toRing.{u3} L (Field.toDivisionRing.{u3} L _inst_10))))) g x) (coeFn.{max (succ u1) (succ u3), max (succ u1) (succ u3)} (RingHom.{u1, u3} A L (NonAssocRing.toNonAssocSemiring.{u1} A (Ring.toNonAssocRing.{u1} A (CommRing.toRing.{u1} A _inst_5))) (NonAssocRing.toNonAssocSemiring.{u3} L (Ring.toNonAssocRing.{u3} L (DivisionRing.toRing.{u3} L (Field.toDivisionRing.{u3} L _inst_10))))) (fun (_x : RingHom.{u1, u3} A L (NonAssocRing.toNonAssocSemiring.{u1} A (Ring.toNonAssocRing.{u1} A (CommRing.toRing.{u1} A _inst_5))) (NonAssocRing.toNonAssocSemiring.{u3} L (Ring.toNonAssocRing.{u3} L (DivisionRing.toRing.{u3} L (Field.toDivisionRing.{u3} L _inst_10))))) => A -> L) (RingHom.hasCoeToFun.{u1, u3} A L (NonAssocRing.toNonAssocSemiring.{u1} A (Ring.toNonAssocRing.{u1} A (CommRing.toRing.{u1} A _inst_5))) (NonAssocRing.toNonAssocSemiring.{u3} L (Ring.toNonAssocRing.{u3} L (DivisionRing.toRing.{u3} L (Field.toDivisionRing.{u3} L _inst_10))))) g ((fun (a : Type.{u1}) (b : Type.{u1}) [self : HasLiftT.{succ u1, succ u1} a b] => self.0) (coeSort.{succ u1, succ (succ u1)} (Submonoid.{u1} A (MulZeroOneClass.toMulOneClass.{u1} A (MonoidWithZero.toMulZeroOneClass.{u1} A (Semiring.toMonoidWithZero.{u1} A (Ring.toSemiring.{u1} A (CommRing.toRing.{u1} A _inst_5)))))) Type.{u1} (SetLike.hasCoeToSort.{u1, u1} (Submonoid.{u1} A (MulZeroOneClass.toMulOneClass.{u1} A (MonoidWithZero.toMulZeroOneClass.{u1} A (Semiring.toMonoidWithZero.{u1} A (Ring.toSemiring.{u1} A (CommRing.toRing.{u1} A _inst_5)))))) A (Submonoid.setLike.{u1} A (MulZeroOneClass.toMulOneClass.{u1} A (MonoidWithZero.toMulZeroOneClass.{u1} A (Semiring.toMonoidWithZero.{u1} A (Ring.toSemiring.{u1} A (CommRing.toRing.{u1} A _inst_5))))))) (nonZeroDivisors.{u1} A (Semiring.toMonoidWithZero.{u1} A (Ring.toSemiring.{u1} A (CommRing.toRing.{u1} A _inst_5))))) A (HasLiftT.mk.{succ u1, succ u1} (coeSort.{succ u1, succ (succ u1)} (Submonoid.{u1} A (MulZeroOneClass.toMulOneClass.{u1} A (MonoidWithZero.toMulZeroOneClass.{u1} A (Semiring.toMonoidWithZero.{u1} A (Ring.toSemiring.{u1} A (CommRing.toRing.{u1} A _inst_5)))))) Type.{u1} (SetLike.hasCoeToSort.{u1, u1} (Submonoid.{u1} A (MulZeroOneClass.toMulOneClass.{u1} A (MonoidWithZero.toMulZeroOneClass.{u1} A (Semiring.toMonoidWithZero.{u1} A (Ring.toSemiring.{u1} A (CommRing.toRing.{u1} A _inst_5)))))) A (Submonoid.setLike.{u1} A (MulZeroOneClass.toMulOneClass.{u1} A (MonoidWithZero.toMulZeroOneClass.{u1} A (Semiring.toMonoidWithZero.{u1} A (Ring.toSemiring.{u1} A (CommRing.toRing.{u1} A _inst_5))))))) (nonZeroDivisors.{u1} A (Semiring.toMonoidWithZero.{u1} A (Ring.toSemiring.{u1} A (CommRing.toRing.{u1} A _inst_5))))) A (CoeTCₓ.coe.{succ u1, succ u1} (coeSort.{succ u1, succ (succ u1)} (Submonoid.{u1} A (MulZeroOneClass.toMulOneClass.{u1} A (MonoidWithZero.toMulZeroOneClass.{u1} A (Semiring.toMonoidWithZero.{u1} A (Ring.toSemiring.{u1} A (CommRing.toRing.{u1} A _inst_5)))))) Type.{u1} (SetLike.hasCoeToSort.{u1, u1} (Submonoid.{u1} A (MulZeroOneClass.toMulOneClass.{u1} A (MonoidWithZero.toMulZeroOneClass.{u1} A (Semiring.toMonoidWithZero.{u1} A (Ring.toSemiring.{u1} A (CommRing.toRing.{u1} A _inst_5)))))) A (Submonoid.setLike.{u1} A (MulZeroOneClass.toMulOneClass.{u1} A (MonoidWithZero.toMulZeroOneClass.{u1} A (Semiring.toMonoidWithZero.{u1} A (Ring.toSemiring.{u1} A (CommRing.toRing.{u1} A _inst_5))))))) (nonZeroDivisors.{u1} A (Semiring.toMonoidWithZero.{u1} A (Ring.toSemiring.{u1} A (CommRing.toRing.{u1} A _inst_5))))) A (coeBase.{succ u1, succ u1} (coeSort.{succ u1, succ (succ u1)} (Submonoid.{u1} A (MulZeroOneClass.toMulOneClass.{u1} A (MonoidWithZero.toMulZeroOneClass.{u1} A (Semiring.toMonoidWithZero.{u1} A (Ring.toSemiring.{u1} A (CommRing.toRing.{u1} A _inst_5)))))) Type.{u1} (SetLike.hasCoeToSort.{u1, u1} (Submonoid.{u1} A (MulZeroOneClass.toMulOneClass.{u1} A (MonoidWithZero.toMulZeroOneClass.{u1} A (Semiring.toMonoidWithZero.{u1} A (Ring.toSemiring.{u1} A (CommRing.toRing.{u1} A _inst_5)))))) A (Submonoid.setLike.{u1} A (MulZeroOneClass.toMulOneClass.{u1} A (MonoidWithZero.toMulZeroOneClass.{u1} A (Semiring.toMonoidWithZero.{u1} A (Ring.toSemiring.{u1} A (CommRing.toRing.{u1} A _inst_5))))))) (nonZeroDivisors.{u1} A (Semiring.toMonoidWithZero.{u1} A (Ring.toSemiring.{u1} A (CommRing.toRing.{u1} A _inst_5))))) A (coeSubtype.{succ u1} A (fun (x : A) => Membership.Mem.{u1, u1} A (Submonoid.{u1} A (MulZeroOneClass.toMulOneClass.{u1} A (MonoidWithZero.toMulZeroOneClass.{u1} A (Semiring.toMonoidWithZero.{u1} A (Ring.toSemiring.{u1} A (CommRing.toRing.{u1} A _inst_5)))))) (SetLike.hasMem.{u1, u1} (Submonoid.{u1} A (MulZeroOneClass.toMulOneClass.{u1} A (MonoidWithZero.toMulZeroOneClass.{u1} A (Semiring.toMonoidWithZero.{u1} A (Ring.toSemiring.{u1} A (CommRing.toRing.{u1} A _inst_5)))))) A (Submonoid.setLike.{u1} A (MulZeroOneClass.toMulOneClass.{u1} A (MonoidWithZero.toMulZeroOneClass.{u1} A (Semiring.toMonoidWithZero.{u1} A (Ring.toSemiring.{u1} A (CommRing.toRing.{u1} A _inst_5))))))) x (nonZeroDivisors.{u1} A (Semiring.toMonoidWithZero.{u1} A (Ring.toSemiring.{u1} A (CommRing.toRing.{u1} A _inst_5))))))))) y)))
but is expected to have type
  forall {A : Type.{u3}} [_inst_5 : CommRing.{u3} A] [_inst_6 : IsDomain.{u3} A (Ring.toSemiring.{u3} A (CommRing.toRing.{u3} A _inst_5))] {K : Type.{u1}} [_inst_9 : Field.{u1} K] {L : Type.{u2}} [_inst_10 : Field.{u2} L] [_inst_11 : Algebra.{u3, u1} A K (CommRing.toCommSemiring.{u3} A _inst_5) (DivisionSemiring.toSemiring.{u1} K (Semifield.toDivisionSemiring.{u1} K (Field.toSemifield.{u1} K _inst_9)))] [_inst_12 : IsFractionRing.{u3, u1} A _inst_5 K (Field.toCommRing.{u1} K _inst_9) _inst_11] {g : RingHom.{u3, u2} A L (NonAssocRing.toNonAssocSemiring.{u3} A (Ring.toNonAssocRing.{u3} A (CommRing.toRing.{u3} A _inst_5))) (NonAssocRing.toNonAssocSemiring.{u2} L (Ring.toNonAssocRing.{u2} L (DivisionRing.toRing.{u2} L (Field.toDivisionRing.{u2} L _inst_10))))} (hg : Function.Injective.{succ u3, succ u2} A L (FunLike.coe.{max (succ u3) (succ u2), succ u3, succ u2} (RingHom.{u3, u2} A L (NonAssocRing.toNonAssocSemiring.{u3} A (Ring.toNonAssocRing.{u3} A (CommRing.toRing.{u3} A _inst_5))) (NonAssocRing.toNonAssocSemiring.{u2} L (Ring.toNonAssocRing.{u2} L (DivisionRing.toRing.{u2} L (Field.toDivisionRing.{u2} L _inst_10))))) A (fun (_x : A) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : A) => L) _x) (MulHomClass.toFunLike.{max u3 u2, u3, u2} (RingHom.{u3, u2} A L (NonAssocRing.toNonAssocSemiring.{u3} A (Ring.toNonAssocRing.{u3} A (CommRing.toRing.{u3} A _inst_5))) (NonAssocRing.toNonAssocSemiring.{u2} L (Ring.toNonAssocRing.{u2} L (DivisionRing.toRing.{u2} L (Field.toDivisionRing.{u2} L _inst_10))))) A L (NonUnitalNonAssocSemiring.toMul.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (NonAssocRing.toNonAssocSemiring.{u3} A (Ring.toNonAssocRing.{u3} A (CommRing.toRing.{u3} A _inst_5))))) (NonUnitalNonAssocSemiring.toMul.{u2} L (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} L (NonAssocRing.toNonAssocSemiring.{u2} L (Ring.toNonAssocRing.{u2} L (DivisionRing.toRing.{u2} L (Field.toDivisionRing.{u2} L _inst_10)))))) (NonUnitalRingHomClass.toMulHomClass.{max u3 u2, u3, u2} (RingHom.{u3, u2} A L (NonAssocRing.toNonAssocSemiring.{u3} A (Ring.toNonAssocRing.{u3} A (CommRing.toRing.{u3} A _inst_5))) (NonAssocRing.toNonAssocSemiring.{u2} L (Ring.toNonAssocRing.{u2} L (DivisionRing.toRing.{u2} L (Field.toDivisionRing.{u2} L _inst_10))))) A L (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (NonAssocRing.toNonAssocSemiring.{u3} A (Ring.toNonAssocRing.{u3} A (CommRing.toRing.{u3} A _inst_5)))) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} L (NonAssocRing.toNonAssocSemiring.{u2} L (Ring.toNonAssocRing.{u2} L (DivisionRing.toRing.{u2} L (Field.toDivisionRing.{u2} L _inst_10))))) (RingHomClass.toNonUnitalRingHomClass.{max u3 u2, u3, u2} (RingHom.{u3, u2} A L (NonAssocRing.toNonAssocSemiring.{u3} A (Ring.toNonAssocRing.{u3} A (CommRing.toRing.{u3} A _inst_5))) (NonAssocRing.toNonAssocSemiring.{u2} L (Ring.toNonAssocRing.{u2} L (DivisionRing.toRing.{u2} L (Field.toDivisionRing.{u2} L _inst_10))))) A L (NonAssocRing.toNonAssocSemiring.{u3} A (Ring.toNonAssocRing.{u3} A (CommRing.toRing.{u3} A _inst_5))) (NonAssocRing.toNonAssocSemiring.{u2} L (Ring.toNonAssocRing.{u2} L (DivisionRing.toRing.{u2} L (Field.toDivisionRing.{u2} L _inst_10)))) (RingHom.instRingHomClassRingHom.{u3, u2} A L (NonAssocRing.toNonAssocSemiring.{u3} A (Ring.toNonAssocRing.{u3} A (CommRing.toRing.{u3} A _inst_5))) (NonAssocRing.toNonAssocSemiring.{u2} L (Ring.toNonAssocRing.{u2} L (DivisionRing.toRing.{u2} L (Field.toDivisionRing.{u2} L _inst_10)))))))) g)) (x : A) (y : Subtype.{succ u3} A (fun (x : A) => Membership.mem.{u3, u3} A (Submonoid.{u3} A (MulZeroOneClass.toMulOneClass.{u3} A (MonoidWithZero.toMulZeroOneClass.{u3} A (Semiring.toMonoidWithZero.{u3} A (Ring.toSemiring.{u3} A (CommRing.toRing.{u3} A _inst_5)))))) (SetLike.instMembership.{u3, u3} (Submonoid.{u3} A (MulZeroOneClass.toMulOneClass.{u3} A (MonoidWithZero.toMulZeroOneClass.{u3} A (Semiring.toMonoidWithZero.{u3} A (Ring.toSemiring.{u3} A (CommRing.toRing.{u3} A _inst_5)))))) A (Submonoid.instSetLikeSubmonoid.{u3} A (MulZeroOneClass.toMulOneClass.{u3} A (MonoidWithZero.toMulZeroOneClass.{u3} A (Semiring.toMonoidWithZero.{u3} A (Ring.toSemiring.{u3} A (CommRing.toRing.{u3} A _inst_5))))))) x (nonZeroDivisors.{u3} A (Semiring.toMonoidWithZero.{u3} A (Ring.toSemiring.{u3} A (CommRing.toRing.{u3} A _inst_5)))))), Eq.{succ u2} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : K) => L) (IsLocalization.mk'.{u3, u1} A (CommRing.toCommSemiring.{u3} A _inst_5) (nonZeroDivisors.{u3} A (Semiring.toMonoidWithZero.{u3} A (Ring.toSemiring.{u3} A (CommRing.toRing.{u3} A _inst_5)))) K (Semifield.toCommSemiring.{u1} K (Field.toSemifield.{u1} K _inst_9)) _inst_11 _inst_12 x y)) (FunLike.coe.{max (succ u2) (succ u1), succ u1, succ u2} (RingHom.{u1, u2} K L (NonAssocRing.toNonAssocSemiring.{u1} K (Ring.toNonAssocRing.{u1} K (DivisionRing.toRing.{u1} K (Field.toDivisionRing.{u1} K _inst_9)))) (NonAssocRing.toNonAssocSemiring.{u2} L (Ring.toNonAssocRing.{u2} L (DivisionRing.toRing.{u2} L (Field.toDivisionRing.{u2} L _inst_10))))) K (fun (_x : K) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : K) => L) _x) (MulHomClass.toFunLike.{max u2 u1, u1, u2} (RingHom.{u1, u2} K L (NonAssocRing.toNonAssocSemiring.{u1} K (Ring.toNonAssocRing.{u1} K (DivisionRing.toRing.{u1} K (Field.toDivisionRing.{u1} K _inst_9)))) (NonAssocRing.toNonAssocSemiring.{u2} L (Ring.toNonAssocRing.{u2} L (DivisionRing.toRing.{u2} L (Field.toDivisionRing.{u2} L _inst_10))))) K L (NonUnitalNonAssocSemiring.toMul.{u1} K (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} K (NonAssocRing.toNonAssocSemiring.{u1} K (Ring.toNonAssocRing.{u1} K (DivisionRing.toRing.{u1} K (Field.toDivisionRing.{u1} K _inst_9)))))) (NonUnitalNonAssocSemiring.toMul.{u2} L (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} L (NonAssocRing.toNonAssocSemiring.{u2} L (Ring.toNonAssocRing.{u2} L (DivisionRing.toRing.{u2} L (Field.toDivisionRing.{u2} L _inst_10)))))) (NonUnitalRingHomClass.toMulHomClass.{max u2 u1, u1, u2} (RingHom.{u1, u2} K L (NonAssocRing.toNonAssocSemiring.{u1} K (Ring.toNonAssocRing.{u1} K (DivisionRing.toRing.{u1} K (Field.toDivisionRing.{u1} K _inst_9)))) (NonAssocRing.toNonAssocSemiring.{u2} L (Ring.toNonAssocRing.{u2} L (DivisionRing.toRing.{u2} L (Field.toDivisionRing.{u2} L _inst_10))))) K L (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} K (NonAssocRing.toNonAssocSemiring.{u1} K (Ring.toNonAssocRing.{u1} K (DivisionRing.toRing.{u1} K (Field.toDivisionRing.{u1} K _inst_9))))) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} L (NonAssocRing.toNonAssocSemiring.{u2} L (Ring.toNonAssocRing.{u2} L (DivisionRing.toRing.{u2} L (Field.toDivisionRing.{u2} L _inst_10))))) (RingHomClass.toNonUnitalRingHomClass.{max u2 u1, u1, u2} (RingHom.{u1, u2} K L (NonAssocRing.toNonAssocSemiring.{u1} K (Ring.toNonAssocRing.{u1} K (DivisionRing.toRing.{u1} K (Field.toDivisionRing.{u1} K _inst_9)))) (NonAssocRing.toNonAssocSemiring.{u2} L (Ring.toNonAssocRing.{u2} L (DivisionRing.toRing.{u2} L (Field.toDivisionRing.{u2} L _inst_10))))) K L (NonAssocRing.toNonAssocSemiring.{u1} K (Ring.toNonAssocRing.{u1} K (DivisionRing.toRing.{u1} K (Field.toDivisionRing.{u1} K _inst_9)))) (NonAssocRing.toNonAssocSemiring.{u2} L (Ring.toNonAssocRing.{u2} L (DivisionRing.toRing.{u2} L (Field.toDivisionRing.{u2} L _inst_10)))) (RingHom.instRingHomClassRingHom.{u1, u2} K L (NonAssocRing.toNonAssocSemiring.{u1} K (Ring.toNonAssocRing.{u1} K (DivisionRing.toRing.{u1} K (Field.toDivisionRing.{u1} K _inst_9)))) (NonAssocRing.toNonAssocSemiring.{u2} L (Ring.toNonAssocRing.{u2} L (DivisionRing.toRing.{u2} L (Field.toDivisionRing.{u2} L _inst_10)))))))) (IsFractionRing.lift.{u3, u1, u2} A _inst_5 _inst_6 K _inst_9 L _inst_10 _inst_11 _inst_12 g hg) (IsLocalization.mk'.{u3, u1} A (CommRing.toCommSemiring.{u3} A _inst_5) (nonZeroDivisors.{u3} A (Semiring.toMonoidWithZero.{u3} A (Ring.toSemiring.{u3} A (CommRing.toRing.{u3} A _inst_5)))) K (Semifield.toCommSemiring.{u1} K (Field.toSemifield.{u1} K _inst_9)) _inst_11 _inst_12 x y)) (HDiv.hDiv.{u2, u2, u2} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : A) => L) x) ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : A) => L) (Subtype.val.{succ u3} A (fun (x : A) => Membership.mem.{u3, u3} A (Set.{u3} A) (Set.instMembershipSet.{u3} A) x (SetLike.coe.{u3, u3} (Submonoid.{u3} A (MulZeroOneClass.toMulOneClass.{u3} A (MonoidWithZero.toMulZeroOneClass.{u3} A (Semiring.toMonoidWithZero.{u3} A (Ring.toSemiring.{u3} A (CommRing.toRing.{u3} A _inst_5)))))) A (Submonoid.instSetLikeSubmonoid.{u3} A (MulZeroOneClass.toMulOneClass.{u3} A (MonoidWithZero.toMulZeroOneClass.{u3} A (Semiring.toMonoidWithZero.{u3} A (Ring.toSemiring.{u3} A (CommRing.toRing.{u3} A _inst_5)))))) (nonZeroDivisors.{u3} A (Semiring.toMonoidWithZero.{u3} A (Ring.toSemiring.{u3} A (CommRing.toRing.{u3} A _inst_5)))))) y)) ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : A) => L) x) (instHDiv.{u2} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : A) => L) x) (Field.toDiv.{u2} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : A) => L) x) _inst_10)) (FunLike.coe.{max (succ u3) (succ u2), succ u3, succ u2} (RingHom.{u3, u2} A L (NonAssocRing.toNonAssocSemiring.{u3} A (Ring.toNonAssocRing.{u3} A (CommRing.toRing.{u3} A _inst_5))) (NonAssocRing.toNonAssocSemiring.{u2} L (Ring.toNonAssocRing.{u2} L (DivisionRing.toRing.{u2} L (Field.toDivisionRing.{u2} L _inst_10))))) A (fun (_x : A) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : A) => L) _x) (MulHomClass.toFunLike.{max u3 u2, u3, u2} (RingHom.{u3, u2} A L (NonAssocRing.toNonAssocSemiring.{u3} A (Ring.toNonAssocRing.{u3} A (CommRing.toRing.{u3} A _inst_5))) (NonAssocRing.toNonAssocSemiring.{u2} L (Ring.toNonAssocRing.{u2} L (DivisionRing.toRing.{u2} L (Field.toDivisionRing.{u2} L _inst_10))))) A L (NonUnitalNonAssocSemiring.toMul.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (NonAssocRing.toNonAssocSemiring.{u3} A (Ring.toNonAssocRing.{u3} A (CommRing.toRing.{u3} A _inst_5))))) (NonUnitalNonAssocSemiring.toMul.{u2} L (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} L (NonAssocRing.toNonAssocSemiring.{u2} L (Ring.toNonAssocRing.{u2} L (DivisionRing.toRing.{u2} L (Field.toDivisionRing.{u2} L _inst_10)))))) (NonUnitalRingHomClass.toMulHomClass.{max u3 u2, u3, u2} (RingHom.{u3, u2} A L (NonAssocRing.toNonAssocSemiring.{u3} A (Ring.toNonAssocRing.{u3} A (CommRing.toRing.{u3} A _inst_5))) (NonAssocRing.toNonAssocSemiring.{u2} L (Ring.toNonAssocRing.{u2} L (DivisionRing.toRing.{u2} L (Field.toDivisionRing.{u2} L _inst_10))))) A L (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (NonAssocRing.toNonAssocSemiring.{u3} A (Ring.toNonAssocRing.{u3} A (CommRing.toRing.{u3} A _inst_5)))) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} L (NonAssocRing.toNonAssocSemiring.{u2} L (Ring.toNonAssocRing.{u2} L (DivisionRing.toRing.{u2} L (Field.toDivisionRing.{u2} L _inst_10))))) (RingHomClass.toNonUnitalRingHomClass.{max u3 u2, u3, u2} (RingHom.{u3, u2} A L (NonAssocRing.toNonAssocSemiring.{u3} A (Ring.toNonAssocRing.{u3} A (CommRing.toRing.{u3} A _inst_5))) (NonAssocRing.toNonAssocSemiring.{u2} L (Ring.toNonAssocRing.{u2} L (DivisionRing.toRing.{u2} L (Field.toDivisionRing.{u2} L _inst_10))))) A L (NonAssocRing.toNonAssocSemiring.{u3} A (Ring.toNonAssocRing.{u3} A (CommRing.toRing.{u3} A _inst_5))) (NonAssocRing.toNonAssocSemiring.{u2} L (Ring.toNonAssocRing.{u2} L (DivisionRing.toRing.{u2} L (Field.toDivisionRing.{u2} L _inst_10)))) (RingHom.instRingHomClassRingHom.{u3, u2} A L (NonAssocRing.toNonAssocSemiring.{u3} A (Ring.toNonAssocRing.{u3} A (CommRing.toRing.{u3} A _inst_5))) (NonAssocRing.toNonAssocSemiring.{u2} L (Ring.toNonAssocRing.{u2} L (DivisionRing.toRing.{u2} L (Field.toDivisionRing.{u2} L _inst_10)))))))) g x) (FunLike.coe.{max (succ u3) (succ u2), succ u3, succ u2} (RingHom.{u3, u2} A L (NonAssocRing.toNonAssocSemiring.{u3} A (Ring.toNonAssocRing.{u3} A (CommRing.toRing.{u3} A _inst_5))) (NonAssocRing.toNonAssocSemiring.{u2} L (Ring.toNonAssocRing.{u2} L (DivisionRing.toRing.{u2} L (Field.toDivisionRing.{u2} L _inst_10))))) A (fun (_x : A) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : A) => L) _x) (MulHomClass.toFunLike.{max u3 u2, u3, u2} (RingHom.{u3, u2} A L (NonAssocRing.toNonAssocSemiring.{u3} A (Ring.toNonAssocRing.{u3} A (CommRing.toRing.{u3} A _inst_5))) (NonAssocRing.toNonAssocSemiring.{u2} L (Ring.toNonAssocRing.{u2} L (DivisionRing.toRing.{u2} L (Field.toDivisionRing.{u2} L _inst_10))))) A L (NonUnitalNonAssocSemiring.toMul.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (NonAssocRing.toNonAssocSemiring.{u3} A (Ring.toNonAssocRing.{u3} A (CommRing.toRing.{u3} A _inst_5))))) (NonUnitalNonAssocSemiring.toMul.{u2} L (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} L (NonAssocRing.toNonAssocSemiring.{u2} L (Ring.toNonAssocRing.{u2} L (DivisionRing.toRing.{u2} L (Field.toDivisionRing.{u2} L _inst_10)))))) (NonUnitalRingHomClass.toMulHomClass.{max u3 u2, u3, u2} (RingHom.{u3, u2} A L (NonAssocRing.toNonAssocSemiring.{u3} A (Ring.toNonAssocRing.{u3} A (CommRing.toRing.{u3} A _inst_5))) (NonAssocRing.toNonAssocSemiring.{u2} L (Ring.toNonAssocRing.{u2} L (DivisionRing.toRing.{u2} L (Field.toDivisionRing.{u2} L _inst_10))))) A L (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (NonAssocRing.toNonAssocSemiring.{u3} A (Ring.toNonAssocRing.{u3} A (CommRing.toRing.{u3} A _inst_5)))) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} L (NonAssocRing.toNonAssocSemiring.{u2} L (Ring.toNonAssocRing.{u2} L (DivisionRing.toRing.{u2} L (Field.toDivisionRing.{u2} L _inst_10))))) (RingHomClass.toNonUnitalRingHomClass.{max u3 u2, u3, u2} (RingHom.{u3, u2} A L (NonAssocRing.toNonAssocSemiring.{u3} A (Ring.toNonAssocRing.{u3} A (CommRing.toRing.{u3} A _inst_5))) (NonAssocRing.toNonAssocSemiring.{u2} L (Ring.toNonAssocRing.{u2} L (DivisionRing.toRing.{u2} L (Field.toDivisionRing.{u2} L _inst_10))))) A L (NonAssocRing.toNonAssocSemiring.{u3} A (Ring.toNonAssocRing.{u3} A (CommRing.toRing.{u3} A _inst_5))) (NonAssocRing.toNonAssocSemiring.{u2} L (Ring.toNonAssocRing.{u2} L (DivisionRing.toRing.{u2} L (Field.toDivisionRing.{u2} L _inst_10)))) (RingHom.instRingHomClassRingHom.{u3, u2} A L (NonAssocRing.toNonAssocSemiring.{u3} A (Ring.toNonAssocRing.{u3} A (CommRing.toRing.{u3} A _inst_5))) (NonAssocRing.toNonAssocSemiring.{u2} L (Ring.toNonAssocRing.{u2} L (DivisionRing.toRing.{u2} L (Field.toDivisionRing.{u2} L _inst_10)))))))) g (Subtype.val.{succ u3} A (fun (x : A) => Membership.mem.{u3, u3} A (Set.{u3} A) (Set.instMembershipSet.{u3} A) x (SetLike.coe.{u3, u3} (Submonoid.{u3} A (MulZeroOneClass.toMulOneClass.{u3} A (MonoidWithZero.toMulZeroOneClass.{u3} A (Semiring.toMonoidWithZero.{u3} A (Ring.toSemiring.{u3} A (CommRing.toRing.{u3} A _inst_5)))))) A (Submonoid.instSetLikeSubmonoid.{u3} A (MulZeroOneClass.toMulOneClass.{u3} A (MonoidWithZero.toMulZeroOneClass.{u3} A (Semiring.toMonoidWithZero.{u3} A (Ring.toSemiring.{u3} A (CommRing.toRing.{u3} A _inst_5)))))) (nonZeroDivisors.{u3} A (Semiring.toMonoidWithZero.{u3} A (Ring.toSemiring.{u3} A (CommRing.toRing.{u3} A _inst_5)))))) y)))
Case conversion may be inaccurate. Consider using '#align is_fraction_ring.lift_mk' IsFractionRing.lift_mk'ₓ'. -/
/-- 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 ∈ non_zero_divisors A`. -/
theorem lift_mk' (hg : Injective g) (x) (y : nonZeroDivisors A) : lift hg (mk' K x y) = g x / g y :=
  by simp only [mk'_eq_div, map_div₀, lift_algebra_map]
#align is_fraction_ring.lift_mk' IsFractionRing.lift_mk'

/- warning: is_fraction_ring.map -> IsFractionRing.map is a dubious translation:
lean 3 declaration is
  forall {A : Type.{u1}} {B : Type.{u2}} {K : Type.{u3}} {L : Type.{u4}} [_inst_13 : CommRing.{u1} A] [_inst_14 : CommRing.{u2} B] [_inst_15 : IsDomain.{u2} B (Ring.toSemiring.{u2} B (CommRing.toRing.{u2} B _inst_14))] [_inst_16 : CommRing.{u3} K] [_inst_17 : Algebra.{u1, u3} A K (CommRing.toCommSemiring.{u1} A _inst_13) (Ring.toSemiring.{u3} K (CommRing.toRing.{u3} K _inst_16))] [_inst_18 : IsFractionRing.{u1, u3} A _inst_13 K _inst_16 _inst_17] [_inst_19 : CommRing.{u4} L] [_inst_20 : Algebra.{u2, u4} B L (CommRing.toCommSemiring.{u2} B _inst_14) (Ring.toSemiring.{u4} L (CommRing.toRing.{u4} L _inst_19))] [_inst_21 : IsFractionRing.{u2, u4} B _inst_14 L _inst_19 _inst_20] {j : RingHom.{u1, u2} A B (NonAssocRing.toNonAssocSemiring.{u1} A (Ring.toNonAssocRing.{u1} A (CommRing.toRing.{u1} A _inst_13))) (NonAssocRing.toNonAssocSemiring.{u2} B (Ring.toNonAssocRing.{u2} B (CommRing.toRing.{u2} B _inst_14)))}, (Function.Injective.{succ u1, succ u2} A B (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RingHom.{u1, u2} A B (NonAssocRing.toNonAssocSemiring.{u1} A (Ring.toNonAssocRing.{u1} A (CommRing.toRing.{u1} A _inst_13))) (NonAssocRing.toNonAssocSemiring.{u2} B (Ring.toNonAssocRing.{u2} B (CommRing.toRing.{u2} B _inst_14)))) (fun (_x : RingHom.{u1, u2} A B (NonAssocRing.toNonAssocSemiring.{u1} A (Ring.toNonAssocRing.{u1} A (CommRing.toRing.{u1} A _inst_13))) (NonAssocRing.toNonAssocSemiring.{u2} B (Ring.toNonAssocRing.{u2} B (CommRing.toRing.{u2} B _inst_14)))) => A -> B) (RingHom.hasCoeToFun.{u1, u2} A B (NonAssocRing.toNonAssocSemiring.{u1} A (Ring.toNonAssocRing.{u1} A (CommRing.toRing.{u1} A _inst_13))) (NonAssocRing.toNonAssocSemiring.{u2} B (Ring.toNonAssocRing.{u2} B (CommRing.toRing.{u2} B _inst_14)))) j)) -> (RingHom.{u3, u4} K L (NonAssocRing.toNonAssocSemiring.{u3} K (Ring.toNonAssocRing.{u3} K (CommRing.toRing.{u3} K _inst_16))) (NonAssocRing.toNonAssocSemiring.{u4} L (Ring.toNonAssocRing.{u4} L (CommRing.toRing.{u4} L _inst_19))))
but is expected to have type
  forall {A : Type.{u1}} {B : Type.{u2}} {K : Type.{u3}} {L : Type.{u4}} [_inst_13 : CommRing.{u1} A] [_inst_14 : CommRing.{u2} B] [_inst_15 : IsDomain.{u2} B (Ring.toSemiring.{u2} B (CommRing.toRing.{u2} B _inst_14))] [_inst_16 : CommRing.{u3} K] [_inst_17 : Algebra.{u1, u3} A K (CommRing.toCommSemiring.{u1} A _inst_13) (Ring.toSemiring.{u3} K (CommRing.toRing.{u3} K _inst_16))] [_inst_18 : IsFractionRing.{u1, u3} A _inst_13 K _inst_16 _inst_17] [_inst_19 : CommRing.{u4} L] [_inst_20 : Algebra.{u2, u4} B L (CommRing.toCommSemiring.{u2} B _inst_14) (Ring.toSemiring.{u4} L (CommRing.toRing.{u4} L _inst_19))] [_inst_21 : IsFractionRing.{u2, u4} B _inst_14 L _inst_19 _inst_20] {j : RingHom.{u1, u2} A B (NonAssocRing.toNonAssocSemiring.{u1} A (Ring.toNonAssocRing.{u1} A (CommRing.toRing.{u1} A _inst_13))) (NonAssocRing.toNonAssocSemiring.{u2} B (Ring.toNonAssocRing.{u2} B (CommRing.toRing.{u2} B _inst_14)))}, (Function.Injective.{succ u1, succ u2} A B (FunLike.coe.{max (succ u1) (succ u2), succ u1, succ u2} (RingHom.{u1, u2} A B (NonAssocRing.toNonAssocSemiring.{u1} A (Ring.toNonAssocRing.{u1} A (CommRing.toRing.{u1} A _inst_13))) (NonAssocRing.toNonAssocSemiring.{u2} B (Ring.toNonAssocRing.{u2} B (CommRing.toRing.{u2} B _inst_14)))) A (fun (_x : A) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : A) => B) _x) (MulHomClass.toFunLike.{max u1 u2, u1, u2} (RingHom.{u1, u2} A B (NonAssocRing.toNonAssocSemiring.{u1} A (Ring.toNonAssocRing.{u1} A (CommRing.toRing.{u1} A _inst_13))) (NonAssocRing.toNonAssocSemiring.{u2} B (Ring.toNonAssocRing.{u2} B (CommRing.toRing.{u2} B _inst_14)))) A B (NonUnitalNonAssocSemiring.toMul.{u1} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} A (NonAssocRing.toNonAssocSemiring.{u1} A (Ring.toNonAssocRing.{u1} A (CommRing.toRing.{u1} A _inst_13))))) (NonUnitalNonAssocSemiring.toMul.{u2} B (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} B (NonAssocRing.toNonAssocSemiring.{u2} B (Ring.toNonAssocRing.{u2} B (CommRing.toRing.{u2} B _inst_14))))) (NonUnitalRingHomClass.toMulHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} A B (NonAssocRing.toNonAssocSemiring.{u1} A (Ring.toNonAssocRing.{u1} A (CommRing.toRing.{u1} A _inst_13))) (NonAssocRing.toNonAssocSemiring.{u2} B (Ring.toNonAssocRing.{u2} B (CommRing.toRing.{u2} B _inst_14)))) A B (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} A (NonAssocRing.toNonAssocSemiring.{u1} A (Ring.toNonAssocRing.{u1} A (CommRing.toRing.{u1} A _inst_13)))) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} B (NonAssocRing.toNonAssocSemiring.{u2} B (Ring.toNonAssocRing.{u2} B (CommRing.toRing.{u2} B _inst_14)))) (RingHomClass.toNonUnitalRingHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} A B (NonAssocRing.toNonAssocSemiring.{u1} A (Ring.toNonAssocRing.{u1} A (CommRing.toRing.{u1} A _inst_13))) (NonAssocRing.toNonAssocSemiring.{u2} B (Ring.toNonAssocRing.{u2} B (CommRing.toRing.{u2} B _inst_14)))) A B (NonAssocRing.toNonAssocSemiring.{u1} A (Ring.toNonAssocRing.{u1} A (CommRing.toRing.{u1} A _inst_13))) (NonAssocRing.toNonAssocSemiring.{u2} B (Ring.toNonAssocRing.{u2} B (CommRing.toRing.{u2} B _inst_14))) (RingHom.instRingHomClassRingHom.{u1, u2} A B (NonAssocRing.toNonAssocSemiring.{u1} A (Ring.toNonAssocRing.{u1} A (CommRing.toRing.{u1} A _inst_13))) (NonAssocRing.toNonAssocSemiring.{u2} B (Ring.toNonAssocRing.{u2} B (CommRing.toRing.{u2} B _inst_14))))))) j)) -> (RingHom.{u3, u4} K L (NonAssocRing.toNonAssocSemiring.{u3} K (Ring.toNonAssocRing.{u3} K (CommRing.toRing.{u3} K _inst_16))) (NonAssocRing.toNonAssocSemiring.{u4} L (Ring.toNonAssocRing.{u4} L (CommRing.toRing.{u4} L _inst_19))))
Case conversion may be inaccurate. Consider using '#align is_fraction_ring.map IsFractionRing.mapₓ'. -/
/-- 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 × (non_zero_divisors 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 :=
  map L j
    (show nonZeroDivisors A ≤ (nonZeroDivisors B).comap j from
      nonZeroDivisors_le_comap_nonZeroDivisors_of_injective j hj)
#align is_fraction_ring.map IsFractionRing.map

/- warning: is_fraction_ring.field_equiv_of_ring_equiv -> IsFractionRing.fieldEquivOfRingEquiv is a dubious translation:
lean 3 declaration is
  forall {A : Type.{u1}} [_inst_5 : CommRing.{u1} A] [_inst_6 : IsDomain.{u1} A (Ring.toSemiring.{u1} A (CommRing.toRing.{u1} A _inst_5))] {K : Type.{u2}} {B : Type.{u3}} [_inst_7 : CommRing.{u3} B] [_inst_8 : IsDomain.{u3} B (Ring.toSemiring.{u3} B (CommRing.toRing.{u3} B _inst_7))] [_inst_9 : Field.{u2} K] {L : Type.{u4}} [_inst_10 : Field.{u4} L] [_inst_11 : Algebra.{u1, u2} A K (CommRing.toCommSemiring.{u1} A _inst_5) (Ring.toSemiring.{u2} K (DivisionRing.toRing.{u2} K (Field.toDivisionRing.{u2} K _inst_9)))] [_inst_12 : IsFractionRing.{u1, u2} A _inst_5 K (Field.toCommRing.{u2} K _inst_9) _inst_11] [_inst_13 : Algebra.{u3, u4} B L (CommRing.toCommSemiring.{u3} B _inst_7) (Ring.toSemiring.{u4} L (DivisionRing.toRing.{u4} L (Field.toDivisionRing.{u4} L _inst_10)))] [_inst_14 : IsFractionRing.{u3, u4} B _inst_7 L (Field.toCommRing.{u4} L _inst_10) _inst_13], (RingEquiv.{u1, u3} A B (Distrib.toHasMul.{u1} A (Ring.toDistrib.{u1} A (CommRing.toRing.{u1} A _inst_5))) (Distrib.toHasAdd.{u1} A (Ring.toDistrib.{u1} A (CommRing.toRing.{u1} A _inst_5))) (Distrib.toHasMul.{u3} B (Ring.toDistrib.{u3} B (CommRing.toRing.{u3} B _inst_7))) (Distrib.toHasAdd.{u3} B (Ring.toDistrib.{u3} B (CommRing.toRing.{u3} B _inst_7)))) -> (RingEquiv.{u2, u4} K L (Distrib.toHasMul.{u2} K (Ring.toDistrib.{u2} K (DivisionRing.toRing.{u2} K (Field.toDivisionRing.{u2} K _inst_9)))) (Distrib.toHasAdd.{u2} K (Ring.toDistrib.{u2} K (DivisionRing.toRing.{u2} K (Field.toDivisionRing.{u2} K _inst_9)))) (Distrib.toHasMul.{u4} L (Ring.toDistrib.{u4} L (DivisionRing.toRing.{u4} L (Field.toDivisionRing.{u4} L _inst_10)))) (Distrib.toHasAdd.{u4} L (Ring.toDistrib.{u4} L (DivisionRing.toRing.{u4} L (Field.toDivisionRing.{u4} L _inst_10)))))
but is expected to have type
  forall {A : Type.{u1}} [_inst_5 : CommRing.{u1} A] [_inst_6 : IsDomain.{u1} A (Ring.toSemiring.{u1} A (CommRing.toRing.{u1} A _inst_5))] {K : Type.{u2}} {B : Type.{u3}} [_inst_7 : CommRing.{u3} B] [_inst_8 : IsDomain.{u3} B (Ring.toSemiring.{u3} B (CommRing.toRing.{u3} B _inst_7))] [_inst_9 : Field.{u2} K] {L : Type.{u4}} [_inst_10 : Field.{u4} L] [_inst_11 : Algebra.{u1, u2} A K (CommRing.toCommSemiring.{u1} A _inst_5) (DivisionSemiring.toSemiring.{u2} K (Semifield.toDivisionSemiring.{u2} K (Field.toSemifield.{u2} K _inst_9)))] [_inst_12 : IsFractionRing.{u1, u2} A _inst_5 K (Field.toCommRing.{u2} K _inst_9) _inst_11] [_inst_13 : Algebra.{u3, u4} B L (CommRing.toCommSemiring.{u3} B _inst_7) (DivisionSemiring.toSemiring.{u4} L (Semifield.toDivisionSemiring.{u4} L (Field.toSemifield.{u4} L _inst_10)))] [_inst_14 : IsFractionRing.{u3, u4} B _inst_7 L (Field.toCommRing.{u4} L _inst_10) _inst_13], (RingEquiv.{u1, u3} A B (NonUnitalNonAssocRing.toMul.{u1} A (NonAssocRing.toNonUnitalNonAssocRing.{u1} A (Ring.toNonAssocRing.{u1} A (CommRing.toRing.{u1} A _inst_5)))) (NonUnitalNonAssocRing.toMul.{u3} B (NonAssocRing.toNonUnitalNonAssocRing.{u3} B (Ring.toNonAssocRing.{u3} B (CommRing.toRing.{u3} B _inst_7)))) (Distrib.toAdd.{u1} A (NonUnitalNonAssocSemiring.toDistrib.{u1} A (NonUnitalNonAssocRing.toNonUnitalNonAssocSemiring.{u1} A (NonAssocRing.toNonUnitalNonAssocRing.{u1} A (Ring.toNonAssocRing.{u1} A (CommRing.toRing.{u1} A _inst_5)))))) (Distrib.toAdd.{u3} B (NonUnitalNonAssocSemiring.toDistrib.{u3} B (NonUnitalNonAssocRing.toNonUnitalNonAssocSemiring.{u3} B (NonAssocRing.toNonUnitalNonAssocRing.{u3} B (Ring.toNonAssocRing.{u3} B (CommRing.toRing.{u3} B _inst_7))))))) -> (RingEquiv.{u2, u4} K L (NonUnitalNonAssocRing.toMul.{u2} K (NonAssocRing.toNonUnitalNonAssocRing.{u2} K (Ring.toNonAssocRing.{u2} K (DivisionRing.toRing.{u2} K (Field.toDivisionRing.{u2} K _inst_9))))) (NonUnitalNonAssocRing.toMul.{u4} L (NonAssocRing.toNonUnitalNonAssocRing.{u4} L (Ring.toNonAssocRing.{u4} L (DivisionRing.toRing.{u4} L (Field.toDivisionRing.{u4} L _inst_10))))) (Distrib.toAdd.{u2} K (NonUnitalNonAssocSemiring.toDistrib.{u2} K (NonUnitalNonAssocRing.toNonUnitalNonAssocSemiring.{u2} K (NonAssocRing.toNonUnitalNonAssocRing.{u2} K (Ring.toNonAssocRing.{u2} K (DivisionRing.toRing.{u2} K (Field.toDivisionRing.{u2} K _inst_9))))))) (Distrib.toAdd.{u4} L (NonUnitalNonAssocSemiring.toDistrib.{u4} L (NonUnitalNonAssocRing.toNonUnitalNonAssocSemiring.{u4} L (NonAssocRing.toNonUnitalNonAssocRing.{u4} L (Ring.toNonAssocRing.{u4} L (DivisionRing.toRing.{u4} L (Field.toDivisionRing.{u4} L _inst_10))))))))
Case conversion may be inaccurate. Consider using '#align is_fraction_ring.field_equiv_of_ring_equiv IsFractionRing.fieldEquivOfRingEquivₓ'. -/
/-- 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 :=
  ringEquivOfRingEquiv K L h
    (by
      ext b
      show b ∈ h.to_equiv '' _ ↔ _
      erw [h.to_equiv.image_eq_preimage, Set.preimage, Set.mem_setOf_eq,
        mem_nonZeroDivisors_iff_ne_zero, mem_nonZeroDivisors_iff_ne_zero]
      exact h.symm.map_ne_zero_iff)
#align is_fraction_ring.field_equiv_of_ring_equiv IsFractionRing.fieldEquivOfRingEquiv

variable (S)

/- warning: is_fraction_ring.is_fraction_ring_iff_of_base_ring_equiv -> IsFractionRing.isFractionRing_iff_of_base_ringEquiv is a dubious translation:
lean 3 declaration is
  forall {R : Type.{u1}} [_inst_1 : CommRing.{u1} R] (S : Type.{u2}) [_inst_2 : CommRing.{u2} S] [_inst_3 : Algebra.{u1, u2} R S (CommRing.toCommSemiring.{u1} R _inst_1) (Ring.toSemiring.{u2} S (CommRing.toRing.{u2} S _inst_2))] {P : Type.{u3}} [_inst_4 : CommRing.{u3} P] (h : RingEquiv.{u1, u3} R P (Distrib.toHasMul.{u1} R (Ring.toDistrib.{u1} R (CommRing.toRing.{u1} R _inst_1))) (Distrib.toHasAdd.{u1} R (Ring.toDistrib.{u1} R (CommRing.toRing.{u1} R _inst_1))) (Distrib.toHasMul.{u3} P (Ring.toDistrib.{u3} P (CommRing.toRing.{u3} P _inst_4))) (Distrib.toHasAdd.{u3} P (Ring.toDistrib.{u3} P (CommRing.toRing.{u3} P _inst_4)))), Iff (IsFractionRing.{u1, u2} R _inst_1 S _inst_2 _inst_3) (IsFractionRing.{u3, u2} P _inst_4 S _inst_2 (RingHom.toAlgebra.{u3, u2} P S (CommRing.toCommSemiring.{u3} P _inst_4) (CommRing.toCommSemiring.{u2} S _inst_2) (RingHom.comp.{u3, u1, u2} P R S (NonAssocRing.toNonAssocSemiring.{u3} P (Ring.toNonAssocRing.{u3} P (CommRing.toRing.{u3} P _inst_4))) (Semiring.toNonAssocSemiring.{u1} R (CommSemiring.toSemiring.{u1} R (CommRing.toCommSemiring.{u1} R _inst_1))) (Semiring.toNonAssocSemiring.{u2} S (Ring.toSemiring.{u2} S (CommRing.toRing.{u2} S _inst_2))) (algebraMap.{u1, u2} R S (CommRing.toCommSemiring.{u1} R _inst_1) (Ring.toSemiring.{u2} S (CommRing.toRing.{u2} S _inst_2)) _inst_3) (RingEquiv.toRingHom.{u3, u1} P R (NonAssocRing.toNonAssocSemiring.{u3} P (Ring.toNonAssocRing.{u3} P (CommRing.toRing.{u3} P _inst_4))) (NonAssocRing.toNonAssocSemiring.{u1} R (Ring.toNonAssocRing.{u1} R (CommRing.toRing.{u1} R _inst_1))) (RingEquiv.symm.{u1, u3} R P (Distrib.toHasMul.{u1} R (Ring.toDistrib.{u1} R (CommRing.toRing.{u1} R _inst_1))) (Distrib.toHasAdd.{u1} R (Ring.toDistrib.{u1} R (CommRing.toRing.{u1} R _inst_1))) (Distrib.toHasMul.{u3} P (Ring.toDistrib.{u3} P (CommRing.toRing.{u3} P _inst_4))) (Distrib.toHasAdd.{u3} P (Ring.toDistrib.{u3} P (CommRing.toRing.{u3} P _inst_4))) h)))))
but is expected to have type
  forall {R : Type.{u3}} [_inst_1 : CommRing.{u3} R] (S : Type.{u1}) [_inst_2 : CommRing.{u1} S] [_inst_3 : Algebra.{u3, u1} R S (CommRing.toCommSemiring.{u3} R _inst_1) (Ring.toSemiring.{u1} S (CommRing.toRing.{u1} S _inst_2))] {P : Type.{u2}} [_inst_4 : CommRing.{u2} P] (h : RingEquiv.{u3, u2} R P (NonUnitalNonAssocRing.toMul.{u3} R (NonAssocRing.toNonUnitalNonAssocRing.{u3} R (Ring.toNonAssocRing.{u3} R (CommRing.toRing.{u3} R _inst_1)))) (NonUnitalNonAssocRing.toMul.{u2} P (NonAssocRing.toNonUnitalNonAssocRing.{u2} P (Ring.toNonAssocRing.{u2} P (CommRing.toRing.{u2} P _inst_4)))) (Distrib.toAdd.{u3} R (NonUnitalNonAssocSemiring.toDistrib.{u3} R (NonUnitalNonAssocRing.toNonUnitalNonAssocSemiring.{u3} R (NonAssocRing.toNonUnitalNonAssocRing.{u3} R (Ring.toNonAssocRing.{u3} R (CommRing.toRing.{u3} R _inst_1)))))) (Distrib.toAdd.{u2} P (NonUnitalNonAssocSemiring.toDistrib.{u2} P (NonUnitalNonAssocRing.toNonUnitalNonAssocSemiring.{u2} P (NonAssocRing.toNonUnitalNonAssocRing.{u2} P (Ring.toNonAssocRing.{u2} P (CommRing.toRing.{u2} P _inst_4))))))), Iff (IsFractionRing.{u3, u1} R _inst_1 S _inst_2 _inst_3) (IsFractionRing.{u2, u1} P _inst_4 S _inst_2 (RingHom.toAlgebra.{u2, u1} P S (CommRing.toCommSemiring.{u2} P _inst_4) (CommRing.toCommSemiring.{u1} S _inst_2) (RingHom.comp.{u2, u3, u1} P R S (NonAssocRing.toNonAssocSemiring.{u2} P (Ring.toNonAssocRing.{u2} P (CommRing.toRing.{u2} P _inst_4))) (Semiring.toNonAssocSemiring.{u3} R (CommSemiring.toSemiring.{u3} R (CommRing.toCommSemiring.{u3} R _inst_1))) (Semiring.toNonAssocSemiring.{u1} S (Ring.toSemiring.{u1} S (CommRing.toRing.{u1} S _inst_2))) (algebraMap.{u3, u1} R S (CommRing.toCommSemiring.{u3} R _inst_1) (Ring.toSemiring.{u1} S (CommRing.toRing.{u1} S _inst_2)) _inst_3) (RingEquiv.toRingHom.{u2, u3} P R (NonAssocRing.toNonAssocSemiring.{u2} P (Ring.toNonAssocRing.{u2} P (CommRing.toRing.{u2} P _inst_4))) (NonAssocRing.toNonAssocSemiring.{u3} R (Ring.toNonAssocRing.{u3} R (CommRing.toRing.{u3} R _inst_1))) (RingEquiv.symm.{u3, u2} R P (NonUnitalNonAssocRing.toMul.{u3} R (NonAssocRing.toNonUnitalNonAssocRing.{u3} R (Ring.toNonAssocRing.{u3} R (CommRing.toRing.{u3} R _inst_1)))) (NonUnitalNonAssocRing.toMul.{u2} P (NonAssocRing.toNonUnitalNonAssocRing.{u2} P (Ring.toNonAssocRing.{u2} P (CommRing.toRing.{u2} P _inst_4)))) (Distrib.toAdd.{u3} R (NonUnitalNonAssocSemiring.toDistrib.{u3} R (NonUnitalNonAssocRing.toNonUnitalNonAssocSemiring.{u3} R (NonAssocRing.toNonUnitalNonAssocRing.{u3} R (Ring.toNonAssocRing.{u3} R (CommRing.toRing.{u3} R _inst_1)))))) (Distrib.toAdd.{u2} P (NonUnitalNonAssocSemiring.toDistrib.{u2} P (NonUnitalNonAssocRing.toNonUnitalNonAssocSemiring.{u2} P (NonAssocRing.toNonUnitalNonAssocRing.{u2} P (Ring.toNonAssocRing.{u2} P (CommRing.toRing.{u2} P _inst_4)))))) h)))))
Case conversion may be inaccurate. Consider using '#align is_fraction_ring.is_fraction_ring_iff_of_base_ring_equiv IsFractionRing.isFractionRing_iff_of_base_ringEquivₓ'. -/
theorem isFractionRing_iff_of_base_ringEquiv (h : R ≃+* P) :
    IsFractionRing R S ↔
      @IsFractionRing P _ S _ ((algebraMap R S).comp h.symm.toRingHom).toAlgebra :=
  by
  delta IsFractionRing
  convert is_localization_iff_of_base_ring_equiv _ _ h
  ext x
  erw [Submonoid.map_equiv_eq_comap_symm]
  simp only [MulEquiv.coe_toMonoidHom, RingEquiv.toMulEquiv_eq_coe, Submonoid.mem_comap]
  constructor
  · rintro hx z (hz : z * h.symm x = 0)
    rw [← h.map_eq_zero_iff]
    apply hx
    simpa only [h.map_zero, h.apply_symm_apply, h.map_mul] using congr_arg h hz
  · rintro (hx : h.symm x ∈ _) z hz
    rw [← h.symm.map_eq_zero_iff]
    apply hx
    rw [← h.symm.map_mul, hz, h.symm.map_zero]
#align is_fraction_ring.is_fraction_ring_iff_of_base_ring_equiv IsFractionRing.isFractionRing_iff_of_base_ringEquiv

/- warning: is_fraction_ring.nontrivial -> IsFractionRing.nontrivial is a dubious translation:
lean 3 declaration is
  forall (R : Type.{u1}) (S : Type.{u2}) [_inst_13 : CommRing.{u1} R] [_inst_14 : Nontrivial.{u1} R] [_inst_15 : CommRing.{u2} S] [_inst_16 : Algebra.{u1, u2} R S (CommRing.toCommSemiring.{u1} R _inst_13) (Ring.toSemiring.{u2} S (CommRing.toRing.{u2} S _inst_15))] [_inst_17 : IsFractionRing.{u1, u2} R _inst_13 S _inst_15 _inst_16], Nontrivial.{u2} S
but is expected to have type
  forall (R : Type.{u2}) (S : Type.{u1}) [_inst_13 : CommRing.{u2} R] [_inst_14 : Nontrivial.{u2} R] [_inst_15 : CommRing.{u1} S] [_inst_16 : Algebra.{u2, u1} R S (CommRing.toCommSemiring.{u2} R _inst_13) (Ring.toSemiring.{u1} S (CommRing.toRing.{u1} S _inst_15))] [_inst_17 : IsFractionRing.{u2, u1} R _inst_13 S _inst_15 _inst_16], Nontrivial.{u1} S
Case conversion may be inaccurate. Consider using '#align is_fraction_ring.nontrivial IsFractionRing.nontrivialₓ'. -/
protected theorem nontrivial (R S : Type _) [CommRing R] [Nontrivial R] [CommRing S] [Algebra R S]
    [IsFractionRing R S] : Nontrivial S :=
  by
  apply nontrivial_of_ne
  intro h
  apply @zero_ne_one R
  exact
    IsLocalization.injective S (le_of_eq rfl)
      (((algebraMap R S).map_zero.trans h).trans (algebraMap R S).map_one.symm)
#align is_fraction_ring.nontrivial IsFractionRing.nontrivial

end IsFractionRing

variable (R A)

#print FractionRing /-
/-- 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.
-/
@[reducible]
def FractionRing :=
  Localization (nonZeroDivisors R)
#align fraction_ring FractionRing
-/

namespace FractionRing

#print FractionRing.unique /-
instance unique [Subsingleton R] : Unique (FractionRing R) :=
  Localization.unique
#align fraction_ring.unique FractionRing.unique
-/

instance [Nontrivial R] : Nontrivial (FractionRing R) :=
  ⟨⟨(algebraMap R _) 0, (algebraMap _ _) 1, fun H =>
      zero_ne_one (IsLocalization.injective _ le_rfl H)⟩⟩

variable {A}

noncomputable instance : Field (FractionRing A) :=
  { Localization.commRing,
    IsFractionRing.toField A with
    add := (· + ·)
    mul := (· * ·)
    neg := Neg.neg
    sub := Sub.sub
    one := 1
    zero := 0
    nsmul := AddMonoid.nsmul
    zsmul := SubNegMonoid.zsmul
    npow := Localization.npow _ }

/- warning: fraction_ring.mk_eq_div -> FractionRing.mk_eq_div is a dubious translation:
lean 3 declaration is
  forall {A : Type.{u1}} [_inst_5 : CommRing.{u1} A] [_inst_6 : IsDomain.{u1} A (Ring.toSemiring.{u1} A (CommRing.toRing.{u1} A _inst_5))] {r : A} {s : coeSort.{succ u1, succ (succ u1)} (Submonoid.{u1} A (Monoid.toMulOneClass.{u1} A (CommMonoid.toMonoid.{u1} A (CommRing.toCommMonoid.{u1} A _inst_5)))) Type.{u1} (SetLike.hasCoeToSort.{u1, u1} (Submonoid.{u1} A (Monoid.toMulOneClass.{u1} A (CommMonoid.toMonoid.{u1} A (CommRing.toCommMonoid.{u1} A _inst_5)))) A (Submonoid.setLike.{u1} A (Monoid.toMulOneClass.{u1} A (CommMonoid.toMonoid.{u1} A (CommRing.toCommMonoid.{u1} A _inst_5))))) (nonZeroDivisors.{u1} A (Semiring.toMonoidWithZero.{u1} A (Ring.toSemiring.{u1} A (CommRing.toRing.{u1} A _inst_5))))}, Eq.{succ u1} (Localization.{u1} A (CommRing.toCommMonoid.{u1} A _inst_5) (nonZeroDivisors.{u1} A (Semiring.toMonoidWithZero.{u1} A (Ring.toSemiring.{u1} A (CommRing.toRing.{u1} A _inst_5))))) (Localization.mk.{u1} A (CommRing.toCommMonoid.{u1} A _inst_5) (nonZeroDivisors.{u1} A (Semiring.toMonoidWithZero.{u1} A (Ring.toSemiring.{u1} A (CommRing.toRing.{u1} A _inst_5)))) r s) (HDiv.hDiv.{u1, u1, u1} (FractionRing.{u1} A _inst_5) (FractionRing.{u1} A _inst_5) (FractionRing.{u1} A _inst_5) (instHDiv.{u1} (FractionRing.{u1} A _inst_5) (DivInvMonoid.toHasDiv.{u1} (FractionRing.{u1} A _inst_5) (DivisionRing.toDivInvMonoid.{u1} (FractionRing.{u1} A _inst_5) (Field.toDivisionRing.{u1} (FractionRing.{u1} A _inst_5) (FractionRing.field.{u1} A _inst_5 _inst_6))))) (coeFn.{succ u1, succ u1} (RingHom.{u1, u1} A (FractionRing.{u1} A _inst_5) (Semiring.toNonAssocSemiring.{u1} A (CommSemiring.toSemiring.{u1} A (CommRing.toCommSemiring.{u1} A _inst_5))) (Semiring.toNonAssocSemiring.{u1} (FractionRing.{u1} A _inst_5) (Ring.toSemiring.{u1} (FractionRing.{u1} A _inst_5) (DivisionRing.toRing.{u1} (FractionRing.{u1} A _inst_5) (Field.toDivisionRing.{u1} (FractionRing.{u1} A _inst_5) (FractionRing.field.{u1} A _inst_5 _inst_6)))))) (fun (_x : RingHom.{u1, u1} A (FractionRing.{u1} A _inst_5) (Semiring.toNonAssocSemiring.{u1} A (CommSemiring.toSemiring.{u1} A (CommRing.toCommSemiring.{u1} A _inst_5))) (Semiring.toNonAssocSemiring.{u1} (FractionRing.{u1} A _inst_5) (Ring.toSemiring.{u1} (FractionRing.{u1} A _inst_5) (DivisionRing.toRing.{u1} (FractionRing.{u1} A _inst_5) (Field.toDivisionRing.{u1} (FractionRing.{u1} A _inst_5) (FractionRing.field.{u1} A _inst_5 _inst_6)))))) => A -> (FractionRing.{u1} A _inst_5)) (RingHom.hasCoeToFun.{u1, u1} A (FractionRing.{u1} A _inst_5) (Semiring.toNonAssocSemiring.{u1} A (CommSemiring.toSemiring.{u1} A (CommRing.toCommSemiring.{u1} A _inst_5))) (Semiring.toNonAssocSemiring.{u1} (FractionRing.{u1} A _inst_5) (Ring.toSemiring.{u1} (FractionRing.{u1} A _inst_5) (DivisionRing.toRing.{u1} (FractionRing.{u1} A _inst_5) (Field.toDivisionRing.{u1} (FractionRing.{u1} A _inst_5) (FractionRing.field.{u1} A _inst_5 _inst_6)))))) (algebraMap.{u1, u1} A (FractionRing.{u1} A _inst_5) (CommRing.toCommSemiring.{u1} A _inst_5) (Ring.toSemiring.{u1} (FractionRing.{u1} A _inst_5) (DivisionRing.toRing.{u1} (FractionRing.{u1} A _inst_5) (Field.toDivisionRing.{u1} (FractionRing.{u1} A _inst_5) (FractionRing.field.{u1} A _inst_5 _inst_6)))) (Localization.algebra.{u1, u1} A (CommRing.toCommSemiring.{u1} A _inst_5) (nonZeroDivisors.{u1} A (Semiring.toMonoidWithZero.{u1} A (Ring.toSemiring.{u1} A (CommRing.toRing.{u1} A _inst_5)))) A (CommRing.toCommSemiring.{u1} A _inst_5) (Algebra.id.{u1} A (CommRing.toCommSemiring.{u1} A _inst_5)))) r) (coeFn.{succ u1, succ u1} (RingHom.{u1, u1} A (FractionRing.{u1} A _inst_5) (Semiring.toNonAssocSemiring.{u1} A (CommSemiring.toSemiring.{u1} A (CommRing.toCommSemiring.{u1} A _inst_5))) (Semiring.toNonAssocSemiring.{u1} (FractionRing.{u1} A _inst_5) (Ring.toSemiring.{u1} (FractionRing.{u1} A _inst_5) (DivisionRing.toRing.{u1} (FractionRing.{u1} A _inst_5) (Field.toDivisionRing.{u1} (FractionRing.{u1} A _inst_5) (FractionRing.field.{u1} A _inst_5 _inst_6)))))) (fun (_x : RingHom.{u1, u1} A (FractionRing.{u1} A _inst_5) (Semiring.toNonAssocSemiring.{u1} A (CommSemiring.toSemiring.{u1} A (CommRing.toCommSemiring.{u1} A _inst_5))) (Semiring.toNonAssocSemiring.{u1} (FractionRing.{u1} A _inst_5) (Ring.toSemiring.{u1} (FractionRing.{u1} A _inst_5) (DivisionRing.toRing.{u1} (FractionRing.{u1} A _inst_5) (Field.toDivisionRing.{u1} (FractionRing.{u1} A _inst_5) (FractionRing.field.{u1} A _inst_5 _inst_6)))))) => A -> (FractionRing.{u1} A _inst_5)) (RingHom.hasCoeToFun.{u1, u1} A (FractionRing.{u1} A _inst_5) (Semiring.toNonAssocSemiring.{u1} A (CommSemiring.toSemiring.{u1} A (CommRing.toCommSemiring.{u1} A _inst_5))) (Semiring.toNonAssocSemiring.{u1} (FractionRing.{u1} A _inst_5) (Ring.toSemiring.{u1} (FractionRing.{u1} A _inst_5) (DivisionRing.toRing.{u1} (FractionRing.{u1} A _inst_5) (Field.toDivisionRing.{u1} (FractionRing.{u1} A _inst_5) (FractionRing.field.{u1} A _inst_5 _inst_6)))))) (algebraMap.{u1, u1} A (FractionRing.{u1} A _inst_5) (CommRing.toCommSemiring.{u1} A _inst_5) (Ring.toSemiring.{u1} (FractionRing.{u1} A _inst_5) (DivisionRing.toRing.{u1} (FractionRing.{u1} A _inst_5) (Field.toDivisionRing.{u1} (FractionRing.{u1} A _inst_5) (FractionRing.field.{u1} A _inst_5 _inst_6)))) (Localization.algebra.{u1, u1} A (CommRing.toCommSemiring.{u1} A _inst_5) (nonZeroDivisors.{u1} A (Semiring.toMonoidWithZero.{u1} A (Ring.toSemiring.{u1} A (CommRing.toRing.{u1} A _inst_5)))) A (CommRing.toCommSemiring.{u1} A _inst_5) (Algebra.id.{u1} A (CommRing.toCommSemiring.{u1} A _inst_5)))) ((fun (a : Type.{u1}) (b : Type.{u1}) [self : HasLiftT.{succ u1, succ u1} a b] => self.0) (coeSort.{succ u1, succ (succ u1)} (Submonoid.{u1} A (Monoid.toMulOneClass.{u1} A (CommMonoid.toMonoid.{u1} A (CommRing.toCommMonoid.{u1} A _inst_5)))) Type.{u1} (SetLike.hasCoeToSort.{u1, u1} (Submonoid.{u1} A (Monoid.toMulOneClass.{u1} A (CommMonoid.toMonoid.{u1} A (CommRing.toCommMonoid.{u1} A _inst_5)))) A (Submonoid.setLike.{u1} A (Monoid.toMulOneClass.{u1} A (CommMonoid.toMonoid.{u1} A (CommRing.toCommMonoid.{u1} A _inst_5))))) (nonZeroDivisors.{u1} A (Semiring.toMonoidWithZero.{u1} A (Ring.toSemiring.{u1} A (CommRing.toRing.{u1} A _inst_5))))) A (HasLiftT.mk.{succ u1, succ u1} (coeSort.{succ u1, succ (succ u1)} (Submonoid.{u1} A (Monoid.toMulOneClass.{u1} A (CommMonoid.toMonoid.{u1} A (CommRing.toCommMonoid.{u1} A _inst_5)))) Type.{u1} (SetLike.hasCoeToSort.{u1, u1} (Submonoid.{u1} A (Monoid.toMulOneClass.{u1} A (CommMonoid.toMonoid.{u1} A (CommRing.toCommMonoid.{u1} A _inst_5)))) A (Submonoid.setLike.{u1} A (Monoid.toMulOneClass.{u1} A (CommMonoid.toMonoid.{u1} A (CommRing.toCommMonoid.{u1} A _inst_5))))) (nonZeroDivisors.{u1} A (Semiring.toMonoidWithZero.{u1} A (Ring.toSemiring.{u1} A (CommRing.toRing.{u1} A _inst_5))))) A (CoeTCₓ.coe.{succ u1, succ u1} (coeSort.{succ u1, succ (succ u1)} (Submonoid.{u1} A (Monoid.toMulOneClass.{u1} A (CommMonoid.toMonoid.{u1} A (CommRing.toCommMonoid.{u1} A _inst_5)))) Type.{u1} (SetLike.hasCoeToSort.{u1, u1} (Submonoid.{u1} A (Monoid.toMulOneClass.{u1} A (CommMonoid.toMonoid.{u1} A (CommRing.toCommMonoid.{u1} A _inst_5)))) A (Submonoid.setLike.{u1} A (Monoid.toMulOneClass.{u1} A (CommMonoid.toMonoid.{u1} A (CommRing.toCommMonoid.{u1} A _inst_5))))) (nonZeroDivisors.{u1} A (Semiring.toMonoidWithZero.{u1} A (Ring.toSemiring.{u1} A (CommRing.toRing.{u1} A _inst_5))))) A (coeBase.{succ u1, succ u1} (coeSort.{succ u1, succ (succ u1)} (Submonoid.{u1} A (Monoid.toMulOneClass.{u1} A (CommMonoid.toMonoid.{u1} A (CommRing.toCommMonoid.{u1} A _inst_5)))) Type.{u1} (SetLike.hasCoeToSort.{u1, u1} (Submonoid.{u1} A (Monoid.toMulOneClass.{u1} A (CommMonoid.toMonoid.{u1} A (CommRing.toCommMonoid.{u1} A _inst_5)))) A (Submonoid.setLike.{u1} A (Monoid.toMulOneClass.{u1} A (CommMonoid.toMonoid.{u1} A (CommRing.toCommMonoid.{u1} A _inst_5))))) (nonZeroDivisors.{u1} A (Semiring.toMonoidWithZero.{u1} A (Ring.toSemiring.{u1} A (CommRing.toRing.{u1} A _inst_5))))) A (coeSubtype.{succ u1} A (fun (x : A) => Membership.Mem.{u1, u1} A (Submonoid.{u1} A (Monoid.toMulOneClass.{u1} A (CommMonoid.toMonoid.{u1} A (CommRing.toCommMonoid.{u1} A _inst_5)))) (SetLike.hasMem.{u1, u1} (Submonoid.{u1} A (Monoid.toMulOneClass.{u1} A (CommMonoid.toMonoid.{u1} A (CommRing.toCommMonoid.{u1} A _inst_5)))) A (Submonoid.setLike.{u1} A (Monoid.toMulOneClass.{u1} A (CommMonoid.toMonoid.{u1} A (CommRing.toCommMonoid.{u1} A _inst_5))))) x (nonZeroDivisors.{u1} A (Semiring.toMonoidWithZero.{u1} A (Ring.toSemiring.{u1} A (CommRing.toRing.{u1} A _inst_5))))))))) s)))
but is expected to have type
  forall (A : Type.{u1}) [_inst_5 : CommRing.{u1} A] [_inst_6 : IsDomain.{u1} A (Ring.toSemiring.{u1} A (CommRing.toRing.{u1} A _inst_5))] {r : A} {s : Subtype.{succ u1} A (fun (x : A) => Membership.mem.{u1, u1} A (Submonoid.{u1} A (Monoid.toMulOneClass.{u1} A (CommMonoid.toMonoid.{u1} A (CommRing.toCommMonoid.{u1} A _inst_5)))) (SetLike.instMembership.{u1, u1} (Submonoid.{u1} A (Monoid.toMulOneClass.{u1} A (CommMonoid.toMonoid.{u1} A (CommRing.toCommMonoid.{u1} A _inst_5)))) A (Submonoid.instSetLikeSubmonoid.{u1} A (Monoid.toMulOneClass.{u1} A (CommMonoid.toMonoid.{u1} A (CommRing.toCommMonoid.{u1} A _inst_5))))) x (nonZeroDivisors.{u1} A (Semiring.toMonoidWithZero.{u1} A (Ring.toSemiring.{u1} A (CommRing.toRing.{u1} A _inst_5)))))}, Eq.{succ u1} (Localization.{u1} A (CommRing.toCommMonoid.{u1} A _inst_5) (nonZeroDivisors.{u1} A (Semiring.toMonoidWithZero.{u1} A (Ring.toSemiring.{u1} A (CommRing.toRing.{u1} A _inst_5))))) (Localization.mk.{u1} A (CommRing.toCommMonoid.{u1} A _inst_5) (nonZeroDivisors.{u1} A (Semiring.toMonoidWithZero.{u1} A (Ring.toSemiring.{u1} A (CommRing.toRing.{u1} A _inst_5)))) r s) (HDiv.hDiv.{u1, u1, u1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : A) => FractionRing.{u1} A _inst_5) r) ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : A) => FractionRing.{u1} A _inst_5) (Subtype.val.{succ u1} A (fun (x : A) => Membership.mem.{u1, u1} A (Set.{u1} A) (Set.instMembershipSet.{u1} A) x (SetLike.coe.{u1, u1} (Submonoid.{u1} A (Monoid.toMulOneClass.{u1} A (CommMonoid.toMonoid.{u1} A (CommRing.toCommMonoid.{u1} A _inst_5)))) A (Submonoid.instSetLikeSubmonoid.{u1} A (Monoid.toMulOneClass.{u1} A (CommMonoid.toMonoid.{u1} A (CommRing.toCommMonoid.{u1} A _inst_5)))) (nonZeroDivisors.{u1} A (Semiring.toMonoidWithZero.{u1} A (Ring.toSemiring.{u1} A (CommRing.toRing.{u1} A _inst_5)))))) s)) (FractionRing.{u1} A _inst_5) (instHDiv.{u1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : A) => FractionRing.{u1} A _inst_5) r) (Field.toDiv.{u1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : A) => FractionRing.{u1} A _inst_5) r) (FractionRing.instFieldFractionRing.{u1} A _inst_5 _inst_6))) (FunLike.coe.{succ u1, succ u1, succ u1} (RingHom.{u1, u1} A (FractionRing.{u1} A _inst_5) (Semiring.toNonAssocSemiring.{u1} A (CommSemiring.toSemiring.{u1} A (CommRing.toCommSemiring.{u1} A _inst_5))) (Semiring.toNonAssocSemiring.{u1} (FractionRing.{u1} A _inst_5) (DivisionSemiring.toSemiring.{u1} (FractionRing.{u1} A _inst_5) (Semifield.toDivisionSemiring.{u1} (FractionRing.{u1} A _inst_5) (Field.toSemifield.{u1} (FractionRing.{u1} A _inst_5) (FractionRing.instFieldFractionRing.{u1} A _inst_5 _inst_6)))))) A (fun (_x : A) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : A) => FractionRing.{u1} A _inst_5) _x) (MulHomClass.toFunLike.{u1, u1, u1} (RingHom.{u1, u1} A (FractionRing.{u1} A _inst_5) (Semiring.toNonAssocSemiring.{u1} A (CommSemiring.toSemiring.{u1} A (CommRing.toCommSemiring.{u1} A _inst_5))) (Semiring.toNonAssocSemiring.{u1} (FractionRing.{u1} A _inst_5) (DivisionSemiring.toSemiring.{u1} (FractionRing.{u1} A _inst_5) (Semifield.toDivisionSemiring.{u1} (FractionRing.{u1} A _inst_5) (Field.toSemifield.{u1} (FractionRing.{u1} A _inst_5) (FractionRing.instFieldFractionRing.{u1} A _inst_5 _inst_6)))))) A (FractionRing.{u1} A _inst_5) (NonUnitalNonAssocSemiring.toMul.{u1} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} A (Semiring.toNonAssocSemiring.{u1} A (CommSemiring.toSemiring.{u1} A (CommRing.toCommSemiring.{u1} A _inst_5))))) (NonUnitalNonAssocSemiring.toMul.{u1} (FractionRing.{u1} A _inst_5) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} (FractionRing.{u1} A _inst_5) (Semiring.toNonAssocSemiring.{u1} (FractionRing.{u1} A _inst_5) (DivisionSemiring.toSemiring.{u1} (FractionRing.{u1} A _inst_5) (Semifield.toDivisionSemiring.{u1} (FractionRing.{u1} A _inst_5) (Field.toSemifield.{u1} (FractionRing.{u1} A _inst_5) (FractionRing.instFieldFractionRing.{u1} A _inst_5 _inst_6))))))) (NonUnitalRingHomClass.toMulHomClass.{u1, u1, u1} (RingHom.{u1, u1} A (FractionRing.{u1} A _inst_5) (Semiring.toNonAssocSemiring.{u1} A (CommSemiring.toSemiring.{u1} A (CommRing.toCommSemiring.{u1} A _inst_5))) (Semiring.toNonAssocSemiring.{u1} (FractionRing.{u1} A _inst_5) (DivisionSemiring.toSemiring.{u1} (FractionRing.{u1} A _inst_5) (Semifield.toDivisionSemiring.{u1} (FractionRing.{u1} A _inst_5) (Field.toSemifield.{u1} (FractionRing.{u1} A _inst_5) (FractionRing.instFieldFractionRing.{u1} A _inst_5 _inst_6)))))) A (FractionRing.{u1} A _inst_5) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} A (Semiring.toNonAssocSemiring.{u1} A (CommSemiring.toSemiring.{u1} A (CommRing.toCommSemiring.{u1} A _inst_5)))) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} (FractionRing.{u1} A _inst_5) (Semiring.toNonAssocSemiring.{u1} (FractionRing.{u1} A _inst_5) (DivisionSemiring.toSemiring.{u1} (FractionRing.{u1} A _inst_5) (Semifield.toDivisionSemiring.{u1} (FractionRing.{u1} A _inst_5) (Field.toSemifield.{u1} (FractionRing.{u1} A _inst_5) (FractionRing.instFieldFractionRing.{u1} A _inst_5 _inst_6)))))) (RingHomClass.toNonUnitalRingHomClass.{u1, u1, u1} (RingHom.{u1, u1} A (FractionRing.{u1} A _inst_5) (Semiring.toNonAssocSemiring.{u1} A (CommSemiring.toSemiring.{u1} A (CommRing.toCommSemiring.{u1} A _inst_5))) (Semiring.toNonAssocSemiring.{u1} (FractionRing.{u1} A _inst_5) (DivisionSemiring.toSemiring.{u1} (FractionRing.{u1} A _inst_5) (Semifield.toDivisionSemiring.{u1} (FractionRing.{u1} A _inst_5) (Field.toSemifield.{u1} (FractionRing.{u1} A _inst_5) (FractionRing.instFieldFractionRing.{u1} A _inst_5 _inst_6)))))) A (FractionRing.{u1} A _inst_5) (Semiring.toNonAssocSemiring.{u1} A (CommSemiring.toSemiring.{u1} A (CommRing.toCommSemiring.{u1} A _inst_5))) (Semiring.toNonAssocSemiring.{u1} (FractionRing.{u1} A _inst_5) (DivisionSemiring.toSemiring.{u1} (FractionRing.{u1} A _inst_5) (Semifield.toDivisionSemiring.{u1} (FractionRing.{u1} A _inst_5) (Field.toSemifield.{u1} (FractionRing.{u1} A _inst_5) (FractionRing.instFieldFractionRing.{u1} A _inst_5 _inst_6))))) (RingHom.instRingHomClassRingHom.{u1, u1} A (FractionRing.{u1} A _inst_5) (Semiring.toNonAssocSemiring.{u1} A (CommSemiring.toSemiring.{u1} A (CommRing.toCommSemiring.{u1} A _inst_5))) (Semiring.toNonAssocSemiring.{u1} (FractionRing.{u1} A _inst_5) (DivisionSemiring.toSemiring.{u1} (FractionRing.{u1} A _inst_5) (Semifield.toDivisionSemiring.{u1} (FractionRing.{u1} A _inst_5) (Field.toSemifield.{u1} (FractionRing.{u1} A _inst_5) (FractionRing.instFieldFractionRing.{u1} A _inst_5 _inst_6))))))))) (algebraMap.{u1, u1} A (FractionRing.{u1} A _inst_5) (CommRing.toCommSemiring.{u1} A _inst_5) (DivisionSemiring.toSemiring.{u1} (FractionRing.{u1} A _inst_5) (Semifield.toDivisionSemiring.{u1} (FractionRing.{u1} A _inst_5) (Field.toSemifield.{u1} (FractionRing.{u1} A _inst_5) (FractionRing.instFieldFractionRing.{u1} A _inst_5 _inst_6)))) (Localization.instAlgebraLocalizationToCommMonoidToSemiringInstCommSemiringLocalizationToCommMonoid.{u1, u1} A (CommRing.toCommSemiring.{u1} A _inst_5) (nonZeroDivisors.{u1} A (Semiring.toMonoidWithZero.{u1} A (Ring.toSemiring.{u1} A (CommRing.toRing.{u1} A _inst_5)))) A (CommRing.toCommSemiring.{u1} A _inst_5) (Algebra.id.{u1} A (CommRing.toCommSemiring.{u1} A _inst_5)))) r) (FunLike.coe.{succ u1, succ u1, succ u1} (RingHom.{u1, u1} A (FractionRing.{u1} A _inst_5) (Semiring.toNonAssocSemiring.{u1} A (CommSemiring.toSemiring.{u1} A (CommRing.toCommSemiring.{u1} A _inst_5))) (Semiring.toNonAssocSemiring.{u1} (FractionRing.{u1} A _inst_5) (DivisionSemiring.toSemiring.{u1} (FractionRing.{u1} A _inst_5) (Semifield.toDivisionSemiring.{u1} (FractionRing.{u1} A _inst_5) (Field.toSemifield.{u1} (FractionRing.{u1} A _inst_5) (FractionRing.instFieldFractionRing.{u1} A _inst_5 _inst_6)))))) A (fun (_x : A) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : A) => FractionRing.{u1} A _inst_5) _x) (MulHomClass.toFunLike.{u1, u1, u1} (RingHom.{u1, u1} A (FractionRing.{u1} A _inst_5) (Semiring.toNonAssocSemiring.{u1} A (CommSemiring.toSemiring.{u1} A (CommRing.toCommSemiring.{u1} A _inst_5))) (Semiring.toNonAssocSemiring.{u1} (FractionRing.{u1} A _inst_5) (DivisionSemiring.toSemiring.{u1} (FractionRing.{u1} A _inst_5) (Semifield.toDivisionSemiring.{u1} (FractionRing.{u1} A _inst_5) (Field.toSemifield.{u1} (FractionRing.{u1} A _inst_5) (FractionRing.instFieldFractionRing.{u1} A _inst_5 _inst_6)))))) A (FractionRing.{u1} A _inst_5) (NonUnitalNonAssocSemiring.toMul.{u1} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} A (Semiring.toNonAssocSemiring.{u1} A (CommSemiring.toSemiring.{u1} A (CommRing.toCommSemiring.{u1} A _inst_5))))) (NonUnitalNonAssocSemiring.toMul.{u1} (FractionRing.{u1} A _inst_5) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} (FractionRing.{u1} A _inst_5) (Semiring.toNonAssocSemiring.{u1} (FractionRing.{u1} A _inst_5) (DivisionSemiring.toSemiring.{u1} (FractionRing.{u1} A _inst_5) (Semifield.toDivisionSemiring.{u1} (FractionRing.{u1} A _inst_5) (Field.toSemifield.{u1} (FractionRing.{u1} A _inst_5) (FractionRing.instFieldFractionRing.{u1} A _inst_5 _inst_6))))))) (NonUnitalRingHomClass.toMulHomClass.{u1, u1, u1} (RingHom.{u1, u1} A (FractionRing.{u1} A _inst_5) (Semiring.toNonAssocSemiring.{u1} A (CommSemiring.toSemiring.{u1} A (CommRing.toCommSemiring.{u1} A _inst_5))) (Semiring.toNonAssocSemiring.{u1} (FractionRing.{u1} A _inst_5) (DivisionSemiring.toSemiring.{u1} (FractionRing.{u1} A _inst_5) (Semifield.toDivisionSemiring.{u1} (FractionRing.{u1} A _inst_5) (Field.toSemifield.{u1} (FractionRing.{u1} A _inst_5) (FractionRing.instFieldFractionRing.{u1} A _inst_5 _inst_6)))))) A (FractionRing.{u1} A _inst_5) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} A (Semiring.toNonAssocSemiring.{u1} A (CommSemiring.toSemiring.{u1} A (CommRing.toCommSemiring.{u1} A _inst_5)))) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} (FractionRing.{u1} A _inst_5) (Semiring.toNonAssocSemiring.{u1} (FractionRing.{u1} A _inst_5) (DivisionSemiring.toSemiring.{u1} (FractionRing.{u1} A _inst_5) (Semifield.toDivisionSemiring.{u1} (FractionRing.{u1} A _inst_5) (Field.toSemifield.{u1} (FractionRing.{u1} A _inst_5) (FractionRing.instFieldFractionRing.{u1} A _inst_5 _inst_6)))))) (RingHomClass.toNonUnitalRingHomClass.{u1, u1, u1} (RingHom.{u1, u1} A (FractionRing.{u1} A _inst_5) (Semiring.toNonAssocSemiring.{u1} A (CommSemiring.toSemiring.{u1} A (CommRing.toCommSemiring.{u1} A _inst_5))) (Semiring.toNonAssocSemiring.{u1} (FractionRing.{u1} A _inst_5) (DivisionSemiring.toSemiring.{u1} (FractionRing.{u1} A _inst_5) (Semifield.toDivisionSemiring.{u1} (FractionRing.{u1} A _inst_5) (Field.toSemifield.{u1} (FractionRing.{u1} A _inst_5) (FractionRing.instFieldFractionRing.{u1} A _inst_5 _inst_6)))))) A (FractionRing.{u1} A _inst_5) (Semiring.toNonAssocSemiring.{u1} A (CommSemiring.toSemiring.{u1} A (CommRing.toCommSemiring.{u1} A _inst_5))) (Semiring.toNonAssocSemiring.{u1} (FractionRing.{u1} A _inst_5) (DivisionSemiring.toSemiring.{u1} (FractionRing.{u1} A _inst_5) (Semifield.toDivisionSemiring.{u1} (FractionRing.{u1} A _inst_5) (Field.toSemifield.{u1} (FractionRing.{u1} A _inst_5) (FractionRing.instFieldFractionRing.{u1} A _inst_5 _inst_6))))) (RingHom.instRingHomClassRingHom.{u1, u1} A (FractionRing.{u1} A _inst_5) (Semiring.toNonAssocSemiring.{u1} A (CommSemiring.toSemiring.{u1} A (CommRing.toCommSemiring.{u1} A _inst_5))) (Semiring.toNonAssocSemiring.{u1} (FractionRing.{u1} A _inst_5) (DivisionSemiring.toSemiring.{u1} (FractionRing.{u1} A _inst_5) (Semifield.toDivisionSemiring.{u1} (FractionRing.{u1} A _inst_5) (Field.toSemifield.{u1} (FractionRing.{u1} A _inst_5) (FractionRing.instFieldFractionRing.{u1} A _inst_5 _inst_6))))))))) (algebraMap.{u1, u1} A (FractionRing.{u1} A _inst_5) (CommRing.toCommSemiring.{u1} A _inst_5) (DivisionSemiring.toSemiring.{u1} (FractionRing.{u1} A _inst_5) (Semifield.toDivisionSemiring.{u1} (FractionRing.{u1} A _inst_5) (Field.toSemifield.{u1} (FractionRing.{u1} A _inst_5) (FractionRing.instFieldFractionRing.{u1} A _inst_5 _inst_6)))) (Localization.instAlgebraLocalizationToCommMonoidToSemiringInstCommSemiringLocalizationToCommMonoid.{u1, u1} A (CommRing.toCommSemiring.{u1} A _inst_5) (nonZeroDivisors.{u1} A (Semiring.toMonoidWithZero.{u1} A (Ring.toSemiring.{u1} A (CommRing.toRing.{u1} A _inst_5)))) A (CommRing.toCommSemiring.{u1} A _inst_5) (Algebra.id.{u1} A (CommRing.toCommSemiring.{u1} A _inst_5)))) (Subtype.val.{succ u1} A (fun (x : A) => Membership.mem.{u1, u1} A (Set.{u1} A) (Set.instMembershipSet.{u1} A) x (SetLike.coe.{u1, u1} (Submonoid.{u1} A (Monoid.toMulOneClass.{u1} A (CommMonoid.toMonoid.{u1} A (CommRing.toCommMonoid.{u1} A _inst_5)))) A (Submonoid.instSetLikeSubmonoid.{u1} A (Monoid.toMulOneClass.{u1} A (CommMonoid.toMonoid.{u1} A (CommRing.toCommMonoid.{u1} A _inst_5)))) (nonZeroDivisors.{u1} A (Semiring.toMonoidWithZero.{u1} A (Ring.toSemiring.{u1} A (CommRing.toRing.{u1} A _inst_5)))))) s)))
Case conversion may be inaccurate. Consider using '#align fraction_ring.mk_eq_div FractionRing.mk_eq_divₓ'. -/
@[simp]
theorem mk_eq_div {r s} :
    (Localization.mk r s : FractionRing A) =
      (algebraMap _ _ r / algebraMap A _ s : FractionRing A) :=
  by rw [Localization.mk_eq_mk', IsFractionRing.mk'_eq_div]
#align fraction_ring.mk_eq_div FractionRing.mk_eq_div

noncomputable instance [IsDomain R] [Field K] [Algebra R K] [NoZeroSMulDivisors R K] :
    Algebra (FractionRing R) K :=
  RingHom.toAlgebra (IsFractionRing.lift (NoZeroSMulDivisors.algebraMap_injective R _))

instance [IsDomain R] [Field K] [Algebra R K] [NoZeroSMulDivisors R K] :
    IsScalarTower R (FractionRing R) K :=
  IsScalarTower.of_algebraMap_eq fun x => (IsFractionRing.lift_algebraMap _ x).symm

variable (A)

/- warning: fraction_ring.alg_equiv -> FractionRing.algEquiv is a dubious translation:
lean 3 declaration is
  forall (A : Type.{u1}) [_inst_5 : CommRing.{u1} A] [_inst_6 : IsDomain.{u1} A (Ring.toSemiring.{u1} A (CommRing.toRing.{u1} A _inst_5))] (K : Type.{u2}) [_inst_7 : Field.{u2} K] [_inst_8 : Algebra.{u1, u2} A K (CommRing.toCommSemiring.{u1} A _inst_5) (Ring.toSemiring.{u2} K (DivisionRing.toRing.{u2} K (Field.toDivisionRing.{u2} K _inst_7)))] [_inst_9 : IsFractionRing.{u1, u2} A _inst_5 K (Field.toCommRing.{u2} K _inst_7) _inst_8], AlgEquiv.{u1, u1, u2} A (FractionRing.{u1} A _inst_5) K (CommRing.toCommSemiring.{u1} A _inst_5) (Ring.toSemiring.{u1} (FractionRing.{u1} A _inst_5) (DivisionRing.toRing.{u1} (FractionRing.{u1} A _inst_5) (Field.toDivisionRing.{u1} (FractionRing.{u1} A _inst_5) (FractionRing.field.{u1} A _inst_5 _inst_6)))) (Ring.toSemiring.{u2} K (DivisionRing.toRing.{u2} K (Field.toDivisionRing.{u2} K _inst_7))) (Localization.algebra.{u1, u1} A (CommRing.toCommSemiring.{u1} A _inst_5) (nonZeroDivisors.{u1} A (Semiring.toMonoidWithZero.{u1} A (Ring.toSemiring.{u1} A (CommRing.toRing.{u1} A _inst_5)))) A (CommRing.toCommSemiring.{u1} A _inst_5) (Algebra.id.{u1} A (CommRing.toCommSemiring.{u1} A _inst_5))) _inst_8
but is expected to have type
  forall (A : Type.{u1}) [_inst_5 : CommRing.{u1} A] [_inst_6 : IsDomain.{u1} A (Ring.toSemiring.{u1} A (CommRing.toRing.{u1} A _inst_5))] (K : Type.{u2}) [_inst_7 : Field.{u2} K] [_inst_8 : Algebra.{u1, u2} A K (CommRing.toCommSemiring.{u1} A _inst_5) (DivisionSemiring.toSemiring.{u2} K (Semifield.toDivisionSemiring.{u2} K (Field.toSemifield.{u2} K _inst_7)))] [_inst_9 : IsFractionRing.{u1, u2} A _inst_5 K (Field.toCommRing.{u2} K _inst_7) _inst_8], AlgEquiv.{u1, u1, u2} A (FractionRing.{u1} A _inst_5) K (CommRing.toCommSemiring.{u1} A _inst_5) (DivisionSemiring.toSemiring.{u1} (FractionRing.{u1} A _inst_5) (Semifield.toDivisionSemiring.{u1} (FractionRing.{u1} A _inst_5) (Field.toSemifield.{u1} (FractionRing.{u1} A _inst_5) (FractionRing.instFieldFractionRing.{u1} A _inst_5 _inst_6)))) (DivisionSemiring.toSemiring.{u2} K (Semifield.toDivisionSemiring.{u2} K (Field.toSemifield.{u2} K _inst_7))) (Localization.instAlgebraLocalizationToCommMonoidToSemiringInstCommSemiringLocalizationToCommMonoid.{u1, u1} A (CommRing.toCommSemiring.{u1} A _inst_5) (nonZeroDivisors.{u1} A (Semiring.toMonoidWithZero.{u1} A (Ring.toSemiring.{u1} A (CommRing.toRing.{u1} A _inst_5)))) A (CommRing.toCommSemiring.{u1} A _inst_5) (Algebra.id.{u1} A (CommRing.toCommSemiring.{u1} A _inst_5))) _inst_8
Case conversion may be inaccurate. Consider using '#align fraction_ring.alg_equiv FractionRing.algEquivₓ'. -/
/-- 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 :=
  Localization.algEquiv (nonZeroDivisors A) K
#align fraction_ring.alg_equiv FractionRing.algEquiv

instance [Algebra R A] [NoZeroSMulDivisors R A] : NoZeroSMulDivisors R (FractionRing A) :=
  NoZeroSMulDivisors.of_algebraMap_injective
    (by
      rw [IsScalarTower.algebraMap_eq R A]
      exact
        Function.Injective.comp (NoZeroSMulDivisors.algebraMap_injective _ _)
          (NoZeroSMulDivisors.algebraMap_injective _ _))

end FractionRing