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

tactic: constructor
state_before: R : Type u_2
inst✝³ : CommSemiring R
M : Submonoid R
S : Type u_1
inst✝² : CommSemiring S
inst✝¹ : Algebra R S
inst✝ : IsLocalization M S
J : Ideal S
⊢ Ideal.IsPrime J ↔ Ideal.IsPrime (Ideal.comap (algebraMap R S) J) ∧ Disjoint ↑M ↑(Ideal.comap (algebraMap R S) J)

tactic: refine' fun h =>
  ⟨⟨_, _⟩,
    Set.disjoint_left.mpr fun m hm1 hm2 =>
      h.ne_top (Ideal.eq_top_of_isUnit_mem _ hm2 (map_units S ⟨m, hm1⟩))⟩
state_before: case mp
R : Type u_2
inst✝³ : CommSemiring R
M : Submonoid R
S : Type u_1
inst✝² : CommSemiring S
inst✝¹ : Algebra R S
inst✝ : IsLocalization M S
J : Ideal S
⊢ Ideal.IsPrime J → Ideal.IsPrime (Ideal.comap (algebraMap R S) J) ∧ Disjoint ↑M ↑(Ideal.comap (algebraMap R S) J)

tactic: refine' fun hJ => h.ne_top _
state_before: case mp.refine'_1
R : Type u_2
inst✝³ : CommSemiring R
M : Submonoid R
S : Type u_1
inst✝² : CommSemiring S
inst✝¹ : Algebra R S
inst✝ : IsLocalization M S
J : Ideal S
h : Ideal.IsPrime J
⊢ Ideal.comap (algebraMap R S) J ≠ ⊤

tactic: rw [eq_top_iff, ← (orderEmbedding M S).le_iff_le]
state_before: case mp.refine'_1
R : Type u_2
inst✝³ : CommSemiring R
M : Submonoid R
S : Type u_1
inst✝² : CommSemiring S
inst✝¹ : Algebra R S
inst✝ : IsLocalization M S
J : Ideal S
h : Ideal.IsPrime J
hJ : Ideal.comap (algebraMap R S) J = ⊤
⊢ J = ⊤

tactic: exact le_of_eq hJ.symm
state_before: case mp.refine'_1
R : Type u_2
inst✝³ : CommSemiring R
M : Submonoid R
S : Type u_1
inst✝² : CommSemiring S
inst✝¹ : Algebra R S
inst✝ : IsLocalization M S
J : Ideal S
h : Ideal.IsPrime J
hJ : Ideal.comap (algebraMap R S) J = ⊤
⊢ ↑(orderEmbedding M S) ⊤ ≤ ↑(orderEmbedding M S) J

tactic: intro x y hxy
state_before: case mp.refine'_2
R : Type u_2
inst✝³ : CommSemiring R
M : Submonoid R
S : Type u_1
inst✝² : CommSemiring S
inst✝¹ : Algebra R S
inst✝ : IsLocalization M S
J : Ideal S
h : Ideal.IsPrime J
⊢ ∀ {x y : R},
    x * y ∈ Ideal.comap (algebraMap R S) J → x ∈ Ideal.comap (algebraMap R S) J ∨ y ∈ Ideal.comap (algebraMap R S) J

tactic: rw [Ideal.mem_comap, RingHom.map_mul] at hxy
state_before: case mp.refine'_2
R : Type u_2
inst✝³ : CommSemiring R
M : Submonoid R
S : Type u_1
inst✝² : CommSemiring S
inst✝¹ : Algebra R S
inst✝ : IsLocalization M S
J : Ideal S
h : Ideal.IsPrime J
x y : R
hxy : x * y ∈ Ideal.comap (algebraMap R S) J
⊢ x ∈ Ideal.comap (algebraMap R S) J ∨ y ∈ Ideal.comap (algebraMap R S) J

tactic: exact h.mem_or_mem hxy
state_before: case mp.refine'_2
R : Type u_2
inst✝³ : CommSemiring R
M : Submonoid R
S : Type u_1
inst✝² : CommSemiring S
inst✝¹ : Algebra R S
inst✝ : IsLocalization M S
J : Ideal S
h : Ideal.IsPrime J
x y : R
hxy : ↑(algebraMap R S) x * ↑(algebraMap R S) y ∈ J
⊢ x ∈ Ideal.comap (algebraMap R S) J ∨ y ∈ Ideal.comap (algebraMap R S) J

