Theorem: Ideal.exists_comap_eq_of_mem_minimalPrimes_of_injective
File: Mathlib/RingTheory/Ideal/MinimalPrime.lean

tactic: have := H.1.1
state_before: R : Type u_1
S : Type u_2
inst✝¹ : CommSemiring R
inst✝ : CommSemiring S
I J : Ideal R
f : R →+* S
hf : Function.Injective ⇑f
p : Ideal R
H : p ∈ minimalPrimes R
⊢ ∃ p', p'.IsPrime ∧ comap f p' = p
state_after: R : Type u_1
S : Type u_2
inst✝¹ : CommSemiring R
inst✝ : CommSemiring S
I J : Ideal R
f : R →+* S
hf : Function.Injective ⇑f
p : Ideal R
H : p ∈ minimalPrimes R
this : p.IsPrime
⊢ ∃ p', p'.IsPrime ∧ comap f p' = p

tactic: obtain ⟨M, hM⟩ := Ideal.exists_maximal (Localization (Submonoid.map f p.primeCompl))
state_before: R : Type u_1
S : Type u_2
inst✝¹ : CommSemiring R
inst✝ : CommSemiring S
I J : Ideal R
f : R →+* S
hf : Function.Injective ⇑f
p : Ideal R
H : p ∈ minimalPrimes R
this✝ : p.IsPrime
this : Nontrivial (Localization (Submonoid.map f p.primeCompl))
⊢ ∃ p', p'.IsPrime ∧ comap f p' = p
state_after: case intro
R : Type u_1
S : Type u_2
inst✝¹ : CommSemiring R
inst✝ : CommSemiring S
I J : Ideal R
f : R →+* S
hf : Function.Injective ⇑f
p : Ideal R
H : p ∈ minimalPrimes R
this✝ : p.IsPrime
this : Nontrivial (Localization (Submonoid.map f p.primeCompl))
M : Ideal (Localization (Submonoid.map f p.primeCompl))
hM : M.IsMaximal
⊢ ∃ p', p'.IsPrime ∧ comap f p' = p

tactic: refine ⟨M.comap (algebraMap S <| Localization (Submonoid.map f p.primeCompl)), inferInstance, ?_⟩
state_before: case intro
R : Type u_1
S : Type u_2
inst✝¹ : CommSemiring R
inst✝ : CommSemiring S
I J : Ideal R
f : R →+* S
hf : Function.Injective ⇑f
p : Ideal R
H : p ∈ minimalPrimes R
this✝ : p.IsPrime
this : Nontrivial (Localization (Submonoid.map f p.primeCompl))
M : Ideal (Localization (Submonoid.map f p.primeCompl))
hM : M.IsMaximal
⊢ ∃ p', p'.IsPrime ∧ comap f p' = p
state_after: case intro
R : Type u_1
S : Type u_2
inst✝¹ : CommSemiring R
inst✝ : CommSemiring S
I J : Ideal R
f : R →+* S
hf : Function.Injective ⇑f
p : Ideal R
H : p ∈ minimalPrimes R
this✝ : p.IsPrime
this : Nontrivial (Localization (Submonoid.map f p.primeCompl))
M : Ideal (Localization (Submonoid.map f p.primeCompl))
hM : M.IsMaximal
⊢ comap f (comap (algebraMap S (Localization (Submonoid.map f p.primeCompl))) M) = p

tactic: rw [Ideal.comap_comap, ← @IsLocalization.map_comp _ _ _ _ _ _ _ _ Localization.isLocalization
    _ _ _ _ p.primeCompl.le_comap_map _ Localization.isLocalization,
  ← Ideal.comap_comap]
state_before: case intro
R : Type u_1
S : Type u_2
inst✝¹ : CommSemiring R
inst✝ : CommSemiring S
I J : Ideal R
f : R →+* S
hf : Function.Injective ⇑f
p : Ideal R
H : p ∈ minimalPrimes R
this✝ : p.IsPrime
this : Nontrivial (Localization (Submonoid.map f p.primeCompl))
M : Ideal (Localization (Submonoid.map f p.primeCompl))
hM : M.IsMaximal
⊢ comap f (comap (algebraMap S (Localization (Submonoid.map f p.primeCompl))) M) = p
state_after: case intro
R : Type u_1
S : Type u_2
inst✝¹ : CommSemiring R
inst✝ : CommSemiring S
I J : Ideal R
f : R →+* S
hf : Function.Injective ⇑f
p : Ideal R
H : p ∈ minimalPrimes R
this✝ : p.IsPrime
this : Nontrivial (Localization (Submonoid.map f p.primeCompl))
M : Ideal (Localization (Submonoid.map f p.primeCompl))
hM : M.IsMaximal
⊢ comap (algebraMap R (Localization p.primeCompl))
      (comap (IsLocalization.map (Localization (Submonoid.map f p.primeCompl)) f ⋯) M) =
    p

