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

tactic: have := H.1.1
state_before: R : Type u_2
S : Type u_1
inst✝¹ : CommRing R
inst✝ : CommRing S
I✝ J : Ideal R
I : Ideal S
f : R →+* S
p : Ideal R
H : p ∈ Ideal.minimalPrimes (comap f I)
⊢ ∃ p', IsPrime p' ∧ I ≤ p' ∧ comap f p' = p

tactic: let f' := (Ideal.Quotient.mk I).comp f
state_before: R : Type u_2
S : Type u_1
inst✝¹ : CommRing R
inst✝ : CommRing S
I✝ J : Ideal R
I : Ideal S
f : R →+* S
p : Ideal R
H : p ∈ Ideal.minimalPrimes (comap f I)
this : IsPrime p
⊢ ∃ p', IsPrime p' ∧ I ≤ p' ∧ comap f p' = p

tactic: have e : RingHom.ker f' = I.comap f := by
  ext1
  exact Submodule.Quotient.mk_eq_zero _
state_before: R : Type u_2
S : Type u_1
inst✝¹ : CommRing R
inst✝ : CommRing S
I✝ J : Ideal R
I : Ideal S
f : R →+* S
p : Ideal R
H : p ∈ Ideal.minimalPrimes (comap f I)
this : IsPrime p
f' : R →+* S ⧸ I := RingHom.comp (Quotient.mk I) f
⊢ ∃ p', IsPrime p' ∧ I ≤ p' ∧ comap f p' = p

