Theorem: IsLocalization.localization_localization_eq_iff_exists
File: Mathlib/RingTheory/Localization/LocalizationLocalization.lean

tactic: rw [IsScalarTower.algebraMap_apply R S T, IsScalarTower.algebraMap_apply R S T,
  IsLocalization.eq_iff_exists N T]
state_before: R : Type u_3
inst✝⁹ : CommRing R
M : Submonoid R
S : Type u_1
inst✝⁸ : CommRing S
inst✝⁷ : Algebra R S
P : Type ?u.134353
inst✝⁶ : CommRing P
N : Submonoid S
T : Type u_2
inst✝⁵ : CommRing T
inst✝⁴ : Algebra R T
inst✝³ : Algebra S T
inst✝² : IsScalarTower R S T
inst✝¹ : IsLocalization M S
inst✝ : IsLocalization N T
x y : R
⊢ ↑(algebraMap R T) x = ↑(algebraMap R T) y ↔ ∃ c, ↑c * x = ↑c * y

tactic: constructor
state_before: R : Type u_3
inst✝⁹ : CommRing R
M : Submonoid R
S : Type u_1
inst✝⁸ : CommRing S
inst✝⁷ : Algebra R S
P : Type ?u.134353
inst✝⁶ : CommRing P
N : Submonoid S
T : Type u_2
inst✝⁵ : CommRing T
inst✝⁴ : Algebra R T
inst✝³ : Algebra S T
inst✝² : IsScalarTower R S T
inst✝¹ : IsLocalization M S
inst✝ : IsLocalization N T
x y : R
⊢ (∃ c, ↑c * ↑(algebraMap R S) x = ↑c * ↑(algebraMap R S) y) ↔ ∃ c, ↑c * x = ↑c * y

tactic: rintro ⟨z, eq₁⟩
state_before: case mp
R : Type u_3
inst✝⁹ : CommRing R
M : Submonoid R
S : Type u_1
inst✝⁸ : CommRing S
inst✝⁷ : Algebra R S
P : Type ?u.134353
inst✝⁶ : CommRing P
N : Submonoid S
T : Type u_2
inst✝⁵ : CommRing T
inst✝⁴ : Algebra R T
inst✝³ : Algebra S T
inst✝² : IsScalarTower R S T
inst✝¹ : IsLocalization M S
inst✝ : IsLocalization N T
x y : R
⊢ (∃ c, ↑c * ↑(algebraMap R S) x = ↑c * ↑(algebraMap R S) y) → ∃ c, ↑c * x = ↑c * y