tactic: suffices _ ≤ p by exact this.antisymm (H.2 ⟨inferInstance, bot_le⟩ this)
state_before: case intro
R : Type u_1
S : Type u_2
inst✝¹ : CommSemiring R
inst✝ : CommSemiring S
I J : Ideal R
f : R →+* S
hf : Function.Injective ⇑f
p : Ideal R
H : p ∈ minimalPrimes R
this✝ : p.IsPrime
this : Nontrivial (Localization (Submonoid.map f p.primeCompl))
M : Ideal (Localization (Submonoid.map f p.primeCompl))
hM : M.IsMaximal
⊢ comap (algebraMap R (Localization p.primeCompl))
      (comap (IsLocalization.map (Localization (Submonoid.map f p.primeCompl)) f ⋯) M) =
    p
state_after: case intro
R : Type u_1
S : Type u_2
inst✝¹ : CommSemiring R
inst✝ : CommSemiring S
I J : Ideal R
f : R →+* S
hf : Function.Injective ⇑f
p : Ideal R
H : p ∈ minimalPrimes R
this✝ : p.IsPrime
this : Nontrivial (Localization (Submonoid.map f p.primeCompl))
M : Ideal (Localization (Submonoid.map f p.primeCompl))
hM : M.IsMaximal
⊢ comap (algebraMap R (Localization p.primeCompl))
      (comap (IsLocalization.map (Localization (Submonoid.map f p.primeCompl)) f ⋯) M) ≤
    p

tactic: intro x hx
state_before: case intro
R : Type u_1
S : Type u_2
inst✝¹ : CommSemiring R
inst✝ : CommSemiring S
I J : Ideal R
f : R →+* S
hf : Function.Injective ⇑f
p : Ideal R
H : p ∈ minimalPrimes R
this✝ : p.IsPrime
this : Nontrivial (Localization (Submonoid.map f p.primeCompl))
M : Ideal (Localization (Submonoid.map f p.primeCompl))
hM : M.IsMaximal
⊢ comap (algebraMap R (Localization p.primeCompl))
      (comap (IsLocalization.map (Localization (Submonoid.map f p.primeCompl)) f ⋯) M) ≤
    p
state_after: case intro
R : Type u_1
S : Type u_2
inst✝¹ : CommSemiring R
inst✝ : CommSemiring S
I J : Ideal R
f : R →+* S
hf : Function.Injective ⇑f
p : Ideal R
H : p ∈ minimalPrimes R
this✝ : p.IsPrime
this : Nontrivial (Localization (Submonoid.map f p.primeCompl))
M : Ideal (Localization (Submonoid.map f p.primeCompl))
hM : M.IsMaximal
x : R
hx :
  x ∈
    comap (algebraMap R (Localization p.primeCompl))
      (comap (IsLocalization.map (Localization (Submonoid.map f p.primeCompl)) f ⋯) M)
⊢ x ∈ p

tactic: by_contra h
state_before: case intro
R : Type u_1
S : Type u_2
inst✝¹ : CommSemiring R
inst✝ : CommSemiring S
I J : Ideal R
f : R →+* S
hf : Function.Injective ⇑f
p : Ideal R
H : p ∈ minimalPrimes R
this✝ : p.IsPrime
this : Nontrivial (Localization (Submonoid.map f p.primeCompl))
M : Ideal (Localization (Submonoid.map f p.primeCompl))
hM : M.IsMaximal
x : R
hx :
  x ∈
    comap (algebraMap R (Localization p.primeCompl))
      (comap (IsLocalization.map (Localization (Submonoid.map f p.primeCompl)) f ⋯) M)
⊢ x ∈ p
state_after: case intro
R : Type u_1
S : Type u_2
inst✝¹ : CommSemiring R
inst✝ : CommSemiring S
I J : Ideal R
f : R →+* S
hf : Function.Injective ⇑f
p : Ideal R
H : p ∈ minimalPrimes R
this✝ : p.IsPrime
this : Nontrivial (Localization (Submonoid.map f p.primeCompl))
M : Ideal (Localization (Submonoid.map f p.primeCompl))
hM : M.IsMaximal
x : R
hx :
  x ∈
    comap (algebraMap R (Localization p.primeCompl))
      (comap (IsLocalization.map (Localization (Submonoid.map f p.primeCompl)) f ⋯) M)
h : x ∉ p
⊢ False

