R : Type u_1
inst✝⁹ : CommRing R
M : Submonoid R
S : Type u_2
inst✝⁸ : CommRing S
inst✝⁷ : Algebra R S
P : Type ?u.284769
inst✝⁶ : CommRing P
Rₘ : Type u_3
Sₘ : Type u_4
inst✝⁵ : CommRing Rₘ
inst✝⁴ : CommRing Sₘ
inst✝³ : Algebra R Rₘ
inst✝² : IsLocalization M Rₘ
inst✝¹ : Algebra S Sₘ
inst✝ : IsLocalization (Algebra.algebraMapSubmonoid S M) Sₘ
H : Algebra.IsIntegral R S
x : Sₘ
⊢ RingHom.IsIntegralElem
    (IsLocalization.map Sₘ (algebraMap R S)
      (_ : M ≤ Submonoid.comap (algebraMap R S) (Algebra.algebraMapSubmonoid S M)))
    x
R : Type u_1
inst✝⁹ : CommRing R
M : Submonoid R
S : Type u_2
inst✝⁸ : CommRing S
inst✝⁷ : Algebra R S
P : Type ?u.284769
inst✝⁶ : CommRing P
Rₘ : Type u_3
Sₘ : Type u_4
inst✝⁵ : CommRing Rₘ
inst✝⁴ : CommRing Sₘ
inst✝³ : Algebra R Rₘ
inst✝² : IsLocalization M Rₘ
inst✝¹ : Algebra S Sₘ
inst✝ : IsLocalization (Algebra.algebraMapSubmonoid S M) Sₘ
H : Algebra.IsIntegral R S
⊢ RingHom.IsIntegral
    (IsLocalization.map Sₘ (algebraMap R S)
      (_ : M ≤ Submonoid.comap (algebraMap R S) (Algebra.algebraMapSubmonoid S M)))
intro x
case intro.mk.mk
R : Type u_1
inst✝⁹ : CommRing R
M : Submonoid R
S : Type u_2
inst✝⁸ : CommRing S
inst✝⁷ : Algebra R S
P : Type ?u.284769
inst✝⁶ : CommRing P
Rₘ : Type u_3
Sₘ : Type u_4
inst✝⁵ : CommRing Rₘ
inst✝⁴ : CommRing Sₘ
inst✝³ : Algebra R Rₘ
inst✝² : IsLocalization M Rₘ
inst✝¹ : Algebra S Sₘ
inst✝ : IsLocalization (Algebra.algebraMapSubmonoid S M) Sₘ
H : Algebra.IsIntegral R S
x : Sₘ
s u : S
hu : u ∈ Algebra.algebraMapSubmonoid S M
hx :
  x * ↑(algebraMap S Sₘ) ↑(s, { val := u, property := hu }).snd =
    ↑(algebraMap S Sₘ) (s, { val := u, property := hu }).fst
⊢ RingHom.IsIntegralElem
    (IsLocalization.map Sₘ (algebraMap R S)
      (_ : M ≤ Submonoid.comap (algebraMap R S) (Algebra.algebraMapSubmonoid S M)))
    x
R : Type u_1
inst✝⁹ : CommRing R
M : Submonoid R
S : Type u_2
inst✝⁸ : CommRing S
inst✝⁷ : Algebra R S
P : Type ?u.284769
inst✝⁶ : CommRing P
Rₘ : Type u_3
Sₘ : Type u_4
inst✝⁵ : CommRing Rₘ
inst✝⁴ : CommRing Sₘ
inst✝³ : Algebra R Rₘ
inst✝² : IsLocalization M Rₘ
inst✝¹ : Algebra S Sₘ
inst✝ : IsLocalization (Algebra.algebraMapSubmonoid S M) Sₘ
H : Algebra.IsIntegral R S
x : Sₘ
⊢ RingHom.IsIntegralElem
    (IsLocalization.map Sₘ (algebraMap R S)
      (_ : M ≤ Submonoid.comap (algebraMap R S) (Algebra.algebraMapSubmonoid S M)))
    x