tactic: refine' fun h => ⟨fun hJ => h.left.ne_top (eq_top_iff.2 _), _⟩
state_before: case mpr
R : Type u_2
inst✝³ : CommSemiring R
M : Submonoid R
S : Type u_1
inst✝² : CommSemiring S
inst✝¹ : Algebra R S
inst✝ : IsLocalization M S
J : Ideal S
⊢ Ideal.IsPrime (Ideal.comap (algebraMap R S) J) ∧ Disjoint ↑M ↑(Ideal.comap (algebraMap R S) J) → Ideal.IsPrime J

tactic: rwa [eq_top_iff, ← (orderEmbedding M S).le_iff_le] at hJ
state_before: case mpr.refine'_1
R : Type u_2
inst✝³ : CommSemiring R
M : Submonoid R
S : Type u_1
inst✝² : CommSemiring S
inst✝¹ : Algebra R S
inst✝ : IsLocalization M S
J : Ideal S
h : Ideal.IsPrime (Ideal.comap (algebraMap R S) J) ∧ Disjoint ↑M ↑(Ideal.comap (algebraMap R S) J)
hJ : J = ⊤
⊢ ⊤ ≤ Ideal.comap (algebraMap R S) J

tactic: intro x y hxy
state_before: case mpr.refine'_2
R : Type u_2
inst✝³ : CommSemiring R
M : Submonoid R
S : Type u_1
inst✝² : CommSemiring S
inst✝¹ : Algebra R S
inst✝ : IsLocalization M S
J : Ideal S
h : Ideal.IsPrime (Ideal.comap (algebraMap R S) J) ∧ Disjoint ↑M ↑(Ideal.comap (algebraMap R S) J)
⊢ ∀ {x y : S}, x * y ∈ J → x ∈ J ∨ y ∈ J

tactic: obtain ⟨a, s, ha⟩ := mk'_surjective M x
state_before: case mpr.refine'_2
R : Type u_2
inst✝³ : CommSemiring R
M : Submonoid R
S : Type u_1
inst✝² : CommSemiring S
inst✝¹ : Algebra R S
inst✝ : IsLocalization M S
J : Ideal S
h : Ideal.IsPrime (Ideal.comap (algebraMap R S) J) ∧ Disjoint ↑M ↑(Ideal.comap (algebraMap R S) J)
x y : S
hxy : x * y ∈ J
⊢ x ∈ J ∨ y ∈ J

