Theorem: IsLocalization.mem_map_algebraMap_iff
File: Mathlib/RingTheory/Localization/Ideal.lean

tactic: constructor
state_before: R : Type u_1
inst✝³ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝² : CommSemiring S
inst✝¹ : Algebra R S
inst✝ : IsLocalization M S
I : Ideal R
z : S
⊢ z ∈ Ideal.map (algebraMap R S) I ↔ ∃ x, z * (algebraMap R S) ↑x.2 = (algebraMap R S) ↑x.1
state_after: case mp
R : Type u_1
inst✝³ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝² : CommSemiring S
inst✝¹ : Algebra R S
inst✝ : IsLocalization M S
I : Ideal R
z : S
⊢ z ∈ Ideal.map (algebraMap R S) I → ∃ x, z * (algebraMap R S) ↑x.2 = (algebraMap R S) ↑x.1

case mpr
R : Type u_1
inst✝³ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝² : CommSemiring S
inst✝¹ : Algebra R S
inst✝ : IsLocalization M S
I : Ideal R
z : S
⊢ (∃ x, z * (algebraMap R S) ↑x.2 = (algebraMap R S) ↑x.1) → z ∈ Ideal.map (algebraMap R S) I

tactic: change _ → z ∈ map_ideal M S I
state_before: case mp
R : Type u_1
inst✝³ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝² : CommSemiring S
inst✝¹ : Algebra R S
inst✝ : IsLocalization M S
I : Ideal R
z : S
⊢ z ∈ Ideal.map (algebraMap R S) I → ∃ x, z * (algebraMap R S) ↑x.2 = (algebraMap R S) ↑x.1
state_after: case mp
R : Type u_1
inst✝³ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝² : CommSemiring S
inst✝¹ : Algebra R S
inst✝ : IsLocalization M S
I : Ideal R
z : S
⊢ z ∈ Ideal.map (algebraMap R S) I → z ∈ IsLocalization.map_ideal M S I

tactic: refine fun h => Ideal.mem_sInf.1 h fun z hz => ?_
state_before: case mp
R : Type u_1
inst✝³ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝² : CommSemiring S
inst✝¹ : Algebra R S
inst✝ : IsLocalization M S
I : Ideal R
z : S
⊢ z ∈ Ideal.map (algebraMap R S) I → z ∈ IsLocalization.map_ideal M S I
state_after: case mp
R : Type u_1
inst✝³ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝² : CommSemiring S
inst✝¹ : Algebra R S
inst✝ : IsLocalization M S
I : Ideal R
z✝ : S
h : z✝ ∈ Ideal.map (algebraMap R S) I
z : S
hz : z ∈ ⇑(algebraMap R S) '' ↑I
⊢ z ∈ ↑(IsLocalization.map_ideal M S I)

tactic: obtain ⟨y, hy⟩ := hz
state_before: case mp
R : Type u_1
inst✝³ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝² : CommSemiring S
inst✝¹ : Algebra R S
inst✝ : IsLocalization M S
I : Ideal R
z✝ : S
h : z✝ ∈ Ideal.map (algebraMap R S) I
z : S
hz : z ∈ ⇑(algebraMap R S) '' ↑I
⊢ z ∈ ↑(IsLocalization.map_ideal M S I)
state_after: case mp.intro
R : Type u_1
inst✝³ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝² : CommSemiring S
inst✝¹ : Algebra R S
inst✝ : IsLocalization M S
I : Ideal R
z✝ : S
h : z✝ ∈ Ideal.map (algebraMap R S) I
z : S
y : R
hy : y ∈ ↑I ∧ (algebraMap R S) y = z
⊢ z ∈ ↑(IsLocalization.map_ideal M S I)