obtain ⟨⟨s, ⟨u, hu⟩⟩, hx⟩ := surj (Algebra.algebraMapSubmonoid S M) x
case intro.mk.mk.intro
R : Type u_1
inst✝⁹ : CommRing R
M : Submonoid R
S : Type u_2
inst✝⁸ : CommRing S
inst✝⁷ : Algebra R S
P : Type ?u.284769
inst✝⁶ : CommRing P
Rₘ : Type u_3
Sₘ : Type u_4
inst✝⁵ : CommRing Rₘ
inst✝⁴ : CommRing Sₘ
inst✝³ : Algebra R Rₘ
inst✝² : IsLocalization M Rₘ
inst✝¹ : Algebra S Sₘ
inst✝ : IsLocalization (Algebra.algebraMapSubmonoid S M) Sₘ
H : Algebra.IsIntegral R S
x : Sₘ
s u : S
v : R
hv : v ∈ ↑M ∧ ↑(algebraMap R S) v = u
hx :
  x * ↑(algebraMap S Sₘ) ↑(s, { val := u, property := (_ : ∃ a, a ∈ ↑M ∧ ↑(algebraMap R S) a = u) }).snd =
    ↑(algebraMap S Sₘ) (s, { val := u, property := (_ : ∃ a, a ∈ ↑M ∧ ↑(algebraMap R S) a = u) }).fst
⊢ RingHom.IsIntegralElem
    (IsLocalization.map Sₘ (algebraMap R S)
      (_ : M ≤ Submonoid.comap (algebraMap R S) (Algebra.algebraMapSubmonoid S M)))
    x
case intro.mk.mk
R : Type u_1
inst✝⁹ : CommRing R
M : Submonoid R
S : Type u_2
inst✝⁸ : CommRing S
inst✝⁷ : Algebra R S
P : Type ?u.284769
inst✝⁶ : CommRing P
Rₘ : Type u_3
Sₘ : Type u_4
inst✝⁵ : CommRing Rₘ
inst✝⁴ : CommRing Sₘ
inst✝³ : Algebra R Rₘ
inst✝² : IsLocalization M Rₘ
inst✝¹ : Algebra S Sₘ
inst✝ : IsLocalization (Algebra.algebraMapSubmonoid S M) Sₘ
H : Algebra.IsIntegral R S
x : Sₘ
s u : S
hu : u ∈ Algebra.algebraMapSubmonoid S M
hx :
  x * ↑(algebraMap S Sₘ) ↑(s, { val := u, property := hu }).snd =
    ↑(algebraMap S Sₘ) (s, { val := u, property := hu }).fst
⊢ RingHom.IsIntegralElem
    (IsLocalization.map Sₘ (algebraMap R S)
      (_ : M ≤ Submonoid.comap (algebraMap R S) (Algebra.algebraMapSubmonoid S M)))
    x
obtain ⟨v, hv⟩ := hu
case intro.mk.mk.intro.intro
R : Type u_1
inst✝⁹ : CommRing R
M : Submonoid R
S : Type u_2
inst✝⁸ : CommRing S
inst✝⁷ : Algebra R S
P : Type ?u.284769
inst✝⁶ : CommRing P
Rₘ : Type u_3
Sₘ : Type u_4
inst✝⁵ : CommRing Rₘ
inst✝⁴ : CommRing Sₘ
inst✝³ : Algebra R Rₘ
inst✝² : IsLocalization M Rₘ
inst✝¹ : Algebra S Sₘ
inst✝ : IsLocalization (Algebra.algebraMapSubmonoid S M) Sₘ
H : Algebra.IsIntegral R S
x : Sₘ
s u : S
v : R
hv : v ∈ ↑M ∧ ↑(algebraMap R S) v = u
hx :
  x * ↑(algebraMap S Sₘ) ↑(s, { val := u, property := (_ : ∃ a, a ∈ ↑M ∧ ↑(algebraMap R S) a = u) }).snd =
    ↑(algebraMap S Sₘ) (s, { val := u, property := (_ : ∃ a, a ∈ ↑M ∧ ↑(algebraMap R S) a = u) }).fst
