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✝¹ : CommRing R
inst✝ : CommRing S
I J : Ideal R
f : R →+* S
hf : Function.Injective ↑f
p : Ideal R
H : p ∈ minimalPrimes R
⊢ ∃ p', IsPrime p' ∧ 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✝¹ : CommRing R
inst✝ : CommRing S
I J : Ideal R
f : R →+* S
hf : Function.Injective ↑f
p : Ideal R
H : p ∈ minimalPrimes R
this✝ : IsPrime p
this : Nontrivial (Localization (Submonoid.map f (primeCompl p)))
⊢ ∃ p', IsPrime p' ∧ 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✝¹ : CommRing R
inst✝ : CommRing S
I J : Ideal R
f : R →+* S
hf : Function.Injective ↑f
p : Ideal R
H : p ∈ minimalPrimes R
this✝ : IsPrime p
this : Nontrivial (Localization (Submonoid.map f (primeCompl p)))
M : Ideal (Localization (Submonoid.map f (primeCompl p)))
hM : IsMaximal M
⊢ ∃ p', IsPrime p' ∧ comap f p' = 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✝¹ : CommRing R
inst✝ : CommRing S
I J : Ideal R
f : R →+* S
hf : Function.Injective ↑f
p : Ideal R
H : p ∈ minimalPrimes R
this✝ : IsPrime p
this : Nontrivial (Localization (Submonoid.map f (primeCompl p)))
M : Ideal (Localization (Submonoid.map f (primeCompl p)))
hM : IsMaximal M
⊢ comap f (comap (algebraMap S (Localization (Submonoid.map f (primeCompl p)))) 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✝¹ : CommRing R
inst✝ : CommRing S
I J : Ideal R
f : R →+* S
hf : Function.Injective ↑f
p : Ideal R
H : p ∈ minimalPrimes R
this✝ : IsPrime p
this : Nontrivial (Localization (Submonoid.map f (primeCompl p)))
M : Ideal (Localization (Submonoid.map f (primeCompl p)))
hM : IsMaximal M
⊢ comap (algebraMap R (Localization (primeCompl p)))
      (comap
        (IsLocalization.map (Localization (Submonoid.map f (primeCompl p))) f
          (_ : primeCompl p ≤ Submonoid.comap f (Submonoid.map f (primeCompl p))))
        M) =
    p

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

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

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

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

tactic: apply IsUnit.map
state_before: case intro
R : Type u_1
S : Type u_2
inst✝¹ : CommRing R
inst✝ : CommRing S
I J : Ideal R
f : R →+* S
hf : Function.Injective ↑f
p : Ideal R
H : p ∈ minimalPrimes R
this✝ : IsPrime p
this : Nontrivial (Localization (Submonoid.map f (primeCompl p)))
M : Ideal (Localization (Submonoid.map f (primeCompl p)))
hM : IsMaximal M
x : R
hx :
  x ∈
    comap (algebraMap R (Localization (primeCompl p)))
      (comap
        (IsLocalization.map (Localization (Submonoid.map f (primeCompl p))) f
          (_ : primeCompl p ≤ Submonoid.comap f (Submonoid.map f (primeCompl p))))
        M)
h : ¬x ∈ p
⊢ IsUnit
    (↑(IsLocalization.map (Localization (Submonoid.map f (primeCompl p))) f
          (_ : primeCompl p ≤ Submonoid.comap f (Submonoid.map f (primeCompl p))))
      (↑(algebraMap R (Localization (primeCompl p))) 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✝¹ : CommRing R
inst✝ : CommRing S
I J : Ideal R
f : R →+* S
hf : Function.Injective ↑f
p : Ideal R
H : p ∈ minimalPrimes R
this✝ : IsPrime p
this : Nontrivial (Localization (Submonoid.map f (primeCompl p)))
M : Ideal (Localization (Submonoid.map f (primeCompl p)))
hM : IsMaximal M
x : R
hx :
  x ∈
    comap (algebraMap R (Localization (primeCompl p)))
      (comap
        (IsLocalization.map (Localization (Submonoid.map f (primeCompl p))) f
          (_ : primeCompl p ≤ Submonoid.comap f (Submonoid.map f (primeCompl p))))
        M)
h : ¬x ∈ p
⊢ IsUnit (↑(algebraMap R (Localization (primeCompl p))) x)

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

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✝¹ : CommRing R
inst✝ : CommRing S
I J : Ideal R
f : R →+* S
hf : Function.Injective ↑f
p : Ideal R
H : p ∈ minimalPrimes R
this : IsPrime p
⊢ 1 ≠ 0

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

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

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