tactic: let Z : { x // x ∈ I } := ⟨y, hy.left⟩
state_before: case mp.intro
R : Type u_1
inst✝³ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝² : CommSemiring S
inst✝¹ : Algebra R S
inst✝ : IsLocalization M S
I : Ideal R
z✝ : S
h : z✝ ∈ Ideal.map (algebraMap R S) I
z : S
y : R
hy : y ∈ ↑I ∧ (algebraMap R S) y = z
⊢ z ∈ ↑(IsLocalization.map_ideal M S I)
state_after: case mp.intro
R : Type u_1
inst✝³ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝² : CommSemiring S
inst✝¹ : Algebra R S
inst✝ : IsLocalization M S
I : Ideal R
z✝ : S
h : z✝ ∈ Ideal.map (algebraMap R S) I
z : S
y : R
hy : y ∈ ↑I ∧ (algebraMap R S) y = z
Z : ↥I := ⟨y, ⋯⟩
⊢ z ∈ ↑(IsLocalization.map_ideal M S I)

tactic: use ⟨Z, 1⟩
state_before: case mp.intro
R : Type u_1
inst✝³ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝² : CommSemiring S
inst✝¹ : Algebra R S
inst✝ : IsLocalization M S
I : Ideal R
z✝ : S
h : z✝ ∈ Ideal.map (algebraMap R S) I
z : S
y : R
hy : y ∈ ↑I ∧ (algebraMap R S) y = z
Z : ↥I := ⟨y, ⋯⟩
⊢ z ∈ ↑(IsLocalization.map_ideal M S I)
state_after: case h
R : Type u_1
inst✝³ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝² : CommSemiring S
inst✝¹ : Algebra R S
inst✝ : IsLocalization M S
I : Ideal R
z✝ : S
h : z✝ ∈ Ideal.map (algebraMap R S) I
z : S
y : R
hy : y ∈ ↑I ∧ (algebraMap R S) y = z
Z : ↥I := ⟨y, ⋯⟩
⊢ z * (algebraMap R S) ↑(Z, 1).2 = (algebraMap R S) ↑(Z, 1).1

tactic: simp [hy.right]
state_before: case h
R : Type u_1
inst✝³ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝² : CommSemiring S
inst✝¹ : Algebra R S
inst✝ : IsLocalization M S
I : Ideal R
z✝ : S
h : z✝ ∈ Ideal.map (algebraMap R S) I
z : S
y : R
hy : y ∈ ↑I ∧ (algebraMap R S) y = z
Z : ↥I := ⟨y, ⋯⟩
⊢ z * (algebraMap R S) ↑(Z, 1).2 = (algebraMap R S) ↑(Z, 1).1
state_after: no goals

tactic: rintro ⟨⟨a, s⟩, h⟩
state_before: case mpr
R : Type u_1
inst✝³ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝² : CommSemiring S
inst✝¹ : Algebra R S
inst✝ : IsLocalization M S
I : Ideal R
z : S
⊢ (∃ x, z * (algebraMap R S) ↑x.2 = (algebraMap R S) ↑x.1) → z ∈ Ideal.map (algebraMap R S) I
state_after: case mpr.intro.mk
R : Type u_1
inst✝³ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝² : CommSemiring S
inst✝¹ : Algebra R S
inst✝ : IsLocalization M S
I : Ideal R
z : S
a : ↥I
s : ↥M
h : z * (algebraMap R S) ↑(a, s).2 = (algebraMap R S) ↑(a, s).1
⊢ z ∈ Ideal.map (algebraMap R S) I

tactic: rw [← Ideal.unit_mul_mem_iff_mem _ (map_units S s), mul_comm]
state_before: case mpr.intro.mk
R : Type u_1
inst✝³ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝² : CommSemiring S
inst✝¹ : Algebra R S
inst✝ : IsLocalization M S
I : Ideal R
z : S
a : ↥I
s : ↥M
h : z * (algebraMap R S) ↑(a, s).2 = (algebraMap R S) ↑(a, s).1
⊢ z ∈ Ideal.map (algebraMap R S) I
state_after: case mpr.intro.mk
R : Type u_1
inst✝³ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝² : CommSemiring S
inst✝¹ : Algebra R S
inst✝ : IsLocalization M S
I : Ideal R
z : S
a : ↥I
s : ↥M
h : z * (algebraMap R S) ↑(a, s).2 = (algebraMap R S) ↑(a, s).1
⊢ z * (algebraMap R S) ↑s ∈ Ideal.map (algebraMap R S) I

tactic: exact h.symm ▸ Ideal.mem_map_of_mem _ a.2
state_before: case mpr.intro.mk
R : Type u_1
inst✝³ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝² : CommSemiring S
inst✝¹ : Algebra R S
inst✝ : IsLocalization M S
I : Ideal R
z : S
a : ↥I
s : ↥M
h : z * (algebraMap R S) ↑(a, s).2 = (algebraMap R S) ↑(a, s).1
⊢ z * (algebraMap R S) ↑s ∈ Ideal.map (algebraMap R S) I
state_after: no goals