v' : Rₘ
hv' : v' * ↑(algebraMap R Rₘ) ↑{ val := v, property := (_ : v ∈ ↑M) } = 1
⊢ RingHom.IsIntegralElem
    (IsLocalization.map Sₘ (algebraMap R S)
      (_ : M ≤ Submonoid.comap (algebraMap R S) (Algebra.algebraMapSubmonoid S M)))
    x
case intro.mk.mk.intro
R : Type u_1
inst✝⁹ : CommRing R
M : Submonoid R
S : Type u_2
inst✝⁸ : CommRing S
inst✝⁷ : Algebra R S
P : Type ?u.284769
inst✝⁶ : CommRing P
Rₘ : Type u_3
Sₘ : Type u_4
inst✝⁵ : CommRing Rₘ
inst✝⁴ : CommRing Sₘ
inst✝³ : Algebra R Rₘ
inst✝² : IsLocalization M Rₘ
inst✝¹ : Algebra S Sₘ
inst✝ : IsLocalization (Algebra.algebraMapSubmonoid S M) Sₘ
H : Algebra.IsIntegral R S
x : Sₘ
s u : S
v : R
hv : v ∈ ↑M ∧ ↑(algebraMap R S) v = u
hx :
  x * ↑(algebraMap S Sₘ) ↑(s, { val := u, property := (_ : ∃ a, a ∈ ↑M ∧ ↑(algebraMap R S) a = u) }).snd =
    ↑(algebraMap S Sₘ) (s, { val := u, property := (_ : ∃ a, a ∈ ↑M ∧ ↑(algebraMap R S) a = u) }).fst
⊢ RingHom.IsIntegralElem
    (IsLocalization.map Sₘ (algebraMap R S)
      (_ : M ≤ Submonoid.comap (algebraMap R S) (Algebra.algebraMapSubmonoid S M)))
    x
obtain ⟨v', hv'⟩ := isUnit_iff_exists_inv'.1 (map_units Rₘ ⟨v, hv.1⟩)
case intro.mk.mk.intro.intro.refine'_1
R : Type u_1
inst✝⁹ : CommRing R
M : Submonoid R
S : Type u_2
inst✝⁸ : CommRing S
inst✝⁷ : Algebra R S
P : Type ?u.284769
inst✝⁶ : CommRing P
Rₘ : Type u_3
Sₘ : Type u_4
inst✝⁵ : CommRing Rₘ
inst✝⁴ : CommRing Sₘ
inst✝³ : Algebra R Rₘ
inst✝² : IsLocalization M Rₘ
inst✝¹ : Algebra S Sₘ
inst✝ : IsLocalization (Algebra.algebraMapSubmonoid S M) Sₘ
H : Algebra.IsIntegral R S
x : Sₘ
s u : S
v : R
hv : v ∈ ↑M ∧ ↑(algebraMap R S) v = u
hx :
  x * ↑(algebraMap S Sₘ) ↑(s, { val := u, property := (_ : ∃ a, a ∈ ↑M ∧ ↑(algebraMap R S) a = u) }).snd =
    ↑(algebraMap S Sₘ) (s, { val := u, property := (_ : ∃ a, a ∈ ↑M ∧ ↑(algebraMap R S) a = u) }).fst
v' : Rₘ
hv' : v' * ↑(algebraMap R Rₘ) ↑{ val := v, property := (_ : v ∈ ↑M) } = 1
⊢ ↑(algebraMap Rₘ Sₘ) v' * ↑(algebraMap S Sₘ) u = 1