tactic: apply hM.ne_top
state_before: case intro
R : Type u_1
S : Type u_2
inst✝¹ : CommSemiring R
inst✝ : CommSemiring S
I J : Ideal R
f : R →+* S
hf : Function.Injective ⇑f
p : Ideal R
H : p ∈ minimalPrimes R
this✝ : p.IsPrime
this : Nontrivial (Localization (Submonoid.map f p.primeCompl))
M : Ideal (Localization (Submonoid.map f p.primeCompl))
hM : M.IsMaximal
x : R
hx :
  x ∈
    comap (algebraMap R (Localization p.primeCompl))
      (comap (IsLocalization.map (Localization (Submonoid.map f p.primeCompl)) f ⋯) M)
h : x ∉ p
⊢ False
state_after: case intro
R : Type u_1
S : Type u_2
inst✝¹ : CommSemiring R
inst✝ : CommSemiring S
I J : Ideal R
f : R →+* S
hf : Function.Injective ⇑f
p : Ideal R
H : p ∈ minimalPrimes R
this✝ : p.IsPrime
this : Nontrivial (Localization (Submonoid.map f p.primeCompl))
M : Ideal (Localization (Submonoid.map f p.primeCompl))
hM : M.IsMaximal
x : R
hx :
  x ∈
    comap (algebraMap R (Localization p.primeCompl))
      (comap (IsLocalization.map (Localization (Submonoid.map f p.primeCompl)) f ⋯) M)
h : x ∉ p
⊢ M = ⊤

tactic: apply M.eq_top_of_isUnit_mem hx
state_before: case intro
R : Type u_1
S : Type u_2
inst✝¹ : CommSemiring R
inst✝ : CommSemiring S
I J : Ideal R
f : R →+* S
hf : Function.Injective ⇑f
p : Ideal R
H : p ∈ minimalPrimes R
this✝ : p.IsPrime
this : Nontrivial (Localization (Submonoid.map f p.primeCompl))
M : Ideal (Localization (Submonoid.map f p.primeCompl))
hM : M.IsMaximal
x : R
hx :
  x ∈
    comap (algebraMap R (Localization p.primeCompl))
      (comap (IsLocalization.map (Localization (Submonoid.map f p.primeCompl)) f ⋯) M)
h : x ∉ p
⊢ M = ⊤
state_after: case intro
R : Type u_1
S : Type u_2
inst✝¹ : CommSemiring R
inst✝ : CommSemiring S
I J : Ideal R
f : R →+* S
hf : Function.Injective ⇑f
p : Ideal R
H : p ∈ minimalPrimes R
this✝ : p.IsPrime
this : Nontrivial (Localization (Submonoid.map f p.primeCompl))
M : Ideal (Localization (Submonoid.map f p.primeCompl))
hM : M.IsMaximal
x : R
hx :
  x ∈
    comap (algebraMap R (Localization p.primeCompl))
      (comap (IsLocalization.map (Localization (Submonoid.map f p.primeCompl)) f ⋯) M)
h : x ∉ p
⊢ IsUnit
    ((IsLocalization.map (Localization (Submonoid.map f p.primeCompl)) f ⋯)
      ((algebraMap R (Localization p.primeCompl)) x))

tactic: apply IsUnit.map
state_before: case intro
R : Type u_1
S : Type u_2
inst✝¹ : CommSemiring R
inst✝ : CommSemiring S
I J : Ideal R
f : R →+* S
hf : Function.Injective ⇑f
p : Ideal R
H : p ∈ minimalPrimes R
this✝ : p.IsPrime
this : Nontrivial (Localization (Submonoid.map f p.primeCompl))
M : Ideal (Localization (Submonoid.map f p.primeCompl))
hM : M.IsMaximal
x : R
hx :
  x ∈
    comap (algebraMap R (Localization p.primeCompl))
      (comap (IsLocalization.map (Localization (Submonoid.map f p.primeCompl)) f ⋯) M)
h : x ∉ p
⊢ IsUnit
    ((IsLocalization.map (Localization (Submonoid.map f p.primeCompl)) f ⋯)
      ((algebraMap R (Localization p.primeCompl)) x))
state_after: case intro.h
R : Type u_1
S : Type u_2
inst✝¹ : CommSemiring R
inst✝ : CommSemiring S
I J : Ideal R
f : R →+* S
hf : Function.Injective ⇑f
p : Ideal R
H : p ∈ minimalPrimes R
this✝ : p.IsPrime
this : Nontrivial (Localization (Submonoid.map f p.primeCompl))
M : Ideal (Localization (Submonoid.map f p.primeCompl))
hM : M.IsMaximal
x : R
hx :
  x ∈
    comap (algebraMap R (Localization p.primeCompl))
      (comap (IsLocalization.map (Localization (Submonoid.map f p.primeCompl)) f ⋯) M)
h : x ∉ p
⊢ IsUnit ((algebraMap R (Localization p.primeCompl)) x)