tactic: have : RingHom.ker (Ideal.Quotient.mk <| RingHom.ker f') ≤ p := by
  rw [Ideal.mk_ker, e]
  exact H.1.2
state_before: R : Type u_2
S : Type u_1
inst✝¹ : CommRing R
inst✝ : CommRing S
I✝ J : Ideal R
I : Ideal S
f : R →+* S
p : Ideal R
H : p ∈ Ideal.minimalPrimes (comap f I)
this : IsPrime p
f' : R →+* S ⧸ I := RingHom.comp (Quotient.mk I) f
e : RingHom.ker f' = comap f I
⊢ ∃ p', IsPrime p' ∧ I ≤ p' ∧ comap f p' = p

tactic: refine' ⟨⟨_, bot_le⟩, _⟩
state_before: R : Type u_2
S : Type u_1
inst✝¹ : CommRing R
inst✝ : CommRing S
I✝ J : Ideal R
I : Ideal S
f : R →+* S
p : Ideal R
H : p ∈ Ideal.minimalPrimes (comap f I)
this✝ : IsPrime p
f' : R →+* S ⧸ I := RingHom.comp (Quotient.mk I) f
e : RingHom.ker f' = comap f I
this : RingHom.ker (Quotient.mk (RingHom.ker f')) ≤ p
⊢ map (Quotient.mk (RingHom.ker f')) p ∈ minimalPrimes (R ⧸ RingHom.ker f')

tactic: ext1
state_before: R : Type u_2
S : Type u_1
inst✝¹ : CommRing R
inst✝ : CommRing S
I✝ J : Ideal R
I : Ideal S
f : R →+* S
p : Ideal R
H : p ∈ Ideal.minimalPrimes (comap f I)
this : IsPrime p
f' : R →+* S ⧸ I := RingHom.comp (Quotient.mk I) f
⊢ RingHom.ker f' = comap f I

tactic: exact Submodule.Quotient.mk_eq_zero _
state_before: case h
R : Type u_2
S : Type u_1
inst✝¹ : CommRing R
inst✝ : CommRing S
I✝ J : Ideal R
I : Ideal S
f : R →+* S
p : Ideal R
H : p ∈ Ideal.minimalPrimes (comap f I)
this : IsPrime p
f' : R →+* S ⧸ I := RingHom.comp (Quotient.mk I) f
x✝ : R
⊢ x✝ ∈ RingHom.ker f' ↔ x✝ ∈ comap f I

tactic: rw [Ideal.mk_ker, e]
state_before: R : Type u_2
S : Type u_1
inst✝¹ : CommRing R
inst✝ : CommRing S
I✝ J : Ideal R
I : Ideal S
f : R →+* S
p : Ideal R
H : p ∈ Ideal.minimalPrimes (comap f I)
this : IsPrime p
f' : R →+* S ⧸ I := RingHom.comp (Quotient.mk I) f
e : RingHom.ker f' = comap f I
⊢ RingHom.ker (Quotient.mk (RingHom.ker f')) ≤ p

tactic: exact H.1.2
state_before: R : Type u_2
S : Type u_1
inst✝¹ : CommRing R
inst✝ : CommRing S
I✝ J : Ideal R
I : Ideal S
f : R →+* S
p : Ideal R
H : p ∈ Ideal.minimalPrimes (comap f I)
this : IsPrime p
f' : R →+* S ⧸ I := RingHom.comp (Quotient.mk I) f
e : RingHom.ker f' = comap f I
⊢ comap f I ≤ p

tactic: have ⟨p', hp₁, hp₂⟩ := Ideal.exists_comap_eq_of_mem_minimalPrimes_of_injective
  (RingHom.kerLift_injective f') (p.map <| Ideal.Quotient.mk <| RingHom.ker f') this
state_before: R : Type u_2
S : Type u_1
inst✝¹ : CommRing R
inst✝ : CommRing S
I✝ J : Ideal R
I : Ideal S
f : R →+* S
p : Ideal R
H : p ∈ Ideal.minimalPrimes (comap f I)
this✝¹ : IsPrime p
f' : R →+* S ⧸ I := RingHom.comp (Quotient.mk I) f
e : RingHom.ker f' = comap f I
this✝ : RingHom.ker (Quotient.mk (RingHom.ker f')) ≤ p
this : ?m.52004
⊢ ∃ p', IsPrime p' ∧ I ≤ p' ∧ comap f p' = p

tactic: refine' ⟨p'.comap <| Ideal.Quotient.mk I, Ideal.IsPrime.comap _, _, _⟩
state_before: R : Type u_2
S : Type u_1
inst✝¹ : CommRing R
inst✝ : CommRing S
I✝ J : Ideal R
I : Ideal S
f : R →+* S
p : Ideal R
H : p ∈ Ideal.minimalPrimes (comap f I)
this✝¹ : IsPrime p
f' : R →+* S ⧸ I := RingHom.comp (Quotient.mk I) f
e : RingHom.ker f' = comap f I
this✝ : RingHom.ker (Quotient.mk (RingHom.ker f')) ≤ p
this : map (Quotient.mk (RingHom.ker f')) p ∈ minimalPrimes (R ⧸ RingHom.ker f')
p' : Ideal (S ⧸ I)
hp₁ : IsPrime p'
hp₂ : comap (RingHom.kerLift f') p' = map (Quotient.mk (RingHom.ker f')) p
⊢ ∃ p', IsPrime p' ∧ I ≤ p' ∧ comap f p' = p

tactic: . convert congr_arg (Ideal.comap <| Ideal.Quotient.mk <| RingHom.ker f') hp₂
  rwa [Ideal.comap_map_of_surjective (Ideal.Quotient.mk <| RingHom.ker f')
    Ideal.Quotient.mk_surjective, eq_comm, sup_eq_left]
state_before: case refine'_2
R : Type u_2
S : Type u_1
inst✝¹ : CommRing R
inst✝ : CommRing S
I✝ J : Ideal R
I : Ideal S
f : R →+* S
p : Ideal R
H : p ∈ Ideal.minimalPrimes (comap f I)
this✝¹ : IsPrime p
f' : R →+* S ⧸ I := RingHom.comp (Quotient.mk I) f
e : RingHom.ker f' = comap f I
this✝ : RingHom.ker (Quotient.mk (RingHom.ker f')) ≤ p
this : map (Quotient.mk (RingHom.ker f')) p ∈ minimalPrimes (R ⧸ RingHom.ker f')
p' : Ideal (S ⧸ I)
hp₁ : IsPrime p'
hp₂ : comap (RingHom.kerLift f') p' = map (Quotient.mk (RingHom.ker f')) p
⊢ comap f (comap (Quotient.mk I) p') = p

tactic: exact Ideal.mk_ker.symm.trans_le (Ideal.comap_mono bot_le)
state_before: case refine'_1
R : Type u_2
S : Type u_1
inst✝¹ : CommRing R
inst✝ : CommRing S
I✝ J : Ideal R
I : Ideal S
f : R →+* S
p : Ideal R
H : p ∈ Ideal.minimalPrimes (comap f I)
this✝¹ : IsPrime p
f' : R →+* S ⧸ I := RingHom.comp (Quotient.mk I) f
e : RingHom.ker f' = comap f I
this✝ : RingHom.ker (Quotient.mk (RingHom.ker f')) ≤ p
this : map (Quotient.mk (RingHom.ker f')) p ∈ minimalPrimes (R ⧸ RingHom.ker f')
p' : Ideal (S ⧸ I)
hp₁ : IsPrime p'
hp₂ : comap (RingHom.kerLift f') p' = map (Quotient.mk (RingHom.ker f')) p
⊢ I ≤ comap (Quotient.mk I) p'

tactic: convert congr_arg (Ideal.comap <| Ideal.Quotient.mk <| RingHom.ker f') hp₂
state_before: case refine'_2
R : Type u_2
S : Type u_1
inst✝¹ : CommRing R
inst✝ : CommRing S
I✝ J : Ideal R
I : Ideal S
f : R →+* S
p : Ideal R
H : p ∈ Ideal.minimalPrimes (comap f I)
this✝¹ : IsPrime p
f' : R →+* S ⧸ I := RingHom.comp (Quotient.mk I) f
e : RingHom.ker f' = comap f I
this✝ : RingHom.ker (Quotient.mk (RingHom.ker f')) ≤ p
this : map (Quotient.mk (RingHom.ker f')) p ∈ minimalPrimes (R ⧸ RingHom.ker f')
p' : Ideal (S ⧸ I)
hp₁ : IsPrime p'
hp₂ : comap (RingHom.kerLift f') p' = map (Quotient.mk (RingHom.ker f')) p
⊢ comap f (comap (Quotient.mk I) p') = p

tactic: rwa [Ideal.comap_map_of_surjective (Ideal.Quotient.mk <| RingHom.ker f')
  Ideal.Quotient.mk_surjective, eq_comm, sup_eq_left]
state_before: case h.e'_3
R : Type u_2
S : Type u_1
inst✝¹ : CommRing R
inst✝ : CommRing S
I✝ J : Ideal R
I : Ideal S
f : R →+* S
p : Ideal R
H : p ∈ Ideal.minimalPrimes (comap f I)
this✝¹ : IsPrime p
f' : R →+* S ⧸ I := RingHom.comp (Quotient.mk I) f
e : RingHom.ker f' = comap f I
this✝ : RingHom.ker (Quotient.mk (RingHom.ker f')) ≤ p
this : map (Quotient.mk (RingHom.ker f')) p ∈ minimalPrimes (R ⧸ RingHom.ker f')
p' : Ideal (S ⧸ I)
hp₁ : IsPrime p'
hp₂ : comap (RingHom.kerLift f') p' = map (Quotient.mk (RingHom.ker f')) p
⊢ p = comap (Quotient.mk (RingHom.ker f')) (map (Quotient.mk (RingHom.ker f')) p)

tactic: apply Ideal.map_isPrime_of_surjective _ this
state_before: case refine'_1
R : Type u_2
S : Type u_1
inst✝¹ : CommRing R
inst✝ : CommRing S
I✝ J : Ideal R
I : Ideal S
f : R →+* S
p : Ideal R
H : p ∈ Ideal.minimalPrimes (comap f I)
this✝ : IsPrime p
f' : R →+* S ⧸ I := RingHom.comp (Quotient.mk I) f
e : RingHom.ker f' = comap f I
this : RingHom.ker (Quotient.mk (RingHom.ker f')) ≤ p
⊢ IsPrime (map (Quotient.mk (RingHom.ker f')) p)

tactic: exact Ideal.Quotient.mk_surjective
state_before: R : Type u_2
S : Type u_1
inst✝¹ : CommRing R
inst✝ : CommRing S
I✝ J : Ideal R
I : Ideal S
f : R →+* S
p : Ideal R
H : p ∈ Ideal.minimalPrimes (comap f I)
this✝ : IsPrime p
f' : R →+* S ⧸ I := RingHom.comp (Quotient.mk I) f
e : RingHom.ker f' = comap f I
this : RingHom.ker (Quotient.mk (RingHom.ker f')) ≤ p
⊢ Function.Surjective ↑(Quotient.mk (RingHom.ker f'))

tactic: rintro q ⟨hq, -⟩ hq'
state_before: case refine'_2
R : Type u_2
S : Type u_1
inst✝¹ : CommRing R
inst✝ : CommRing S
I✝ J : Ideal R
I : Ideal S
f : R →+* S
p : Ideal R
H : p ∈ Ideal.minimalPrimes (comap f I)
this✝ : IsPrime p
f' : R →+* S ⧸ I := RingHom.comp (Quotient.mk I) f
e : RingHom.ker f' = comap f I
this : RingHom.ker (Quotient.mk (RingHom.ker f')) ≤ p
⊢ ∀ ⦃b : Ideal (R ⧸ RingHom.ker f')⦄,
    b ∈ {p | IsPrime p ∧ ⊥ ≤ p} →
      (fun x x_1 => x ≤ x_1) b (map (Quotient.mk (RingHom.ker f')) p) →
        (fun x x_1 => x ≤ x_1) (map (Quotient.mk (RingHom.ker f')) p) b

tactic: rw [← Ideal.map_comap_of_surjective
    (Ideal.Quotient.mk (RingHom.ker ((Ideal.Quotient.mk I).comp f)))
    Ideal.Quotient.mk_surjective q]
state_before: case refine'_2.intro
R : Type u_2
S : Type u_1
inst✝¹ : CommRing R
inst✝ : CommRing S
I✝ J : Ideal R
I : Ideal S
f : R →+* S
p : Ideal R
H : p ∈ Ideal.minimalPrimes (comap f I)
this✝ : IsPrime p
f' : R →+* S ⧸ I := RingHom.comp (Quotient.mk I) f
e : RingHom.ker f' = comap f I
this : RingHom.ker (Quotient.mk (RingHom.ker f')) ≤ p
q : Ideal (R ⧸ RingHom.ker f')
hq : IsPrime q
hq' : q ≤ map (Quotient.mk (RingHom.ker f')) p
⊢ map (Quotient.mk (RingHom.ker f')) p ≤ q

tactic: apply Ideal.map_mono
state_before: case refine'_2.intro
R : Type u_2
S : Type u_1
inst✝¹ : CommRing R
inst✝ : CommRing S
I✝ J : Ideal R
I : Ideal S
f : R →+* S
p : Ideal R
H : p ∈ Ideal.minimalPrimes (comap f I)
this✝ : IsPrime p
f' : R →+* S ⧸ I := RingHom.comp (Quotient.mk I) f
e : RingHom.ker f' = comap f I
this : RingHom.ker (Quotient.mk (RingHom.ker f')) ≤ p
q : Ideal (R ⧸ RingHom.ker f')
hq : IsPrime q
hq' : q ≤ map (Quotient.mk (RingHom.ker f')) p
⊢ map (Quotient.mk (RingHom.ker f')) p ≤
    map (Quotient.mk (RingHom.ker (RingHom.comp (Quotient.mk I) f)))
      (comap (Quotient.mk (RingHom.ker (RingHom.comp (Quotient.mk I) f))) q)

tactic: apply H.2
state_before: case refine'_2.intro.h
R : Type u_2
S : Type u_1
inst✝¹ : CommRing R
inst✝ : CommRing S
I✝ J : Ideal R
I : Ideal S
f : R →+* S
p : Ideal R
H : p ∈ Ideal.minimalPrimes (comap f I)
this✝ : IsPrime p
f' : R →+* S ⧸ I := RingHom.comp (Quotient.mk I) f
e : RingHom.ker f' = comap f I
this : RingHom.ker (Quotient.mk (RingHom.ker f')) ≤ p
q : Ideal (R ⧸ RingHom.ker f')
hq : IsPrime q
hq' : q ≤ map (Quotient.mk (RingHom.ker f')) p
⊢ p ≤ comap (Quotient.mk (RingHom.ker (RingHom.comp (Quotient.mk I) f))) q

tactic: refine' ⟨inferInstance, (Ideal.mk_ker.trans e).symm.trans_le (Ideal.comap_mono bot_le)⟩
state_before: case refine'_2.intro.h.a
R : Type u_2
S : Type u_1
inst✝¹ : CommRing R
inst✝ : CommRing S
I✝ J : Ideal R
I : Ideal S
f : R →+* S
p : Ideal R
H : p ∈ Ideal.minimalPrimes (comap f I)
this✝ : IsPrime p
f' : R →+* S ⧸ I := RingHom.comp (Quotient.mk I) f
e : RingHom.ker f' = comap f I
this : RingHom.ker (Quotient.mk (RingHom.ker f')) ≤ p
q : Ideal (R ⧸ RingHom.ker f')
hq : IsPrime q
hq' : q ≤ map (Quotient.mk (RingHom.ker f')) p
⊢ comap (Quotient.mk (RingHom.ker (RingHom.comp (Quotient.mk I) f))) q ∈ {p | IsPrime p ∧ comap f I ≤ p}

tactic: refine' (Ideal.comap_mono hq').trans _
state_before: case refine'_2.intro.h.a
R : Type u_2
S : Type u_1
inst✝¹ : CommRing R
inst✝ : CommRing S
I✝ J : Ideal R
I : Ideal S
f : R →+* S
p : Ideal R
H : p ∈ Ideal.minimalPrimes (comap f I)
this✝ : IsPrime p
f' : R →+* S ⧸ I := RingHom.comp (Quotient.mk I) f
e : RingHom.ker f' = comap f I
this : RingHom.ker (Quotient.mk (RingHom.ker f')) ≤ p
q : Ideal (R ⧸ RingHom.ker f')
hq : IsPrime q
hq' : q ≤ map (Quotient.mk (RingHom.ker f')) p
⊢ comap (Quotient.mk (RingHom.ker (RingHom.comp (Quotient.mk I) f))) q ≤ p

tactic: rw [Ideal.comap_map_of_surjective]
state_before: case refine'_2.intro.h.a
R : Type u_2
S : Type u_1
inst✝¹ : CommRing R
inst✝ : CommRing S
I✝ J : Ideal R
I : Ideal S
f : R →+* S
p : Ideal R
H : p ∈ Ideal.minimalPrimes (comap f I)
this✝ : IsPrime p
f' : R →+* S ⧸ I := RingHom.comp (Quotient.mk I) f
e : RingHom.ker f' = comap f I
this : RingHom.ker (Quotient.mk (RingHom.ker f')) ≤ p
q : Ideal (R ⧸ RingHom.ker f')
hq : IsPrime q
hq' : q ≤ map (Quotient.mk (RingHom.ker f')) p
⊢ comap (Quotient.mk (RingHom.ker (RingHom.comp (Quotient.mk I) f))) (map (Quotient.mk (RingHom.ker f')) p) ≤ p

tactic: exacts [sup_le rfl.le this, Ideal.Quotient.mk_surjective]
state_before: case refine'_2.intro.h.a
R : Type u_2
S : Type u_1
inst✝¹ : CommRing R
inst✝ : CommRing S
I✝ J : Ideal R
I : Ideal S
f : R →+* S
p : Ideal R
H : p ∈ Ideal.minimalPrimes (comap f I)
this✝ : IsPrime p
f' : R →+* S ⧸ I := RingHom.comp (Quotient.mk I) f
e : RingHom.ker f' = comap f I
this : RingHom.ker (Quotient.mk (RingHom.ker f')) ≤ p
q : Ideal (R ⧸ RingHom.ker f')
hq : IsPrime q
hq' : q ≤ map (Quotient.mk (RingHom.ker f')) p
⊢ p ⊔ comap (Quotient.mk (RingHom.ker (RingHom.comp (Quotient.mk I) f))) ⊥ ≤ p

case refine'_2.intro.h.a.hf
R : Type u_2
S : Type u_1
inst✝¹ : CommRing R
inst✝ : CommRing S
I✝ J : Ideal R
I : Ideal S
f : R →+* S
p : Ideal R
H : p ∈ Ideal.minimalPrimes (comap f I)
this✝ : IsPrime p
f' : R →+* S ⧸ I := RingHom.comp (Quotient.mk I) f
e : RingHom.ker f' = comap f I
this : RingHom.ker (Quotient.mk (RingHom.ker f')) ≤ p
q : Ideal (R ⧸ RingHom.ker f')
hq : IsPrime q
hq' : q ≤ map (Quotient.mk (RingHom.ker f')) p
⊢ Function.Surjective ↑(Quotient.mk (RingHom.ker (RingHom.comp (Quotient.mk I) f)))