case intro.mk.mk.intro.intro.refine'_2
R : Type u_1
inst✝⁹ : CommRing R
M : Submonoid R
S : Type u_2
inst✝⁸ : CommRing S
inst✝⁷ : Algebra R S
P : Type ?u.284769
inst✝⁶ : CommRing P
Rₘ : Type u_3
Sₘ : Type u_4
inst✝⁵ : CommRing Rₘ
inst✝⁴ : CommRing Sₘ
inst✝³ : Algebra R Rₘ
inst✝² : IsLocalization M Rₘ
inst✝¹ : Algebra S Sₘ
inst✝ : IsLocalization (Algebra.algebraMapSubmonoid S M) Sₘ
H : Algebra.IsIntegral R S
x : Sₘ
s u : S
v : R
hv : v ∈ ↑M ∧ ↑(algebraMap R S) v = u
hx :
  x * ↑(algebraMap S Sₘ) ↑(s, { val := u, property := (_ : ∃ a, a ∈ ↑M ∧ ↑(algebraMap R S) a = u) }).snd =
    ↑(algebraMap S Sₘ) (s, { val := u, property := (_ : ∃ a, a ∈ ↑M ∧ ↑(algebraMap R S) a = u) }).fst
v' : Rₘ
hv' : v' * ↑(algebraMap R Rₘ) ↑{ val := v, property := (_ : v ∈ ↑M) } = 1
⊢ IsIntegral Rₘ (x * ↑(algebraMap S Sₘ) u)
case intro.mk.mk.intro.intro
R : Type u_1
inst✝⁹ : CommRing R
M : Submonoid R
S : Type u_2
inst✝⁸ : CommRing S
inst✝⁷ : Algebra R S
P : Type ?u.284769
inst✝⁶ : CommRing P
Rₘ : Type u_3
Sₘ : Type u_4
inst✝⁵ : CommRing Rₘ
inst✝⁴ : CommRing Sₘ
inst✝³ : Algebra R Rₘ
inst✝² : IsLocalization M Rₘ
inst✝¹ : Algebra S Sₘ
inst✝ : IsLocalization (Algebra.algebraMapSubmonoid S M) Sₘ
H : Algebra.IsIntegral R S
x : Sₘ
s u : S
v : R
hv : v ∈ ↑M ∧ ↑(algebraMap R S) v = u
hx :
  x * ↑(algebraMap S Sₘ) ↑(s, { val := u, property := (_ : ∃ a, a ∈ ↑M ∧ ↑(algebraMap R S) a = u) }).snd =
    ↑(algebraMap S Sₘ) (s, { val := u, property := (_ : ∃ a, a ∈ ↑M ∧ ↑(algebraMap R S) a = u) }).fst
v' : Rₘ
hv' : v' * ↑(algebraMap R Rₘ) ↑{ val := v, property := (_ : v ∈ ↑M) } = 1
⊢ RingHom.IsIntegralElem
    (IsLocalization.map Sₘ (algebraMap R S)
      (_ : M ≤ Submonoid.comap (algebraMap R S) (Algebra.algebraMapSubmonoid S M)))
    x
refine'
  @isIntegral_of_isIntegral_mul_unit Rₘ _ _ _ (localizationAlgebra M S) x (algebraMap S Sₘ u) v' _
    _
case intro.mk.mk.intro.intro.refine'_1
R : Type u_1
inst✝⁹ : CommRing R
M : Submonoid R
S : Type u_2
inst✝⁸ : CommRing S
inst✝⁷ : Algebra R S
P : Type ?u.284769
inst✝⁶ : CommRing P
Rₘ : Type u_3
Sₘ : Type u_4
inst✝⁵ : CommRing Rₘ
inst✝⁴ : CommRing Sₘ
inst✝³ : Algebra R Rₘ
inst✝² : IsLocalization M Rₘ
inst✝¹ : Algebra S Sₘ
inst✝ : IsLocalization (Algebra.algebraMapSubmonoid S M) Sₘ
H : Algebra.IsIntegral R S
x : Sₘ
s u : S
v : R
hv : v ∈ ↑M ∧ ↑(algebraMap R S) v = u
hx :
  x * ↑(algebraMap S Sₘ) ↑(s, { val := u, property := (_ : ∃ a, a ∈ ↑M ∧ ↑(algebraMap R S) a = u) }).snd =
    ↑(algebraMap S Sₘ) (s, { val := u, property := (_ : ∃ a, a ∈ ↑M ∧ ↑(algebraMap R S) a = u) }).fst