tactic: apply IsLocalization.map_units _ (show p.primeCompl from ⟨x, h⟩)
state_before: case intro.h
R : Type u_1
S : Type u_2
inst✝¹ : CommSemiring R
inst✝ : CommSemiring S
I J : Ideal R
f : R →+* S
hf : Function.Injective ⇑f
p : Ideal R
H : p ∈ minimalPrimes R
this✝ : p.IsPrime
this : Nontrivial (Localization (Submonoid.map f p.primeCompl))
M : Ideal (Localization (Submonoid.map f p.primeCompl))
hM : M.IsMaximal
x : R
hx :
  x ∈
    comap (algebraMap R (Localization p.primeCompl))
      (comap (IsLocalization.map (Localization (Submonoid.map f p.primeCompl)) f ⋯) M)
h : x ∉ p
⊢ IsUnit ((algebraMap R (Localization p.primeCompl)) x)
state_after: no goals

tactic: refine ⟨⟨1, 0, ?_⟩⟩
state_before: R : Type u_1
S : Type u_2
inst✝¹ : CommSemiring R
inst✝ : CommSemiring S
I J : Ideal R
f : R →+* S
hf : Function.Injective ⇑f
p : Ideal R
H : p ∈ minimalPrimes R
this : p.IsPrime
⊢ Nontrivial (Localization (Submonoid.map f p.primeCompl))
state_after: R : Type u_1
S : Type u_2
inst✝¹ : CommSemiring R
inst✝ : CommSemiring S
I J : Ideal R
f : R →+* S
hf : Function.Injective ⇑f
p : Ideal R
H : p ∈ minimalPrimes R
this : p.IsPrime
⊢ 1 ≠ 0

tactic: convert (IsLocalization.map_injective_of_injective p.primeCompl (Localization.AtPrime p)
    (Localization <| p.primeCompl.map f) hf).ne one_ne_zero
state_before: R : Type u_1
S : Type u_2
inst✝¹ : CommSemiring R
inst✝ : CommSemiring S
I J : Ideal R
f : R →+* S
hf : Function.Injective ⇑f
p : Ideal R
H : p ∈ minimalPrimes R
this : p.IsPrime
⊢ 1 ≠ 0
state_after: case h.e'_2
R : Type u_1
S : Type u_2
inst✝¹ : CommSemiring R
inst✝ : CommSemiring S
I J : Ideal R
f : R →+* S
hf : Function.Injective ⇑f
p : Ideal R
H : p ∈ minimalPrimes R
this : p.IsPrime
⊢ 1 = (IsLocalization.map (Localization (Submonoid.map f p.primeCompl)) f ⋯) 1

case h.e'_3
R : Type u_1
S : Type u_2
inst✝¹ : CommSemiring R
inst✝ : CommSemiring S
I J : Ideal R
f : R →+* S
hf : Function.Injective ⇑f
p : Ideal R
H : p ∈ minimalPrimes R
this : p.IsPrime
⊢ 0 = (IsLocalization.map (Localization (Submonoid.map f p.primeCompl)) f ⋯) 0

tactic: rw [map_one]
state_before: case h.e'_2
R : Type u_1
S : Type u_2
inst✝¹ : CommSemiring R
inst✝ : CommSemiring S
I J : Ideal R
f : R →+* S
hf : Function.Injective ⇑f
p : Ideal R
H : p ∈ minimalPrimes R
this : p.IsPrime
⊢ 1 = (IsLocalization.map (Localization (Submonoid.map f p.primeCompl)) f ⋯) 1
state_after: no goals

tactic: rw [map_zero]
state_before: case h.e'_3
R : Type u_1
S : Type u_2
inst✝¹ : CommSemiring R
inst✝ : CommSemiring S
I J : Ideal R
f : R →+* S
hf : Function.Injective ⇑f
p : Ideal R
H : p ∈ minimalPrimes R
this : p.IsPrime
⊢ 0 = (IsLocalization.map (Localization (Submonoid.map f p.primeCompl)) f ⋯) 0
state_after: no goals

tactic: exact this.antisymm (H.2 ⟨inferInstance, bot_le⟩ this)
state_before: R : Type u_1
S : Type u_2
inst✝¹ : CommSemiring R
inst✝ : CommSemiring S
I J : Ideal R
f : R →+* S
hf : Function.Injective ⇑f
p : Ideal R
H : p ∈ minimalPrimes R
this✝¹ : p.IsPrime
this✝ : Nontrivial (Localization (Submonoid.map f p.primeCompl))
M : Ideal (Localization (Submonoid.map f p.primeCompl))
hM : M.IsMaximal
this : ?m.24155 ≤ p
⊢ comap (algebraMap R (Localization p.primeCompl))
      (comap (IsLocalization.map (Localization (Submonoid.map f p.primeCompl)) f ⋯) M) =
    p
state_after: no goals