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

tactic: rintro ⟨_, ⟨y, hy, rfl⟩⟩
state_before: R : Type u_1
inst✝⁹ : CommRing R
M✝ : Submonoid R
S : Type u_2
inst✝⁸ : CommRing S
inst✝⁷ : Algebra R S
P : Type ?u.278377
inst✝⁶ : CommRing P
N✝ : Submonoid S
T : Type u_3
inst✝⁵ : CommRing T
inst✝⁴ : Algebra R T
M N : Submonoid R
h : M ≤ N
inst✝³ : IsLocalization M S
inst✝² : IsLocalization N T
inst✝¹ : Algebra S T
inst✝ : IsScalarTower R S T
⊢ ∀ (y : { x // x ∈ Submonoid.map (algebraMap R S) N }), IsUnit (↑(algebraMap S T) ↑y)

tactic: convert IsLocalization.map_units T ⟨y, hy⟩
state_before: case 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.278377
inst✝⁶ : CommRing P
N✝ : Submonoid S
T : Type u_3
inst✝⁵ : CommRing T
inst✝⁴ : Algebra R T
M N : Submonoid R
h : M ≤ N
inst✝³ : IsLocalization M S
inst✝² : IsLocalization N T
inst✝¹ : Algebra S T
inst✝ : IsScalarTower R S T
y : R
hy : y ∈ ↑N
⊢ IsUnit
    (↑(algebraMap S T)
      ↑{ val := ↑(algebraMap R S) y, property := (_ : ∃ a, a ∈ ↑N ∧ ↑(algebraMap R S) a = ↑(algebraMap R S) y) })

tactic: exact (IsScalarTower.algebraMap_apply _ _ _ _).symm
state_before: case h.e'_3
R : Type u_1
inst✝⁹ : CommRing R
M✝ : Submonoid R
S : Type u_2
inst✝⁸ : CommRing S
inst✝⁷ : Algebra R S
P : Type ?u.278377
inst✝⁶ : CommRing P
N✝ : Submonoid S
T : Type u_3
inst✝⁵ : CommRing T
inst✝⁴ : Algebra R T
M N : Submonoid R
h : M ≤ N
inst✝³ : IsLocalization M S
inst✝² : IsLocalization N T
inst✝¹ : Algebra S T
inst✝ : IsScalarTower R S T
y : R
hy : y ∈ ↑N
⊢ ↑(algebraMap S T)
      ↑{ val := ↑(algebraMap R S) y, property := (_ : ∃ a, a ∈ ↑N ∧ ↑(algebraMap R S) a = ↑(algebraMap R S) y) } =
    ↑(algebraMap R T) ↑{ val := y, property := hy }

tactic: obtain ⟨⟨x, s⟩, e⟩ := IsLocalization.surj N y
state_before: R : Type u_1
inst✝⁹ : CommRing R
M✝ : Submonoid R
S : Type u_2
inst✝⁸ : CommRing S
inst✝⁷ : Algebra R S
P : Type ?u.278377
inst✝⁶ : CommRing P
N✝ : Submonoid S
T : Type u_3
inst✝⁵ : CommRing T
inst✝⁴ : Algebra R T
M N : Submonoid R
h : M ≤ N
inst✝³ : IsLocalization M S
inst✝² : IsLocalization N T
inst✝¹ : Algebra S T
inst✝ : IsScalarTower R S T
y : T
⊢ ∃ x, y * ↑(algebraMap S T) ↑x.snd = ↑(algebraMap S T) x.fst

tactic: refine ⟨⟨algebraMap R S x, _, _, s.prop, rfl⟩, ?_⟩
state_before: case 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.278377
inst✝⁶ : CommRing P
N✝ : Submonoid S
T : Type u_3
inst✝⁵ : CommRing T
inst✝⁴ : Algebra R T
M N : Submonoid R
h : M ≤ N
inst✝³ : IsLocalization M S
inst✝² : IsLocalization N T
inst✝¹ : Algebra S T
inst✝ : IsScalarTower R S T
y : T
x : R
s : { x // x ∈ N }
e : y * ↑(algebraMap R T) ↑(x, s).snd = ↑(algebraMap R T) (x, s).fst
⊢ ∃ x, y * ↑(algebraMap S T) ↑x.snd = ↑(algebraMap S T) x.fst

tactic: simpa [← IsScalarTower.algebraMap_apply] using e
state_before: case 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.278377
inst✝⁶ : CommRing P
N✝ : Submonoid S
T : Type u_3
inst✝⁵ : CommRing T
inst✝⁴ : Algebra R T
M N : Submonoid R
h : M ≤ N
inst✝³ : IsLocalization M S
inst✝² : IsLocalization N T
inst✝¹ : Algebra S T
inst✝ : IsScalarTower R S T
y : T
x : R
s : { x // x ∈ N }
e : y * ↑(algebraMap R T) ↑(x, s).snd = ↑(algebraMap R T) (x, s).fst
⊢ y *
      ↑(algebraMap S T)
        ↑(↑(algebraMap R S) x,
              { val := ↑(algebraMap R S) ↑s,
                property := (_ : ∃ a, a ∈ ↑N ∧ ↑(algebraMap R S) a = ↑(algebraMap R S) ↑s) }).snd =
    ↑(algebraMap S T)
      (↑(algebraMap R S) x,
          { val := ↑(algebraMap R S) ↑s,
            property := (_ : ∃ a, a ∈ ↑N ∧ ↑(algebraMap R S) a = ↑(algebraMap R S) ↑s) }).fst

tactic: obtain ⟨⟨y₁, s₁⟩, e₁⟩ := IsLocalization.surj M x₁
state_before: R : Type u_1
inst✝⁹ : CommRing R
M✝ : Submonoid R
S : Type u_2
inst✝⁸ : CommRing S
inst✝⁷ : Algebra R S
P : Type ?u.278377
inst✝⁶ : CommRing P
N✝ : Submonoid S
T : Type u_3
inst✝⁵ : CommRing T
inst✝⁴ : Algebra R T
M N : Submonoid R
h : M ≤ N
inst✝³ : IsLocalization M S
inst✝² : IsLocalization N T
inst✝¹ : Algebra S T
inst✝ : IsScalarTower R S T
x₁ x₂ : S
⊢ ↑(algebraMap S T) x₁ = ↑(algebraMap S T) x₂ ↔ ∃ c, ↑c * x₁ = ↑c * x₂

tactic: obtain ⟨⟨y₂, s₂⟩, e₂⟩ := IsLocalization.surj M x₂
state_before: case 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.278377
inst✝⁶ : CommRing P
N✝ : Submonoid S
T : Type u_3
inst✝⁵ : CommRing T
inst✝⁴ : Algebra R T
M N : Submonoid R
h : M ≤ N
inst✝³ : IsLocalization M S
inst✝² : IsLocalization N T
inst✝¹ : Algebra S T
inst✝ : IsScalarTower R S T
x₁ x₂ : S
y₁ : R
s₁ : { x // x ∈ M }
e₁ : x₁ * ↑(algebraMap R S) ↑(y₁, s₁).snd = ↑(algebraMap R S) (y₁, s₁).fst
⊢ ↑(algebraMap S T) x₁ = ↑(algebraMap S T) x₂ ↔ ∃ c, ↑c * x₁ = ↑c * x₂

tactic: refine' Iff.trans _ (Set.exists_image_iff (algebraMap R S) N fun c => c * x₁ = c * x₂).symm
state_before: case intro.mk.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.278377
inst✝⁶ : CommRing P
N✝ : Submonoid S
T : Type u_3
inst✝⁵ : CommRing T
inst✝⁴ : Algebra R T
M N : Submonoid R
h : M ≤ N
inst✝³ : IsLocalization M S
inst✝² : IsLocalization N T
inst✝¹ : Algebra S T
inst✝ : IsScalarTower R S T
x₁ x₂ : S
y₁ : R
s₁ : { x // x ∈ M }
e₁ : x₁ * ↑(algebraMap R S) ↑(y₁, s₁).snd = ↑(algebraMap R S) (y₁, s₁).fst
y₂ : R
s₂ : { x // x ∈ M }
e₂ : x₂ * ↑(algebraMap R S) ↑(y₂, s₂).snd = ↑(algebraMap R S) (y₂, s₂).fst
⊢ ↑(algebraMap S T) x₁ = ↑(algebraMap S T) x₂ ↔ ∃ c, ↑c * x₁ = ↑c * x₂

tactic: dsimp only at e₁ e₂⊢
state_before: case intro.mk.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.278377
inst✝⁶ : CommRing P
N✝ : Submonoid S
T : Type u_3
inst✝⁵ : CommRing T
inst✝⁴ : Algebra R T
M N : Submonoid R
h : M ≤ N
inst✝³ : IsLocalization M S
inst✝² : IsLocalization N T
inst✝¹ : Algebra S T
inst✝ : IsScalarTower R S T
x₁ x₂ : S
y₁ : R
s₁ : { x // x ∈ M }
e₁ : x₁ * ↑(algebraMap R S) ↑(y₁, s₁).snd = ↑(algebraMap R S) (y₁, s₁).fst
y₂ : R
s₂ : { x // x ∈ M }
e₂ : x₂ * ↑(algebraMap R S) ↑(y₂, s₂).snd = ↑(algebraMap R S) (y₂, s₂).fst
⊢ ↑(algebraMap S T) x₁ = ↑(algebraMap S T) x₂ ↔ ∃ a, ↑(algebraMap R S) ↑a * x₁ = ↑(algebraMap R S) ↑a * x₂

tactic: suffices : algebraMap R T (y₁ * s₂) = algebraMap R T (y₂ * s₁) ↔
  ∃ a : N, algebraMap R S (a * (y₁ * s₂)) = algebraMap R S (a * (y₂ * s₁))
state_before: case intro.mk.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.278377
inst✝⁶ : CommRing P
N✝ : Submonoid S
T : Type u_3
inst✝⁵ : CommRing T
inst✝⁴ : Algebra R T
M N : Submonoid R
h : M ≤ N
inst✝³ : IsLocalization M S
inst✝² : IsLocalization N T
inst✝¹ : Algebra S T
inst✝ : IsScalarTower R S T
x₁ x₂ : S
y₁ : R
s₁ : { x // x ∈ M }
e₁ : x₁ * ↑(algebraMap R S) ↑s₁ = ↑(algebraMap R S) y₁
y₂ : R
s₂ : { x // x ∈ M }
e₂ : x₂ * ↑(algebraMap R S) ↑s₂ = ↑(algebraMap R S) y₂
⊢ ↑(algebraMap S T) x₁ = ↑(algebraMap S T) x₂ ↔ ∃ a, ↑(algebraMap R S) ↑a * x₁ = ↑(algebraMap R S) ↑a * x₂

tactic: have h₁ := @IsUnit.mul_left_inj T _ _ (algebraMap S T x₁) (algebraMap S T x₂)
  (IsLocalization.map_units T ⟨(s₁ : R), h s₁.prop⟩)
state_before: case intro.mk.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.278377
inst✝⁶ : CommRing P
N✝ : Submonoid S
T : Type u_3
inst✝⁵ : CommRing T
inst✝⁴ : Algebra R T
M N : Submonoid R
h : M ≤ N
inst✝³ : IsLocalization M S
inst✝² : IsLocalization N T
inst✝¹ : Algebra S T
inst✝ : IsScalarTower R S T
x₁ x₂ : S
y₁ : R
s₁ : { x // x ∈ M }
e₁ : x₁ * ↑(algebraMap R S) ↑s₁ = ↑(algebraMap R S) y₁
y₂ : R
s₂ : { x // x ∈ M }
e₂ : x₂ * ↑(algebraMap R S) ↑s₂ = ↑(algebraMap R S) y₂
this :
  ↑(algebraMap R T) (y₁ * ↑s₂) = ↑(algebraMap R T) (y₂ * ↑s₁) ↔
    ∃ a, ↑(algebraMap R S) (↑a * (y₁ * ↑s₂)) = ↑(algebraMap R S) (↑a * (y₂ * ↑s₁))
⊢ ↑(algebraMap S T) x₁ = ↑(algebraMap S T) x₂ ↔ ∃ a, ↑(algebraMap R S) ↑a * x₁ = ↑(algebraMap R S) ↑a * x₂

tactic: have h₂ := @IsUnit.mul_left_inj T _ _ ((algebraMap S T x₁) * (algebraMap R T s₁))
  ((algebraMap S T x₂) * (algebraMap R T s₁))
  (IsLocalization.map_units T ⟨(s₂ : R), h s₂.prop⟩)
state_before: case intro.mk.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.278377
inst✝⁶ : CommRing P
N✝ : Submonoid S
T : Type u_3
inst✝⁵ : CommRing T
inst✝⁴ : Algebra R T
M N : Submonoid R
h : M ≤ N
inst✝³ : IsLocalization M S
inst✝² : IsLocalization N T
inst✝¹ : Algebra S T
inst✝ : IsScalarTower R S T
x₁ x₂ : S
y₁ : R
s₁ : { x // x ∈ M }
e₁ : x₁ * ↑(algebraMap R S) ↑s₁ = ↑(algebraMap R S) y₁
y₂ : R
s₂ : { x // x ∈ M }
e₂ : x₂ * ↑(algebraMap R S) ↑s₂ = ↑(algebraMap R S) y₂
this :
  ↑(algebraMap R T) (y₁ * ↑s₂) = ↑(algebraMap R T) (y₂ * ↑s₁) ↔
    ∃ a, ↑(algebraMap R S) (↑a * (y₁ * ↑s₂)) = ↑(algebraMap R S) (↑a * (y₂ * ↑s₁))
h₁ :
  ↑(algebraMap S T) x₁ * ↑(algebraMap R T) ↑{ val := ↑s₁, property := (_ : ↑s₁ ∈ N) } =
      ↑(algebraMap S T) x₂ * ↑(algebraMap R T) ↑{ val := ↑s₁, property := (_ : ↑s₁ ∈ N) } ↔
    ↑(algebraMap S T) x₁ = ↑(algebraMap S T) x₂
⊢ ↑(algebraMap S T) x₁ = ↑(algebraMap S T) x₂ ↔ ∃ a, ↑(algebraMap R S) ↑a * x₁ = ↑(algebraMap R S) ↑a * x₂

tactic: simp only [IsScalarTower.algebraMap_apply R S T, Subtype.coe_mk] at h₁ h₂
state_before: case intro.mk.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.278377
inst✝⁶ : CommRing P
N✝ : Submonoid S
T : Type u_3
inst✝⁵ : CommRing T
inst✝⁴ : Algebra R T
M N : Submonoid R
h : M ≤ N
inst✝³ : IsLocalization M S
inst✝² : IsLocalization N T
inst✝¹ : Algebra S T
inst✝ : IsScalarTower R S T
x₁ x₂ : S
y₁ : R
s₁ : { x // x ∈ M }
e₁ : x₁ * ↑(algebraMap R S) ↑s₁ = ↑(algebraMap R S) y₁
y₂ : R
s₂ : { x // x ∈ M }
e₂ : x₂ * ↑(algebraMap R S) ↑s₂ = ↑(algebraMap R S) y₂
this :
  ↑(algebraMap R T) (y₁ * ↑s₂) = ↑(algebraMap R T) (y₂ * ↑s₁) ↔
    ∃ a, ↑(algebraMap R S) (↑a * (y₁ * ↑s₂)) = ↑(algebraMap R S) (↑a * (y₂ * ↑s₁))
h₁ :
  ↑(algebraMap S T) x₁ * ↑(algebraMap R T) ↑{ val := ↑s₁, property := (_ : ↑s₁ ∈ N) } =
      ↑(algebraMap S T) x₂ * ↑(algebraMap R T) ↑{ val := ↑s₁, property := (_ : ↑s₁ ∈ N) } ↔
    ↑(algebraMap S T) x₁ = ↑(algebraMap S T) x₂
h₂ :
  ↑(algebraMap S T) x₁ * ↑(algebraMap R T) ↑s₁ * ↑(algebraMap R T) ↑{ val := ↑s₂, property := (_ : ↑s₂ ∈ N) } =
      ↑(algebraMap S T) x₂ * ↑(algebraMap R T) ↑s₁ * ↑(algebraMap R T) ↑{ val := ↑s₂, property := (_ : ↑s₂ ∈ N) } ↔
    ↑(algebraMap S T) x₁ * ↑(algebraMap R T) ↑s₁ = ↑(algebraMap S T) x₂ * ↑(algebraMap R T) ↑s₁
⊢ ↑(algebraMap S T) x₁ = ↑(algebraMap S T) x₂ ↔ ∃ a, ↑(algebraMap R S) ↑a * x₁ = ↑(algebraMap R S) ↑a * x₂

tactic: simp only [IsScalarTower.algebraMap_apply R S T, map_mul, ← e₁, ← e₂, ← mul_assoc,
  mul_right_comm _ (algebraMap R S s₂),
  mul_right_comm _ (algebraMap S T (algebraMap R S s₂)),
  (IsLocalization.map_units S s₁).mul_left_inj,
  (IsLocalization.map_units S s₂).mul_left_inj] at this
state_before: case intro.mk.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.278377
inst✝⁶ : CommRing P
N✝ : Submonoid S
T : Type u_3
inst✝⁵ : CommRing T
inst✝⁴ : Algebra R T
M N : Submonoid R
h : M ≤ N
inst✝³ : IsLocalization M S
inst✝² : IsLocalization N T
inst✝¹ : Algebra S T
inst✝ : IsScalarTower R S T
x₁ x₂ : S
y₁ : R
s₁ : { x // x ∈ M }
e₁ : x₁ * ↑(algebraMap R S) ↑s₁ = ↑(algebraMap R S) y₁
y₂ : R
s₂ : { x // x ∈ M }
e₂ : x₂ * ↑(algebraMap R S) ↑s₂ = ↑(algebraMap R S) y₂
this :
  ↑(algebraMap R T) (y₁ * ↑s₂) = ↑(algebraMap R T) (y₂ * ↑s₁) ↔
    ∃ a, ↑(algebraMap R S) (↑a * (y₁ * ↑s₂)) = ↑(algebraMap R S) (↑a * (y₂ * ↑s₁))
h₁ :
  ↑(algebraMap S T) x₁ * ↑(algebraMap S T) (↑(algebraMap R S) ↑s₁) =
      ↑(algebraMap S T) x₂ * ↑(algebraMap S T) (↑(algebraMap R S) ↑s₁) ↔
    ↑(algebraMap S T) x₁ = ↑(algebraMap S T) x₂
h₂ :
  ↑(algebraMap S T) x₁ * ↑(algebraMap S T) (↑(algebraMap R S) ↑s₁) * ↑(algebraMap S T) (↑(algebraMap R S) ↑s₂) =
      ↑(algebraMap S T) x₂ * ↑(algebraMap S T) (↑(algebraMap R S) ↑s₁) * ↑(algebraMap S T) (↑(algebraMap R S) ↑s₂) ↔
    ↑(algebraMap S T) x₁ * ↑(algebraMap S T) (↑(algebraMap R S) ↑s₁) =
      ↑(algebraMap S T) x₂ * ↑(algebraMap S T) (↑(algebraMap R S) ↑s₁)
⊢ ↑(algebraMap S T) x₁ = ↑(algebraMap S T) x₂ ↔ ∃ a, ↑(algebraMap R S) ↑a * x₁ = ↑(algebraMap R S) ↑a * x₂

tactic: rw [h₂, h₁] at this
state_before: case intro.mk.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.278377
inst✝⁶ : CommRing P
N✝ : Submonoid S
T : Type u_3
inst✝⁵ : CommRing T
inst✝⁴ : Algebra R T
M N : Submonoid R
h : M ≤ N
inst✝³ : IsLocalization M S
inst✝² : IsLocalization N T
inst✝¹ : Algebra S T
inst✝ : IsScalarTower R S T
x₁ x₂ : S
y₁ : R
s₁ : { x // x ∈ M }
e₁ : x₁ * ↑(algebraMap R S) ↑s₁ = ↑(algebraMap R S) y₁
y₂ : R
s₂ : { x // x ∈ M }
e₂ : x₂ * ↑(algebraMap R S) ↑s₂ = ↑(algebraMap R S) y₂
h₁ :
  ↑(algebraMap S T) x₁ * ↑(algebraMap S T) (↑(algebraMap R S) ↑s₁) =
      ↑(algebraMap S T) x₂ * ↑(algebraMap S T) (↑(algebraMap R S) ↑s₁) ↔
    ↑(algebraMap S T) x₁ = ↑(algebraMap S T) x₂
h₂ :
  ↑(algebraMap S T) x₁ * ↑(algebraMap S T) (↑(algebraMap R S) ↑s₁) * ↑(algebraMap S T) (↑(algebraMap R S) ↑s₂) =
      ↑(algebraMap S T) x₂ * ↑(algebraMap S T) (↑(algebraMap R S) ↑s₁) * ↑(algebraMap S T) (↑(algebraMap R S) ↑s₂) ↔
    ↑(algebraMap S T) x₁ * ↑(algebraMap S T) (↑(algebraMap R S) ↑s₁) =
      ↑(algebraMap S T) x₂ * ↑(algebraMap S T) (↑(algebraMap R S) ↑s₁)
this :
  ↑(algebraMap S T) x₁ * ↑(algebraMap S T) (↑(algebraMap R S) ↑s₁) * ↑(algebraMap S T) (↑(algebraMap R S) ↑s₂) =
      ↑(algebraMap S T) x₂ * ↑(algebraMap S T) (↑(algebraMap R S) ↑s₁) * ↑(algebraMap S T) (↑(algebraMap R S) ↑s₂) ↔
    ∃ a, ↑(algebraMap R S) ↑a * x₁ = ↑(algebraMap R S) ↑a * x₂
⊢ ↑(algebraMap S T) x₁ = ↑(algebraMap S T) x₂ ↔ ∃ a, ↑(algebraMap R S) ↑a * x₁ = ↑(algebraMap R S) ↑a * x₂

tactic: simpa only [mul_comm] using this
state_before: case intro.mk.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.278377
inst✝⁶ : CommRing P
N✝ : Submonoid S
T : Type u_3
inst✝⁵ : CommRing T
inst✝⁴ : Algebra R T
M N : Submonoid R
h : M ≤ N
inst✝³ : IsLocalization M S
inst✝² : IsLocalization N T
inst✝¹ : Algebra S T
inst✝ : IsScalarTower R S T
x₁ x₂ : S
y₁ : R
s₁ : { x // x ∈ M }
e₁ : x₁ * ↑(algebraMap R S) ↑s₁ = ↑(algebraMap R S) y₁
y₂ : R
s₂ : { x // x ∈ M }
e₂ : x₂ * ↑(algebraMap R S) ↑s₂ = ↑(algebraMap R S) y₂
h₁ :
  ↑(algebraMap S T) x₁ * ↑(algebraMap S T) (↑(algebraMap R S) ↑s₁) =
      ↑(algebraMap S T) x₂ * ↑(algebraMap S T) (↑(algebraMap R S) ↑s₁) ↔
    ↑(algebraMap S T) x₁ = ↑(algebraMap S T) x₂
h₂ :
  ↑(algebraMap S T) x₁ * ↑(algebraMap S T) (↑(algebraMap R S) ↑s₁) * ↑(algebraMap S T) (↑(algebraMap R S) ↑s₂) =
      ↑(algebraMap S T) x₂ * ↑(algebraMap S T) (↑(algebraMap R S) ↑s₁) * ↑(algebraMap S T) (↑(algebraMap R S) ↑s₂) ↔
    ↑(algebraMap S T) x₁ * ↑(algebraMap S T) (↑(algebraMap R S) ↑s₁) =
      ↑(algebraMap S T) x₂ * ↑(algebraMap S T) (↑(algebraMap R S) ↑s₁)
this : ↑(algebraMap S T) x₁ = ↑(algebraMap S T) x₂ ↔ ∃ a, ↑(algebraMap R S) ↑a * x₁ = ↑(algebraMap R S) ↑a * x₂
⊢ ↑(algebraMap S T) x₁ = ↑(algebraMap S T) x₂ ↔ ∃ a, ↑(algebraMap R S) ↑a * x₁ = ↑(algebraMap R S) ↑a * x₂

tactic: simp_rw [IsLocalization.eq_iff_exists N T, IsLocalization.eq_iff_exists M S]
state_before: case this
R : Type u_1
inst✝⁹ : CommRing R
M✝ : Submonoid R
S : Type u_2
inst✝⁸ : CommRing S
inst✝⁷ : Algebra R S
P : Type ?u.278377
inst✝⁶ : CommRing P
N✝ : Submonoid S
T : Type u_3
inst✝⁵ : CommRing T
inst✝⁴ : Algebra R T
M N : Submonoid R
h : M ≤ N
inst✝³ : IsLocalization M S
inst✝² : IsLocalization N T
inst✝¹ : Algebra S T
inst✝ : IsScalarTower R S T
x₁ x₂ : S
y₁ : R
s₁ : { x // x ∈ M }
e₁ : x₁ * ↑(algebraMap R S) ↑s₁ = ↑(algebraMap R S) y₁
y₂ : R
s₂ : { x // x ∈ M }
e₂ : x₂ * ↑(algebraMap R S) ↑s₂ = ↑(algebraMap R S) y₂
⊢ ↑(algebraMap R T) (y₁ * ↑s₂) = ↑(algebraMap R T) (y₂ * ↑s₁) ↔
    ∃ a, ↑(algebraMap R S) (↑a * (y₁ * ↑s₂)) = ↑(algebraMap R S) (↑a * (y₂ * ↑s₁))

tactic: constructor
state_before: case this
R : Type u_1
inst✝⁹ : CommRing R
M✝ : Submonoid R
S : Type u_2
inst✝⁸ : CommRing S
inst✝⁷ : Algebra R S
P : Type ?u.278377
inst✝⁶ : CommRing P
N✝ : Submonoid S
T : Type u_3
inst✝⁵ : CommRing T
inst✝⁴ : Algebra R T
M N : Submonoid R
h : M ≤ N
inst✝³ : IsLocalization M S
inst✝² : IsLocalization N T
inst✝¹ : Algebra S T
inst✝ : IsScalarTower R S T
x₁ x₂ : S
y₁ : R
s₁ : { x // x ∈ M }
e₁ : x₁ * ↑(algebraMap R S) ↑s₁ = ↑(algebraMap R S) y₁
y₂ : R
s₂ : { x // x ∈ M }
e₂ : x₂ * ↑(algebraMap R S) ↑s₂ = ↑(algebraMap R S) y₂
⊢ (∃ c, ↑c * (y₁ * ↑s₂) = ↑c * (y₂ * ↑s₁)) ↔ ∃ a c, ↑c * (↑a * (y₁ * ↑s₂)) = ↑c * (↑a * (y₂ * ↑s₁))

tactic: rintro ⟨a, e⟩
state_before: case this.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.278377
inst✝⁶ : CommRing P
N✝ : Submonoid S
T : Type u_3
inst✝⁵ : CommRing T
inst✝⁴ : Algebra R T
M N : Submonoid R
h : M ≤ N
inst✝³ : IsLocalization M S
inst✝² : IsLocalization N T
inst✝¹ : Algebra S T
inst✝ : IsScalarTower R S T
x₁ x₂ : S
y₁ : R
s₁ : { x // x ∈ M }
e₁ : x₁ * ↑(algebraMap R S) ↑s₁ = ↑(algebraMap R S) y₁
y₂ : R
s₂ : { x // x ∈ M }
e₂ : x₂ * ↑(algebraMap R S) ↑s₂ = ↑(algebraMap R S) y₂
⊢ (∃ c, ↑c * (y₁ * ↑s₂) = ↑c * (y₂ * ↑s₁)) → ∃ a c, ↑c * (↑a * (y₁ * ↑s₂)) = ↑c * (↑a * (y₂ * ↑s₁))

tactic: exact ⟨a, 1, by convert e using 1 <;> simp⟩
state_before: case this.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.278377
inst✝⁶ : CommRing P
N✝ : Submonoid S
T : Type u_3
inst✝⁵ : CommRing T
inst✝⁴ : Algebra R T
M N : Submonoid R
h : M ≤ N
inst✝³ : IsLocalization M S
inst✝² : IsLocalization N T
inst✝¹ : Algebra S T
inst✝ : IsScalarTower R S T
x₁ x₂ : S
y₁ : R
s₁ : { x // x ∈ M }
e₁ : x₁ * ↑(algebraMap R S) ↑s₁ = ↑(algebraMap R S) y₁
y₂ : R
s₂ : { x // x ∈ M }
e₂ : x₂ * ↑(algebraMap R S) ↑s₂ = ↑(algebraMap R S) y₂
a : { x // x ∈ N }
e : ↑a * (y₁ * ↑s₂) = ↑a * (y₂ * ↑s₁)
⊢ ∃ a c, ↑c * (↑a * (y₁ * ↑s₂)) = ↑c * (↑a * (y₂ * ↑s₁))

tactic: convert e using 1 <;> simp
state_before: R : Type u_1
inst✝⁹ : CommRing R
M✝ : Submonoid R
S : Type u_2
inst✝⁸ : CommRing S
inst✝⁷ : Algebra R S
P : Type ?u.278377
inst✝⁶ : CommRing P
N✝ : Submonoid S
T : Type u_3
inst✝⁵ : CommRing T
inst✝⁴ : Algebra R T
M N : Submonoid R
h : M ≤ N
inst✝³ : IsLocalization M S
inst✝² : IsLocalization N T
inst✝¹ : Algebra S T
inst✝ : IsScalarTower R S T
x₁ x₂ : S
y₁ : R
s₁ : { x // x ∈ M }
e₁ : x₁ * ↑(algebraMap R S) ↑s₁ = ↑(algebraMap R S) y₁
y₂ : R
s₂ : { x // x ∈ M }
e₂ : x₂ * ↑(algebraMap R S) ↑s₂ = ↑(algebraMap R S) y₂
a : { x // x ∈ N }
e : ↑a * (y₁ * ↑s₂) = ↑a * (y₂ * ↑s₁)
⊢ ↑1 * (↑a * (y₁ * ↑s₂)) = ↑1 * (↑a * (y₂ * ↑s₁))

tactic: rintro ⟨a, b, e⟩
state_before: case this.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.278377
inst✝⁶ : CommRing P
N✝ : Submonoid S
T : Type u_3
inst✝⁵ : CommRing T
inst✝⁴ : Algebra R T
M N : Submonoid R
h : M ≤ N
inst✝³ : IsLocalization M S
inst✝² : IsLocalization N T
inst✝¹ : Algebra S T
inst✝ : IsScalarTower R S T
x₁ x₂ : S
y₁ : R
s₁ : { x // x ∈ M }
e₁ : x₁ * ↑(algebraMap R S) ↑s₁ = ↑(algebraMap R S) y₁
y₂ : R
s₂ : { x // x ∈ M }
e₂ : x₂ * ↑(algebraMap R S) ↑s₂ = ↑(algebraMap R S) y₂
⊢ (∃ a c, ↑c * (↑a * (y₁ * ↑s₂)) = ↑c * (↑a * (y₂ * ↑s₁))) → ∃ c, ↑c * (y₁ * ↑s₂) = ↑c * (y₂ * ↑s₁)

tactic: exact ⟨a * (⟨_, h b.prop⟩ : N), by convert e using 1 <;> simp <;> ring⟩
state_before: case this.mpr.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.278377
inst✝⁶ : CommRing P
N✝ : Submonoid S
T : Type u_3
inst✝⁵ : CommRing T
inst✝⁴ : Algebra R T
M N : Submonoid R
h : M ≤ N
inst✝³ : IsLocalization M S
inst✝² : IsLocalization N T
inst✝¹ : Algebra S T
inst✝ : IsScalarTower R S T
x₁ x₂ : S
y₁ : R
s₁ : { x // x ∈ M }
e₁ : x₁ * ↑(algebraMap R S) ↑s₁ = ↑(algebraMap R S) y₁
y₂ : R
s₂ : { x // x ∈ M }
e₂ : x₂ * ↑(algebraMap R S) ↑s₂ = ↑(algebraMap R S) y₂
a : { x // x ∈ N }
b : { x // x ∈ M }
e : ↑b * (↑a * (y₁ * ↑s₂)) = ↑b * (↑a * (y₂ * ↑s₁))
⊢ ∃ c, ↑c * (y₁ * ↑s₂) = ↑c * (y₂ * ↑s₁)

tactic: convert e using 1 <;> simp <;> ring
state_before: R : Type u_1
inst✝⁹ : CommRing R
M✝ : Submonoid R
S : Type u_2
inst✝⁸ : CommRing S
inst✝⁷ : Algebra R S
P : Type ?u.278377
inst✝⁶ : CommRing P
N✝ : Submonoid S
T : Type u_3
inst✝⁵ : CommRing T
inst✝⁴ : Algebra R T
M N : Submonoid R
h : M ≤ N
inst✝³ : IsLocalization M S
inst✝² : IsLocalization N T
inst✝¹ : Algebra S T
inst✝ : IsScalarTower R S T
x₁ x₂ : S
y₁ : R
s₁ : { x // x ∈ M }
e₁ : x₁ * ↑(algebraMap R S) ↑s₁ = ↑(algebraMap R S) y₁
y₂ : R
s₂ : { x // x ∈ M }
e₂ : x₂ * ↑(algebraMap R S) ↑s₂ = ↑(algebraMap R S) y₂
a : { x // x ∈ N }
b : { x // x ∈ M }
e : ↑b * (↑a * (y₁ * ↑s₂)) = ↑b * (↑a * (y₂ * ↑s₁))
⊢ ↑(a * { val := ↑b, property := (_ : ↑b ∈ N) }) * (y₁ * ↑s₂) =
    ↑(a * { val := ↑b, property := (_ : ↑b ∈ N) }) * (y₂ * ↑s₁)