v' : Rₘ
hv' : ↑(algebraMap Rₘ Sₘ) (v' * ↑(algebraMap R Rₘ) ↑{ val := v, property := (_ : v ∈ ↑M) }) = ↑(algebraMap Rₘ Sₘ) 1
⊢ ↑(algebraMap Rₘ Sₘ) v' * ↑(algebraMap S Sₘ) u = 1
case intro.mk.mk.intro.intro.refine'_1
R : Type u_1
inst✝⁹ : CommRing R
M : Submonoid R
S : Type u_2
inst✝⁸ : CommRing S
inst✝⁷ : Algebra R S
P : Type ?u.284769
inst✝⁶ : CommRing P
Rₘ : Type u_3
Sₘ : Type u_4
inst✝⁵ : CommRing Rₘ
inst✝⁴ : CommRing Sₘ
inst✝³ : Algebra R Rₘ
inst✝² : IsLocalization M Rₘ
inst✝¹ : Algebra S Sₘ
inst✝ : IsLocalization (Algebra.algebraMapSubmonoid S M) Sₘ
H : Algebra.IsIntegral R S
x : Sₘ
s u : S
v : R
hv : v ∈ ↑M ∧ ↑(algebraMap R S) v = u
hx :
  x * ↑(algebraMap S Sₘ) ↑(s, { val := u, property := (_ : ∃ a, a ∈ ↑M ∧ ↑(algebraMap R S) a = u) }).snd =
    ↑(algebraMap S Sₘ) (s, { val := u, property := (_ : ∃ a, a ∈ ↑M ∧ ↑(algebraMap R S) a = u) }).fst
v' : Rₘ
hv' : v' * ↑(algebraMap R Rₘ) ↑{ val := v, property := (_ : v ∈ ↑M) } = 1
⊢ ↑(algebraMap Rₘ Sₘ) v' * ↑(algebraMap S Sₘ) u = 1
replace hv' := congr_arg (@algebraMap Rₘ Sₘ _ _ (localizationAlgebra M S)) hv'
case intro.mk.mk.intro.intro.refine'_1
R : Type u_1
inst✝⁹ : CommRing R
M : Submonoid R
S : Type u_2
inst✝⁸ : CommRing S
inst✝⁷ : Algebra R S
P : Type ?u.284769
inst✝⁶ : CommRing P
Rₘ : Type u_3
Sₘ : Type u_4
inst✝⁵ : CommRing Rₘ
inst✝⁴ : CommRing Sₘ
inst✝³ : Algebra R Rₘ
inst✝² : IsLocalization M Rₘ
inst✝¹ : Algebra S Sₘ
inst✝ : IsLocalization (Algebra.algebraMapSubmonoid S M) Sₘ
H : Algebra.IsIntegral R S
x : Sₘ
s u : S
v : R
hv : v ∈ ↑M ∧ ↑(algebraMap R S) v = u
hx :
  x * ↑(algebraMap S Sₘ) ↑(s, { val := u, property := (_ : ∃ a, a ∈ ↑M ∧ ↑(algebraMap R S) a = u) }).snd =
    ↑(algebraMap S Sₘ) (s, { val := u, property := (_ : ∃ a, a ∈ ↑M ∧ ↑(algebraMap R S) a = u) }).fst
v' : Rₘ
hv' :
  ↑(algebraMap Rₘ Sₘ) v' *
      ↑(RingHom.comp (algebraMap Rₘ Sₘ) (algebraMap R Rₘ)) ↑{ val := v, property := (_ : v ∈ ↑M) } =
    1