tactic: rcases IsLocalization.surj M (z : S) with ⟨⟨z', s⟩, eq₂⟩
state_before: case mp.intro
R : Type u_3
inst✝⁹ : CommRing R
M : Submonoid R
S : Type u_1
inst✝⁸ : CommRing S
inst✝⁷ : Algebra R S
P : Type ?u.134353
inst✝⁶ : CommRing P
N : Submonoid S
T : Type u_2
inst✝⁵ : CommRing T
inst✝⁴ : Algebra R T
inst✝³ : Algebra S T
inst✝² : IsScalarTower R S T
inst✝¹ : IsLocalization M S
inst✝ : IsLocalization N T
x y : R
z : { x // x ∈ N }
eq₁ : ↑z * ↑(algebraMap R S) x = ↑z * ↑(algebraMap R S) y
⊢ ∃ c, ↑c * x = ↑c * y

tactic: dsimp only at eq₂
state_before: case mp.intro.intro.mk
R : Type u_3
inst✝⁹ : CommRing R
M : Submonoid R
S : Type u_1
inst✝⁸ : CommRing S
inst✝⁷ : Algebra R S
P : Type ?u.134353
inst✝⁶ : CommRing P
N : Submonoid S
T : Type u_2
inst✝⁵ : CommRing T
inst✝⁴ : Algebra R T
inst✝³ : Algebra S T
inst✝² : IsScalarTower R S T
inst✝¹ : IsLocalization M S
inst✝ : IsLocalization N T
x y : R
z : { x // x ∈ N }
eq₁ : ↑z * ↑(algebraMap R S) x = ↑z * ↑(algebraMap R S) y
z' : R
s : { x // x ∈ M }
eq₂ : ↑z * ↑(algebraMap R S) ↑(z', s).snd = ↑(algebraMap R S) (z', s).fst
⊢ ∃ c, ↑c * x = ↑c * y

tactic: suffices : (algebraMap R S) (x * z' : R) = (algebraMap R S) (y * z')
state_before: case mp.intro.intro.mk
R : Type u_3
inst✝⁹ : CommRing R
M : Submonoid R
S : Type u_1
inst✝⁸ : CommRing S
inst✝⁷ : Algebra R S
P : Type ?u.134353
inst✝⁶ : CommRing P
N : Submonoid S
T : Type u_2
inst✝⁵ : CommRing T
inst✝⁴ : Algebra R T
inst✝³ : Algebra S T
inst✝² : IsScalarTower R S T
inst✝¹ : IsLocalization M S
inst✝ : IsLocalization N T
x y : R
z : { x // x ∈ N }
eq₁ : ↑z * ↑(algebraMap R S) x = ↑z * ↑(algebraMap R S) y
z' : R
s : { x // x ∈ M }
eq₂ : ↑z * ↑(algebraMap R S) ↑s = ↑(algebraMap R S) z'
⊢ ∃ c, ↑c * x = ↑c * y

tactic: obtain ⟨c, eq₃ : ↑c * (x * z') = ↑c * (y * z')⟩ := (IsLocalization.eq_iff_exists M S).mp this
state_before: case mp.intro.intro.mk
R : Type u_3
inst✝⁹ : CommRing R
M : Submonoid R
S : Type u_1
inst✝⁸ : CommRing S
inst✝⁷ : Algebra R S
P : Type ?u.134353
inst✝⁶ : CommRing P
N : Submonoid S
T : Type u_2
inst✝⁵ : CommRing T
inst✝⁴ : Algebra R T
inst✝³ : Algebra S T
inst✝² : IsScalarTower R S T
inst✝¹ : IsLocalization M S
inst✝ : IsLocalization N T
x y : R
z : { x // x ∈ N }
eq₁ : ↑z * ↑(algebraMap R S) x = ↑z * ↑(algebraMap R S) y
z' : R
s : { x // x ∈ M }
eq₂ : ↑z * ↑(algebraMap R S) ↑s = ↑(algebraMap R S) z'
this : ↑(algebraMap R S) (x * z') = ↑(algebraMap R S) (y * z')
⊢ ∃ c, ↑c * x = ↑c * y

tactic: refine ⟨⟨c * z', ?_⟩, ?_⟩
state_before: case mp.intro.intro.mk.intro
R : Type u_3
inst✝⁹ : CommRing R
M : Submonoid R
S : Type u_1
inst✝⁸ : CommRing S
inst✝⁷ : Algebra R S
P : Type ?u.134353
inst✝⁶ : CommRing P
N : Submonoid S
T : Type u_2
inst✝⁵ : CommRing T
inst✝⁴ : Algebra R T
inst✝³ : Algebra S T
inst✝² : IsScalarTower R S T
inst✝¹ : IsLocalization M S
inst✝ : IsLocalization N T
x y : R
z : { x // x ∈ N }
eq₁ : ↑z * ↑(algebraMap R S) x = ↑z * ↑(algebraMap R S) y
z' : R
s : { x // x ∈ M }
eq₂ : ↑z * ↑(algebraMap R S) ↑s = ↑(algebraMap R S) z'
this : ↑(algebraMap R S) (x * z') = ↑(algebraMap R S) (y * z')
c : { x // x ∈ M }
eq₃ : ↑c * (x * z') = ↑c * (y * z')
⊢ ∃ c, ↑c * x = ↑c * y

tactic: rw [mem_localizationLocalizationSubmodule]
state_before: case mp.intro.intro.mk.intro.refine_1
R : Type u_3
inst✝⁹ : CommRing R
M : Submonoid R
S : Type u_1
inst✝⁸ : CommRing S
inst✝⁷ : Algebra R S
P : Type ?u.134353
inst✝⁶ : CommRing P
N : Submonoid S
T : Type u_2
inst✝⁵ : CommRing T
inst✝⁴ : Algebra R T
inst✝³ : Algebra S T
inst✝² : IsScalarTower R S T
inst✝¹ : IsLocalization M S
inst✝ : IsLocalization N T
x y : R
z : { x // x ∈ N }
eq₁ : ↑z * ↑(algebraMap R S) x = ↑z * ↑(algebraMap R S) y
z' : R
s : { x // x ∈ M }
eq₂ : ↑z * ↑(algebraMap R S) ↑s = ↑(algebraMap R S) z'
this : ↑(algebraMap R S) (x * z') = ↑(algebraMap R S) (y * z')
c : { x // x ∈ M }
eq₃ : ↑c * (x * z') = ↑c * (y * z')
⊢ ↑c * z' ∈ localizationLocalizationSubmodule M N

tactic: refine ⟨z, c * s, ?_⟩
state_before: case mp.intro.intro.mk.intro.refine_1
R : Type u_3
inst✝⁹ : CommRing R
M : Submonoid R
S : Type u_1
inst✝⁸ : CommRing S
inst✝⁷ : Algebra R S
P : Type ?u.134353
inst✝⁶ : CommRing P
N : Submonoid S
T : Type u_2
inst✝⁵ : CommRing T
inst✝⁴ : Algebra R T
inst✝³ : Algebra S T
inst✝² : IsScalarTower R S T
inst✝¹ : IsLocalization M S
inst✝ : IsLocalization N T
x y : R
z : { x // x ∈ N }
eq₁ : ↑z * ↑(algebraMap R S) x = ↑z * ↑(algebraMap R S) y
z' : R
s : { x // x ∈ M }
eq₂ : ↑z * ↑(algebraMap R S) ↑s = ↑(algebraMap R S) z'
this : ↑(algebraMap R S) (x * z') = ↑(algebraMap R S) (y * z')
c : { x // x ∈ M }
eq₃ : ↑c * (x * z') = ↑c * (y * z')
⊢ ∃ y z, ↑(algebraMap R S) (↑c * z') = ↑y * ↑(algebraMap R S) ↑z

tactic: rw [map_mul, ← eq₂, Submonoid.coe_mul, map_mul, mul_left_comm]
state_before: case mp.intro.intro.mk.intro.refine_1
R : Type u_3
inst✝⁹ : CommRing R
M : Submonoid R
S : Type u_1
inst✝⁸ : CommRing S
inst✝⁷ : Algebra R S
P : Type ?u.134353
inst✝⁶ : CommRing P
N : Submonoid S
T : Type u_2
inst✝⁵ : CommRing T
inst✝⁴ : Algebra R T
inst✝³ : Algebra S T
inst✝² : IsScalarTower R S T
inst✝¹ : IsLocalization M S
inst✝ : IsLocalization N T
x y : R
z : { x // x ∈ N }
eq₁ : ↑z * ↑(algebraMap R S) x = ↑z * ↑(algebraMap R S) y
z' : R
s : { x // x ∈ M }
eq₂ : ↑z * ↑(algebraMap R S) ↑s = ↑(algebraMap R S) z'
this : ↑(algebraMap R S) (x * z') = ↑(algebraMap R S) (y * z')
c : { x // x ∈ M }
eq₃ : ↑c * (x * z') = ↑c * (y * z')
⊢ ↑(algebraMap R S) (↑c * z') = ↑z * ↑(algebraMap R S) ↑(c * s)

tactic: rwa [mul_comm _ z', mul_comm _ z', ← mul_assoc, ← mul_assoc] at eq₃
state_before: case mp.intro.intro.mk.intro.refine_2
R : Type u_3
inst✝⁹ : CommRing R
M : Submonoid R
S : Type u_1
inst✝⁸ : CommRing S
inst✝⁷ : Algebra R S
P : Type ?u.134353
inst✝⁶ : CommRing P
N : Submonoid S
T : Type u_2
inst✝⁵ : CommRing T
inst✝⁴ : Algebra R T
inst✝³ : Algebra S T
inst✝² : IsScalarTower R S T
inst✝¹ : IsLocalization M S
inst✝ : IsLocalization N T
x y : R
z : { x // x ∈ N }
eq₁ : ↑z * ↑(algebraMap R S) x = ↑z * ↑(algebraMap R S) y
z' : R
s : { x // x ∈ M }
eq₂ : ↑z * ↑(algebraMap R S) ↑s = ↑(algebraMap R S) z'
this : ↑(algebraMap R S) (x * z') = ↑(algebraMap R S) (y * z')
c : { x // x ∈ M }
eq₃ : ↑c * (x * z') = ↑c * (y * z')
⊢ ↑{ val := ↑c * z', property := (_ : ↑c * z' ∈ localizationLocalizationSubmodule M N) } * x =
    ↑{ val := ↑c * z', property := (_ : ↑c * z' ∈ localizationLocalizationSubmodule M N) } * y

tactic: rw [map_mul, map_mul, ← eq₂, ← mul_assoc, ← mul_assoc, mul_comm _ (z : S), eq₁,
mul_comm _ (z : S)]
state_before: case this
R : Type u_3
inst✝⁹ : CommRing R
M : Submonoid R
S : Type u_1
inst✝⁸ : CommRing S
inst✝⁷ : Algebra R S
P : Type ?u.134353
inst✝⁶ : CommRing P
N : Submonoid S
T : Type u_2
inst✝⁵ : CommRing T
inst✝⁴ : Algebra R T
inst✝³ : Algebra S T
inst✝² : IsScalarTower R S T
inst✝¹ : IsLocalization M S
inst✝ : IsLocalization N T
x y : R
z : { x // x ∈ N }
eq₁ : ↑z * ↑(algebraMap R S) x = ↑z * ↑(algebraMap R S) y
z' : R
s : { x // x ∈ M }
eq₂ : ↑z * ↑(algebraMap R S) ↑s = ↑(algebraMap R S) z'
⊢ ↑(algebraMap R S) (x * z') = ↑(algebraMap R S) (y * z')

tactic: rintro ⟨⟨c, hc⟩, eq₁ : c * x = c * y⟩
state_before: case mpr
R : Type u_3
inst✝⁹ : CommRing R
M : Submonoid R
S : Type u_1
inst✝⁸ : CommRing S
inst✝⁷ : Algebra R S
P : Type ?u.134353
inst✝⁶ : CommRing P
N : Submonoid S
T : Type u_2
inst✝⁵ : CommRing T
inst✝⁴ : Algebra R T
inst✝³ : Algebra S T
inst✝² : IsScalarTower R S T
inst✝¹ : IsLocalization M S
inst✝ : IsLocalization N T
x y : R
⊢ (∃ c, ↑c * x = ↑c * y) → ∃ c, ↑c * ↑(algebraMap R S) x = ↑c * ↑(algebraMap R S) y

tactic: rw [mem_localizationLocalizationSubmodule] at hc
state_before: case mpr.intro.mk
R : Type u_3
inst✝⁹ : CommRing R
M : Submonoid R
S : Type u_1
inst✝⁸ : CommRing S
inst✝⁷ : Algebra R S
P : Type ?u.134353
inst✝⁶ : CommRing P
N : Submonoid S
T : Type u_2
inst✝⁵ : CommRing T
inst✝⁴ : Algebra R T
inst✝³ : Algebra S T
inst✝² : IsScalarTower R S T
inst✝¹ : IsLocalization M S
inst✝ : IsLocalization N T
x y c : R
hc : c ∈ localizationLocalizationSubmodule M N
eq₁ : c * x = c * y
⊢ ∃ c, ↑c * ↑(algebraMap R S) x = ↑c * ↑(algebraMap R S) y

tactic: rcases hc with ⟨z₁, z, eq₂⟩
state_before: case mpr.intro.mk
R : Type u_3
inst✝⁹ : CommRing R
M : Submonoid R
S : Type u_1
inst✝⁸ : CommRing S
inst✝⁷ : Algebra R S
P : Type ?u.134353
inst✝⁶ : CommRing P
N : Submonoid S
T : Type u_2
inst✝⁵ : CommRing T
inst✝⁴ : Algebra R T
inst✝³ : Algebra S T
inst✝² : IsScalarTower R S T
inst✝¹ : IsLocalization M S
inst✝ : IsLocalization N T
x y c : R
hc : ∃ y z, ↑(algebraMap R S) c = ↑y * ↑(algebraMap R S) ↑z
eq₁ : c * x = c * y
⊢ ∃ c, ↑c * ↑(algebraMap R S) x = ↑c * ↑(algebraMap R S) y

tactic: use z₁
state_before: case mpr.intro.mk.intro.intro
R : Type u_3
inst✝⁹ : CommRing R
M : Submonoid R
S : Type u_1
inst✝⁸ : CommRing S
inst✝⁷ : Algebra R S
P : Type ?u.134353
inst✝⁶ : CommRing P
N : Submonoid S
T : Type u_2
inst✝⁵ : CommRing T
inst✝⁴ : Algebra R T
inst✝³ : Algebra S T
inst✝² : IsScalarTower R S T
inst✝¹ : IsLocalization M S
inst✝ : IsLocalization N T
x y c : R
eq₁ : c * x = c * y
z₁ : { x // x ∈ N }
z : { x // x ∈ M }
eq₂ : ↑(algebraMap R S) c = ↑z₁ * ↑(algebraMap R S) ↑z
⊢ ∃ c, ↑c * ↑(algebraMap R S) x = ↑c * ↑(algebraMap R S) y

tactic: refine (IsLocalization.map_units S z).mul_right_inj.mp ?_
state_before: case mpr.intro.mk.intro.intro
R : Type u_3
inst✝⁹ : CommRing R
M : Submonoid R
S : Type u_1
inst✝⁸ : CommRing S
inst✝⁷ : Algebra R S
P : Type ?u.134353
inst✝⁶ : CommRing P
N : Submonoid S
T : Type u_2
inst✝⁵ : CommRing T
inst✝⁴ : Algebra R T
inst✝³ : Algebra S T
inst✝² : IsScalarTower R S T
inst✝¹ : IsLocalization M S
inst✝ : IsLocalization N T
x y c : R
eq₁ : c * x = c * y
z₁ : { x // x ∈ N }
z : { x // x ∈ M }
eq₂ : ↑(algebraMap R S) c = ↑z₁ * ↑(algebraMap R S) ↑z
⊢ ↑z₁ * ↑(algebraMap R S) x = ↑z₁ * ↑(algebraMap R S) y

tactic: rw [← mul_assoc, mul_comm _ (z₁ : S), ← eq₂, ← map_mul, eq₁, map_mul, eq₂, ← mul_assoc,
  mul_comm _ (z₁ : S)]
state_before: case mpr.intro.mk.intro.intro
R : Type u_3
inst✝⁹ : CommRing R
M : Submonoid R
S : Type u_1
inst✝⁸ : CommRing S
inst✝⁷ : Algebra R S
P : Type ?u.134353
inst✝⁶ : CommRing P
N : Submonoid S
T : Type u_2
inst✝⁵ : CommRing T
inst✝⁴ : Algebra R T
inst✝³ : Algebra S T
inst✝² : IsScalarTower R S T
inst✝¹ : IsLocalization M S
inst✝ : IsLocalization N T
x y c : R
eq₁ : c * x = c * y
z₁ : { x // x ∈ N }
z : { x // x ∈ M }
eq₂ : ↑(algebraMap R S) c = ↑z₁ * ↑(algebraMap R S) ↑z
⊢ ↑(algebraMap R S) ↑z * (↑z₁ * ↑(algebraMap R S) x) = ↑(algebraMap R S) ↑z * (↑z₁ * ↑(algebraMap R S) y)