[GOAL]
R : Type u_1
inst✝⁴ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝³ : CommSemiring S
inst✝² : Algebra R S
P : Type u_3
inst✝¹ : CommSemiring P
inst✝ : IsLocalization M S
N : Submonoid R
h₁ : M ≤ N
h₂ : ∀ (r : R), r ∈ N → IsUnit (↑(algebraMap R S) r)
s : S
⊢ ∃ x, s * ↑(algebraMap R S) ↑x.snd = ↑(algebraMap R S) x.fst
[PROOFSTEP]
obtain ⟨⟨x, y, hy⟩, H⟩ := IsLocalization.surj M s
[GOAL]
case intro.mk.mk
R : Type u_1
inst✝⁴ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝³ : CommSemiring S
inst✝² : Algebra R S
P : Type u_3
inst✝¹ : CommSemiring P
inst✝ : IsLocalization M S
N : Submonoid R
h₁ : M ≤ N
h₂ : ∀ (r : R), r ∈ N → IsUnit (↑(algebraMap R S) r)
s : S
x y : R
hy : y ∈ M
H :
  s * ↑(algebraMap R S) ↑(x, { val := y, property := hy }).snd = ↑(algebraMap R S) (x, { val := y, property := hy }).fst
⊢ ∃ x, s * ↑(algebraMap R S) ↑x.snd = ↑(algebraMap R S) x.fst
[PROOFSTEP]
exact ⟨⟨x, y, h₁ hy⟩, H⟩
[GOAL]
R : Type u_1
inst✝⁴ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝³ : CommSemiring S
inst✝² : Algebra R S
P : Type u_3
inst✝¹ : CommSemiring P
inst✝ : IsLocalization M S
N : Submonoid R
h₁ : M ≤ N
h₂ : ∀ (r : R), r ∈ N → IsUnit (↑(algebraMap R S) r)
x y : R
⊢ ↑(algebraMap R S) x = ↑(algebraMap R S) y ↔ ∃ c, ↑c * x = ↑c * y
[PROOFSTEP]
constructor
[GOAL]
case mp
R : Type u_1
inst✝⁴ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝³ : CommSemiring S
inst✝² : Algebra R S
P : Type u_3
inst✝¹ : CommSemiring P
inst✝ : IsLocalization M S
N : Submonoid R
h₁ : M ≤ N
h₂ : ∀ (r : R), r ∈ N → IsUnit (↑(algebraMap R S) r)
x y : R
⊢ ↑(algebraMap R S) x = ↑(algebraMap R S) y → ∃ c, ↑c * x = ↑c * y
[PROOFSTEP]
rw [IsLocalization.eq_iff_exists M]
[GOAL]
case mp
R : Type u_1
inst✝⁴ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝³ : CommSemiring S
inst✝² : Algebra R S
P : Type u_3
inst✝¹ : CommSemiring P
inst✝ : IsLocalization M S
N : Submonoid R
h₁ : M ≤ N
h₂ : ∀ (r : R), r ∈ N → IsUnit (↑(algebraMap R S) r)
x y : R
⊢ (∃ c, ↑c * x = ↑c * y) → ∃ c, ↑c * x = ↑c * y
[PROOFSTEP]
rintro ⟨c, hc⟩
[GOAL]
case mp.intro
R : Type u_1
inst✝⁴ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝³ : CommSemiring S
inst✝² : Algebra R S
P : Type u_3
inst✝¹ : CommSemiring P
inst✝ : IsLocalization M S
N : Submonoid R
h₁ : M ≤ N
h₂ : ∀ (r : R), r ∈ N → IsUnit (↑(algebraMap R S) r)
x y : R
c : { x // x ∈ M }
hc : ↑c * x = ↑c * y
⊢ ∃ c, ↑c * x = ↑c * y
[PROOFSTEP]
exact ⟨⟨c, h₁ c.2⟩, hc⟩
[GOAL]
case mpr
R : Type u_1
inst✝⁴ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝³ : CommSemiring S
inst✝² : Algebra R S
P : Type u_3
inst✝¹ : CommSemiring P
inst✝ : IsLocalization M S
N : Submonoid R
h₁ : M ≤ N
h₂ : ∀ (r : R), r ∈ N → IsUnit (↑(algebraMap R S) r)
x y : R
⊢ (∃ c, ↑c * x = ↑c * y) → ↑(algebraMap R S) x = ↑(algebraMap R S) y
[PROOFSTEP]
rintro ⟨c, h⟩
[GOAL]
case mpr.intro
R : Type u_1
inst✝⁴ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝³ : CommSemiring S
inst✝² : Algebra R S
P : Type u_3
inst✝¹ : CommSemiring P
inst✝ : IsLocalization M S
N : Submonoid R
h₁ : M ≤ N
h₂ : ∀ (r : R), r ∈ N → IsUnit (↑(algebraMap R S) r)
x y : R
c : { x // x ∈ N }
h : ↑c * x = ↑c * y
⊢ ↑(algebraMap R S) x = ↑(algebraMap R S) y
[PROOFSTEP]
simpa only [map_mul, (h₂ c c.2).mul_right_inj] using congr_arg (algebraMap R S) h
[GOAL]
R : Type u_1
inst✝⁴ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝³ : CommSemiring S
inst✝² : Algebra R S
P : Type u_3
inst✝¹ : CommSemiring P
inst✝ : IsLocalization M S
z : S
⊢ ↑(algebraMap R S) (sec M z).fst = ↑(algebraMap R S) ↑(sec M z).snd * z
[PROOFSTEP]
rw [mul_comm, sec_spec]
[GOAL]
R : Type u_1
inst✝⁴ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝³ : CommSemiring S
inst✝² : Algebra R S
P : Type u_3
inst✝¹ : CommSemiring P
inst✝ : IsLocalization M S
z : S
x : R
y : { x // x ∈ M }
h : z * ↑(algebraMap R S) ↑y = ↑(algebraMap R S) x
hx : x = 0
⊢ z = 0
[PROOFSTEP]
rw [hx, (algebraMap R S).map_zero] at h
[GOAL]
R : Type u_1
inst✝⁴ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝³ : CommSemiring S
inst✝² : Algebra R S
P : Type u_3
inst✝¹ : CommSemiring P
inst✝ : IsLocalization M S
z : S
x : R
y : { x // x ∈ M }
h : z * ↑(algebraMap R S) ↑y = 0
hx : x = 0
⊢ z = 0
[PROOFSTEP]
exact (IsUnit.mul_left_eq_zero (IsLocalization.map_units S y)).1 h
[GOAL]
R : Type u_1
inst✝⁴ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝³ : CommSemiring S
inst✝² : Algebra R S
P : Type u_3
inst✝¹ : CommSemiring P
inst✝ : IsLocalization M S
r : R
⊢ ↑(algebraMap R S) r = 0 ↔ ∃ m, ↑m * r = 0
[PROOFSTEP]
constructor
[GOAL]
case mp
R : Type u_1
inst✝⁴ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝³ : CommSemiring S
inst✝² : Algebra R S
P : Type u_3
inst✝¹ : CommSemiring P
inst✝ : IsLocalization M S
r : R
⊢ ↑(algebraMap R S) r = 0 → ∃ m, ↑m * r = 0
case mpr
R : Type u_1
inst✝⁴ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝³ : CommSemiring S
inst✝² : Algebra R S
P : Type u_3
inst✝¹ : CommSemiring P
inst✝ : IsLocalization M S
r : R
⊢ (∃ m, ↑m * r = 0) → ↑(algebraMap R S) r = 0
[PROOFSTEP]
intro h
[GOAL]
case mp
R : Type u_1
inst✝⁴ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝³ : CommSemiring S
inst✝² : Algebra R S
P : Type u_3
inst✝¹ : CommSemiring P
inst✝ : IsLocalization M S
r : R
h : ↑(algebraMap R S) r = 0
⊢ ∃ m, ↑m * r = 0
[PROOFSTEP]
obtain ⟨m, hm⟩ := (IsLocalization.eq_iff_exists M S).mp ((algebraMap R S).map_zero.trans h.symm)
[GOAL]
case mp.intro
R : Type u_1
inst✝⁴ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝³ : CommSemiring S
inst✝² : Algebra R S
P : Type u_3
inst✝¹ : CommSemiring P
inst✝ : IsLocalization M S
r : R
h : ↑(algebraMap R S) r = 0
m : { x // x ∈ M }
hm : ↑m * 0 = ↑m * r
⊢ ∃ m, ↑m * r = 0
[PROOFSTEP]
exact ⟨m, by simpa using hm.symm⟩
[GOAL]
R : Type u_1
inst✝⁴ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝³ : CommSemiring S
inst✝² : Algebra R S
P : Type u_3
inst✝¹ : CommSemiring P
inst✝ : IsLocalization M S
r : R
h : ↑(algebraMap R S) r = 0
m : { x // x ∈ M }
hm : ↑m * 0 = ↑m * r
⊢ ↑m * r = 0
[PROOFSTEP]
simpa using hm.symm
[GOAL]
case mpr
R : Type u_1
inst✝⁴ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝³ : CommSemiring S
inst✝² : Algebra R S
P : Type u_3
inst✝¹ : CommSemiring P
inst✝ : IsLocalization M S
r : R
⊢ (∃ m, ↑m * r = 0) → ↑(algebraMap R S) r = 0
[PROOFSTEP]
rintro ⟨m, hm⟩
[GOAL]
case mpr.intro
R : Type u_1
inst✝⁴ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝³ : CommSemiring S
inst✝² : Algebra R S
P : Type u_3
inst✝¹ : CommSemiring P
inst✝ : IsLocalization M S
r : R
m : { x // x ∈ M }
hm : ↑m * r = 0
⊢ ↑(algebraMap R S) r = 0
[PROOFSTEP]
rw [← (IsLocalization.map_units S m).mul_right_inj, mul_zero, ← RingHom.map_mul, hm, RingHom.map_zero]
[GOAL]
R : Type u_1
inst✝⁴ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝³ : CommSemiring S
inst✝² : Algebra R S
P : Type u_3
inst✝¹ : CommSemiring P
inst✝ : IsLocalization M S
x : R
y : { x // x ∈ M }
z₁ z₂ : S
⊢ mk' S x y + z₁ = z₂ ↔ ↑(algebraMap R S) x + z₁ * ↑(algebraMap R S) ↑y = z₂ * ↑(algebraMap R S) ↑y
[PROOFSTEP]
rw [← mk'_spec S x y, ← IsUnit.mul_left_inj (IsLocalization.map_units S y), right_distrib]
[GOAL]
R : Type u_1
inst✝⁴ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝³ : CommSemiring S
inst✝² : Algebra R S
P : Type u_3
inst✝¹ : CommSemiring P
inst✝ : IsLocalization M S
h : 0 ∈ M
⊢ 0 = 1
[PROOFSTEP]
simpa using IsLocalization.map_units S ⟨0, h⟩
[GOAL]
R : Type u_1
inst✝⁴ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝³ : CommSemiring S
inst✝² : Algebra R S
P : Type u_3
inst✝¹ : CommSemiring P
inst✝ : IsLocalization M S
x : R
y : { x // x ∈ M }
I : Ideal S
⊢ mk' S x y ∈ I ↔ ↑(algebraMap R S) x ∈ I
[PROOFSTEP]
constructor
[GOAL]
case mp
R : Type u_1
inst✝⁴ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝³ : CommSemiring S
inst✝² : Algebra R S
P : Type u_3
inst✝¹ : CommSemiring P
inst✝ : IsLocalization M S
x : R
y : { x // x ∈ M }
I : Ideal S
⊢ mk' S x y ∈ I → ↑(algebraMap R S) x ∈ I
[PROOFSTEP]
intro h
[GOAL]
case mpr
R : Type u_1
inst✝⁴ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝³ : CommSemiring S
inst✝² : Algebra R S
P : Type u_3
inst✝¹ : CommSemiring P
inst✝ : IsLocalization M S
x : R
y : { x // x ∈ M }
I : Ideal S
⊢ ↑(algebraMap R S) x ∈ I → mk' S x y ∈ I
[PROOFSTEP]
intro h
[GOAL]
case mp
R : Type u_1
inst✝⁴ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝³ : CommSemiring S
inst✝² : Algebra R S
P : Type u_3
inst✝¹ : CommSemiring P
inst✝ : IsLocalization M S
x : R
y : { x // x ∈ M }
I : Ideal S
h : mk' S x y ∈ I
⊢ ↑(algebraMap R S) x ∈ I
[PROOFSTEP]
rw [← mk'_spec S x y, mul_comm]
[GOAL]
case mp
R : Type u_1
inst✝⁴ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝³ : CommSemiring S
inst✝² : Algebra R S
P : Type u_3
inst✝¹ : CommSemiring P
inst✝ : IsLocalization M S
x : R
y : { x // x ∈ M }
I : Ideal S
h : mk' S x y ∈ I
⊢ ↑(algebraMap R S) ↑y * mk' S x y ∈ I
[PROOFSTEP]
exact I.mul_mem_left ((algebraMap R S) y) h
[GOAL]
case mpr
R : Type u_1
inst✝⁴ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝³ : CommSemiring S
inst✝² : Algebra R S
P : Type u_3
inst✝¹ : CommSemiring P
inst✝ : IsLocalization M S
x : R
y : { x // x ∈ M }
I : Ideal S
h : ↑(algebraMap R S) x ∈ I
⊢ mk' S x y ∈ I
[PROOFSTEP]
rw [← mk'_spec S x y] at h
[GOAL]
case mpr
R : Type u_1
inst✝⁴ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝³ : CommSemiring S
inst✝² : Algebra R S
P : Type u_3
inst✝¹ : CommSemiring P
inst✝ : IsLocalization M S
x : R
y : { x // x ∈ M }
I : Ideal S
h : mk' S x y * ↑(algebraMap R S) ↑y ∈ I
⊢ mk' S x y ∈ I
[PROOFSTEP]
obtain ⟨b, hb⟩ := isUnit_iff_exists_inv.1 (map_units S y)
[GOAL]
case mpr.intro
R : Type u_1
inst✝⁴ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝³ : CommSemiring S
inst✝² : Algebra R S
P : Type u_3
inst✝¹ : CommSemiring P
inst✝ : IsLocalization M S
x : R
y : { x // x ∈ M }
I : Ideal S
h : mk' S x y * ↑(algebraMap R S) ↑y ∈ I
b : S
hb : ↑(algebraMap R S) ↑y * b = 1
⊢ mk' S x y ∈ I
[PROOFSTEP]
have := I.mul_mem_left b h
[GOAL]
case mpr.intro
R : Type u_1
inst✝⁴ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝³ : CommSemiring S
inst✝² : Algebra R S
P : Type u_3
inst✝¹ : CommSemiring P
inst✝ : IsLocalization M S
x : R
y : { x // x ∈ M }
I : Ideal S
h : mk' S x y * ↑(algebraMap R S) ↑y ∈ I
b : S
hb : ↑(algebraMap R S) ↑y * b = 1
this : b * (mk' S x y * ↑(algebraMap R S) ↑y) ∈ I
⊢ mk' S x y ∈ I
[PROOFSTEP]
rwa [mul_comm, mul_assoc, hb, mul_one] at this
[GOAL]
R : Type u_1
inst✝⁴ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝³ : CommSemiring S
inst✝² : Algebra R S
P : Type u_3
inst✝¹ : CommSemiring P
inst✝ : IsLocalization M S
x : R
s : { x // x ∈ M }
⊢ mk' S x s = 0 ↔ ∃ m, ↑m * x = 0
[PROOFSTEP]
rw [← (map_units S s).mul_left_inj, mk'_spec, zero_mul, map_eq_zero_iff M]
[GOAL]
R : Type u_1
inst✝⁴ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝³ : CommSemiring S
inst✝² : Algebra R S
P : Type u_3
inst✝¹ : CommSemiring P
inst✝ : IsLocalization M S
s : { x // x ∈ M }
⊢ mk' S 0 s = 0
[PROOFSTEP]
rw [eq_comm, IsLocalization.eq_mk'_iff_mul_eq, zero_mul, map_zero]
[GOAL]
R : Type u_1
inst✝⁴ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝³ : CommSemiring S
inst✝² : Algebra R S
P : Type u_3
inst✝¹ : CommSemiring P
inst✝ : IsLocalization M S
x : R
y : { x // x ∈ M }
hxy : mk' S x y ≠ 0
⊢ x ≠ 0
[PROOFSTEP]
rintro rfl
[GOAL]
R : Type u_1
inst✝⁴ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝³ : CommSemiring S
inst✝² : Algebra R S
P : Type u_3
inst✝¹ : CommSemiring P
inst✝ : IsLocalization M S
y : { x // x ∈ M }
hxy : mk' S 0 y ≠ 0
⊢ False
[PROOFSTEP]
exact hxy (IsLocalization.mk'_zero _)
[GOAL]
R : Type u_1
inst✝⁴ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝³ : CommSemiring S
inst✝² : Algebra R S
P : Type u_3
inst✝¹ : CommSemiring P
inst✝ : IsLocalization M S
x y : { x // x ∈ M }
⊢ mk' S (↑x) y * mk' S (↑y) x = 1
[PROOFSTEP]
rw [← mk'_mul, mul_comm]
[GOAL]
R : Type u_1
inst✝⁴ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝³ : CommSemiring S
inst✝² : Algebra R S
P : Type u_3
inst✝¹ : CommSemiring P
inst✝ : IsLocalization M S
x y : { x // x ∈ M }
⊢ mk' S (↑y * ↑x) (y * x) = 1
[PROOFSTEP]
exact mk'_self _ _
[GOAL]
R : Type u_1
inst✝⁴ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝³ : CommSemiring S
inst✝² : Algebra R S
P : Type u_3
inst✝¹ : CommSemiring P
inst✝ : IsLocalization M S
x y : R
m : { x // x ∈ M }
⊢ x • mk' S y m = mk' S (x * y) m
[PROOFSTEP]
nth_rw 2 [← one_mul m]
[GOAL]
R : Type u_1
inst✝⁴ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝³ : CommSemiring S
inst✝² : Algebra R S
P : Type u_3
inst✝¹ : CommSemiring P
inst✝ : IsLocalization M S
x y : R
m : { x // x ∈ M }
⊢ x • mk' S y m = mk' S (x * y) (1 * m)
[PROOFSTEP]
rw [mk'_mul, mk'_one, Algebra.smul_def]
[GOAL]
R : Type u_1
inst✝⁴ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝³ : CommSemiring S
inst✝² : Algebra R S
P : Type u_3
inst✝¹ : CommSemiring P
inst✝ : IsLocalization M S
x : R
m : { x // x ∈ M }
⊢ x • mk' S 1 m = mk' S x m
[PROOFSTEP]
rw [smul_mk', mul_one]
[GOAL]
R : Type u_1
inst✝⁴ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝³ : CommSemiring S
inst✝² : Algebra R S
P : Type u_3
inst✝¹ : CommSemiring P
inst✝ : IsLocalization M S
m : { x // x ∈ M }
r : R
⊢ ↑m • mk' S r m = ↑(algebraMap R S) r
[PROOFSTEP]
rw [smul_mk', mk'_mul_cancel_left]
[GOAL]
R : Type u_1
inst✝⁴ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝³ : CommSemiring S
inst✝² : Algebra R S
P : Type u_3
inst✝¹ : CommSemiring P
inst✝ : IsLocalization M S
x₁ x₂ : R
y₁ y₂ : { x // x ∈ M }
⊢ (mk' S x₁ y₁ + mk' S x₂ y₂) * ↑(algebraMap R S) ↑(y₁ * y₂) = ↑(algebraMap R S) (x₁ * ↑y₂ + x₂ * ↑y₁)
[PROOFSTEP]
rw [mul_comm (_ + _), mul_add, mul_mk'_eq_mk'_of_mul, mk'_add_eq_iff_add_mul_eq_mul, mul_comm (_ * _), ← mul_assoc,
  add_comm, ← map_mul, mul_mk'_eq_mk'_of_mul, add_comm _ (mk' _ _ _), mk'_add_eq_iff_add_mul_eq_mul]
[GOAL]
R : Type u_1
inst✝⁴ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝³ : CommSemiring S
inst✝² : Algebra R S
P : Type u_3
inst✝¹ : CommSemiring P
inst✝ : IsLocalization M S
x₁ x₂ : R
y₁ y₂ : { x // x ∈ M }
⊢ ↑(algebraMap R ((fun x => (fun x => S) (x₂ * ↑y₁ + x₁ * ↑y₂)) (↑(y₁ * y₂) * x₁))) (↑y₁ * ↑(y₁ * y₂) * x₂) +
      ↑(algebraMap R ((fun x => S) (x₂ * ↑y₁ + x₁ * ↑y₂))) (↑(y₁ * y₂) * x₁) *
        ↑(algebraMap R ((fun x => (fun x => S) (x₂ * ↑y₁ + x₁ * ↑y₂)) (↑(y₁ * y₂) * x₁))) ↑y₂ =
    ↑(algebraMap R S) (x₂ * ↑y₁ + x₁ * ↑y₂) * ↑(algebraMap R ((fun x => S) (x₂ * ↑y₁ + x₁ * ↑y₂))) ↑y₁ *
      ↑(algebraMap R ((fun x => (fun x => S) (x₂ * ↑y₁ + x₁ * ↑y₂)) (↑(y₁ * y₂) * x₁))) ↑y₂
[PROOFSTEP]
simp only [map_add, Submonoid.coe_mul, map_mul]
[GOAL]
R : Type u_1
inst✝⁴ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝³ : CommSemiring S
inst✝² : Algebra R S
P : Type u_3
inst✝¹ : CommSemiring P
inst✝ : IsLocalization M S
x₁ x₂ : R
y₁ y₂ : { x // x ∈ M }
⊢ ↑(algebraMap R S) ↑y₁ * (↑(algebraMap R S) ↑y₁ * ↑(algebraMap R S) ↑y₂) * ↑(algebraMap R S) x₂ +
      ↑(algebraMap R S) ↑y₁ * ↑(algebraMap R S) ↑y₂ * ↑(algebraMap R S) x₁ * ↑(algebraMap R S) ↑y₂ =
    (↑(algebraMap R S) x₂ * ↑(algebraMap R S) ↑y₁ + ↑(algebraMap R S) x₁ * ↑(algebraMap R S) ↑y₂) *
        ↑(algebraMap R S) ↑y₁ *
      ↑(algebraMap R S) ↑y₂
[PROOFSTEP]
ring
[GOAL]
R : Type u_1
inst✝⁴ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝³ : CommSemiring S
inst✝² : Algebra R S
P : Type u_3
inst✝¹ : CommSemiring P
inst✝ : IsLocalization M S
g : R →+* P
h : ∀ (y : { x // x ∈ M }), IsUnit (↑g ↑y)
y : { x // x ∈ M }
w z₁ z₂ : P
⊢ w * ↑(↑(IsUnit.liftRight (MonoidHom.restrict (↑g) M) h) y)⁻¹ + z₁ = z₂ ↔ w + ↑g ↑y * z₁ = ↑g ↑y * z₂
[PROOFSTEP]
rw [mul_comm, ← one_mul z₁, ← Units.inv_mul (IsUnit.liftRight (g.toMonoidHom.restrict M) h y), mul_assoc, ← mul_add,
  Units.inv_mul_eq_iff_eq_mul, Units.inv_mul_cancel_left, IsUnit.coe_liftRight]
[GOAL]
R : Type u_1
inst✝⁴ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝³ : CommSemiring S
inst✝² : Algebra R S
P : Type u_3
inst✝¹ : CommSemiring P
inst✝ : IsLocalization M S
g : R →+* P
h : ∀ (y : { x // x ∈ M }), IsUnit (↑g ↑y)
y : { x // x ∈ M }
w z₁ z₂ : P
⊢ w + ↑(MonoidHom.restrict (↑g) M) y * z₁ = ↑(MonoidHom.restrict (↑g) M) y * z₂ ↔ w + ↑g ↑y * z₁ = ↑g ↑y * z₂
[PROOFSTEP]
simp [RingHom.toMonoidHom_eq_coe, MonoidHom.restrict_apply]
[GOAL]
R : Type u_1
inst✝⁴ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝³ : CommSemiring S
inst✝² : Algebra R S
P : Type u_3
inst✝¹ : CommSemiring P
inst✝ : IsLocalization M S
g : R →+* P
hg : ∀ (y : { x // x ∈ M }), IsUnit (↑g ↑y)
z : S
w w' v : (fun x => P) z
⊢ ↑(Submonoid.LocalizationWithZeroMap.lift (toLocalizationWithZeroMap M S) (RingHom.toMonoidWithZeroHom g) hg) z * w +
        w' =
      v ↔
    ↑g (Submonoid.LocalizationMap.sec (toLocalizationMap M S) z).fst * w +
        ↑g ↑(Submonoid.LocalizationMap.sec (toLocalizationMap M S) z).snd * w' =
      ↑g ↑(Submonoid.LocalizationMap.sec (toLocalizationMap M S) z).snd * v
[PROOFSTEP]
erw [mul_comm, ← mul_assoc, mul_add_inv_left hg, mul_comm]
[GOAL]
R : Type u_1
inst✝⁴ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝³ : CommSemiring S
inst✝² : Algebra R S
P : Type u_3
inst✝¹ : CommSemiring P
inst✝ : IsLocalization M S
g : R →+* P
hg : ∀ (y : { x // x ∈ M }), IsUnit (↑g ↑y)
z : S
w w' v : (fun x => P) z
⊢ ↑↑(RingHom.toMonoidWithZeroHom g)
            (Submonoid.LocalizationMap.sec (toLocalizationWithZeroMap M S).toLocalizationMap z).fst *
          w +
        ↑g ↑(Submonoid.LocalizationMap.sec (toLocalizationWithZeroMap M S).toLocalizationMap z).snd * w' =
      ↑g ↑(Submonoid.LocalizationMap.sec (toLocalizationWithZeroMap M S).toLocalizationMap z).snd * v ↔
    ↑g (Submonoid.LocalizationMap.sec (toLocalizationMap M S) z).fst * w +
        ↑g ↑(Submonoid.LocalizationMap.sec (toLocalizationMap M S) z).snd * w' =
      ↑g ↑(Submonoid.LocalizationMap.sec (toLocalizationMap M S) z).snd * v
[PROOFSTEP]
rfl
[GOAL]
R : Type u_1
inst✝⁴ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝³ : CommSemiring S
inst✝² : Algebra R S
P : Type u_3
inst✝¹ : CommSemiring P
inst✝ : IsLocalization M S
g : R →+* P
hg : ∀ (y : { x // x ∈ M }), IsUnit (↑g ↑y)
src✝ : S →*₀ P :=
  Submonoid.LocalizationWithZeroMap.lift (toLocalizationWithZeroMap M S) (RingHom.toMonoidWithZeroHom g) hg
⊢ ∀ (x y : S),
    OneHom.toFun
        (↑{ toOneHom := { toFun := src✝.toFun, map_one' := (_ : ZeroHom.toFun (↑src✝) 1 = 1) },
            map_mul' :=
              (_ : ∀ (x y : S), ZeroHom.toFun (↑src✝) (x * y) = ZeroHom.toFun (↑src✝) x * ZeroHom.toFun (↑src✝) y) })
        (x + y) =
      OneHom.toFun
          (↑{ toOneHom := { toFun := src✝.toFun, map_one' := (_ : ZeroHom.toFun (↑src✝) 1 = 1) },
              map_mul' :=
                (_ : ∀ (x y : S), ZeroHom.toFun (↑src✝) (x * y) = ZeroHom.toFun (↑src✝) x * ZeroHom.toFun (↑src✝) y) })
          x +
        OneHom.toFun
          (↑{ toOneHom := { toFun := src✝.toFun, map_one' := (_ : ZeroHom.toFun (↑src✝) 1 = 1) },
              map_mul' :=
                (_ : ∀ (x y : S), ZeroHom.toFun (↑src✝) (x * y) = ZeroHom.toFun (↑src✝) x * ZeroHom.toFun (↑src✝) y) })
          y
[PROOFSTEP]
intro x y
[GOAL]
R : Type u_1
inst✝⁴ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝³ : CommSemiring S
inst✝² : Algebra R S
P : Type u_3
inst✝¹ : CommSemiring P
inst✝ : IsLocalization M S
g : R →+* P
hg : ∀ (y : { x // x ∈ M }), IsUnit (↑g ↑y)
src✝ : S →*₀ P :=
  Submonoid.LocalizationWithZeroMap.lift (toLocalizationWithZeroMap M S) (RingHom.toMonoidWithZeroHom g) hg
x y : S
⊢ OneHom.toFun
      (↑{ toOneHom := { toFun := src✝.toFun, map_one' := (_ : ZeroHom.toFun (↑src✝) 1 = 1) },
          map_mul' :=
            (_ : ∀ (x y : S), ZeroHom.toFun (↑src✝) (x * y) = ZeroHom.toFun (↑src✝) x * ZeroHom.toFun (↑src✝) y) })
      (x + y) =
    OneHom.toFun
        (↑{ toOneHom := { toFun := src✝.toFun, map_one' := (_ : ZeroHom.toFun (↑src✝) 1 = 1) },
            map_mul' :=
              (_ : ∀ (x y : S), ZeroHom.toFun (↑src✝) (x * y) = ZeroHom.toFun (↑src✝) x * ZeroHom.toFun (↑src✝) y) })
        x +
      OneHom.toFun
        (↑{ toOneHom := { toFun := src✝.toFun, map_one' := (_ : ZeroHom.toFun (↑src✝) 1 = 1) },
            map_mul' :=
              (_ : ∀ (x y : S), ZeroHom.toFun (↑src✝) (x * y) = ZeroHom.toFun (↑src✝) x * ZeroHom.toFun (↑src✝) y) })
        y
[PROOFSTEP]
erw [(toLocalizationMap M S).lift_spec, mul_add, mul_comm, eq_comm, lift_spec_mul_add, add_comm, mul_comm, mul_assoc,
  mul_comm, mul_assoc, lift_spec_mul_add]
[GOAL]
R : Type u_1
inst✝⁴ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝³ : CommSemiring S
inst✝² : Algebra R S
P : Type u_3
inst✝¹ : CommSemiring P
inst✝ : IsLocalization M S
g : R →+* P
hg : ∀ (y : { x // x ∈ M }), IsUnit (↑g ↑y)
src✝ : S →*₀ P :=
  Submonoid.LocalizationWithZeroMap.lift (toLocalizationWithZeroMap M S) (RingHom.toMonoidWithZeroHom g) hg
x y : S
⊢ ↑g (Submonoid.LocalizationMap.sec (toLocalizationMap M S) y).fst *
        (↑g ↑(Submonoid.LocalizationMap.sec (toLocalizationMap M S) x).snd *
          ↑↑(RingHom.toMonoidWithZeroHom g) ↑(Submonoid.LocalizationMap.sec (toLocalizationMap M S) (x + y)).snd) +
      ↑g ↑(Submonoid.LocalizationMap.sec (toLocalizationMap M S) y).snd *
        (↑g (Submonoid.LocalizationMap.sec (toLocalizationMap M S) x).fst *
          ↑↑(RingHom.toMonoidWithZeroHom g) ↑(Submonoid.LocalizationMap.sec (toLocalizationMap M S) (x + y)).snd) =
    ↑g ↑(Submonoid.LocalizationMap.sec (toLocalizationMap M S) y).snd *
      (↑g ↑(Submonoid.LocalizationMap.sec (toLocalizationMap M S) x).snd *
        ↑↑(RingHom.toMonoidWithZeroHom g) (Submonoid.LocalizationMap.sec (toLocalizationMap M S) (x + y)).fst)
[PROOFSTEP]
simp_rw [← mul_assoc]
[GOAL]
R : Type u_1
inst✝⁴ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝³ : CommSemiring S
inst✝² : Algebra R S
P : Type u_3
inst✝¹ : CommSemiring P
inst✝ : IsLocalization M S
g : R →+* P
hg : ∀ (y : { x // x ∈ M }), IsUnit (↑g ↑y)
src✝ : S →*₀ P :=
  Submonoid.LocalizationWithZeroMap.lift (toLocalizationWithZeroMap M S) (RingHom.toMonoidWithZeroHom g) hg
x y : S
⊢ ↑g (Submonoid.LocalizationMap.sec (toLocalizationMap M S) y).fst *
          ↑g ↑(Submonoid.LocalizationMap.sec (toLocalizationMap M S) x).snd *
        ↑↑(RingHom.toMonoidWithZeroHom g) ↑(Submonoid.LocalizationMap.sec (toLocalizationMap M S) (x + y)).snd +
      ↑g ↑(Submonoid.LocalizationMap.sec (toLocalizationMap M S) y).snd *
          ↑g (Submonoid.LocalizationMap.sec (toLocalizationMap M S) x).fst *
        ↑↑(RingHom.toMonoidWithZeroHom g) ↑(Submonoid.LocalizationMap.sec (toLocalizationMap M S) (x + y)).snd =
    ↑g ↑(Submonoid.LocalizationMap.sec (toLocalizationMap M S) y).snd *
        ↑g ↑(Submonoid.LocalizationMap.sec (toLocalizationMap M S) x).snd *
      ↑↑(RingHom.toMonoidWithZeroHom g) (Submonoid.LocalizationMap.sec (toLocalizationMap M S) (x + y)).fst
[PROOFSTEP]
show g _ * g _ * g _ + g _ * g _ * g _ = g _ * g _ * g _
[GOAL]
R : Type u_1
inst✝⁴ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝³ : CommSemiring S
inst✝² : Algebra R S
P : Type u_3
inst✝¹ : CommSemiring P
inst✝ : IsLocalization M S
g : R →+* P
hg : ∀ (y : { x // x ∈ M }), IsUnit (↑g ↑y)
src✝ : S →*₀ P :=
  Submonoid.LocalizationWithZeroMap.lift (toLocalizationWithZeroMap M S) (RingHom.toMonoidWithZeroHom g) hg
x y : S
⊢ ↑g (Submonoid.LocalizationMap.sec (toLocalizationMap M S) y).fst *
          ↑g ↑(Submonoid.LocalizationMap.sec (toLocalizationMap M S) x).snd *
        ↑g ↑(Submonoid.LocalizationMap.sec (toLocalizationMap M S) (x + y)).snd +
      ↑g ↑(Submonoid.LocalizationMap.sec (toLocalizationMap M S) y).snd *
          ↑g (Submonoid.LocalizationMap.sec (toLocalizationMap M S) x).fst *
        ↑g ↑(Submonoid.LocalizationMap.sec (toLocalizationMap M S) (x + y)).snd =
    ↑g ↑(Submonoid.LocalizationMap.sec (toLocalizationMap M S) y).snd *
        ↑g ↑(Submonoid.LocalizationMap.sec (toLocalizationMap M S) x).snd *
      ↑g (Submonoid.LocalizationMap.sec (toLocalizationMap M S) (x + y)).fst
[PROOFSTEP]
simp_rw [← map_mul g, ← map_add g]
[GOAL]
R : Type u_1
inst✝⁴ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝³ : CommSemiring S
inst✝² : Algebra R S
P : Type u_3
inst✝¹ : CommSemiring P
inst✝ : IsLocalization M S
g : R →+* P
hg : ∀ (y : { x // x ∈ M }), IsUnit (↑g ↑y)
src✝ : S →*₀ P :=
  Submonoid.LocalizationWithZeroMap.lift (toLocalizationWithZeroMap M S) (RingHom.toMonoidWithZeroHom g) hg
x y : S
⊢ ↑g
      ((Submonoid.LocalizationMap.sec (toLocalizationMap M S) y).fst *
            ↑(Submonoid.LocalizationMap.sec (toLocalizationMap M S) x).snd *
          ↑(Submonoid.LocalizationMap.sec (toLocalizationMap M S) (x + y)).snd +
        ↑(Submonoid.LocalizationMap.sec (toLocalizationMap M S) y).snd *
            (Submonoid.LocalizationMap.sec (toLocalizationMap M S) x).fst *
          ↑(Submonoid.LocalizationMap.sec (toLocalizationMap M S) (x + y)).snd) =
    ↑g
      (↑(Submonoid.LocalizationMap.sec (toLocalizationMap M S) y).snd *
          ↑(Submonoid.LocalizationMap.sec (toLocalizationMap M S) x).snd *
        (Submonoid.LocalizationMap.sec (toLocalizationMap M S) (x + y)).fst)
[PROOFSTEP]
apply @eq_of_eq _ _ _ S _ _ _ _ _ g hg
[GOAL]
case h
R : Type u_1
inst✝⁴ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝³ : CommSemiring S
inst✝² : Algebra R S
P : Type u_3
inst✝¹ : CommSemiring P
inst✝ : IsLocalization M S
g : R →+* P
hg : ∀ (y : { x // x ∈ M }), IsUnit (↑g ↑y)
src✝ : S →*₀ P :=
  Submonoid.LocalizationWithZeroMap.lift (toLocalizationWithZeroMap M S) (RingHom.toMonoidWithZeroHom g) hg
x y : S
⊢ ↑(algebraMap R S)
      ((Submonoid.LocalizationMap.sec (toLocalizationMap M S) y).fst *
            ↑(Submonoid.LocalizationMap.sec (toLocalizationMap M S) x).snd *
          ↑(Submonoid.LocalizationMap.sec (toLocalizationMap M S) (x + y)).snd +
        ↑(Submonoid.LocalizationMap.sec (toLocalizationMap M S) y).snd *
            (Submonoid.LocalizationMap.sec (toLocalizationMap M S) x).fst *
          ↑(Submonoid.LocalizationMap.sec (toLocalizationMap M S) (x + y)).snd) =
    ↑(algebraMap R S)
      (↑(Submonoid.LocalizationMap.sec (toLocalizationMap M S) y).snd *
          ↑(Submonoid.LocalizationMap.sec (toLocalizationMap M S) x).snd *
        (Submonoid.LocalizationMap.sec (toLocalizationMap M S) (x + y)).fst)
[PROOFSTEP]
simp only [sec_spec', toLocalizationMap_sec, map_add, map_mul]
[GOAL]
case h
R : Type u_1
inst✝⁴ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝³ : CommSemiring S
inst✝² : Algebra R S
P : Type u_3
inst✝¹ : CommSemiring P
inst✝ : IsLocalization M S
g : R →+* P
hg : ∀ (y : { x // x ∈ M }), IsUnit (↑g ↑y)
src✝ : S →*₀ P :=
  Submonoid.LocalizationWithZeroMap.lift (toLocalizationWithZeroMap M S) (RingHom.toMonoidWithZeroHom g) hg
x y : S
⊢ ↑(algebraMap R S) ↑(sec M y).snd * y * ↑(algebraMap R S) ↑(sec M x).snd * ↑(algebraMap R S) ↑(sec M (x + y)).snd +
      ↑(algebraMap R S) ↑(sec M y).snd * (↑(algebraMap R S) ↑(sec M x).snd * x) *
        ↑(algebraMap R S) ↑(sec M (x + y)).snd =
    ↑(algebraMap R S) ↑(sec M y).snd * ↑(algebraMap R S) ↑(sec M x).snd *
      (↑(algebraMap R S) ↑(sec M (x + y)).snd * (x + y))
[PROOFSTEP]
ring
[GOAL]
R : Type u_1
inst✝⁵ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝⁴ : CommSemiring S
inst✝³ : Algebra R S
P : Type u_3
inst✝² : CommSemiring P
inst✝¹ : IsLocalization M S
g✝ : R →+* P
hg : ∀ (y : { x // x ∈ M }), IsUnit (↑g✝ ↑y)
inst✝ : Algebra R P
f g : S →ₐ[R] P
⊢ RingHom.comp (↑f) (algebraMap R S) = RingHom.comp (↑g) (algebraMap R S)
[PROOFSTEP]
rw [f.comp_algebraMap, g.comp_algebraMap]
[GOAL]
R : Type u_1
inst✝⁴ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝³ : CommSemiring S
inst✝² : Algebra R S
P : Type u_3
inst✝¹ : CommSemiring P
inst✝ : IsLocalization M S
g : R →+* P
hg : ∀ (y : { x // x ∈ M }), IsUnit (↑g ↑y)
j k : S → P
hj1 : j 1 = 1
hk1 : k 1 = 1
hjm : ∀ (a b : S), j (a * b) = j a * j b
hkm : ∀ (a b : S), k (a * b) = k a * k b
h : ∀ (a : R), j (↑(algebraMap R S) a) = k (↑(algebraMap R S) a)
j' : S →* P := { toOneHom := { toFun := j, map_one' := hj1 }, map_mul' := hjm }
k' : S →* P := { toOneHom := { toFun := k, map_one' := hk1 }, map_mul' := hkm }
this : j' = k'
⊢ j'.toFun = k'.toFun
[PROOFSTEP]
rw [this]
[GOAL]
R : Type u_1
inst✝¹¹ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝¹⁰ : CommSemiring S
inst✝⁹ : Algebra R S
P : Type u_3
inst✝⁸ : CommSemiring P
inst✝⁷ : IsLocalization M S
g : R →+* P
hg : ∀ (y : { x // x ∈ M }), IsUnit (↑g ↑y)
T : Submonoid P
Q : Type u_4
inst✝⁶ : CommSemiring Q
hy : M ≤ Submonoid.comap g T
inst✝⁵ : Algebra P Q
inst✝⁴ : IsLocalization T Q
A : Type u_5
inst✝³ : CommSemiring A
U : Submonoid A
W : Type u_6
inst✝² : CommSemiring W
inst✝¹ : Algebra A W
inst✝ : IsLocalization U W
l : P →+* A
hl : T ≤ Submonoid.comap l U
x : S
⊢ ↑(map W l hl) (↑(map Q g hy) x) = ↑(map W (RingHom.comp l g) (_ : ∀ (x : R), x ∈ M → ↑g x ∈ Submonoid.comap l U)) x
[PROOFSTEP]
rw [← map_comp_map (Q := Q) hy hl]
[GOAL]
R : Type u_1
inst✝¹¹ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝¹⁰ : CommSemiring S
inst✝⁹ : Algebra R S
P : Type u_3
inst✝⁸ : CommSemiring P
inst✝⁷ : IsLocalization M S
g : R →+* P
hg : ∀ (y : { x // x ∈ M }), IsUnit (↑g ↑y)
T : Submonoid P
Q : Type u_4
inst✝⁶ : CommSemiring Q
hy : M ≤ Submonoid.comap g T
inst✝⁵ : Algebra P Q
inst✝⁴ : IsLocalization T Q
A : Type u_5
inst✝³ : CommSemiring A
U : Submonoid A
W : Type u_6
inst✝² : CommSemiring W
inst✝¹ : Algebra A W
inst✝ : IsLocalization U W
l : P →+* A
hl : T ≤ Submonoid.comap l U
x : S
⊢ ↑(map W l hl) (↑(map Q g hy) x) = ↑(RingHom.comp (map W l hl) (map Q g hy)) x
[PROOFSTEP]
rfl
[GOAL]
R : Type u_1
inst✝⁷ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝⁶ : CommSemiring S
inst✝⁵ : Algebra R S
P : Type u_3
inst✝⁴ : CommSemiring P
inst✝³ : IsLocalization M S
g : R →+* P
hg : ∀ (y : { x // x ∈ M }), IsUnit (↑g ↑y)
T : Submonoid P
Q : Type u_4
inst✝² : CommSemiring Q
hy : M ≤ Submonoid.comap g T
inst✝¹ : Algebra P Q
inst✝ : IsLocalization T Q
x : S
z : R
⊢ ↑(map Q g hy) (z • x) = ↑g z • ↑(map Q g hy) x
[PROOFSTEP]
rw [Algebra.smul_def, Algebra.smul_def, RingHom.map_mul, map_eq]
[GOAL]
R : Type u_1
inst✝⁷ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝⁶ : CommSemiring S
inst✝⁵ : Algebra R S
P : Type u_3
inst✝⁴ : CommSemiring P
inst✝³ : IsLocalization M S
g : R →+* P
hg : ∀ (y : { x // x ∈ M }), IsUnit (↑g ↑y)
T : Submonoid P
Q : Type u_4
inst✝² : CommSemiring Q
hy : M ≤ Submonoid.comap g T
inst✝¹ : Algebra P Q
inst✝ : IsLocalization T Q
h : R ≃+* P
H : Submonoid.map (RingEquiv.toMonoidHom h) M = T
⊢ Submonoid.map (RingEquiv.toMonoidHom (RingEquiv.symm h)) T = M
[PROOFSTEP]
rw [← M.map_id, ← H, Submonoid.map_map]
[GOAL]
R : Type u_1
inst✝⁷ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝⁶ : CommSemiring S
inst✝⁵ : Algebra R S
P : Type u_3
inst✝⁴ : CommSemiring P
inst✝³ : IsLocalization M S
g : R →+* P
hg : ∀ (y : { x // x ∈ M }), IsUnit (↑g ↑y)
T : Submonoid P
Q : Type u_4
inst✝² : CommSemiring Q
hy : M ≤ Submonoid.comap g T
inst✝¹ : Algebra P Q
inst✝ : IsLocalization T Q
h : R ≃+* P
H : Submonoid.map (RingEquiv.toMonoidHom h) M = T
⊢ Submonoid.map (MonoidHom.comp (RingEquiv.toMonoidHom (RingEquiv.symm h)) (RingEquiv.toMonoidHom h)) M =
    Submonoid.map (MonoidHom.id R) M
[PROOFSTEP]
congr
[GOAL]
case e_f
R : Type u_1
inst✝⁷ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝⁶ : CommSemiring S
inst✝⁵ : Algebra R S
P : Type u_3
inst✝⁴ : CommSemiring P
inst✝³ : IsLocalization M S
g : R →+* P
hg : ∀ (y : { x // x ∈ M }), IsUnit (↑g ↑y)
T : Submonoid P
Q : Type u_4
inst✝² : CommSemiring Q
hy : M ≤ Submonoid.comap g T
inst✝¹ : Algebra P Q
inst✝ : IsLocalization T Q
h : R ≃+* P
H : Submonoid.map (RingEquiv.toMonoidHom h) M = T
⊢ MonoidHom.comp (RingEquiv.toMonoidHom (RingEquiv.symm h)) (RingEquiv.toMonoidHom h) = MonoidHom.id R
[PROOFSTEP]
ext
[GOAL]
case e_f.h
R : Type u_1
inst✝⁷ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝⁶ : CommSemiring S
inst✝⁵ : Algebra R S
P : Type u_3
inst✝⁴ : CommSemiring P
inst✝³ : IsLocalization M S
g : R →+* P
hg : ∀ (y : { x // x ∈ M }), IsUnit (↑g ↑y)
T : Submonoid P
Q : Type u_4
inst✝² : CommSemiring Q
hy : M ≤ Submonoid.comap g T
inst✝¹ : Algebra P Q
inst✝ : IsLocalization T Q
h : R ≃+* P
H : Submonoid.map (RingEquiv.toMonoidHom h) M = T
x✝ : R
⊢ ↑(MonoidHom.comp (RingEquiv.toMonoidHom (RingEquiv.symm h)) (RingEquiv.toMonoidHom h)) x✝ = ↑(MonoidHom.id R) x✝
[PROOFSTEP]
apply h.symm_apply_apply
[GOAL]
R : Type u_1
inst✝⁷ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝⁶ : CommSemiring S
inst✝⁵ : Algebra R S
P : Type u_3
inst✝⁴ : CommSemiring P
inst✝³ : IsLocalization M S
g : R →+* P
hg : ∀ (y : { x // x ∈ M }), IsUnit (↑g ↑y)
T : Submonoid P
Q : Type u_4
inst✝² : CommSemiring Q
hy : M ≤ Submonoid.comap g T
inst✝¹ : Algebra P Q
inst✝ : IsLocalization T Q
h : R ≃+* P
H : Submonoid.map (RingEquiv.toMonoidHom h) M = T
H' : Submonoid.map (RingEquiv.toMonoidHom (RingEquiv.symm h)) T = M
src✝ : S →+* Q := map Q ↑h (_ : M ≤ Submonoid.comap (↑h) T)
x : S
⊢ ↑(map S ↑(RingEquiv.symm h) (_ : T ≤ Submonoid.comap (↑(RingEquiv.symm h)) M))
      (↑(map Q ↑h (_ : M ≤ Submonoid.comap (↑h) T)) x) =
    x
[PROOFSTEP]
rw [map_map, map_unique _ (RingHom.id _), RingHom.id_apply]
[GOAL]
R : Type u_1
inst✝⁷ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝⁶ : CommSemiring S
inst✝⁵ : Algebra R S
P : Type u_3
inst✝⁴ : CommSemiring P
inst✝³ : IsLocalization M S
g : R →+* P
hg : ∀ (y : { x // x ∈ M }), IsUnit (↑g ↑y)
T : Submonoid P
Q : Type u_4
inst✝² : CommSemiring Q
hy : M ≤ Submonoid.comap g T
inst✝¹ : Algebra P Q
inst✝ : IsLocalization T Q
h : R ≃+* P
H : Submonoid.map (RingEquiv.toMonoidHom h) M = T
H' : Submonoid.map (RingEquiv.toMonoidHom (RingEquiv.symm h)) T = M
src✝ : S →+* Q := map Q ↑h (_ : M ≤ Submonoid.comap (↑h) T)
x : S
⊢ ∀ (x : R), ↑(RingHom.id S) (↑(algebraMap R S) x) = ↑(algebraMap R S) (↑(RingHom.comp ↑(RingEquiv.symm h) ↑h) x)
[PROOFSTEP]
simp
[GOAL]
R : Type u_1
inst✝⁷ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝⁶ : CommSemiring S
inst✝⁵ : Algebra R S
P : Type u_3
inst✝⁴ : CommSemiring P
inst✝³ : IsLocalization M S
g : R →+* P
hg : ∀ (y : { x // x ∈ M }), IsUnit (↑g ↑y)
T : Submonoid P
Q : Type u_4
inst✝² : CommSemiring Q
hy : M ≤ Submonoid.comap g T
inst✝¹ : Algebra P Q
inst✝ : IsLocalization T Q
h : R ≃+* P
H : Submonoid.map (RingEquiv.toMonoidHom h) M = T
H' : Submonoid.map (RingEquiv.toMonoidHom (RingEquiv.symm h)) T = M
src✝ : S →+* Q := map Q ↑h (_ : M ≤ Submonoid.comap (↑h) T)
x : Q
⊢ ↑(map Q ↑h (_ : M ≤ Submonoid.comap (↑h) T))
      (↑(map S ↑(RingEquiv.symm h) (_ : T ≤ Submonoid.comap (↑(RingEquiv.symm h)) M)) x) =
    x
[PROOFSTEP]
rw [map_map, map_unique _ (RingHom.id _), RingHom.id_apply]
[GOAL]
R : Type u_1
inst✝⁷ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝⁶ : CommSemiring S
inst✝⁵ : Algebra R S
P : Type u_3
inst✝⁴ : CommSemiring P
inst✝³ : IsLocalization M S
g : R →+* P
hg : ∀ (y : { x // x ∈ M }), IsUnit (↑g ↑y)
T : Submonoid P
Q : Type u_4
inst✝² : CommSemiring Q
hy : M ≤ Submonoid.comap g T
inst✝¹ : Algebra P Q
inst✝ : IsLocalization T Q
h : R ≃+* P
H : Submonoid.map (RingEquiv.toMonoidHom h) M = T
H' : Submonoid.map (RingEquiv.toMonoidHom (RingEquiv.symm h)) T = M
src✝ : S →+* Q := map Q ↑h (_ : M ≤ Submonoid.comap (↑h) T)
x : Q
⊢ ∀ (x : P), ↑(RingHom.id Q) (↑(algebraMap P Q) x) = ↑(algebraMap P Q) (↑(RingHom.comp ↑h ↑(RingEquiv.symm h)) x)
[PROOFSTEP]
simp
[GOAL]
R : Type u_1
inst✝⁷ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝⁶ : CommSemiring S
inst✝⁵ : Algebra R S
P : Type u_3
inst✝⁴ : CommSemiring P
inst✝³ : IsLocalization M S
g : R →+* P
hg : ∀ (y : { x // x ∈ M }), IsUnit (↑g ↑y)
T : Submonoid P
Q : Type u_4
inst✝² : CommSemiring Q
hy : M ≤ Submonoid.comap g T
inst✝¹ : Algebra P Q
inst✝ : IsLocalization T Q
j : R ≃+* P
H : Submonoid.map (RingEquiv.toMonoidHom j) M = T
x : R
⊢ ↑(ringEquivOfRingEquiv S Q j H) (↑(algebraMap R S) x) = ↑(algebraMap P Q) (↑j x)
[PROOFSTEP]
simp
[GOAL]
R : Type u_1
inst✝⁷ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝⁶ : CommSemiring S
inst✝⁵ : Algebra R S
P : Type u_3
inst✝⁴ : CommSemiring P
inst✝³ : IsLocalization M S
g : R →+* P
hg : ∀ (y : { x // x ∈ M }), IsUnit (↑g ↑y)
T : Submonoid P
Q : Type u_4
inst✝² : CommSemiring Q
hy : M ≤ Submonoid.comap g T
inst✝¹ : Algebra P Q
inst✝ : IsLocalization T Q
j : R ≃+* P
H : Submonoid.map (RingEquiv.toMonoidHom j) M = T
x : R
y : { x // x ∈ M }
⊢ ↑(ringEquivOfRingEquiv S Q j H) (mk' S x y) = mk' Q (↑j x) { val := ↑j ↑y, property := (_ : ↑j ↑y ∈ T) }
[PROOFSTEP]
simp [map_mk']
[GOAL]
R : Type u_1
inst✝⁷ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝⁶ : CommSemiring S
inst✝⁵ : Algebra R S
P : Type u_3
inst✝⁴ : CommSemiring P
inst✝³ : IsLocalization M S
g : R →+* P
hg : ∀ (y : { x // x ∈ M }), IsUnit (↑g ↑y)
Q : Type u_4
inst✝² : CommSemiring Q
inst✝¹ : Algebra R Q
inst✝ : IsLocalization M Q
x : R
y : { x // x ∈ M }
⊢ ↑(algEquiv M S Q) (mk' S x y) = mk' Q x y
[PROOFSTEP]
simp
[GOAL]
R : Type u_1
inst✝⁷ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝⁶ : CommSemiring S
inst✝⁵ : Algebra R S
P : Type u_3
inst✝⁴ : CommSemiring P
inst✝³ : IsLocalization M S
g : R →+* P
hg : ∀ (y : { x // x ∈ M }), IsUnit (↑g ↑y)
Q : Type u_4
inst✝² : CommSemiring Q
inst✝¹ : Algebra R Q
inst✝ : IsLocalization M Q
x : R
y : { x // x ∈ M }
⊢ ↑(AlgEquiv.symm (algEquiv M S Q)) (mk' Q x y) = mk' S x y
[PROOFSTEP]
simp
[GOAL]
R : Type u_1
inst✝⁵ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝⁴ : CommSemiring S
inst✝³ : Algebra R S
P : Type u_3
inst✝² : CommSemiring P
inst✝¹ : Algebra R P
inst✝ : IsLocalization M S
h : S ≃ₐ[R] P
⊢ IsLocalization M P
[PROOFSTEP]
constructor
[GOAL]
case map_units'
R : Type u_1
inst✝⁵ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝⁴ : CommSemiring S
inst✝³ : Algebra R S
P : Type u_3
inst✝² : CommSemiring P
inst✝¹ : Algebra R P
inst✝ : IsLocalization M S
h : S ≃ₐ[R] P
⊢ ∀ (y : { x // x ∈ M }), IsUnit (↑(algebraMap R P) ↑y)
[PROOFSTEP]
intro y
[GOAL]
case map_units'
R : Type u_1
inst✝⁵ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝⁴ : CommSemiring S
inst✝³ : Algebra R S
P : Type u_3
inst✝² : CommSemiring P
inst✝¹ : Algebra R P
inst✝ : IsLocalization M S
h : S ≃ₐ[R] P
y : { x // x ∈ M }
⊢ IsUnit (↑(algebraMap R P) ↑y)
[PROOFSTEP]
convert (IsLocalization.map_units S y).map h.toAlgHom.toRingHom.toMonoidHom
[GOAL]
case h.e'_3
R : Type u_1
inst✝⁵ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝⁴ : CommSemiring S
inst✝³ : Algebra R S
P : Type u_3
inst✝² : CommSemiring P
inst✝¹ : Algebra R P
inst✝ : IsLocalization M S
h : S ≃ₐ[R] P
y : { x // x ∈ M }
⊢ ↑(algebraMap R P) ↑y = ↑↑↑↑h (↑(algebraMap R S) ↑y)
[PROOFSTEP]
exact (h.commutes y).symm
[GOAL]
case surj'
R : Type u_1
inst✝⁵ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝⁴ : CommSemiring S
inst✝³ : Algebra R S
P : Type u_3
inst✝² : CommSemiring P
inst✝¹ : Algebra R P
inst✝ : IsLocalization M S
h : S ≃ₐ[R] P
⊢ ∀ (z : P), ∃ x, z * ↑(algebraMap R P) ↑x.snd = ↑(algebraMap R P) x.fst
[PROOFSTEP]
intro y
[GOAL]
case surj'
R : Type u_1
inst✝⁵ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝⁴ : CommSemiring S
inst✝³ : Algebra R S
P : Type u_3
inst✝² : CommSemiring P
inst✝¹ : Algebra R P
inst✝ : IsLocalization M S
h : S ≃ₐ[R] P
y : P
⊢ ∃ x, y * ↑(algebraMap R P) ↑x.snd = ↑(algebraMap R P) x.fst
[PROOFSTEP]
obtain ⟨⟨x, s⟩, e⟩ := IsLocalization.surj M (h.symm y)
[GOAL]
case surj'.intro.mk
R : Type u_1
inst✝⁵ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝⁴ : CommSemiring S
inst✝³ : Algebra R S
P : Type u_3
inst✝² : CommSemiring P
inst✝¹ : Algebra R P
inst✝ : IsLocalization M S
h : S ≃ₐ[R] P
y : P
x : R
s : { x // x ∈ M }
e : ↑(AlgEquiv.symm h) y * ↑(algebraMap R ((fun x => S) y)) ↑(x, s).snd = ↑(algebraMap R ((fun x => S) y)) (x, s).fst
⊢ ∃ x, y * ↑(algebraMap R P) ↑x.snd = ↑(algebraMap R P) x.fst
[PROOFSTEP]
apply_fun (show S → P from h) at e
[GOAL]
case surj'.intro.mk
R : Type u_1
inst✝⁵ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝⁴ : CommSemiring S
inst✝³ : Algebra R S
P : Type u_3
inst✝² : CommSemiring P
inst✝¹ : Algebra R P
inst✝ : IsLocalization M S
h : S ≃ₐ[R] P
y : P
x : R
s : { x // x ∈ M }
e :
  (let_fun this := ↑h;
      this)
      (↑(AlgEquiv.symm h) y * ↑(algebraMap R ((fun x => S) y)) ↑(x, s).snd) =
    (let_fun this := ↑h;
      this)
      (↑(algebraMap R ((fun x => S) y)) (x, s).fst)
⊢ ∃ x, y * ↑(algebraMap R P) ↑x.snd = ↑(algebraMap R P) x.fst
[PROOFSTEP]
simp only [h.map_mul, h.apply_symm_apply, h.commutes] at e
[GOAL]
case surj'.intro.mk
R : Type u_1
inst✝⁵ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝⁴ : CommSemiring S
inst✝³ : Algebra R S
P : Type u_3
inst✝² : CommSemiring P
inst✝¹ : Algebra R P
inst✝ : IsLocalization M S
h : S ≃ₐ[R] P
y : P
x : R
s : { x // x ∈ M }
e : y * ↑(algebraMap R P) ↑s = ↑(algebraMap R P) x
⊢ ∃ x, y * ↑(algebraMap R P) ↑x.snd = ↑(algebraMap R P) x.fst
[PROOFSTEP]
exact ⟨⟨x, s⟩, e⟩
[GOAL]
case eq_iff_exists'
R : Type u_1
inst✝⁵ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝⁴ : CommSemiring S
inst✝³ : Algebra R S
P : Type u_3
inst✝² : CommSemiring P
inst✝¹ : Algebra R P
inst✝ : IsLocalization M S
h : S ≃ₐ[R] P
⊢ ∀ {x y : R}, ↑(algebraMap R P) x = ↑(algebraMap R P) y ↔ ∃ c, ↑c * x = ↑c * y
[PROOFSTEP]
intro x y
[GOAL]
case eq_iff_exists'
R : Type u_1
inst✝⁵ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝⁴ : CommSemiring S
inst✝³ : Algebra R S
P : Type u_3
inst✝² : CommSemiring P
inst✝¹ : Algebra R P
inst✝ : IsLocalization M S
h : S ≃ₐ[R] P
x y : R
⊢ ↑(algebraMap R P) x = ↑(algebraMap R P) y ↔ ∃ c, ↑c * x = ↑c * y
[PROOFSTEP]
rw [← h.symm.toEquiv.injective.eq_iff, ← IsLocalization.eq_iff_exists M S, ← h.symm.commutes, ← h.symm.commutes]
[GOAL]
case eq_iff_exists'
R : Type u_1
inst✝⁵ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝⁴ : CommSemiring S
inst✝³ : Algebra R S
P : Type u_3
inst✝² : CommSemiring P
inst✝¹ : Algebra R P
inst✝ : IsLocalization M S
h : S ≃ₐ[R] P
x y : R
⊢ ↑(AlgEquiv.symm h).toEquiv (↑(algebraMap R P) x) = ↑(AlgEquiv.symm h).toEquiv (↑(algebraMap R P) y) ↔
    ↑(AlgEquiv.symm h) (↑(algebraMap R P) x) = ↑(AlgEquiv.symm h) (↑(algebraMap R P) y)
[PROOFSTEP]
rfl
[GOAL]
R : Type u_1
inst✝⁴ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝³ : CommSemiring S
inst✝² : Algebra R S
P : Type u_3
inst✝¹ : CommSemiring P
inst✝ : IsLocalization M S
h : R ≃+* P
⊢ IsLocalization (Submonoid.map (RingEquiv.toMonoidHom h) M) S
[PROOFSTEP]
letI : Algebra P S := ((algebraMap R S).comp h.symm.toRingHom).toAlgebra
[GOAL]
R : Type u_1
inst✝⁴ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝³ : CommSemiring S
inst✝² : Algebra R S
P : Type u_3
inst✝¹ : CommSemiring P
inst✝ : IsLocalization M S
h : R ≃+* P
this : Algebra P S := RingHom.toAlgebra (RingHom.comp (algebraMap R S) (RingEquiv.toRingHom (RingEquiv.symm h)))
⊢ IsLocalization (Submonoid.map (RingEquiv.toMonoidHom h) M) S
[PROOFSTEP]
constructor
[GOAL]
case map_units'
R : Type u_1
inst✝⁴ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝³ : CommSemiring S
inst✝² : Algebra R S
P : Type u_3
inst✝¹ : CommSemiring P
inst✝ : IsLocalization M S
h : R ≃+* P
this : Algebra P S := RingHom.toAlgebra (RingHom.comp (algebraMap R S) (RingEquiv.toRingHom (RingEquiv.symm h)))
⊢ ∀ (y : { x // x ∈ Submonoid.map (RingEquiv.toMonoidHom h) M }), IsUnit (↑(algebraMap P S) ↑y)
[PROOFSTEP]
rintro ⟨_, ⟨y, hy, rfl⟩⟩
[GOAL]
case map_units'.mk.intro.intro
R : Type u_1
inst✝⁴ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝³ : CommSemiring S
inst✝² : Algebra R S
P : Type u_3
inst✝¹ : CommSemiring P
inst✝ : IsLocalization M S
h : R ≃+* P
this : Algebra P S := RingHom.toAlgebra (RingHom.comp (algebraMap R S) (RingEquiv.toRingHom (RingEquiv.symm h)))
y : R
hy : y ∈ ↑M
⊢ IsUnit
    (↑(algebraMap P S)
      ↑{ val := ↑(RingEquiv.toMonoidHom h) y,
          property := (_ : ∃ a, a ∈ ↑M ∧ ↑(RingEquiv.toMonoidHom h) a = ↑(RingEquiv.toMonoidHom h) y) })
[PROOFSTEP]
convert IsLocalization.map_units S ⟨y, hy⟩
[GOAL]
case h.e'_3
R : Type u_1
inst✝⁴ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝³ : CommSemiring S
inst✝² : Algebra R S
P : Type u_3
inst✝¹ : CommSemiring P
inst✝ : IsLocalization M S
h : R ≃+* P
this : Algebra P S := RingHom.toAlgebra (RingHom.comp (algebraMap R S) (RingEquiv.toRingHom (RingEquiv.symm h)))
y : R
hy : y ∈ ↑M
⊢ ↑(algebraMap P S)
      ↑{ val := ↑(RingEquiv.toMonoidHom h) y,
          property := (_ : ∃ a, a ∈ ↑M ∧ ↑(RingEquiv.toMonoidHom h) a = ↑(RingEquiv.toMonoidHom h) y) } =
    ↑(algebraMap R S) ↑{ val := y, property := hy }
[PROOFSTEP]
dsimp only [RingHom.algebraMap_toAlgebra, RingHom.comp_apply]
[GOAL]
case h.e'_3
R : Type u_1
inst✝⁴ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝³ : CommSemiring S
inst✝² : Algebra R S
P : Type u_3
inst✝¹ : CommSemiring P
inst✝ : IsLocalization M S
h : R ≃+* P
this : Algebra P S := RingHom.toAlgebra (RingHom.comp (algebraMap R S) (RingEquiv.toRingHom (RingEquiv.symm h)))
y : R
hy : y ∈ ↑M
⊢ ↑(algebraMap R S) (↑(RingEquiv.toRingHom (RingEquiv.symm h)) (↑(RingEquiv.toMonoidHom h) y)) = ↑(algebraMap R S) y
[PROOFSTEP]
exact congr_arg _ (h.symm_apply_apply _)
[GOAL]
case surj'
R : Type u_1
inst✝⁴ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝³ : CommSemiring S
inst✝² : Algebra R S
P : Type u_3
inst✝¹ : CommSemiring P
inst✝ : IsLocalization M S
h : R ≃+* P
this : Algebra P S := RingHom.toAlgebra (RingHom.comp (algebraMap R S) (RingEquiv.toRingHom (RingEquiv.symm h)))
⊢ ∀ (z : S), ∃ x, z * ↑(algebraMap P S) ↑x.snd = ↑(algebraMap P S) x.fst
[PROOFSTEP]
intro y
[GOAL]
case surj'
R : Type u_1
inst✝⁴ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝³ : CommSemiring S
inst✝² : Algebra R S
P : Type u_3
inst✝¹ : CommSemiring P
inst✝ : IsLocalization M S
h : R ≃+* P
this : Algebra P S := RingHom.toAlgebra (RingHom.comp (algebraMap R S) (RingEquiv.toRingHom (RingEquiv.symm h)))
y : S
⊢ ∃ x, y * ↑(algebraMap P S) ↑x.snd = ↑(algebraMap P S) x.fst
[PROOFSTEP]
obtain ⟨⟨x, s⟩, e⟩ := IsLocalization.surj M y
[GOAL]
case surj'.intro.mk
R : Type u_1
inst✝⁴ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝³ : CommSemiring S
inst✝² : Algebra R S
P : Type u_3
inst✝¹ : CommSemiring P
inst✝ : IsLocalization M S
h : R ≃+* P
this : Algebra P S := RingHom.toAlgebra (RingHom.comp (algebraMap R S) (RingEquiv.toRingHom (RingEquiv.symm h)))
y : S
x : R
s : { x // x ∈ M }
e : y * ↑(algebraMap R S) ↑(x, s).snd = ↑(algebraMap R S) (x, s).fst
⊢ ∃ x, y * ↑(algebraMap P S) ↑x.snd = ↑(algebraMap P S) x.fst
[PROOFSTEP]
refine' ⟨⟨h x, _, _, s.prop, rfl⟩, _⟩
[GOAL]
case surj'.intro.mk
R : Type u_1
inst✝⁴ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝³ : CommSemiring S
inst✝² : Algebra R S
P : Type u_3
inst✝¹ : CommSemiring P
inst✝ : IsLocalization M S
h : R ≃+* P
this : Algebra P S := RingHom.toAlgebra (RingHom.comp (algebraMap R S) (RingEquiv.toRingHom (RingEquiv.symm h)))
y : S
x : R
s : { x // x ∈ M }
e : y * ↑(algebraMap R S) ↑(x, s).snd = ↑(algebraMap R S) (x, s).fst
⊢ y *
      ↑(algebraMap P S)
        ↑(↑h x,
              { val := ↑(RingEquiv.toMonoidHom h) ↑s,
                property := (_ : ∃ a, a ∈ ↑M ∧ ↑(RingEquiv.toMonoidHom h) a = ↑(RingEquiv.toMonoidHom h) ↑s) }).snd =
    ↑(algebraMap P S)
      (↑h x,
          { val := ↑(RingEquiv.toMonoidHom h) ↑s,
            property := (_ : ∃ a, a ∈ ↑M ∧ ↑(RingEquiv.toMonoidHom h) a = ↑(RingEquiv.toMonoidHom h) ↑s) }).fst
[PROOFSTEP]
dsimp only [RingHom.algebraMap_toAlgebra, RingHom.comp_apply] at e ⊢
[GOAL]
case surj'.intro.mk
R : Type u_1
inst✝⁴ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝³ : CommSemiring S
inst✝² : Algebra R S
P : Type u_3
inst✝¹ : CommSemiring P
inst✝ : IsLocalization M S
h : R ≃+* P
this : Algebra P S := RingHom.toAlgebra (RingHom.comp (algebraMap R S) (RingEquiv.toRingHom (RingEquiv.symm h)))
y : S
x : R
s : { x // x ∈ M }
e : y * ↑(algebraMap R S) ↑s = ↑(algebraMap R S) x
⊢ y * ↑(algebraMap R S) (↑(RingEquiv.toRingHom (RingEquiv.symm h)) (↑(RingEquiv.toMonoidHom h) ↑s)) =
    ↑(algebraMap R S) (↑(RingEquiv.toRingHom (RingEquiv.symm h)) (↑h x))
[PROOFSTEP]
convert e
[GOAL]
case h.e'_2.h.e'_6.h.e'_6
R : Type u_1
inst✝⁴ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝³ : CommSemiring S
inst✝² : Algebra R S
P : Type u_3
inst✝¹ : CommSemiring P
inst✝ : IsLocalization M S
h : R ≃+* P
this : Algebra P S := RingHom.toAlgebra (RingHom.comp (algebraMap R S) (RingEquiv.toRingHom (RingEquiv.symm h)))
y : S
x : R
s : { x // x ∈ M }
e : y * ↑(algebraMap R S) ↑s = ↑(algebraMap R S) x
⊢ ↑(RingEquiv.toRingHom (RingEquiv.symm h)) (↑(RingEquiv.toMonoidHom h) ↑s) = ↑s
[PROOFSTEP]
exact h.symm_apply_apply _
[GOAL]
case h.e'_3.h.e'_6
R : Type u_1
inst✝⁴ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝³ : CommSemiring S
inst✝² : Algebra R S
P : Type u_3
inst✝¹ : CommSemiring P
inst✝ : IsLocalization M S
h : R ≃+* P
this : Algebra P S := RingHom.toAlgebra (RingHom.comp (algebraMap R S) (RingEquiv.toRingHom (RingEquiv.symm h)))
y : S
x : R
s : { x // x ∈ M }
e : y * ↑(algebraMap R S) ↑s = ↑(algebraMap R S) x
⊢ ↑(RingEquiv.toRingHom (RingEquiv.symm h)) (↑h x) = x
[PROOFSTEP]
exact h.symm_apply_apply _
[GOAL]
case eq_iff_exists'
R : Type u_1
inst✝⁴ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝³ : CommSemiring S
inst✝² : Algebra R S
P : Type u_3
inst✝¹ : CommSemiring P
inst✝ : IsLocalization M S
h : R ≃+* P
this : Algebra P S := RingHom.toAlgebra (RingHom.comp (algebraMap R S) (RingEquiv.toRingHom (RingEquiv.symm h)))
⊢ ∀ {x y : P}, ↑(algebraMap P S) x = ↑(algebraMap P S) y ↔ ∃ c, ↑c * x = ↑c * y
[PROOFSTEP]
intro x y
[GOAL]
case eq_iff_exists'
R : Type u_1
inst✝⁴ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝³ : CommSemiring S
inst✝² : Algebra R S
P : Type u_3
inst✝¹ : CommSemiring P
inst✝ : IsLocalization M S
h : R ≃+* P
this : Algebra P S := RingHom.toAlgebra (RingHom.comp (algebraMap R S) (RingEquiv.toRingHom (RingEquiv.symm h)))
x y : P
⊢ ↑(algebraMap P S) x = ↑(algebraMap P S) y ↔ ∃ c, ↑c * x = ↑c * y
[PROOFSTEP]
rw [RingHom.algebraMap_toAlgebra, RingHom.comp_apply, RingHom.comp_apply, IsLocalization.eq_iff_exists M S]
[GOAL]
case eq_iff_exists'
R : Type u_1
inst✝⁴ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝³ : CommSemiring S
inst✝² : Algebra R S
P : Type u_3
inst✝¹ : CommSemiring P
inst✝ : IsLocalization M S
h : R ≃+* P
this : Algebra P S := RingHom.toAlgebra (RingHom.comp (algebraMap R S) (RingEquiv.toRingHom (RingEquiv.symm h)))
x y : P
⊢ (∃ c, ↑c * ↑(RingEquiv.toRingHom (RingEquiv.symm h)) x = ↑c * ↑(RingEquiv.toRingHom (RingEquiv.symm h)) y) ↔
    ∃ c, ↑c * x = ↑c * y
[PROOFSTEP]
simp_rw [← h.toEquiv.apply_eq_iff_eq]
[GOAL]
case eq_iff_exists'
R : Type u_1
inst✝⁴ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝³ : CommSemiring S
inst✝² : Algebra R S
P : Type u_3
inst✝¹ : CommSemiring P
inst✝ : IsLocalization M S
h : R ≃+* P
this : Algebra P S := RingHom.toAlgebra (RingHom.comp (algebraMap R S) (RingEquiv.toRingHom (RingEquiv.symm h)))
x y : P
⊢ (∃ c,
      ↑h.toEquiv (↑c * ↑(RingEquiv.toRingHom (RingEquiv.symm h)) x) =
        ↑h.toEquiv (↑c * ↑(RingEquiv.toRingHom (RingEquiv.symm h)) y)) ↔
    ∃ c, ↑c * x = ↑c * y
[PROOFSTEP]
change (∃ c : M, h (c * h.symm x) = h (c * h.symm y)) ↔ _
[GOAL]
case eq_iff_exists'
R : Type u_1
inst✝⁴ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝³ : CommSemiring S
inst✝² : Algebra R S
P : Type u_3
inst✝¹ : CommSemiring P
inst✝ : IsLocalization M S
h : R ≃+* P
this : Algebra P S := RingHom.toAlgebra (RingHom.comp (algebraMap R S) (RingEquiv.toRingHom (RingEquiv.symm h)))
x y : P
⊢ (∃ c, ↑h (↑c * ↑(RingEquiv.symm h) x) = ↑h (↑c * ↑(RingEquiv.symm h) y)) ↔ ∃ c, ↑c * x = ↑c * y
[PROOFSTEP]
simp only [RingEquiv.apply_symm_apply, RingEquiv.map_mul]
[GOAL]
case eq_iff_exists'
R : Type u_1
inst✝⁴ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝³ : CommSemiring S
inst✝² : Algebra R S
P : Type u_3
inst✝¹ : CommSemiring P
inst✝ : IsLocalization M S
h : R ≃+* P
this : Algebra P S := RingHom.toAlgebra (RingHom.comp (algebraMap R S) (RingEquiv.toRingHom (RingEquiv.symm h)))
x y : P
⊢ (∃ c, ↑h ↑c * x = ↑h ↑c * y) ↔ ∃ c, ↑c * x = ↑c * y
[PROOFSTEP]
exact ⟨fun ⟨c, e⟩ => ⟨⟨_, _, c.prop, rfl⟩, e⟩, fun ⟨⟨_, c, h, e₁⟩, e₂⟩ => ⟨⟨_, h⟩, e₁.symm ▸ e₂⟩⟩
[GOAL]
R : Type u_1
inst✝³ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝² : CommSemiring S
inst✝¹ : Algebra R S
P : Type u_3
inst✝ : CommSemiring P
h : R ≃+* P
⊢ IsLocalization M S ↔ IsLocalization (Submonoid.map (RingEquiv.toMonoidHom h) M) S
[PROOFSTEP]
letI : Algebra P S := ((algebraMap R S).comp h.symm.toRingHom).toAlgebra
[GOAL]
R : Type u_1
inst✝³ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝² : CommSemiring S
inst✝¹ : Algebra R S
P : Type u_3
inst✝ : CommSemiring P
h : R ≃+* P
this : Algebra P S := RingHom.toAlgebra (RingHom.comp (algebraMap R S) (RingEquiv.toRingHom (RingEquiv.symm h)))
⊢ IsLocalization M S ↔ IsLocalization (Submonoid.map (RingEquiv.toMonoidHom h) M) S
[PROOFSTEP]
refine' ⟨fun _ => isLocalization_of_base_ringEquiv M S h, _⟩
[GOAL]
R : Type u_1
inst✝³ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝² : CommSemiring S
inst✝¹ : Algebra R S
P : Type u_3
inst✝ : CommSemiring P
h : R ≃+* P
this : Algebra P S := RingHom.toAlgebra (RingHom.comp (algebraMap R S) (RingEquiv.toRingHom (RingEquiv.symm h)))
⊢ IsLocalization (Submonoid.map (RingEquiv.toMonoidHom h) M) S → IsLocalization M S
[PROOFSTEP]
intro H
[GOAL]
R : Type u_1
inst✝³ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝² : CommSemiring S
inst✝¹ : Algebra R S
P : Type u_3
inst✝ : CommSemiring P
h : R ≃+* P
this : Algebra P S := RingHom.toAlgebra (RingHom.comp (algebraMap R S) (RingEquiv.toRingHom (RingEquiv.symm h)))
H : IsLocalization (Submonoid.map (RingEquiv.toMonoidHom h) M) S
⊢ IsLocalization M S
[PROOFSTEP]
convert isLocalization_of_base_ringEquiv (Submonoid.map (RingEquiv.toMonoidHom h) M) S h.symm
[GOAL]
case h.e'_3
R : Type u_1
inst✝³ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝² : CommSemiring S
inst✝¹ : Algebra R S
P : Type u_3
inst✝ : CommSemiring P
h : R ≃+* P
this : Algebra P S := RingHom.toAlgebra (RingHom.comp (algebraMap R S) (RingEquiv.toRingHom (RingEquiv.symm h)))
H : IsLocalization (Submonoid.map (RingEquiv.toMonoidHom h) M) S
⊢ M = Submonoid.map (RingEquiv.toMonoidHom (RingEquiv.symm h)) (Submonoid.map (RingEquiv.toMonoidHom h) M)
[PROOFSTEP]
erw [Submonoid.map_equiv_eq_comap_symm, Submonoid.comap_map_eq_of_injective]
[GOAL]
case h.e'_3.hf
R : Type u_1
inst✝³ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝² : CommSemiring S
inst✝¹ : Algebra R S
P : Type u_3
inst✝ : CommSemiring P
h : R ≃+* P
this : Algebra P S := RingHom.toAlgebra (RingHom.comp (algebraMap R S) (RingEquiv.toRingHom (RingEquiv.symm h)))
H : IsLocalization (Submonoid.map (RingEquiv.toMonoidHom h) M) S
⊢ Injective ↑(MulEquiv.toMonoidHom (MulEquiv.symm (RingEquiv.toMulEquiv (RingEquiv.symm h))))
[PROOFSTEP]
exact h.toEquiv.injective
[GOAL]
case h.e'_6
R : Type u_1
inst✝³ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝² : CommSemiring S
inst✝¹ : Algebra R S
P : Type u_3
inst✝ : CommSemiring P
h : R ≃+* P
this : Algebra P S := RingHom.toAlgebra (RingHom.comp (algebraMap R S) (RingEquiv.toRingHom (RingEquiv.symm h)))
H : IsLocalization (Submonoid.map (RingEquiv.toMonoidHom h) M) S
⊢ inst✝¹ = RingHom.toAlgebra (RingHom.comp (algebraMap P S) (RingEquiv.toRingHom (RingEquiv.symm (RingEquiv.symm h))))
[PROOFSTEP]
rw [RingHom.algebraMap_toAlgebra, RingHom.comp_assoc]
[GOAL]
case h.e'_6
R : Type u_1
inst✝³ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝² : CommSemiring S
inst✝¹ : Algebra R S
P : Type u_3
inst✝ : CommSemiring P
h : R ≃+* P
this : Algebra P S := RingHom.toAlgebra (RingHom.comp (algebraMap R S) (RingEquiv.toRingHom (RingEquiv.symm h)))
H : IsLocalization (Submonoid.map (RingEquiv.toMonoidHom h) M) S
⊢ inst✝¹ =
    RingHom.toAlgebra
      (RingHom.comp (algebraMap R S)
        (RingHom.comp (RingEquiv.toRingHom (RingEquiv.symm h))
          (RingEquiv.toRingHom (RingEquiv.symm (RingEquiv.symm h)))))
[PROOFSTEP]
simp only [RingHom.comp_id, RingEquiv.symm_symm, RingEquiv.symm_toRingHom_comp_toRingHom]
[GOAL]
case h.e'_6
R : Type u_1
inst✝³ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝² : CommSemiring S
inst✝¹ : Algebra R S
P : Type u_3
inst✝ : CommSemiring P
h : R ≃+* P
this : Algebra P S := RingHom.toAlgebra (RingHom.comp (algebraMap R S) (RingEquiv.toRingHom (RingEquiv.symm h)))
H : IsLocalization (Submonoid.map (RingEquiv.toMonoidHom h) M) S
⊢ inst✝¹ = RingHom.toAlgebra (algebraMap R S)
[PROOFSTEP]
apply Algebra.algebra_ext
[GOAL]
case h.e'_6.h
R : Type u_1
inst✝³ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝² : CommSemiring S
inst✝¹ : Algebra R S
P : Type u_3
inst✝ : CommSemiring P
h : R ≃+* P
this : Algebra P S := RingHom.toAlgebra (RingHom.comp (algebraMap R S) (RingEquiv.toRingHom (RingEquiv.symm h)))
H : IsLocalization (Submonoid.map (RingEquiv.toMonoidHom h) M) S
⊢ ∀ (r : R), ↑(algebraMap R S) r = ↑(algebraMap R S) r
[PROOFSTEP]
intro r
[GOAL]
case h.e'_6.h
R : Type u_1
inst✝³ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝² : CommSemiring S
inst✝¹ : Algebra R S
P : Type u_3
inst✝ : CommSemiring P
h : R ≃+* P
this : Algebra P S := RingHom.toAlgebra (RingHom.comp (algebraMap R S) (RingEquiv.toRingHom (RingEquiv.symm h)))
H : IsLocalization (Submonoid.map (RingEquiv.toMonoidHom h) M) S
r : R
⊢ ↑(algebraMap R S) r = ↑(algebraMap R S) r
[PROOFSTEP]
rw [RingHom.algebraMap_toAlgebra]
[GOAL]
R : Type u_1
inst✝⁴ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝³ : CommSemiring S
inst✝² : Algebra R S
P : Type u_3
inst✝¹ : CommSemiring P
inst✝ : IsLocalization M S
⊢ nonZeroDivisors R ≤ Submonoid.comap (algebraMap R S) (nonZeroDivisors S)
[PROOFSTEP]
rintro a ha b (e : b * algebraMap R S a = 0)
[GOAL]
R : Type u_1
inst✝⁴ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝³ : CommSemiring S
inst✝² : Algebra R S
P : Type u_3
inst✝¹ : CommSemiring P
inst✝ : IsLocalization M S
a : R
ha : a ∈ nonZeroDivisors R
b : S
e : b * ↑(algebraMap R S) a = 0
⊢ b = 0
[PROOFSTEP]
obtain ⟨x, s, rfl⟩ := mk'_surjective M b
[GOAL]
case intro.intro
R : Type u_1
inst✝⁴ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝³ : CommSemiring S
inst✝² : Algebra R S
P : Type u_3
inst✝¹ : CommSemiring P
inst✝ : IsLocalization M S
a : R
ha : a ∈ nonZeroDivisors R
x : R
s : { x // x ∈ M }
e : mk' S x s * ↑(algebraMap R S) a = 0
⊢ mk' S x s = 0
[PROOFSTEP]
rw [← @mk'_one R _ M, ← mk'_mul, ← (algebraMap R S).map_zero, ← @mk'_one R _ M, IsLocalization.eq] at e
[GOAL]
case intro.intro
R : Type u_1
inst✝⁴ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝³ : CommSemiring S
inst✝² : Algebra R S
P : Type u_3
inst✝¹ : CommSemiring P
inst✝ : IsLocalization M S
a : R
ha : a ∈ nonZeroDivisors R
x : R
s : { x // x ∈ M }
e : ∃ c, ↑c * (↑1 * (x * a)) = ↑c * (↑(s * 1) * 0)
⊢ mk' S x s = 0
[PROOFSTEP]
obtain ⟨c, e⟩ := e
[GOAL]
case intro.intro.intro
R : Type u_1
inst✝⁴ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝³ : CommSemiring S
inst✝² : Algebra R S
P : Type u_3
inst✝¹ : CommSemiring P
inst✝ : IsLocalization M S
a : R
ha : a ∈ nonZeroDivisors R
x : R
s c : { x // x ∈ M }
e : ↑c * (↑1 * (x * a)) = ↑c * (↑(s * 1) * 0)
⊢ mk' S x s = 0
[PROOFSTEP]
rw [mul_zero, mul_zero, Submonoid.coe_one, one_mul, ← mul_assoc] at e
[GOAL]
case intro.intro.intro
R : Type u_1
inst✝⁴ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝³ : CommSemiring S
inst✝² : Algebra R S
P : Type u_3
inst✝¹ : CommSemiring P
inst✝ : IsLocalization M S
a : R
ha : a ∈ nonZeroDivisors R
x : R
s c : { x // x ∈ M }
e : ↑c * x * a = 0
⊢ mk' S x s = 0
[PROOFSTEP]
rw [mk'_eq_zero_iff]
[GOAL]
case intro.intro.intro
R : Type u_1
inst✝⁴ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝³ : CommSemiring S
inst✝² : Algebra R S
P : Type u_3
inst✝¹ : CommSemiring P
inst✝ : IsLocalization M S
a : R
ha : a ∈ nonZeroDivisors R
x : R
s c : { x // x ∈ M }
e : ↑c * x * a = 0
⊢ ∃ m, ↑m * x = 0
[PROOFSTEP]
exact ⟨c, ha _ e⟩
[GOAL]
R : Type u_1
inst✝⁴ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝³ : CommSemiring S
inst✝² : Algebra R S
P : Type u_3
inst✝¹ : CommSemiring P
inst✝ : Subsingleton R
a : Localization M
x✝ : R × { x // x ∈ M }
⊢ mk x✝.fst x✝.snd = mk 1 1
[PROOFSTEP]
congr
[GOAL]
case e_x
R : Type u_1
inst✝⁴ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝³ : CommSemiring S
inst✝² : Algebra R S
P : Type u_3
inst✝¹ : CommSemiring P
inst✝ : Subsingleton R
a : Localization M
x✝ : R × { x // x ∈ M }
⊢ x✝.fst = 1
[PROOFSTEP]
apply Subsingleton.elim
[GOAL]
case e_y
R : Type u_1
inst✝⁴ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝³ : CommSemiring S
inst✝² : Algebra R S
P : Type u_3
inst✝¹ : CommSemiring P
inst✝ : Subsingleton R
a : Localization M
x✝ : R × { x // x ∈ M }
⊢ x✝.snd = 1
[PROOFSTEP]
apply Subsingleton.elim
[GOAL]
R : Type u_1
inst✝³ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝² : CommSemiring S
inst✝¹ : Algebra R S
P : Type u_3
inst✝ : CommSemiring P
z w : Localization M
a a' : R
b b' : { x // x ∈ M }
c c' : R
d d' : { x // x ∈ M }
h1 : ↑(r M) (a, b) (a', b')
h2 : ↑(r M) (c, d) (c', d')
⊢ ↑(r M) (↑b * c + ↑d * a, b * d) (↑b' * c' + ↑d' * a', b' * d')
[PROOFSTEP]
rw [r_eq_r'] at h1 h2 ⊢
[GOAL]
R : Type u_1
inst✝³ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝² : CommSemiring S
inst✝¹ : Algebra R S
P : Type u_3
inst✝ : CommSemiring P
z w : Localization M
a a' : R
b b' : { x // x ∈ M }
c c' : R
d d' : { x // x ∈ M }
h1 : ↑(r' M) (a, b) (a', b')
h2 : ↑(r' M) (c, d) (c', d')
⊢ ↑(r' M) (↑b * c + ↑d * a, b * d) (↑b' * c' + ↑d' * a', b' * d')
[PROOFSTEP]
cases' h1 with t₅ ht₅
[GOAL]
case intro
R : Type u_1
inst✝³ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝² : CommSemiring S
inst✝¹ : Algebra R S
P : Type u_3
inst✝ : CommSemiring P
z w : Localization M
a a' : R
b b' : { x // x ∈ M }
c c' : R
d d' : { x // x ∈ M }
h2 : ↑(r' M) (c, d) (c', d')
t₅ : { x // x ∈ M }
ht₅ : ↑t₅ * (↑(a', b').snd * (a, b).fst) = ↑t₅ * (↑(a, b).snd * (a', b').fst)
⊢ ↑(r' M) (↑b * c + ↑d * a, b * d) (↑b' * c' + ↑d' * a', b' * d')
[PROOFSTEP]
cases' h2 with t₆ ht₆
[GOAL]
case intro.intro
R : Type u_1
inst✝³ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝² : CommSemiring S
inst✝¹ : Algebra R S
P : Type u_3
inst✝ : CommSemiring P
z w : Localization M
a a' : R
b b' : { x // x ∈ M }
c c' : R
d d' t₅ : { x // x ∈ M }
ht₅ : ↑t₅ * (↑(a', b').snd * (a, b).fst) = ↑t₅ * (↑(a, b).snd * (a', b').fst)
t₆ : { x // x ∈ M }
ht₆ : ↑t₆ * (↑(c', d').snd * (c, d).fst) = ↑t₆ * (↑(c, d).snd * (c', d').fst)
⊢ ↑(r' M) (↑b * c + ↑d * a, b * d) (↑b' * c' + ↑d' * a', b' * d')
[PROOFSTEP]
use t₅ * t₆
[GOAL]
case h
R : Type u_1
inst✝³ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝² : CommSemiring S
inst✝¹ : Algebra R S
P : Type u_3
inst✝ : CommSemiring P
z w : Localization M
a a' : R
b b' : { x // x ∈ M }
c c' : R
d d' t₅ : { x // x ∈ M }
ht₅ : ↑t₅ * (↑(a', b').snd * (a, b).fst) = ↑t₅ * (↑(a, b).snd * (a', b').fst)
t₆ : { x // x ∈ M }
ht₆ : ↑t₆ * (↑(c', d').snd * (c, d).fst) = ↑t₆ * (↑(c, d).snd * (c', d').fst)
⊢ ↑(t₅ * t₆) * (↑(↑b' * c' + ↑d' * a', b' * d').snd * (↑b * c + ↑d * a, b * d).fst) =
    ↑(t₅ * t₆) * (↑(↑b * c + ↑d * a, b * d).snd * (↑b' * c' + ↑d' * a', b' * d').fst)
[PROOFSTEP]
dsimp only
[GOAL]
case h
R : Type u_1
inst✝³ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝² : CommSemiring S
inst✝¹ : Algebra R S
P : Type u_3
inst✝ : CommSemiring P
z w : Localization M
a a' : R
b b' : { x // x ∈ M }
c c' : R
d d' t₅ : { x // x ∈ M }
ht₅ : ↑t₅ * (↑(a', b').snd * (a, b).fst) = ↑t₅ * (↑(a, b).snd * (a', b').fst)
t₆ : { x // x ∈ M }
ht₆ : ↑t₆ * (↑(c', d').snd * (c, d).fst) = ↑t₆ * (↑(c, d).snd * (c', d').fst)
⊢ ↑(t₅ * t₆) * (↑(b' * d') * (↑b * c + ↑d * a)) = ↑(t₅ * t₆) * (↑(b * d) * (↑b' * c' + ↑d' * a'))
[PROOFSTEP]
calc
  ↑t₅ * ↑t₆ * (↑b' * ↑d' * ((b : R) * c + d * a)) = t₆ * (d' * c) * (t₅ * (b' * b)) + t₅ * (b' * a) * (t₆ * (d' * d)) :=
    by ring
  _ = t₅ * t₆ * (b * d * (b' * c' + d' * a')) := by rw [ht₆, ht₅]; ring
[GOAL]
R : Type u_1
inst✝³ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝² : CommSemiring S
inst✝¹ : Algebra R S
P : Type u_3
inst✝ : CommSemiring P
z w : Localization M
a a' : R
b b' : { x // x ∈ M }
c c' : R
d d' t₅ : { x // x ∈ M }
ht₅ : ↑t₅ * (↑(a', b').snd * (a, b).fst) = ↑t₅ * (↑(a, b).snd * (a', b').fst)
t₆ : { x // x ∈ M }
ht₆ : ↑t₆ * (↑(c', d').snd * (c, d).fst) = ↑t₆ * (↑(c, d).snd * (c', d').fst)
⊢ ↑t₅ * ↑t₆ * (↑b' * ↑d' * (↑b * c + ↑d * a)) =
    ↑t₆ * (↑d' * c) * (↑t₅ * (↑b' * ↑b)) + ↑t₅ * (↑b' * a) * (↑t₆ * (↑d' * ↑d))
[PROOFSTEP]
ring
[GOAL]
R : Type u_1
inst✝³ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝² : CommSemiring S
inst✝¹ : Algebra R S
P : Type u_3
inst✝ : CommSemiring P
z w : Localization M
a a' : R
b b' : { x // x ∈ M }
c c' : R
d d' t₅ : { x // x ∈ M }
ht₅ : ↑t₅ * (↑(a', b').snd * (a, b).fst) = ↑t₅ * (↑(a, b).snd * (a', b').fst)
t₆ : { x // x ∈ M }
ht₆ : ↑t₆ * (↑(c', d').snd * (c, d).fst) = ↑t₆ * (↑(c, d).snd * (c', d').fst)
⊢ ↑t₆ * (↑d' * c) * (↑t₅ * (↑b' * ↑b)) + ↑t₅ * (↑b' * a) * (↑t₆ * (↑d' * ↑d)) =
    ↑t₅ * ↑t₆ * (↑b * ↑d * (↑b' * c' + ↑d' * a'))
[PROOFSTEP]
rw [ht₆, ht₅]
[GOAL]
R : Type u_1
inst✝³ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝² : CommSemiring S
inst✝¹ : Algebra R S
P : Type u_3
inst✝ : CommSemiring P
z w : Localization M
a a' : R
b b' : { x // x ∈ M }
c c' : R
d d' t₅ : { x // x ∈ M }
ht₅ : ↑t₅ * (↑(a', b').snd * (a, b).fst) = ↑t₅ * (↑(a, b).snd * (a', b').fst)
t₆ : { x // x ∈ M }
ht₆ : ↑t₆ * (↑(c', d').snd * (c, d).fst) = ↑t₆ * (↑(c, d).snd * (c', d').fst)
⊢ ↑t₆ * (↑(c, d).snd * (c', d').fst) * (↑t₅ * (↑b' * ↑b)) + ↑t₅ * (↑(a, b).snd * (a', b').fst) * (↑t₆ * (↑d' * ↑d)) =
    ↑t₅ * ↑t₆ * (↑b * ↑d * (↑b' * c' + ↑d' * a'))
[PROOFSTEP]
ring
[GOAL]
R : Type u_1
inst✝³ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝² : CommSemiring S
inst✝¹ : Algebra R S
P : Type u_3
inst✝ : CommSemiring P
a : R
b : { x // x ∈ M }
c : R
d : { x // x ∈ M }
⊢ mk a b + mk c d = mk (↑b * c + ↑d * a) (b * d)
[PROOFSTEP]
show Localization.add (mk a b) (mk c d) = mk _ _
[GOAL]
R : Type u_1
inst✝³ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝² : CommSemiring S
inst✝¹ : Algebra R S
P : Type u_3
inst✝ : CommSemiring P
a : R
b : { x // x ∈ M }
c : R
d : { x // x ∈ M }
⊢ Localization.add (mk a b) (mk c d) = mk (↑b * c + ↑d * a) (b * d)
[PROOFSTEP]
simp [Localization.add_def]
[GOAL]
R : Type u_1
inst✝³ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝² : CommSemiring S
inst✝¹ : Algebra R S
P : Type u_3
inst✝ : CommSemiring P
a : R
b : { x // x ∈ M }
c : R
⊢ mk a b + mk c b = mk (a + c) b
[PROOFSTEP]
rw [add_mk, mk_eq_mk_iff, r_eq_r']
[GOAL]
R : Type u_1
inst✝³ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝² : CommSemiring S
inst✝¹ : Algebra R S
P : Type u_3
inst✝ : CommSemiring P
a : R
b : { x // x ∈ M }
c : R
⊢ ↑(r' M) (↑b * c + ↑b * a, b * b) (a + c, b)
[PROOFSTEP]
refine' (r' M).symm ⟨1, _⟩
[GOAL]
R : Type u_1
inst✝³ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝² : CommSemiring S
inst✝¹ : Algebra R S
P : Type u_3
inst✝ : CommSemiring P
a : R
b : { x // x ∈ M }
c : R
⊢ ↑1 * (↑(↑b * c + ↑b * a, b * b).snd * (a + c, b).fst) = ↑1 * (↑(a + c, b).snd * (↑b * c + ↑b * a, b * b).fst)
[PROOFSTEP]
simp only [Submonoid.coe_one, Submonoid.coe_mul]
[GOAL]
R : Type u_1
inst✝³ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝² : CommSemiring S
inst✝¹ : Algebra R S
P : Type u_3
inst✝ : CommSemiring P
a : R
b : { x // x ∈ M }
c : R
⊢ 1 * (↑b * ↑b * (a + c)) = 1 * (↑b * (↑b * c + ↑b * a))
[PROOFSTEP]
ring
[GOAL]
R : Type u_1
inst✝³ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝² : CommSemiring S
inst✝¹ : Algebra R S
P : Type u_3
inst✝ : CommSemiring P
⊢ CommMonoidWithZero (Localization M)
[PROOFSTEP]
infer_instance
[GOAL]
R : Type u_1
inst✝³ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝² : CommSemiring S
inst✝¹ : Algebra R S
P : Type u_3
inst✝ : CommSemiring P
src✝ : CommMonoidWithZero (Localization M) :=
  let_fun this := inferInstance;
  this
m n k : Localization M
⊢ ∀ (x y z : R × { x // x ∈ M }),
    mk x.fst x.snd + mk y.fst y.snd + mk z.fst z.snd = mk x.fst x.snd + (mk y.fst y.snd + mk z.fst z.snd)
[PROOFSTEP]
localization_tac
[GOAL]
R : Type u_1
inst✝³ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝² : CommSemiring S
inst✝¹ : Algebra R S
P : Type u_3
inst✝ : CommSemiring P
src✝ : CommMonoidWithZero (Localization M) :=
  let_fun this := inferInstance;
  this
y : Localization M
⊢ ∀ (y : R × { x // x ∈ M }), 0 + mk y.fst y.snd = mk y.fst y.snd
[PROOFSTEP]
localization_tac
[GOAL]
R : Type u_1
inst✝³ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝² : CommSemiring S
inst✝¹ : Algebra R S
P : Type u_3
inst✝ : CommSemiring P
src✝ : CommMonoidWithZero (Localization M) :=
  let_fun this := inferInstance;
  this
y : Localization M
⊢ ∀ (y : R × { x // x ∈ M }), mk y.fst y.snd + 0 = mk y.fst y.snd
[PROOFSTEP]
localization_tac
[GOAL]
R : Type u_1
inst✝³ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝² : CommSemiring S
inst✝¹ : Algebra R S
P : Type u_3
inst✝ : CommSemiring P
src✝ : CommMonoidWithZero (Localization M) :=
  let_fun this := inferInstance;
  this
x✝ : Localization M
x : R × { x // x ∈ M }
⊢ (fun x x_1 => x • x_1) 0 (mk x.fst x.snd) = 0
[PROOFSTEP]
simp only [smul_mk, zero_nsmul, mk_zero]
[GOAL]
R : Type u_1
inst✝³ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝² : CommSemiring S
inst✝¹ : Algebra R S
P : Type u_3
inst✝ : CommSemiring P
src✝ : CommMonoidWithZero (Localization M) :=
  let_fun this := inferInstance;
  this
n : ℕ
x✝ : Localization M
x : R × { x // x ∈ M }
⊢ (fun x x_1 => x • x_1) (n + 1) (mk x.fst x.snd) = mk x.fst x.snd + (fun x x_1 => x • x_1) n (mk x.fst x.snd)
[PROOFSTEP]
simp only [smul_mk, succ_nsmul, add_mk_self]
[GOAL]
R : Type u_1
inst✝³ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝² : CommSemiring S
inst✝¹ : Algebra R S
P : Type u_3
inst✝ : CommSemiring P
src✝ : CommMonoidWithZero (Localization M) :=
  let_fun this := inferInstance;
  this
y z : Localization M
⊢ ∀ (x y : R × { x // x ∈ M }), mk y.fst y.snd + mk x.fst x.snd = mk x.fst x.snd + mk y.fst y.snd
[PROOFSTEP]
localization_tac
[GOAL]
R : Type u_1
inst✝³ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝² : CommSemiring S
inst✝¹ : Algebra R S
P : Type u_3
inst✝ : CommSemiring P
src✝ : CommMonoidWithZero (Localization M) :=
  let_fun this := inferInstance;
  this
m n k : Localization M
⊢ ∀ (x y z : R × { x // x ∈ M }),
    mk x.fst x.snd * (mk y.fst y.snd + mk z.fst z.snd) =
      mk x.fst x.snd * mk y.fst y.snd + mk x.fst x.snd * mk z.fst z.snd
[PROOFSTEP]
localization_tac
[GOAL]
R : Type u_1
inst✝³ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝² : CommSemiring S
inst✝¹ : Algebra R S
P : Type u_3
inst✝ : CommSemiring P
src✝ : CommMonoidWithZero (Localization M) :=
  let_fun this := inferInstance;
  this
m n k : Localization M
⊢ ∀ (x y z : R × { x // x ∈ M }),
    (mk x.fst x.snd + mk y.fst y.snd) * mk z.fst z.snd =
      mk x.fst x.snd * mk z.fst z.snd + mk y.fst y.snd * mk z.fst z.snd
[PROOFSTEP]
localization_tac
[GOAL]
R : Type u_1
inst✝⁶ : CommSemiring R
M : Submonoid R
S✝ : Type u_2
inst✝⁵ : CommSemiring S✝
inst✝⁴ : Algebra R S✝
P : Type u_3
inst✝³ : CommSemiring P
S : Type u_4
inst✝² : Monoid S
inst✝¹ : DistribMulAction S R
inst✝ : IsScalarTower S R R
s : S
⊢ s • 0 = 0
[PROOFSTEP]
simp only [← Localization.mk_zero 1, Localization.smul_mk, smul_zero]
[GOAL]
R : Type u_1
inst✝⁶ : CommSemiring R
M : Submonoid R
S✝ : Type u_2
inst✝⁵ : CommSemiring S✝
inst✝⁴ : Algebra R S✝
P : Type u_3
inst✝³ : CommSemiring P
S : Type u_4
inst✝² : Monoid S
inst✝¹ : DistribMulAction S R
inst✝ : IsScalarTower S R R
s : S
x y : Localization M
r₁ : R
x₁ : { x // x ∈ M }
r₂ : R
x₂ : { x // x ∈ M }
⊢ s • (mk (r₁, x₁).fst (r₁, x₁).snd + mk (r₂, x₂).fst (r₂, x₂).snd) =
    s • mk (r₁, x₁).fst (r₁, x₁).snd + s • mk (r₂, x₂).fst (r₂, x₂).snd
[PROOFSTEP]
simp only [Localization.smul_mk, Localization.add_mk, smul_add, mul_comm _ (s • _), mul_comm _ r₁, mul_comm _ r₂,
  smul_mul_assoc]
[GOAL]
R : Type u_1
inst✝⁶ : CommSemiring R
M : Submonoid R
S✝ : Type u_2
inst✝⁵ : CommSemiring S✝
inst✝⁴ : Algebra R S✝
P : Type u_3
inst✝³ : CommSemiring P
S : Type u_4
inst✝² : Semiring S
inst✝¹ : Module S R
inst✝ : IsScalarTower S R R
src✝ : DistribMulAction S (Localization M) := inferInstanceAs (DistribMulAction S (Localization M))
s₁ s₂ : S
⊢ ∀ (fst : R) (snd : { x // x ∈ M }),
    (s₁ + s₂) • mk (fst, snd).fst (fst, snd).snd =
      s₁ • mk (fst, snd).fst (fst, snd).snd + s₂ • mk (fst, snd).fst (fst, snd).snd
[PROOFSTEP]
intros
[GOAL]
R : Type u_1
inst✝⁶ : CommSemiring R
M : Submonoid R
S✝ : Type u_2
inst✝⁵ : CommSemiring S✝
inst✝⁴ : Algebra R S✝
P : Type u_3
inst✝³ : CommSemiring P
S : Type u_4
inst✝² : Semiring S
inst✝¹ : Module S R
inst✝ : IsScalarTower S R R
src✝ : DistribMulAction S (Localization M) := inferInstanceAs (DistribMulAction S (Localization M))
s₁ s₂ : S
fst✝ : R
snd✝ : { x // x ∈ M }
⊢ (s₁ + s₂) • mk (fst✝, snd✝).fst (fst✝, snd✝).snd =
    s₁ • mk (fst✝, snd✝).fst (fst✝, snd✝).snd + s₂ • mk (fst✝, snd✝).fst (fst✝, snd✝).snd
[PROOFSTEP]
simp only [Localization.smul_mk, add_smul, add_mk_self]
[GOAL]
R : Type u_1
inst✝⁶ : CommSemiring R
M : Submonoid R
S✝ : Type u_2
inst✝⁵ : CommSemiring S✝
inst✝⁴ : Algebra R S✝
P : Type u_3
inst✝³ : CommSemiring P
S : Type u_4
inst✝² : Semiring S
inst✝¹ : Module S R
inst✝ : IsScalarTower S R R
src✝ : DistribMulAction S (Localization M) := inferInstanceAs (DistribMulAction S (Localization M))
⊢ ∀ (fst : R) (snd : { x // x ∈ M }), 0 • mk (fst, snd).fst (fst, snd).snd = 0
[PROOFSTEP]
intros
[GOAL]
R : Type u_1
inst✝⁶ : CommSemiring R
M : Submonoid R
S✝ : Type u_2
inst✝⁵ : CommSemiring S✝
inst✝⁴ : Algebra R S✝
P : Type u_3
inst✝³ : CommSemiring P
S : Type u_4
inst✝² : Semiring S
inst✝¹ : Module S R
inst✝ : IsScalarTower S R R
src✝ : DistribMulAction S (Localization M) := inferInstanceAs (DistribMulAction S (Localization M))
fst✝ : R
snd✝ : { x // x ∈ M }
⊢ 0 • mk (fst✝, snd✝).fst (fst✝, snd✝).snd = 0
[PROOFSTEP]
simp only [Localization.smul_mk, zero_smul, mk_zero]
[GOAL]
R : Type u_1
inst✝⁵ : CommSemiring R
M : Submonoid R
S✝ : Type u_2
inst✝⁴ : CommSemiring S✝
inst✝³ : Algebra R S✝
P : Type u_3
inst✝² : CommSemiring P
S : Type u_4
inst✝¹ : CommSemiring S
inst✝ : Algebra S R
src✝ : Submonoid.LocalizationMap M (Localization M) := monoidOf M
⊢ OneHom.toFun
      (↑{
          toOneHom :=
            { toFun := ↑(Submonoid.LocalizationMap.toMap (monoidOf M)),
              map_one' := (_ : OneHom.toFun (↑src✝.toMonoidHom) 1 = 1) },
          map_mul' :=
            (_ :
              ∀ (x y : R),
                OneHom.toFun (↑src✝.toMonoidHom) (x * y) =
                  OneHom.toFun (↑src✝.toMonoidHom) x * OneHom.toFun (↑src✝.toMonoidHom) y) })
      0 =
    0
[PROOFSTEP]
rw [← mk_zero (1 : M), mk_one_eq_monoidOf_mk]
[GOAL]
R : Type u_1
inst✝⁵ : CommSemiring R
M : Submonoid R
S✝ : Type u_2
inst✝⁴ : CommSemiring S✝
inst✝³ : Algebra R S✝
P : Type u_3
inst✝² : CommSemiring P
S : Type u_4
inst✝¹ : CommSemiring S
inst✝ : Algebra S R
src✝ : Submonoid.LocalizationMap M (Localization M) := monoidOf M
x y : R
⊢ OneHom.toFun
      (↑{
          toOneHom :=
            { toFun := ↑(Submonoid.LocalizationMap.toMap (monoidOf M)),
              map_one' := (_ : OneHom.toFun (↑src✝.toMonoidHom) 1 = 1) },
          map_mul' :=
            (_ :
              ∀ (x y : R),
                OneHom.toFun (↑src✝.toMonoidHom) (x * y) =
                  OneHom.toFun (↑src✝.toMonoidHom) x * OneHom.toFun (↑src✝.toMonoidHom) y) })
      (x + y) =
    OneHom.toFun
        (↑{
            toOneHom :=
              { toFun := ↑(Submonoid.LocalizationMap.toMap (monoidOf M)),
                map_one' := (_ : OneHom.toFun (↑src✝.toMonoidHom) 1 = 1) },
            map_mul' :=
              (_ :
                ∀ (x y : R),
                  OneHom.toFun (↑src✝.toMonoidHom) (x * y) =
                    OneHom.toFun (↑src✝.toMonoidHom) x * OneHom.toFun (↑src✝.toMonoidHom) y) })
        x +
      OneHom.toFun
        (↑{
            toOneHom :=
              { toFun := ↑(Submonoid.LocalizationMap.toMap (monoidOf M)),
                map_one' := (_ : OneHom.toFun (↑src✝.toMonoidHom) 1 = 1) },
            map_mul' :=
              (_ :
                ∀ (x y : R),
                  OneHom.toFun (↑src✝.toMonoidHom) (x * y) =
                    OneHom.toFun (↑src✝.toMonoidHom) x * OneHom.toFun (↑src✝.toMonoidHom) y) })
        y
[PROOFSTEP]
simp only [← mk_one_eq_monoidOf_mk, add_mk, Submonoid.coe_one, one_mul, add_comm]
[GOAL]
R : Type u_1
inst✝⁵ : CommSemiring R
M : Submonoid R
S✝ : Type u_2
inst✝⁴ : CommSemiring S✝
inst✝³ : Algebra R S✝
P : Type u_3
inst✝² : CommSemiring P
S : Type u_4
inst✝¹ : CommSemiring S
inst✝ : Algebra S R
s : S
⊢ ∀ (fst : R) (snd : { x // x ∈ M }),
    ↑(RingHom.comp
              (let src := monoidOf M;
              {
                toMonoidHom :=
                  {
                    toOneHom :=
                      { toFun := ↑(Submonoid.LocalizationMap.toMap (monoidOf M)),
                        map_one' := (_ : OneHom.toFun (↑src.toMonoidHom) 1 = 1) },
                    map_mul' :=
                      (_ :
                        ∀ (x y : R),
                          OneHom.toFun (↑src.toMonoidHom) (x * y) =
                            OneHom.toFun (↑src.toMonoidHom) x * OneHom.toFun (↑src.toMonoidHom) y) },
                map_zero' :=
                  (_ :
                    OneHom.toFun
                        (↑{
                            toOneHom :=
                              { toFun := ↑(Submonoid.LocalizationMap.toMap (monoidOf M)),
                                map_one' := (_ : OneHom.toFun (↑src.toMonoidHom) 1 = 1) },
                            map_mul' :=
                              (_ :
                                ∀ (x y : R),
                                  OneHom.toFun (↑src.toMonoidHom) (x * y) =
                                    OneHom.toFun (↑src.toMonoidHom) x * OneHom.toFun (↑src.toMonoidHom) y) })
                        0 =
                      0),
                map_add' := (_ : ∀ (x y : R), mk (x + y) 1 = mk x 1 + mk y 1) })
              (algebraMap S R))
          s *
        mk (fst, snd).fst (fst, snd).snd =
      mk (fst, snd).fst (fst, snd).snd *
        ↑(RingHom.comp
              (let src := monoidOf M;
              {
                toMonoidHom :=
                  {
                    toOneHom :=
                      { toFun := ↑(Submonoid.LocalizationMap.toMap (monoidOf M)),
                        map_one' := (_ : OneHom.toFun (↑src.toMonoidHom) 1 = 1) },
                    map_mul' :=
                      (_ :
                        ∀ (x y : R),
                          OneHom.toFun (↑src.toMonoidHom) (x * y) =
                            OneHom.toFun (↑src.toMonoidHom) x * OneHom.toFun (↑src.toMonoidHom) y) },
                map_zero' :=
                  (_ :
                    OneHom.toFun
                        (↑{
                            toOneHom :=
                              { toFun := ↑(Submonoid.LocalizationMap.toMap (monoidOf M)),
                                map_one' := (_ : OneHom.toFun (↑src.toMonoidHom) 1 = 1) },
                            map_mul' :=
                              (_ :
                                ∀ (x y : R),
                                  OneHom.toFun (↑src.toMonoidHom) (x * y) =
                                    OneHom.toFun (↑src.toMonoidHom) x * OneHom.toFun (↑src.toMonoidHom) y) })
                        0 =
                      0),
                map_add' := (_ : ∀ (x y : R), mk (x + y) 1 = mk x 1 + mk y 1) })
              (algebraMap S R))
          s
[PROOFSTEP]
intro r x
[GOAL]
R : Type u_1
inst✝⁵ : CommSemiring R
M : Submonoid R
S✝ : Type u_2
inst✝⁴ : CommSemiring S✝
inst✝³ : Algebra R S✝
P : Type u_3
inst✝² : CommSemiring P
S : Type u_4
inst✝¹ : CommSemiring S
inst✝ : Algebra S R
s : S
r : R
x : { x // x ∈ M }
⊢ ↑(RingHom.comp
            (let src := monoidOf M;
            {
              toMonoidHom :=
                {
                  toOneHom :=
                    { toFun := ↑(Submonoid.LocalizationMap.toMap (monoidOf M)),
                      map_one' := (_ : OneHom.toFun (↑src.toMonoidHom) 1 = 1) },
                  map_mul' :=
                    (_ :
                      ∀ (x y : R),
                        OneHom.toFun (↑src.toMonoidHom) (x * y) =
                          OneHom.toFun (↑src.toMonoidHom) x * OneHom.toFun (↑src.toMonoidHom) y) },
              map_zero' :=
                (_ :
                  OneHom.toFun
                      (↑{
                          toOneHom :=
                            { toFun := ↑(Submonoid.LocalizationMap.toMap (monoidOf M)),
                              map_one' := (_ : OneHom.toFun (↑src.toMonoidHom) 1 = 1) },
                          map_mul' :=
                            (_ :
                              ∀ (x y : R),
                                OneHom.toFun (↑src.toMonoidHom) (x * y) =
                                  OneHom.toFun (↑src.toMonoidHom) x * OneHom.toFun (↑src.toMonoidHom) y) })
                      0 =
                    0),
              map_add' := (_ : ∀ (x y : R), mk (x + y) 1 = mk x 1 + mk y 1) })
            (algebraMap S R))
        s *
      mk (r, x).fst (r, x).snd =
    mk (r, x).fst (r, x).snd *
      ↑(RingHom.comp
            (let src := monoidOf M;
            {
              toMonoidHom :=
                {
                  toOneHom :=
                    { toFun := ↑(Submonoid.LocalizationMap.toMap (monoidOf M)),
                      map_one' := (_ : OneHom.toFun (↑src.toMonoidHom) 1 = 1) },
                  map_mul' :=
                    (_ :
                      ∀ (x y : R),
                        OneHom.toFun (↑src.toMonoidHom) (x * y) =
                          OneHom.toFun (↑src.toMonoidHom) x * OneHom.toFun (↑src.toMonoidHom) y) },
              map_zero' :=
                (_ :
                  OneHom.toFun
                      (↑{
                          toOneHom :=
                            { toFun := ↑(Submonoid.LocalizationMap.toMap (monoidOf M)),
                              map_one' := (_ : OneHom.toFun (↑src.toMonoidHom) 1 = 1) },
                          map_mul' :=
                            (_ :
                              ∀ (x y : R),
                                OneHom.toFun (↑src.toMonoidHom) (x * y) =
                                  OneHom.toFun (↑src.toMonoidHom) x * OneHom.toFun (↑src.toMonoidHom) y) })
                      0 =
                    0),
              map_add' := (_ : ∀ (x y : R), mk (x + y) 1 = mk x 1 + mk y 1) })
            (algebraMap S R))
        s
[PROOFSTEP]
dsimp
[GOAL]
R : Type u_1
inst✝⁵ : CommSemiring R
M : Submonoid R
S✝ : Type u_2
inst✝⁴ : CommSemiring S✝
inst✝³ : Algebra R S✝
P : Type u_3
inst✝² : CommSemiring P
S : Type u_4
inst✝¹ : CommSemiring S
inst✝ : Algebra S R
s : S
r : R
x : { x // x ∈ M }
⊢ ↑(Submonoid.LocalizationMap.toMap (monoidOf M)) (↑(algebraMap S R) s) * mk r x =
    mk r x * ↑(Submonoid.LocalizationMap.toMap (monoidOf M)) (↑(algebraMap S R) s)
[PROOFSTEP]
simp only [← mk_one_eq_monoidOf_mk, mk_mul, Localization.smul_mk, one_mul, mul_one, Algebra.commutes]
[GOAL]
R : Type u_1
inst✝⁵ : CommSemiring R
M : Submonoid R
S✝ : Type u_2
inst✝⁴ : CommSemiring S✝
inst✝³ : Algebra R S✝
P : Type u_3
inst✝² : CommSemiring P
S : Type u_4
inst✝¹ : CommSemiring S
inst✝ : Algebra S R
s : S
⊢ ∀ (fst : R) (snd : { x // x ∈ M }),
    s • mk (fst, snd).fst (fst, snd).snd =
      ↑(RingHom.comp
              (let src := monoidOf M;
              {
                toMonoidHom :=
                  {
                    toOneHom :=
                      { toFun := ↑(Submonoid.LocalizationMap.toMap (monoidOf M)),
                        map_one' := (_ : OneHom.toFun (↑src.toMonoidHom) 1 = 1) },
                    map_mul' :=
                      (_ :
                        ∀ (x y : R),
                          OneHom.toFun (↑src.toMonoidHom) (x * y) =
                            OneHom.toFun (↑src.toMonoidHom) x * OneHom.toFun (↑src.toMonoidHom) y) },
                map_zero' :=
                  (_ :
                    OneHom.toFun
                        (↑{
                            toOneHom :=
                              { toFun := ↑(Submonoid.LocalizationMap.toMap (monoidOf M)),
                                map_one' := (_ : OneHom.toFun (↑src.toMonoidHom) 1 = 1) },
                            map_mul' :=
                              (_ :
                                ∀ (x y : R),
                                  OneHom.toFun (↑src.toMonoidHom) (x * y) =
                                    OneHom.toFun (↑src.toMonoidHom) x * OneHom.toFun (↑src.toMonoidHom) y) })
                        0 =
                      0),
                map_add' := (_ : ∀ (x y : R), mk (x + y) 1 = mk x 1 + mk y 1) })
              (algebraMap S R))
          s *
        mk (fst, snd).fst (fst, snd).snd
[PROOFSTEP]
intro r x
[GOAL]
R : Type u_1
inst✝⁵ : CommSemiring R
M : Submonoid R
S✝ : Type u_2
inst✝⁴ : CommSemiring S✝
inst✝³ : Algebra R S✝
P : Type u_3
inst✝² : CommSemiring P
S : Type u_4
inst✝¹ : CommSemiring S
inst✝ : Algebra S R
s : S
r : R
x : { x // x ∈ M }
⊢ s • mk (r, x).fst (r, x).snd =
    ↑(RingHom.comp
            (let src := monoidOf M;
            {
              toMonoidHom :=
                {
                  toOneHom :=
                    { toFun := ↑(Submonoid.LocalizationMap.toMap (monoidOf M)),
                      map_one' := (_ : OneHom.toFun (↑src.toMonoidHom) 1 = 1) },
                  map_mul' :=
                    (_ :
                      ∀ (x y : R),
                        OneHom.toFun (↑src.toMonoidHom) (x * y) =
                          OneHom.toFun (↑src.toMonoidHom) x * OneHom.toFun (↑src.toMonoidHom) y) },
              map_zero' :=
                (_ :
                  OneHom.toFun
                      (↑{
                          toOneHom :=
                            { toFun := ↑(Submonoid.LocalizationMap.toMap (monoidOf M)),
                              map_one' := (_ : OneHom.toFun (↑src.toMonoidHom) 1 = 1) },
                          map_mul' :=
                            (_ :
                              ∀ (x y : R),
                                OneHom.toFun (↑src.toMonoidHom) (x * y) =
                                  OneHom.toFun (↑src.toMonoidHom) x * OneHom.toFun (↑src.toMonoidHom) y) })
                      0 =
                    0),
              map_add' := (_ : ∀ (x y : R), mk (x + y) 1 = mk x 1 + mk y 1) })
            (algebraMap S R))
        s *
      mk (r, x).fst (r, x).snd
[PROOFSTEP]
dsimp
[GOAL]
R : Type u_1
inst✝⁵ : CommSemiring R
M : Submonoid R
S✝ : Type u_2
inst✝⁴ : CommSemiring S✝
inst✝³ : Algebra R S✝
P : Type u_3
inst✝² : CommSemiring P
S : Type u_4
inst✝¹ : CommSemiring S
inst✝ : Algebra S R
s : S
r : R
x : { x // x ∈ M }
⊢ s • mk r x = ↑(Submonoid.LocalizationMap.toMap (monoidOf M)) (↑(algebraMap S R) s) * mk r x
[PROOFSTEP]
simp only [← mk_one_eq_monoidOf_mk, mk_mul, Localization.smul_mk, one_mul, Algebra.smul_def]
[GOAL]
R : Type u_1
inst✝³ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝² : CommSemiring S
inst✝¹ : Algebra R S
P : Type u_3
inst✝ : CommSemiring P
x : R
y : { x // x ∈ M }
⊢ mk x y = mk' (Localization M) x y
[PROOFSTEP]
rw [mk_eq_monoidOf_mk'_apply, mk', toLocalizationMap_eq_monoidOf]
[GOAL]
R : Type u_1
inst✝⁵ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝⁴ : CommSemiring S
inst✝³ : Algebra R S
P : Type u_3
inst✝² : CommSemiring P
A : Type u_4
inst✝¹ : CommSemiring A
inst✝ : Algebra A R
m : A
⊢ mk (↑(algebraMap A R) m) 1 = ↑(algebraMap A (Localization M)) m
[PROOFSTEP]
rw [mk_eq_mk', mk'_eq_iff_eq_mul, Submonoid.coe_one, map_one, mul_one]
[GOAL]
R : Type u_1
inst✝⁵ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝⁴ : CommSemiring S
inst✝³ : Algebra R S
P : Type u_3
inst✝² : CommSemiring P
A : Type u_4
inst✝¹ : CommSemiring A
inst✝ : Algebra A R
m : A
⊢ ↑(algebraMap ((fun x => R) m) (Localization M)) (↑(algebraMap A R) m) = ↑(algebraMap A (Localization M)) m
[PROOFSTEP]
rfl
[GOAL]
R : Type u_1
inst✝³ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝² : CommSemiring S
inst✝¹ : Algebra R S
P : Type u_3
inst✝ : CommSemiring P
m : ℕ
⊢ mk (↑m) 1 = ↑m
[PROOFSTEP]
simpa using @mk_algebraMap R _ M ℕ _ _ m
[GOAL]
R : Type u_1
inst✝⁴ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝³ : CommSemiring S
inst✝² : Algebra R S
P : Type u_3
inst✝¹ : CommSemiring P
inst✝ : IsLocalization M S
x : R
y : { x // x ∈ M }
⊢ ↑(algEquiv M S) (mk x y) = mk' S x y
[PROOFSTEP]
rw [mk_eq_mk', algEquiv_mk']
[GOAL]
R : Type u_1
inst✝⁴ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝³ : CommSemiring S
inst✝² : Algebra R S
P : Type u_3
inst✝¹ : CommSemiring P
inst✝ : IsLocalization M S
x : R
y : { x // x ∈ M }
⊢ ↑(AlgEquiv.symm (algEquiv M S)) (mk' S x y) = mk x y
[PROOFSTEP]
rw [mk_eq_mk', algEquiv_symm_mk']
[GOAL]
R : Type u_1
inst✝³ : CommRing R
M : Submonoid R
S : Type u_2
inst✝² : CommRing S
inst✝¹ : Algebra R S
P : Type u_3
inst✝ : CommRing P
z : Localization M
a b : R
c d : { x // x ∈ M }
h : ↑(r M) (a, c) (b, d)
⊢ ↑(r M) (-a, c) (-b, d)
[PROOFSTEP]
rw [r_eq_r'] at h ⊢
[GOAL]
R : Type u_1
inst✝³ : CommRing R
M : Submonoid R
S : Type u_2
inst✝² : CommRing S
inst✝¹ : Algebra R S
P : Type u_3
inst✝ : CommRing P
z : Localization M
a b : R
c d : { x // x ∈ M }
h : ↑(r' M) (a, c) (b, d)
⊢ ↑(r' M) (-a, c) (-b, d)
[PROOFSTEP]
cases' h with t ht
[GOAL]
case 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_3
inst✝ : CommRing P
z : Localization M
a b : R
c d t : { x // x ∈ M }
ht : ↑t * (↑(b, d).snd * (a, c).fst) = ↑t * (↑(a, c).snd * (b, d).fst)
⊢ ↑(r' M) (-a, c) (-b, d)
[PROOFSTEP]
use t
[GOAL]
case h
R : Type u_1
inst✝³ : CommRing R
M : Submonoid R
S : Type u_2
inst✝² : CommRing S
inst✝¹ : Algebra R S
P : Type u_3
inst✝ : CommRing P
z : Localization M
a b : R
c d t : { x // x ∈ M }
ht : ↑t * (↑(b, d).snd * (a, c).fst) = ↑t * (↑(a, c).snd * (b, d).fst)
⊢ ↑t * (↑(-b, d).snd * (-a, c).fst) = ↑t * (↑(-a, c).snd * (-b, d).fst)
[PROOFSTEP]
rw [mul_neg, mul_neg, ht]
[GOAL]
case h
R : Type u_1
inst✝³ : CommRing R
M : Submonoid R
S : Type u_2
inst✝² : CommRing S
inst✝¹ : Algebra R S
P : Type u_3
inst✝ : CommRing P
z : Localization M
a b : R
c d t : { x // x ∈ M }
ht : ↑t * (↑(b, d).snd * (a, c).fst) = ↑t * (↑(a, c).snd * (b, d).fst)
⊢ -(↑t * (↑(a, c).snd * (b, d).fst)) = ↑t * (↑(-a, c).snd * (-b, d).fst)
[PROOFSTEP]
ring_nf
[GOAL]
R : Type u_1
inst✝³ : CommRing R
M : Submonoid R
S : Type u_2
inst✝² : CommRing S
inst✝¹ : Algebra R S
P : Type u_3
inst✝ : CommRing P
a : R
b : { x // x ∈ M }
⊢ -mk a b = mk (-a) b
[PROOFSTEP]
show Localization.neg (mk a b) = mk (-a) b
[GOAL]
R : Type u_1
inst✝³ : CommRing R
M : Submonoid R
S : Type u_2
inst✝² : CommRing S
inst✝¹ : Algebra R S
P : Type u_3
inst✝ : CommRing P
a : R
b : { x // x ∈ M }
⊢ Localization.neg (mk a b) = mk (-a) b
[PROOFSTEP]
rw [Localization.neg_def]
[GOAL]
R : Type u_1
inst✝³ : CommRing R
M : Submonoid R
S : Type u_2
inst✝² : CommRing S
inst✝¹ : Algebra R S
P : Type u_3
inst✝ : CommRing P
a : R
b : { x // x ∈ M }
⊢ liftOn (mk a b) (fun a b => mk (-a) b)
      (_ : ∀ (a b : R) (c d : { x // x ∈ M }), ↑(r M) (a, c) (b, d) → mk (-a) c = mk (-b) d) =
    mk (-a) b
[PROOFSTEP]
apply liftOn_mk
[GOAL]
R : Type u_1
inst✝³ : CommRing R
M : Submonoid R
S : Type u_2
inst✝² : CommRing S
inst✝¹ : Algebra R S
P : Type u_3
inst✝ : CommRing P
src✝ : CommSemiring (Localization M) := inferInstanceAs (CommSemiring (Localization M))
x✝ : Localization M
x : R × { x // x ∈ M }
⊢ (fun x x_1 => x • x_1) 0 (mk x.fst x.snd) = 0
[PROOFSTEP]
simp only [smul_mk, zero_zsmul, mk_zero]
[GOAL]
R : Type u_1
inst✝³ : CommRing R
M : Submonoid R
S : Type u_2
inst✝² : CommRing S
inst✝¹ : Algebra R S
P : Type u_3
inst✝ : CommRing P
src✝ : CommSemiring (Localization M) := inferInstanceAs (CommSemiring (Localization M))
n : ℕ
x✝ : Localization M
x : R × { x // x ∈ M }
⊢ (fun x x_1 => x • x_1) (Int.ofNat (Nat.succ n)) (mk x.fst x.snd) =
    mk x.fst x.snd + (fun x x_1 => x • x_1) (Int.ofNat n) (mk x.fst x.snd)
[PROOFSTEP]
simp [smul_mk, add_mk_self, -mk_eq_monoidOf_mk', add_comm (n : ℤ) 1, add_smul]
[GOAL]
R : Type u_1
inst✝³ : CommRing R
M : Submonoid R
S : Type u_2
inst✝² : CommRing S
inst✝¹ : Algebra R S
P : Type u_3
inst✝ : CommRing P
src✝ : CommSemiring (Localization M) := inferInstanceAs (CommSemiring (Localization M))
n : ℕ
x✝ : Localization M
x : R × { x // x ∈ M }
⊢ (fun x x_1 => x • x_1) (Int.negSucc n) (mk x.fst x.snd) = -(fun x x_1 => x • x_1) (↑(Nat.succ n)) (mk x.fst x.snd)
[PROOFSTEP]
dsimp only
[GOAL]
R : Type u_1
inst✝³ : CommRing R
M : Submonoid R
S : Type u_2
inst✝² : CommRing S
inst✝¹ : Algebra R S
P : Type u_3
inst✝ : CommRing P
src✝ : CommSemiring (Localization M) := inferInstanceAs (CommSemiring (Localization M))
n : ℕ
x✝ : Localization M
x : R × { x // x ∈ M }
⊢ Int.negSucc n • mk x.fst x.snd = -(↑(Nat.succ n) • mk x.fst x.snd)
[PROOFSTEP]
rw [smul_mk, smul_mk, neg_mk, ← neg_smul]
[GOAL]
R : Type u_1
inst✝³ : CommRing R
M : Submonoid R
S : Type u_2
inst✝² : CommRing S
inst✝¹ : Algebra R S
P : Type u_3
inst✝ : CommRing P
src✝ : CommSemiring (Localization M) := inferInstanceAs (CommSemiring (Localization M))
n : ℕ
x✝ : Localization M
x : R × { x // x ∈ M }
⊢ mk (Int.negSucc n • x.fst) x.snd = mk (-↑(Nat.succ n) • x.fst) x.snd
[PROOFSTEP]
rfl
[GOAL]
R : Type u_1
inst✝³ : CommRing R
M : Submonoid R
S : Type u_2
inst✝² : CommRing S
inst✝¹ : Algebra R S
P : Type u_3
inst✝ : CommRing P
src✝ : CommSemiring (Localization M) := inferInstanceAs (CommSemiring (Localization M))
y : Localization M
⊢ ∀ (y : R × { x // x ∈ M }), -mk y.fst y.snd + mk y.fst y.snd = 0
[PROOFSTEP]
intros
[GOAL]
R : Type u_1
inst✝³ : CommRing R
M : Submonoid R
S : Type u_2
inst✝² : CommRing S
inst✝¹ : Algebra R S
P : Type u_3
inst✝ : CommRing P
src✝ : CommSemiring (Localization M) := inferInstanceAs (CommSemiring (Localization M))
y : Localization M
y✝ : R × { x // x ∈ M }
⊢ -mk y✝.fst y✝.snd + mk y✝.fst y✝.snd = 0
[PROOFSTEP]
simp only [add_mk, Localization.mk_mul, neg_mk, ← mk_zero 1]
[GOAL]
R : Type u_1
inst✝³ : CommRing R
M : Submonoid R
S : Type u_2
inst✝² : CommRing S
inst✝¹ : Algebra R S
P : Type u_3
inst✝ : CommRing P
src✝ : CommSemiring (Localization M) := inferInstanceAs (CommSemiring (Localization M))
y : Localization M
y✝ : R × { x // x ∈ M }
⊢ mk (↑y✝.snd * y✝.fst + ↑y✝.snd * -y✝.fst) (y✝.snd * y✝.snd) = mk 0 1
[PROOFSTEP]
refine' mk_eq_mk_iff.mpr (r_of_eq _)
[GOAL]
R : Type u_1
inst✝³ : CommRing R
M : Submonoid R
S : Type u_2
inst✝² : CommRing S
inst✝¹ : Algebra R S
P : Type u_3
inst✝ : CommRing P
src✝ : CommSemiring (Localization M) := inferInstanceAs (CommSemiring (Localization M))
y : Localization M
y✝ : R × { x // x ∈ M }
⊢ ↑(0, 1).snd * (↑y✝.snd * y✝.fst + ↑y✝.snd * -y✝.fst, y✝.snd * y✝.snd).fst =
    ↑(↑y✝.snd * y✝.fst + ↑y✝.snd * -y✝.fst, y✝.snd * y✝.snd).snd * (0, 1).fst
[PROOFSTEP]
simp only [Submonoid.coe_mul]
[GOAL]
R : Type u_1
inst✝³ : CommRing R
M : Submonoid R
S : Type u_2
inst✝² : CommRing S
inst✝¹ : Algebra R S
P : Type u_3
inst✝ : CommRing P
src✝ : CommSemiring (Localization M) := inferInstanceAs (CommSemiring (Localization M))
y : Localization M
y✝ : R × { x // x ∈ M }
⊢ ↑1 * (↑y✝.snd * y✝.fst + ↑y✝.snd * -y✝.fst) = ↑y✝.snd * ↑y✝.snd * 0
[PROOFSTEP]
ring
[GOAL]
R : Type u_1
inst✝³ : CommRing R
M : Submonoid R
S : Type u_2
inst✝² : CommRing S
inst✝¹ : Algebra R S
P : Type u_3
inst✝ : CommRing P
a c : R
b d : { x // x ∈ M }
⊢ mk a b + -mk c d = mk a b + mk (-c) d
[PROOFSTEP]
rw [neg_mk]
[GOAL]
R : Type u_1
inst✝³ : CommRing R
M : Submonoid R
S : Type u_2
inst✝² : CommRing S
inst✝¹ : Algebra R S
P : Type u_3
inst✝ : CommRing P
a c : R
b d : { x // x ∈ M }
⊢ mk (↑b * -c + ↑d * a) (b * d) = mk (↑d * a - ↑b * c) (b * d)
[PROOFSTEP]
congr
[GOAL]
case e_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_3
inst✝ : CommRing P
a c : R
b d : { x // x ∈ M }
⊢ ↑b * -c + ↑d * a = ↑d * a - ↑b * c
[PROOFSTEP]
ring
[GOAL]
R : Type u_1
inst✝³ : CommRing R
M : Submonoid R
S : Type u_2
inst✝² : CommRing S
inst✝¹ : Algebra R S
P : Type u_3
inst✝ : CommRing P
m : ℤ
⊢ mk (↑m) 1 = ↑m
[PROOFSTEP]
simpa using @mk_algebraMap R _ M ℤ _ _ m
[GOAL]
R : Type u_1
inst✝⁴ : CommRing R
M : Submonoid R
S : Type u_2
inst✝³ : CommRing S
inst✝² : Algebra R S
P : Type u_3
inst✝¹ : CommRing P
K : Type u_4
inst✝ : IsLocalization M S
x : R
hM : M ≤ nonZeroDivisors R
⊢ ↑(algebraMap R S) x = 0 ↔ x = 0
[PROOFSTEP]
rw [← (algebraMap R S).map_zero]
[GOAL]
R : Type u_1
inst✝⁴ : CommRing R
M : Submonoid R
S : Type u_2
inst✝³ : CommRing S
inst✝² : Algebra R S
P : Type u_3
inst✝¹ : CommRing P
K : Type u_4
inst✝ : IsLocalization M S
x : R
hM : M ≤ nonZeroDivisors R
⊢ ↑(algebraMap R S) x = ↑(algebraMap R S) 0 ↔ x = 0
[PROOFSTEP]
constructor
[GOAL]
case mp
R : Type u_1
inst✝⁴ : CommRing R
M : Submonoid R
S : Type u_2
inst✝³ : CommRing S
inst✝² : Algebra R S
P : Type u_3
inst✝¹ : CommRing P
K : Type u_4
inst✝ : IsLocalization M S
x : R
hM : M ≤ nonZeroDivisors R
⊢ ↑(algebraMap R S) x = ↑(algebraMap R S) 0 → x = 0
[PROOFSTEP]
intro h
[GOAL]
case mpr
R : Type u_1
inst✝⁴ : CommRing R
M : Submonoid R
S : Type u_2
inst✝³ : CommRing S
inst✝² : Algebra R S
P : Type u_3
inst✝¹ : CommRing P
K : Type u_4
inst✝ : IsLocalization M S
x : R
hM : M ≤ nonZeroDivisors R
⊢ x = 0 → ↑(algebraMap R S) x = ↑(algebraMap R S) 0
[PROOFSTEP]
intro h
[GOAL]
case mp
R : Type u_1
inst✝⁴ : CommRing R
M : Submonoid R
S : Type u_2
inst✝³ : CommRing S
inst✝² : Algebra R S
P : Type u_3
inst✝¹ : CommRing P
K : Type u_4
inst✝ : IsLocalization M S
x : R
hM : M ≤ nonZeroDivisors R
h : ↑(algebraMap R S) x = ↑(algebraMap R S) 0
⊢ x = 0
[PROOFSTEP]
cases' (eq_iff_exists M S).mp h with c hc
[GOAL]
case mp.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_3
inst✝¹ : CommRing P
K : Type u_4
inst✝ : IsLocalization M S
x : R
hM : M ≤ nonZeroDivisors R
h : ↑(algebraMap R S) x = ↑(algebraMap R S) 0
c : { x // x ∈ M }
hc : ↑c * x = ↑c * 0
⊢ x = 0
[PROOFSTEP]
rw [mul_zero, mul_comm] at hc
[GOAL]
case mp.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_3
inst✝¹ : CommRing P
K : Type u_4
inst✝ : IsLocalization M S
x : R
hM : M ≤ nonZeroDivisors R
h : ↑(algebraMap R S) x = ↑(algebraMap R S) 0
c : { x // x ∈ M }
hc : x * ↑c = 0
⊢ x = 0
[PROOFSTEP]
exact hM c.2 x hc
[GOAL]
case mpr
R : Type u_1
inst✝⁴ : CommRing R
M : Submonoid R
S : Type u_2
inst✝³ : CommRing S
inst✝² : Algebra R S
P : Type u_3
inst✝¹ : CommRing P
K : Type u_4
inst✝ : IsLocalization M S
x : R
hM : M ≤ nonZeroDivisors R
h : x = 0
⊢ ↑(algebraMap R S) x = ↑(algebraMap R S) 0
[PROOFSTEP]
rw [h]
[GOAL]
R : Type u_1
inst✝⁴ : CommRing R
M : Submonoid R
S : Type u_2
inst✝³ : CommRing S
inst✝² : Algebra R S
P : Type u_3
inst✝¹ : CommRing P
K : Type u_4
inst✝ : IsLocalization M S
hM : M ≤ nonZeroDivisors R
⊢ Injective ↑(algebraMap R S)
[PROOFSTEP]
rw [injective_iff_map_eq_zero (algebraMap R S)]
[GOAL]
R : Type u_1
inst✝⁴ : CommRing R
M : Submonoid R
S : Type u_2
inst✝³ : CommRing S
inst✝² : Algebra R S
P : Type u_3
inst✝¹ : CommRing P
K : Type u_4
inst✝ : IsLocalization M S
hM : M ≤ nonZeroDivisors R
⊢ ∀ (a : R), ↑(algebraMap R S) a = 0 → a = 0
[PROOFSTEP]
intro a ha
[GOAL]
R : Type u_1
inst✝⁴ : CommRing R
M : Submonoid R
S : Type u_2
inst✝³ : CommRing S
inst✝² : Algebra R S
P : Type u_3
inst✝¹ : CommRing P
K : Type u_4
inst✝ : IsLocalization M S
hM : M ≤ nonZeroDivisors R
a : R
ha : ↑(algebraMap R S) a = 0
⊢ a = 0
[PROOFSTEP]
rwa [to_map_eq_zero_iff S hM] at ha
[GOAL]
R : Type u_1
inst✝⁶ : CommRing R
M : Submonoid R
S : Type u_2
inst✝⁵ : CommRing S
inst✝⁴ : Algebra R S
P : Type u_3
inst✝³ : CommRing P
K : Type u_4
inst✝² : IsLocalization M S
inst✝¹ : Nontrivial R
inst✝ : NoZeroDivisors S
hM : M ≤ nonZeroDivisors R
x : S
hx : x ≠ 0
⊢ (sec M x).fst ≠ 0
[PROOFSTEP]
have hsec := sec_spec M x
[GOAL]
R : Type u_1
inst✝⁶ : CommRing R
M : Submonoid R
S : Type u_2
inst✝⁵ : CommRing S
inst✝⁴ : Algebra R S
P : Type u_3
inst✝³ : CommRing P
K : Type u_4
inst✝² : IsLocalization M S
inst✝¹ : Nontrivial R
inst✝ : NoZeroDivisors S
hM : M ≤ nonZeroDivisors R
x : S
hx : x ≠ 0
hsec : x * ↑(algebraMap R S) ↑(sec M x).snd = ↑(algebraMap R S) (sec M x).fst
⊢ (sec M x).fst ≠ 0
[PROOFSTEP]
intro hfst
[GOAL]
R : Type u_1
inst✝⁶ : CommRing R
M : Submonoid R
S : Type u_2
inst✝⁵ : CommRing S
inst✝⁴ : Algebra R S
P : Type u_3
inst✝³ : CommRing P
K : Type u_4
inst✝² : IsLocalization M S
inst✝¹ : Nontrivial R
inst✝ : NoZeroDivisors S
hM : M ≤ nonZeroDivisors R
x : S
hx : x ≠ 0
hsec : x * ↑(algebraMap R S) ↑(sec M x).snd = ↑(algebraMap R S) (sec M x).fst
hfst : (sec M x).fst = 0
⊢ False
[PROOFSTEP]
rw [hfst, map_zero, mul_eq_zero, _root_.map_eq_zero_iff] at hsec
[GOAL]
R : Type u_1
inst✝⁶ : CommRing R
M : Submonoid R
S : Type u_2
inst✝⁵ : CommRing S
inst✝⁴ : Algebra R S
P : Type u_3
inst✝³ : CommRing P
K : Type u_4
inst✝² : IsLocalization M S
inst✝¹ : Nontrivial R
inst✝ : NoZeroDivisors S
hM : M ≤ nonZeroDivisors R
x : S
hx : x ≠ 0
hsec : x = 0 ∨ ↑(sec M x).snd = 0
hfst : (sec M x).fst = 0
⊢ False
[PROOFSTEP]
exact Or.elim hsec hx (sec_snd_ne_zero hM x)
[GOAL]
case hf
R : Type u_1
inst✝⁶ : CommRing R
M : Submonoid R
S : Type u_2
inst✝⁵ : CommRing S
inst✝⁴ : Algebra R S
P : Type u_3
inst✝³ : CommRing P
K : Type u_4
inst✝² : IsLocalization M S
inst✝¹ : Nontrivial R
inst✝ : NoZeroDivisors S
hM : M ≤ nonZeroDivisors R
x : S
hx : x ≠ 0
hsec : x = 0 ∨ ↑(algebraMap R S) ↑(sec M x).snd = 0
hfst : (sec M x).fst = 0
⊢ Injective ↑(algebraMap R S)
[PROOFSTEP]
exact IsLocalization.injective S hM
[GOAL]
R : Type u_1
inst✝⁶ : CommRing R
M : Submonoid R
S : Type u_2
inst✝⁵ : CommRing S
inst✝⁴ : Algebra R S
P : Type u_3
inst✝³ : CommRing P
K : Type u_4
inst✝² : IsLocalization M S
Q : Type u_5
inst✝¹ : CommRing Q
g : R →+* P
inst✝ : Algebra P Q
hg : Injective ↑g
i : IsLocalization (Submonoid.map g M) Q
⊢ Injective ↑(map Q g (_ : M ≤ Submonoid.comap g (Submonoid.map g M)))
[PROOFSTEP]
rw [injective_iff_map_eq_zero]
[GOAL]
R : Type u_1
inst✝⁶ : CommRing R
M : Submonoid R
S : Type u_2
inst✝⁵ : CommRing S
inst✝⁴ : Algebra R S
P : Type u_3
inst✝³ : CommRing P
K : Type u_4
inst✝² : IsLocalization M S
Q : Type u_5
inst✝¹ : CommRing Q
g : R →+* P
inst✝ : Algebra P Q
hg : Injective ↑g
i : IsLocalization (Submonoid.map g M) Q
⊢ ∀ (a : S), ↑(map Q g (_ : M ≤ Submonoid.comap g (Submonoid.map g M))) a = 0 → a = 0
[PROOFSTEP]
intro z hz
[GOAL]
R : Type u_1
inst✝⁶ : CommRing R
M : Submonoid R
S : Type u_2
inst✝⁵ : CommRing S
inst✝⁴ : Algebra R S
P : Type u_3
inst✝³ : CommRing P
K : Type u_4
inst✝² : IsLocalization M S
Q : Type u_5
inst✝¹ : CommRing Q
g : R →+* P
inst✝ : Algebra P Q
hg : Injective ↑g
i : IsLocalization (Submonoid.map g M) Q
z : S
hz : ↑(map Q g (_ : M ≤ Submonoid.comap g (Submonoid.map g M))) z = 0
⊢ z = 0
[PROOFSTEP]
obtain ⟨a, b, rfl⟩ := mk'_surjective M z
[GOAL]
case 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_3
inst✝³ : CommRing P
K : Type u_4
inst✝² : IsLocalization M S
Q : Type u_5
inst✝¹ : CommRing Q
g : R →+* P
inst✝ : Algebra P Q
hg : Injective ↑g
i : IsLocalization (Submonoid.map g M) Q
a : R
b : { x // x ∈ M }
hz : ↑(map Q g (_ : M ≤ Submonoid.comap g (Submonoid.map g M))) (mk' S a b) = 0
⊢ mk' S a b = 0
[PROOFSTEP]
rw [map_mk', mk'_eq_zero_iff] at hz
[GOAL]
case 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_3
inst✝³ : CommRing P
K : Type u_4
inst✝² : IsLocalization M S
Q : Type u_5
inst✝¹ : CommRing Q
g : R →+* P
inst✝ : Algebra P Q
hg : Injective ↑g
i : IsLocalization (Submonoid.map g M) Q
a : R
b : { x // x ∈ M }
hz : ∃ m, ↑m * ↑g a = 0
⊢ mk' S a b = 0
[PROOFSTEP]
obtain ⟨⟨m', hm'⟩, hm⟩ := hz
[GOAL]
case intro.intro.intro.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_3
inst✝³ : CommRing P
K : Type u_4
inst✝² : IsLocalization M S
Q : Type u_5
inst✝¹ : CommRing Q
g : R →+* P
inst✝ : Algebra P Q
hg : Injective ↑g
i : IsLocalization (Submonoid.map g M) Q
a : R
b : { x // x ∈ M }
m' : P
hm' : m' ∈ Submonoid.map g M
hm : ↑{ val := m', property := hm' } * ↑g a = 0
⊢ mk' S a b = 0
[PROOFSTEP]
rw [Submonoid.mem_map] at hm'
[GOAL]
case intro.intro.intro.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_3
inst✝³ : CommRing P
K : Type u_4
inst✝² : IsLocalization M S
Q : Type u_5
inst✝¹ : CommRing Q
g : R →+* P
inst✝ : Algebra P Q
hg : Injective ↑g
i : IsLocalization (Submonoid.map g M) Q
a : R
b : { x // x ∈ M }
m' : P
hm'✝ : m' ∈ Submonoid.map g M
hm' : ∃ x, x ∈ M ∧ ↑g x = m'
hm : ↑{ val := m', property := hm'✝ } * ↑g a = 0
⊢ mk' S a b = 0
[PROOFSTEP]
obtain ⟨n, hn, hnm⟩ := hm'
[GOAL]
case intro.intro.intro.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_3
inst✝³ : CommRing P
K : Type u_4
inst✝² : IsLocalization M S
Q : Type u_5
inst✝¹ : CommRing Q
g : R →+* P
inst✝ : Algebra P Q
hg : Injective ↑g
i : IsLocalization (Submonoid.map g M) Q
a : R
b : { x // x ∈ M }
m' : P
hm' : m' ∈ Submonoid.map g M
hm : ↑{ val := m', property := hm' } * ↑g a = 0
n : R
hn : n ∈ M
hnm : ↑g n = m'
⊢ mk' S a b = 0
[PROOFSTEP]
rw [Subtype.coe_mk, ← hnm, ← map_mul, ← map_zero g] at hm
[GOAL]
case intro.intro.intro.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_3
inst✝³ : CommRing P
K : Type u_4
inst✝² : IsLocalization M S
Q : Type u_5
inst✝¹ : CommRing Q
g : R →+* P
inst✝ : Algebra P Q
hg : Injective ↑g
i : IsLocalization (Submonoid.map g M) Q
a : R
b : { x // x ∈ M }
m' : P
hm' : m' ∈ Submonoid.map g M
n : R
hm : ↑g (n * a) = ↑g 0
hn : n ∈ M
hnm : ↑g n = m'
⊢ mk' S a b = 0
[PROOFSTEP]
rw [mk'_eq_zero_iff]
[GOAL]
case intro.intro.intro.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_3
inst✝³ : CommRing P
K : Type u_4
inst✝² : IsLocalization M S
Q : Type u_5
inst✝¹ : CommRing Q
g : R →+* P
inst✝ : Algebra P Q
hg : Injective ↑g
i : IsLocalization (Submonoid.map g M) Q
a : R
b : { x // x ∈ M }
m' : P
hm' : m' ∈ Submonoid.map g M
n : R
hm : ↑g (n * a) = ↑g 0
hn : n ∈ M
hnm : ↑g n = m'
⊢ ∃ m, ↑m * a = 0
[PROOFSTEP]
exact ⟨⟨n, hn⟩, hg hm⟩
[GOAL]
R : Type u_1
inst✝¹⁰ : CommRing R
M✝ : Submonoid R
S : Type u_2
inst✝⁹ : CommRing S
inst✝⁸ : Algebra R S
P : Type u_3
inst✝⁷ : CommRing P
K : Type u_4
inst✝⁶ : IsLocalization M✝ S
Q : Type u_5
inst✝⁵ : CommRing Q
g : R →+* P
inst✝⁴ : Algebra P Q
A : Type u_6
inst✝³ : CommRing A
inst✝² : IsDomain A
inst✝¹ : Algebra A S
M : Submonoid A
inst✝ : IsLocalization M S
hM : M ≤ nonZeroDivisors A
⊢ ∀ {a b : S}, a * b = 0 → a = 0 ∨ b = 0
[PROOFSTEP]
intro z w h
[GOAL]
R : Type u_1
inst✝¹⁰ : CommRing R
M✝ : Submonoid R
S : Type u_2
inst✝⁹ : CommRing S
inst✝⁸ : Algebra R S
P : Type u_3
inst✝⁷ : CommRing P
K : Type u_4
inst✝⁶ : IsLocalization M✝ S
Q : Type u_5
inst✝⁵ : CommRing Q
g : R →+* P
inst✝⁴ : Algebra P Q
A : Type u_6
inst✝³ : CommRing A
inst✝² : IsDomain A
inst✝¹ : Algebra A S
M : Submonoid A
inst✝ : IsLocalization M S
hM : M ≤ nonZeroDivisors A
z w : S
h : z * w = 0
⊢ z = 0 ∨ w = 0
[PROOFSTEP]
cases' surj M z with x hx
[GOAL]
case 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_3
inst✝⁷ : CommRing P
K : Type u_4
inst✝⁶ : IsLocalization M✝ S
Q : Type u_5
inst✝⁵ : CommRing Q
g : R →+* P
inst✝⁴ : Algebra P Q
A : Type u_6
inst✝³ : CommRing A
inst✝² : IsDomain A
inst✝¹ : Algebra A S
M : Submonoid A
inst✝ : IsLocalization M S
hM : M ≤ nonZeroDivisors A
z w : S
h : z * w = 0
x : A × { x // x ∈ M }
hx : z * ↑(algebraMap A S) ↑x.snd = ↑(algebraMap A S) x.fst
⊢ z = 0 ∨ w = 0
[PROOFSTEP]
cases' surj M w with y hy
[GOAL]
case 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_3
inst✝⁷ : CommRing P
K : Type u_4
inst✝⁶ : IsLocalization M✝ S
Q : Type u_5
inst✝⁵ : CommRing Q
g : R →+* P
inst✝⁴ : Algebra P Q
A : Type u_6
inst✝³ : CommRing A
inst✝² : IsDomain A
inst✝¹ : Algebra A S
M : Submonoid A
inst✝ : IsLocalization M S
hM : M ≤ nonZeroDivisors A
z w : S
h : z * w = 0
x : A × { x // x ∈ M }
hx : z * ↑(algebraMap A S) ↑x.snd = ↑(algebraMap A S) x.fst
y : A × { x // x ∈ M }
hy : w * ↑(algebraMap A S) ↑y.snd = ↑(algebraMap A S) y.fst
⊢ z = 0 ∨ w = 0
[PROOFSTEP]
have : z * w * algebraMap A S y.2 * algebraMap A S x.2 = algebraMap A S x.1 * algebraMap A S y.1 := by
  rw [mul_assoc z, hy, ← hx]; ring
[GOAL]
R : Type u_1
inst✝¹⁰ : CommRing R
M✝ : Submonoid R
S : Type u_2
inst✝⁹ : CommRing S
inst✝⁸ : Algebra R S
P : Type u_3
inst✝⁷ : CommRing P
K : Type u_4
inst✝⁶ : IsLocalization M✝ S
Q : Type u_5
inst✝⁵ : CommRing Q
g : R →+* P
inst✝⁴ : Algebra P Q
A : Type u_6
inst✝³ : CommRing A
inst✝² : IsDomain A
inst✝¹ : Algebra A S
M : Submonoid A
inst✝ : IsLocalization M S
hM : M ≤ nonZeroDivisors A
z w : S
h : z * w = 0
x : A × { x // x ∈ M }
hx : z * ↑(algebraMap A S) ↑x.snd = ↑(algebraMap A S) x.fst
y : A × { x // x ∈ M }
hy : w * ↑(algebraMap A S) ↑y.snd = ↑(algebraMap A S) y.fst
⊢ z * w * ↑(algebraMap A S) ↑y.snd * ↑(algebraMap A S) ↑x.snd = ↑(algebraMap A S) x.fst * ↑(algebraMap A S) y.fst
[PROOFSTEP]
rw [mul_assoc z, hy, ← hx]
[GOAL]
R : Type u_1
inst✝¹⁰ : CommRing R
M✝ : Submonoid R
S : Type u_2
inst✝⁹ : CommRing S
inst✝⁸ : Algebra R S
P : Type u_3
inst✝⁷ : CommRing P
K : Type u_4
inst✝⁶ : IsLocalization M✝ S
Q : Type u_5
inst✝⁵ : CommRing Q
g : R →+* P
inst✝⁴ : Algebra P Q
A : Type u_6
inst✝³ : CommRing A
inst✝² : IsDomain A
inst✝¹ : Algebra A S
M : Submonoid A
inst✝ : IsLocalization M S
hM : M ≤ nonZeroDivisors A
z w : S
h : z * w = 0
x : A × { x // x ∈ M }
hx : z * ↑(algebraMap A S) ↑x.snd = ↑(algebraMap A S) x.fst
y : A × { x // x ∈ M }
hy : w * ↑(algebraMap A S) ↑y.snd = ↑(algebraMap A S) y.fst
⊢ z * ↑(algebraMap A S) y.fst * ↑(algebraMap A S) ↑x.snd = z * ↑(algebraMap A S) ↑x.snd * ↑(algebraMap A S) y.fst
[PROOFSTEP]
ring
[GOAL]
case 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_3
inst✝⁷ : CommRing P
K : Type u_4
inst✝⁶ : IsLocalization M✝ S
Q : Type u_5
inst✝⁵ : CommRing Q
g : R →+* P
inst✝⁴ : Algebra P Q
A : Type u_6
inst✝³ : CommRing A
inst✝² : IsDomain A
inst✝¹ : Algebra A S
M : Submonoid A
inst✝ : IsLocalization M S
hM : M ≤ nonZeroDivisors A
z w : S
h : z * w = 0
x : A × { x // x ∈ M }
hx : z * ↑(algebraMap A S) ↑x.snd = ↑(algebraMap A S) x.fst
y : A × { x // x ∈ M }
hy : w * ↑(algebraMap A S) ↑y.snd = ↑(algebraMap A S) y.fst
this : z * w * ↑(algebraMap A S) ↑y.snd * ↑(algebraMap A S) ↑x.snd = ↑(algebraMap A S) x.fst * ↑(algebraMap A S) y.fst
⊢ z = 0 ∨ w = 0
[PROOFSTEP]
rw [h, zero_mul, zero_mul, ← (algebraMap A S).map_mul] at this
[GOAL]
case 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_3
inst✝⁷ : CommRing P
K : Type u_4
inst✝⁶ : IsLocalization M✝ S
Q : Type u_5
inst✝⁵ : CommRing Q
g : R →+* P
inst✝⁴ : Algebra P Q
A : Type u_6
inst✝³ : CommRing A
inst✝² : IsDomain A
inst✝¹ : Algebra A S
M : Submonoid A
inst✝ : IsLocalization M S
hM : M ≤ nonZeroDivisors A
z w : S
h : z * w = 0
x : A × { x // x ∈ M }
hx : z * ↑(algebraMap A S) ↑x.snd = ↑(algebraMap A S) x.fst
y : A × { x // x ∈ M }
hy : w * ↑(algebraMap A S) ↑y.snd = ↑(algebraMap A S) y.fst
this : 0 = ↑(algebraMap A S) (x.fst * y.fst)
⊢ z = 0 ∨ w = 0
[PROOFSTEP]
cases' eq_zero_or_eq_zero_of_mul_eq_zero ((to_map_eq_zero_iff S hM).mp this.symm) with H H
[GOAL]
case intro.intro.inl
R : Type u_1
inst✝¹⁰ : CommRing R
M✝ : Submonoid R
S : Type u_2
inst✝⁹ : CommRing S
inst✝⁸ : Algebra R S
P : Type u_3
inst✝⁷ : CommRing P
K : Type u_4
inst✝⁶ : IsLocalization M✝ S
Q : Type u_5
inst✝⁵ : CommRing Q
g : R →+* P
inst✝⁴ : Algebra P Q
A : Type u_6
inst✝³ : CommRing A
inst✝² : IsDomain A
inst✝¹ : Algebra A S
M : Submonoid A
inst✝ : IsLocalization M S
hM : M ≤ nonZeroDivisors A
z w : S
h : z * w = 0
x : A × { x // x ∈ M }
hx : z * ↑(algebraMap A S) ↑x.snd = ↑(algebraMap A S) x.fst
y : A × { x // x ∈ M }
hy : w * ↑(algebraMap A S) ↑y.snd = ↑(algebraMap A S) y.fst
this : 0 = ↑(algebraMap A S) (x.fst * y.fst)
H : x.fst = 0
⊢ z = 0 ∨ w = 0
[PROOFSTEP]
exact Or.inl (eq_zero_of_fst_eq_zero hx H)
[GOAL]
case intro.intro.inr
R : Type u_1
inst✝¹⁰ : CommRing R
M✝ : Submonoid R
S : Type u_2
inst✝⁹ : CommRing S
inst✝⁸ : Algebra R S
P : Type u_3
inst✝⁷ : CommRing P
K : Type u_4
inst✝⁶ : IsLocalization M✝ S
Q : Type u_5
inst✝⁵ : CommRing Q
g : R →+* P
inst✝⁴ : Algebra P Q
A : Type u_6
inst✝³ : CommRing A
inst✝² : IsDomain A
inst✝¹ : Algebra A S
M : Submonoid A
inst✝ : IsLocalization M S
hM : M ≤ nonZeroDivisors A
z w : S
h : z * w = 0
x : A × { x // x ∈ M }
hx : z * ↑(algebraMap A S) ↑x.snd = ↑(algebraMap A S) x.fst
y : A × { x // x ∈ M }
hy : w * ↑(algebraMap A S) ↑y.snd = ↑(algebraMap A S) y.fst
this : 0 = ↑(algebraMap A S) (x.fst * y.fst)
H : y.fst = 0
⊢ z = 0 ∨ w = 0
[PROOFSTEP]
exact Or.inr (eq_zero_of_fst_eq_zero hy H)
[GOAL]
R : Type u_1
inst✝¹⁰ : CommRing R
M✝ : Submonoid R
S : Type u_2
inst✝⁹ : CommRing S
inst✝⁸ : Algebra R S
P : Type u_3
inst✝⁷ : CommRing P
K : Type u_4
inst✝⁶ : IsLocalization M✝ S
Q : Type u_5
inst✝⁵ : CommRing Q
g : R →+* P
inst✝⁴ : Algebra P Q
A : Type u_6
inst✝³ : CommRing A
inst✝² : IsDomain A
inst✝¹ : Algebra A S
M : Submonoid A
inst✝ : IsLocalization M S
hM : M ≤ nonZeroDivisors A
⊢ IsDomain S
[PROOFSTEP]
apply @NoZeroDivisors.to_isDomain _ _ (id _) (id _)
[GOAL]
R : Type u_1
inst✝¹⁰ : CommRing R
M✝ : Submonoid R
S : Type u_2
inst✝⁹ : CommRing S
inst✝⁸ : Algebra R S
P : Type u_3
inst✝⁷ : CommRing P
K : Type u_4
inst✝⁶ : IsLocalization M✝ S
Q : Type u_5
inst✝⁵ : CommRing Q
g : R →+* P
inst✝⁴ : Algebra P Q
A : Type u_6
inst✝³ : CommRing A
inst✝² : IsDomain A
inst✝¹ : Algebra A S
M : Submonoid A
inst✝ : IsLocalization M S
hM : M ≤ nonZeroDivisors A
⊢ Nontrivial S
[PROOFSTEP]
exact ⟨⟨(algebraMap A S) 0, (algebraMap A S) 1, fun h => zero_ne_one (IsLocalization.injective S hM h)⟩⟩
[GOAL]
R : Type u_1
inst✝¹⁰ : CommRing R
M✝ : Submonoid R
S : Type u_2
inst✝⁹ : CommRing S
inst✝⁸ : Algebra R S
P : Type u_3
inst✝⁷ : CommRing P
K : Type u_4
inst✝⁶ : IsLocalization M✝ S
Q : Type u_5
inst✝⁵ : CommRing Q
g : R →+* P
inst✝⁴ : Algebra P Q
A : Type u_6
inst✝³ : CommRing A
inst✝² : IsDomain A
inst✝¹ : Algebra A S
M : Submonoid A
inst✝ : IsLocalization M S
hM : M ≤ nonZeroDivisors A
⊢ NoZeroDivisors S
[PROOFSTEP]
exact noZeroDivisors_of_le_nonZeroDivisors _ hM
[GOAL]
R✝ : Type u_1
inst✝⁷ : CommRing R✝
M✝ : Submonoid R✝
S : Type u_2
inst✝⁶ : CommRing S
inst✝⁵ : Algebra R✝ S
P : Type u_3
inst✝⁴ : CommRing P
R : Type u_4
Rₘ : Type u_5
inst✝³ : CommRing R
inst✝² : CommRing Rₘ
M : Submonoid R
hM : ¬0 ∈ M
hR : IsField R
inst✝¹ : Algebra R Rₘ
inst✝ : IsLocalization M Rₘ
⊢ Bijective ↑(algebraMap R Rₘ)
[PROOFSTEP]
letI := hR.toField
[GOAL]
R✝ : Type u_1
inst✝⁷ : CommRing R✝
M✝ : Submonoid R✝
S : Type u_2
inst✝⁶ : CommRing S
inst✝⁵ : Algebra R✝ S
P : Type u_3
inst✝⁴ : CommRing P
R : Type u_4
Rₘ : Type u_5
inst✝³ : CommRing R
inst✝² : CommRing Rₘ
M : Submonoid R
hM : ¬0 ∈ M
hR : IsField R
inst✝¹ : Algebra R Rₘ
inst✝ : IsLocalization M Rₘ
this : Field R := toField hR
⊢ Bijective ↑(algebraMap R Rₘ)
[PROOFSTEP]
replace hM := le_nonZeroDivisors_of_noZeroDivisors hM
[GOAL]
R✝ : Type u_1
inst✝⁷ : CommRing R✝
M✝ : Submonoid R✝
S : Type u_2
inst✝⁶ : CommRing S
inst✝⁵ : Algebra R✝ S
P : Type u_3
inst✝⁴ : CommRing P
R : Type u_4
Rₘ : Type u_5
inst✝³ : CommRing R
inst✝² : CommRing Rₘ
M : Submonoid R
hR : IsField R
inst✝¹ : Algebra R Rₘ
inst✝ : IsLocalization M Rₘ
this : Field R := toField hR
hM : M ≤ nonZeroDivisors R
⊢ Bijective ↑(algebraMap R Rₘ)
[PROOFSTEP]
refine' ⟨IsLocalization.injective _ hM, fun x => _⟩
[GOAL]
R✝ : Type u_1
inst✝⁷ : CommRing R✝
M✝ : Submonoid R✝
S : Type u_2
inst✝⁶ : CommRing S
inst✝⁵ : Algebra R✝ S
P : Type u_3
inst✝⁴ : CommRing P
R : Type u_4
Rₘ : Type u_5
inst✝³ : CommRing R
inst✝² : CommRing Rₘ
M : Submonoid R
hR : IsField R
inst✝¹ : Algebra R Rₘ
inst✝ : IsLocalization M Rₘ
this : Field R := toField hR
hM : M ≤ nonZeroDivisors R
x : Rₘ
⊢ ∃ a, ↑(algebraMap R Rₘ) a = x
[PROOFSTEP]
obtain ⟨r, ⟨m, hm⟩, rfl⟩ := mk'_surjective M x
[GOAL]
case intro.intro.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_3
inst✝⁴ : CommRing P
R : Type u_4
Rₘ : Type u_5
inst✝³ : CommRing R
inst✝² : CommRing Rₘ
M : Submonoid R
hR : IsField R
inst✝¹ : Algebra R Rₘ
inst✝ : IsLocalization M Rₘ
this : Field R := toField hR
hM : M ≤ nonZeroDivisors R
r m : R
hm : m ∈ M
⊢ ∃ a, ↑(algebraMap R Rₘ) a = mk' Rₘ r { val := m, property := hm }
[PROOFSTEP]
obtain ⟨n, hn⟩ := hR.mul_inv_cancel (nonZeroDivisors.ne_zero <| hM hm)
[GOAL]
case intro.intro.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_3
inst✝⁴ : CommRing P
R : Type u_4
Rₘ : Type u_5
inst✝³ : CommRing R
inst✝² : CommRing Rₘ
M : Submonoid R
hR : IsField R
inst✝¹ : Algebra R Rₘ
inst✝ : IsLocalization M Rₘ
this : Field R := toField hR
hM : M ≤ nonZeroDivisors R
r m : R
hm : m ∈ M
n : R
hn : m * n = 1
⊢ ∃ a, ↑(algebraMap R Rₘ) a = mk' Rₘ r { val := m, property := hm }
[PROOFSTEP]
exact ⟨r * n, by erw [eq_mk'_iff_mul_eq, ← map_mul, mul_assoc, _root_.mul_comm n, hn, mul_one]⟩
[GOAL]
R✝ : Type u_1
inst✝⁷ : CommRing R✝
M✝ : Submonoid R✝
S : Type u_2
inst✝⁶ : CommRing S
inst✝⁵ : Algebra R✝ S
P : Type u_3
inst✝⁴ : CommRing P
R : Type u_4
Rₘ : Type u_5
inst✝³ : CommRing R
inst✝² : CommRing Rₘ
M : Submonoid R
hR : IsField R
inst✝¹ : Algebra R Rₘ
inst✝ : IsLocalization M Rₘ
this : Field R := toField hR
hM : M ≤ nonZeroDivisors R
r m : R
hm : m ∈ M
n : R
hn : m * n = 1
⊢ ↑(algebraMap R Rₘ) (r * n) = mk' Rₘ r { val := m, property := hm }
[PROOFSTEP]
erw [eq_mk'_iff_mul_eq, ← map_mul, mul_assoc, _root_.mul_comm n, hn, mul_one]
[GOAL]
R : Type u_1
inst✝¹² : CommRing R
M : Submonoid R
S : Type u_2
inst✝¹¹ : CommRing S
inst✝¹⁰ : Algebra R S
P : Type u_3
inst✝⁹ : CommRing P
Rₘ : Type u_4
Sₘ : Type u_5
inst✝⁸ : CommRing Rₘ
inst✝⁷ : CommRing Sₘ
inst✝⁶ : Algebra R Rₘ
inst✝⁵ : IsLocalization M Rₘ
inst✝⁴ : Algebra S Sₘ
i : IsLocalization (Algebra.algebraMapSubmonoid S M) Sₘ
inst✝³ : Algebra Rₘ Sₘ
inst✝² : Algebra R Sₘ
inst✝¹ : IsScalarTower R Rₘ Sₘ
inst✝ : IsScalarTower R S Sₘ
y : { x // x ∈ M }
⊢ IsUnit (↑(algebraMap R Sₘ) ↑y)
[PROOFSTEP]
rw [IsScalarTower.algebraMap_apply _ S]
[GOAL]
R : Type u_1
inst✝¹² : CommRing R
M : Submonoid R
S : Type u_2
inst✝¹¹ : CommRing S
inst✝¹⁰ : Algebra R S
P : Type u_3
inst✝⁹ : CommRing P
Rₘ : Type u_4
Sₘ : Type u_5
inst✝⁸ : CommRing Rₘ
inst✝⁷ : CommRing Sₘ
inst✝⁶ : Algebra R Rₘ
inst✝⁵ : IsLocalization M Rₘ
inst✝⁴ : Algebra S Sₘ
i : IsLocalization (Algebra.algebraMapSubmonoid S M) Sₘ
inst✝³ : Algebra Rₘ Sₘ
inst✝² : Algebra R Sₘ
inst✝¹ : IsScalarTower R Rₘ Sₘ
inst✝ : IsScalarTower R S Sₘ
y : { x // x ∈ M }
⊢ IsUnit (↑(algebraMap S Sₘ) (↑(algebraMap R S) ↑y))
[PROOFSTEP]
exact IsLocalization.map_units Sₘ ⟨algebraMap R S y, Algebra.mem_algebraMapSubmonoid_of_mem y⟩
[GOAL]
R : Type u_1
inst✝¹² : CommRing R
M : Submonoid R
S : Type u_2
inst✝¹¹ : CommRing S
inst✝¹⁰ : Algebra R S
P : Type u_3
inst✝⁹ : CommRing P
Rₘ : Type u_4
Sₘ : Type u_5
inst✝⁸ : CommRing Rₘ
inst✝⁷ : CommRing Sₘ
inst✝⁶ : Algebra R Rₘ
inst✝⁵ : IsLocalization M Rₘ
inst✝⁴ : Algebra S Sₘ
i : IsLocalization (Algebra.algebraMapSubmonoid S M) Sₘ
inst✝³ : Algebra Rₘ Sₘ
inst✝² : Algebra R Sₘ
inst✝¹ : IsScalarTower R Rₘ Sₘ
inst✝ : IsScalarTower R S Sₘ
x : R
y : { x // x ∈ M }
⊢ ↑(algebraMap Rₘ Sₘ) (mk' Rₘ x y) =
    mk' Sₘ (↑(algebraMap R S) x)
      { val := ↑(algebraMap R S) ↑y, property := (_ : ↑(algebraMap R S) ↑y ∈ Algebra.algebraMapSubmonoid S M) }
[PROOFSTEP]
rw [IsLocalization.eq_mk'_iff_mul_eq, Subtype.coe_mk, ← IsScalarTower.algebraMap_apply, ←
  IsScalarTower.algebraMap_apply, IsScalarTower.algebraMap_apply R Rₘ Sₘ, IsScalarTower.algebraMap_apply R Rₘ Sₘ, ←
  _root_.map_mul, mul_comm, IsLocalization.mul_mk'_eq_mk'_of_mul]
[GOAL]
R : Type u_1
inst✝¹² : CommRing R
M : Submonoid R
S : Type u_2
inst✝¹¹ : CommRing S
inst✝¹⁰ : Algebra R S
P : Type u_3
inst✝⁹ : CommRing P
Rₘ : Type u_4
Sₘ : Type u_5
inst✝⁸ : CommRing Rₘ
inst✝⁷ : CommRing Sₘ
inst✝⁶ : Algebra R Rₘ
inst✝⁵ : IsLocalization M Rₘ
inst✝⁴ : Algebra S Sₘ
i : IsLocalization (Algebra.algebraMapSubmonoid S M) Sₘ
inst✝³ : Algebra Rₘ Sₘ
inst✝² : Algebra R Sₘ
inst✝¹ : IsScalarTower R Rₘ Sₘ
inst✝ : IsScalarTower R S Sₘ
x : R
y : { x // x ∈ M }
⊢ ↑(algebraMap Rₘ Sₘ) (mk' Rₘ (↑y * x) y) = ↑(algebraMap Rₘ Sₘ) (↑(algebraMap R Rₘ) x)
[PROOFSTEP]
exact congr_arg (algebraMap Rₘ Sₘ) (IsLocalization.mk'_mul_cancel_left x y)
[GOAL]
R : Type u_1
inst✝¹² : CommRing R
M : Submonoid R
S : Type u_2
inst✝¹¹ : CommRing S
inst✝¹⁰ : Algebra R S
P : Type u_3
inst✝⁹ : CommRing P
Rₘ : Type u_4
Sₘ : Type u_5
inst✝⁸ : CommRing Rₘ
inst✝⁷ : CommRing Sₘ
inst✝⁶ : Algebra R Rₘ
inst✝⁵ : IsLocalization M Rₘ
inst✝⁴ : Algebra S Sₘ
i : IsLocalization (Algebra.algebraMapSubmonoid S M) Sₘ
inst✝³ : Algebra Rₘ Sₘ
inst✝² : Algebra R Sₘ
inst✝¹ : IsScalarTower R Rₘ Sₘ
inst✝ : IsScalarTower R S Sₘ
x : R
⊢ ↑(algebraMap Rₘ Sₘ) (↑(algebraMap R Rₘ) x) = ↑(algebraMap S Sₘ) (↑(algebraMap R S) x)
[PROOFSTEP]
rw [← IsScalarTower.algebraMap_apply R S Sₘ, ← IsScalarTower.algebraMap_apply R Rₘ Sₘ]