⊢ ↑(algebraMap Rₘ Sₘ) v' * ↑(algebraMap S Sₘ) u = 1
case intro.mk.mk.intro.intro.refine'_1
R : Type u_1
inst✝⁹ : CommRing R
M : Submonoid R
S : Type u_2
inst✝⁸ : CommRing S
inst✝⁷ : Algebra R S
P : Type ?u.284769
inst✝⁶ : CommRing P
Rₘ : Type u_3
Sₘ : Type u_4
inst✝⁵ : CommRing Rₘ
inst✝⁴ : CommRing Sₘ
inst✝³ : Algebra R Rₘ
inst✝² : IsLocalization M Rₘ
inst✝¹ : Algebra S Sₘ
inst✝ : IsLocalization (Algebra.algebraMapSubmonoid S M) Sₘ
H : Algebra.IsIntegral R S
x : Sₘ
s u : S
v : R
hv : v ∈ ↑M ∧ ↑(algebraMap R S) v = u
hx :
  x * ↑(algebraMap S Sₘ) ↑(s, { val := u, property := (_ : ∃ a, a ∈ ↑M ∧ ↑(algebraMap R S) a = u) }).snd =
    ↑(algebraMap S Sₘ) (s, { val := u, property := (_ : ∃ a, a ∈ ↑M ∧ ↑(algebraMap R S) a = u) }).fst
v' : Rₘ
hv' : ↑(algebraMap Rₘ Sₘ) (v' * ↑(algebraMap R Rₘ) ↑{ val := v, property := (_ : v ∈ ↑M) }) = ↑(algebraMap Rₘ Sₘ) 1
⊢ ↑(algebraMap Rₘ Sₘ) v' * ↑(algebraMap S Sₘ) u = 1
rw [RingHom.map_mul, RingHom.map_one, ← RingHom.comp_apply _ (algebraMap R Rₘ)] at hv'
case intro.mk.mk.intro.intro.refine'_1
R : Type u_1
inst✝⁹ : CommRing R
M : Submonoid R
S : Type u_2
inst✝⁸ : CommRing S
inst✝⁷ : Algebra R S
P : Type ?u.284769
inst✝⁶ : CommRing P
Rₘ : Type u_3
Sₘ : Type u_4
inst✝⁵ : CommRing Rₘ
inst✝⁴ : CommRing Sₘ
inst✝³ : Algebra R Rₘ
inst✝² : IsLocalization M Rₘ
inst✝¹ : Algebra S Sₘ
inst✝ : IsLocalization (Algebra.algebraMapSubmonoid S M) Sₘ
H : Algebra.IsIntegral R S
x : Sₘ
s u : S
v : R
hv : v ∈ ↑M ∧ ↑(algebraMap R S) v = u
hx :
  x * ↑(algebraMap S Sₘ) ↑(s, { val := u, property := (_ : ∃ a, a ∈ ↑M ∧ ↑(algebraMap R S) a = u) }).snd =
    ↑(algebraMap S Sₘ) (s, { val := u, property := (_ : ∃ a, a ∈ ↑M ∧ ↑(algebraMap R S) a = u) }).fst
v' : Rₘ
hv' :
  ↑(algebraMap Rₘ Sₘ) v' * ↑(RingHom.comp (algebraMap S Sₘ) (algebraMap R S)) ↑{ val := v, property := (_ : v ∈ ↑M) } =
    1