tactic: obtain ⟨b, t, hb⟩ := mk'_surjective M y
state_before: case mpr.refine'_2.intro.intro
R : Type u_2
inst✝³ : CommSemiring R
M : Submonoid R
S : Type u_1
inst✝² : CommSemiring S
inst✝¹ : Algebra R S
inst✝ : IsLocalization M S
J : Ideal S
h : Ideal.IsPrime (Ideal.comap (algebraMap R S) J) ∧ Disjoint ↑M ↑(Ideal.comap (algebraMap R S) J)
x y : S
hxy : x * y ∈ J
a : R
s : { x // x ∈ M }
ha : mk' S a s = x
⊢ x ∈ J ∨ y ∈ J

tactic: have : mk' S (a * b) (s * t) ∈ J := by rwa [mk'_mul, ha, hb]
state_before: case mpr.refine'_2.intro.intro.intro.intro
R : Type u_2
inst✝³ : CommSemiring R
M : Submonoid R
S : Type u_1
inst✝² : CommSemiring S
inst✝¹ : Algebra R S
inst✝ : IsLocalization M S
J : Ideal S
h : Ideal.IsPrime (Ideal.comap (algebraMap R S) J) ∧ Disjoint ↑M ↑(Ideal.comap (algebraMap R S) J)
x y : S
hxy : x * y ∈ J
a : R
s : { x // x ∈ M }
ha : mk' S a s = x
b : R
t : { x // x ∈ M }
hb : mk' S b t = y
⊢ x ∈ J ∨ y ∈ J

tactic: rw [mk'_mem_iff, ← Ideal.mem_comap] at this
state_before: case mpr.refine'_2.intro.intro.intro.intro
R : Type u_2
inst✝³ : CommSemiring R
M : Submonoid R
S : Type u_1
inst✝² : CommSemiring S
inst✝¹ : Algebra R S
inst✝ : IsLocalization M S
J : Ideal S
h : Ideal.IsPrime (Ideal.comap (algebraMap R S) J) ∧ Disjoint ↑M ↑(Ideal.comap (algebraMap R S) J)
x y : S
hxy : x * y ∈ J
a : R
s : { x // x ∈ M }
ha : mk' S a s = x
b : R
t : { x // x ∈ M }
hb : mk' S b t = y
this : mk' S (a * b) (s * t) ∈ J
⊢ x ∈ J ∨ y ∈ J

tactic: have this₂ := (h.1).mul_mem_iff_mem_or_mem.1 this
state_before: case mpr.refine'_2.intro.intro.intro.intro
R : Type u_2
inst✝³ : CommSemiring R
M : Submonoid R
S : Type u_1
inst✝² : CommSemiring S
inst✝¹ : Algebra R S
inst✝ : IsLocalization M S
J : Ideal S
h : Ideal.IsPrime (Ideal.comap (algebraMap R S) J) ∧ Disjoint ↑M ↑(Ideal.comap (algebraMap R S) J)
x y : S
hxy : x * y ∈ J
a : R
s : { x // x ∈ M }
ha : mk' S a s = x
b : R
t : { x // x ∈ M }
hb : mk' S b t = y
this : a * b ∈ Ideal.comap (algebraMap R S) J
⊢ x ∈ J ∨ y ∈ J

tactic: rw [Ideal.mem_comap, Ideal.mem_comap] at this₂
state_before: case mpr.refine'_2.intro.intro.intro.intro
R : Type u_2
inst✝³ : CommSemiring R
M : Submonoid R
S : Type u_1
inst✝² : CommSemiring S
inst✝¹ : Algebra R S
inst✝ : IsLocalization M S
J : Ideal S
h : Ideal.IsPrime (Ideal.comap (algebraMap R S) J) ∧ Disjoint ↑M ↑(Ideal.comap (algebraMap R S) J)
x y : S
hxy : x * y ∈ J
a : R
s : { x // x ∈ M }
ha : mk' S a s = x
b : R
t : { x // x ∈ M }
hb : mk' S b t = y
this : a * b ∈ Ideal.comap (algebraMap R S) J
this₂ : a ∈ Ideal.comap (algebraMap R S) J ∨ b ∈ Ideal.comap (algebraMap R S) J
⊢ x ∈ J ∨ y ∈ J

tactic: rwa [← ha, ← hb, mk'_mem_iff, mk'_mem_iff]
state_before: case mpr.refine'_2.intro.intro.intro.intro
R : Type u_2
inst✝³ : CommSemiring R
M : Submonoid R
S : Type u_1
inst✝² : CommSemiring S
inst✝¹ : Algebra R S
inst✝ : IsLocalization M S
J : Ideal S
h : Ideal.IsPrime (Ideal.comap (algebraMap R S) J) ∧ Disjoint ↑M ↑(Ideal.comap (algebraMap R S) J)
x y : S
hxy : x * y ∈ J
a : R
s : { x // x ∈ M }
ha : mk' S a s = x
b : R
t : { x // x ∈ M }
hb : mk' S b t = y
this : a * b ∈ Ideal.comap (algebraMap R S) J
this₂ : ↑(algebraMap R S) a ∈ J ∨ ↑(algebraMap R S) b ∈ J
⊢ x ∈ J ∨ y ∈ J

tactic: rwa [mk'_mul, ha, hb]
state_before: R : Type u_2
inst✝³ : CommSemiring R
M : Submonoid R
S : Type u_1
inst✝² : CommSemiring S
inst✝¹ : Algebra R S
inst✝ : IsLocalization M S
J : Ideal S
h : Ideal.IsPrime (Ideal.comap (algebraMap R S) J) ∧ Disjoint ↑M ↑(Ideal.comap (algebraMap R S) J)
x y : S
hxy : x * y ∈ J
a : R
s : { x // x ∈ M }
ha : mk' S a s = x
b : R
t : { x // x ∈ M }
hb : mk' S b t = y
⊢ mk' S (a * b) (s * t) ∈ J