⊢ ↑(algebraMap Rₘ Sₘ) v' * ↑(algebraMap S Sₘ) u = 1
case intro.mk.mk.intro.intro.refine'_1
R : Type u_1
inst✝⁹ : CommRing R
M : Submonoid R
S : Type u_2
inst✝⁸ : CommRing S
inst✝⁷ : Algebra R S
P : Type ?u.284769
inst✝⁶ : CommRing P
Rₘ : Type u_3
Sₘ : Type u_4
inst✝⁵ : CommRing Rₘ
inst✝⁴ : CommRing Sₘ
inst✝³ : Algebra R Rₘ
inst✝² : IsLocalization M Rₘ
inst✝¹ : Algebra S Sₘ
inst✝ : IsLocalization (Algebra.algebraMapSubmonoid S M) Sₘ
H : Algebra.IsIntegral R S
x : Sₘ
s u : S
v : R
hv : v ∈ ↑M ∧ ↑(algebraMap R S) v = u
hx :
  x * ↑(algebraMap S Sₘ) ↑(s, { val := u, property := (_ : ∃ a, a ∈ ↑M ∧ ↑(algebraMap R S) a = u) }).snd =
    ↑(algebraMap S Sₘ) (s, { val := u, property := (_ : ∃ a, a ∈ ↑M ∧ ↑(algebraMap R S) a = u) }).fst
v' : Rₘ
hv' :
  ↑(algebraMap Rₘ Sₘ) v' *
      ↑(RingHom.comp (algebraMap Rₘ Sₘ) (algebraMap R Rₘ)) ↑{ val := v, property := (_ : v ∈ ↑M) } =
    1
⊢ ↑(algebraMap Rₘ Sₘ) v' * ↑(algebraMap S Sₘ) u = 1
erw [IsLocalization.map_comp
  (show _ ≤ (Algebra.algebraMapSubmonoid S M).comap _ from M.le_comap_map)] at hv'
no goals
case intro.mk.mk.intro.intro.refine'_1
R : Type u_1
inst✝⁹ : CommRing R
M : Submonoid R
S : Type u_2
inst✝⁸ : CommRing S
inst✝⁷ : Algebra R S
P : Type ?u.284769
inst✝⁶ : CommRing P
Rₘ : Type u_3
Sₘ : Type u_4
inst✝⁵ : CommRing Rₘ
inst✝⁴ : CommRing Sₘ
inst✝³ : Algebra R Rₘ
inst✝² : IsLocalization M Rₘ
inst✝¹ : Algebra S Sₘ
inst✝ : IsLocalization (Algebra.algebraMapSubmonoid S M) Sₘ
H : Algebra.IsIntegral R S
x : Sₘ
s u : S
v : R
hv : v ∈ ↑M ∧ ↑(algebraMap R S) v = u
hx :
  x * ↑(algebraMap S Sₘ) ↑(s, { val := u, property := (_ : ∃ a, a ∈ ↑M ∧ ↑(algebraMap R S) a = u) }).snd =
    ↑(algebraMap S Sₘ) (s, { val := u, property := (_ : ∃ a, a ∈ ↑M ∧ ↑(algebraMap R S) a = u) }).fst
v' : Rₘ
hv' :
  ↑(algebraMap Rₘ Sₘ) v' * ↑(RingHom.comp (algebraMap S Sₘ) (algebraMap R S)) ↑{ val := v, property := (_ : v ∈ ↑M) } =
    1
⊢ ↑(algebraMap Rₘ Sₘ) v' * ↑(algebraMap S Sₘ) u = 1
exact hv.2 ▸ hv'
case intro.mk.mk.intro.intro.refine'_2.intro
R : Type u_1
inst✝⁹ : CommRing R
M : Submonoid R
S : Type u_2
inst✝⁸ : CommRing S
inst✝⁷ : Algebra R S
P : Type ?u.284769
inst✝⁶ : CommRing P
Rₘ : Type u_3
Sₘ : Type u_4
inst✝⁵ : CommRing Rₘ
inst✝⁴ : CommRing Sₘ
inst✝³ : Algebra R Rₘ
inst✝² : IsLocalization M Rₘ
inst✝¹ : Algebra S Sₘ
inst✝ : IsLocalization (Algebra.algebraMapSubmonoid S M) Sₘ
H : Algebra.IsIntegral R S
x : Sₘ
s u : S
v : R
hv : v ∈ ↑M ∧ ↑(algebraMap R S) v = u
hx :
  x * ↑(algebraMap S Sₘ) ↑(s, { val := u, property := (_ : ∃ a, a ∈ ↑M ∧ ↑(algebraMap R S) a = u) }).snd =
    ↑(algebraMap S Sₘ) (s, { val := u, property := (_ : ∃ a, a ∈ ↑M ∧ ↑(algebraMap R S) a = u) }).fst
v' : Rₘ
hv' : v' * ↑(algebraMap R Rₘ) ↑{ val := v, property := (_ : v ∈ ↑M) } = 1
p : R[X]
hp : Monic p ∧ eval₂ (algebraMap R S) s p = 0
⊢ IsIntegral Rₘ (x * ↑(algebraMap S Sₘ) u)
case intro.mk.mk.intro.intro.refine'_2
R : Type u_1
inst✝⁹ : CommRing R
M : Submonoid R
S : Type u_2
inst✝⁸ : CommRing S
inst✝⁷ : Algebra R S
P : Type ?u.284769
inst✝⁶ : CommRing P
Rₘ : Type u_3
Sₘ : Type u_4
inst✝⁵ : CommRing Rₘ
inst✝⁴ : CommRing Sₘ
inst✝³ : Algebra R Rₘ
inst✝² : IsLocalization M Rₘ
inst✝¹ : Algebra S Sₘ
inst✝ : IsLocalization (Algebra.algebraMapSubmonoid S M) Sₘ
H : Algebra.IsIntegral R S
x : Sₘ
s u : S
v : R
hv : v ∈ ↑M ∧ ↑(algebraMap R S) v = u
hx :
  x * ↑(algebraMap S Sₘ) ↑(s, { val := u, property := (_ : ∃ a, a ∈ ↑M ∧ ↑(algebraMap R S) a = u) }).snd =
    ↑(algebraMap S Sₘ) (s, { val := u, property := (_ : ∃ a, a ∈ ↑M ∧ ↑(algebraMap R S) a = u) }).fst
v' : Rₘ
hv' : v' * ↑(algebraMap R Rₘ) ↑{ val := v, property := (_ : v ∈ ↑M) } = 1
⊢ IsIntegral Rₘ (x * ↑(algebraMap S Sₘ) u)
obtain ⟨p, hp⟩ := H s
no goals
case intro.mk.mk.intro.intro.refine'_2.intro
R : Type u_1
inst✝⁹ : CommRing R
M : Submonoid R
S : Type u_2
inst✝⁸ : CommRing S
inst✝⁷ : Algebra R S
P : Type ?u.284769
inst✝⁶ : CommRing P
Rₘ : Type u_3
Sₘ : Type u_4
inst✝⁵ : CommRing Rₘ
inst✝⁴ : CommRing Sₘ
inst✝³ : Algebra R Rₘ
inst✝² : IsLocalization M Rₘ
inst✝¹ : Algebra S Sₘ
inst✝ : IsLocalization (Algebra.algebraMapSubmonoid S M) Sₘ
H : Algebra.IsIntegral R S
x : Sₘ
s u : S
v : R
hv : v ∈ ↑M ∧ ↑(algebraMap R S) v = u
hx :
  x * ↑(algebraMap S Sₘ) ↑(s, { val := u, property := (_ : ∃ a, a ∈ ↑M ∧ ↑(algebraMap R S) a = u) }).snd =
    ↑(algebraMap S Sₘ) (s, { val := u, property := (_ : ∃ a, a ∈ ↑M ∧ ↑(algebraMap R S) a = u) }).fst
v' : Rₘ
hv' : v' * ↑(algebraMap R Rₘ) ↑{ val := v, property := (_ : v ∈ ↑M) } = 1
p : R[X]
hp : Monic p ∧ eval₂ (algebraMap R S) s p = 0
⊢ IsIntegral Rₘ (x * ↑(algebraMap S Sₘ) u)
exact hx.symm ▸ is_integral_localization_at_leadingCoeff p hp.2 (hp.1.symm ▸ M.one_mem)