-- Mathlib/RingTheory/DedekindDomain/Ideal.lean
theorem exists_multiset_prod_cons_le_and_prod_not_le [IsDedekindDomain A] (hNF : ¬IsField A)
    {I M : Ideal A} (hI0 : I ≠ ⊥) (hIM : I ≤ M) [hM : M.IsMaximal] :
    ∃ Z : Multiset (PrimeSpectrum A),
      (M ::ₘ Z.map PrimeSpectrum.asIdeal).prod ≤ I ∧
        ¬Multiset.prod (Z.map PrimeSpectrum.asIdeal) ≤ I

Proof state:
case intro.intro.intro.intro.intro.intro.intro.intro.intro.refine_2
A : Type u_2
inst✝¹ : CommRing A
inst✝ : IsDedekindDomain A
hNF : ¬IsField A
I : Ideal A
hI0 : I ≠ ⊥
Z₀ : Multiset (PrimeSpectrum A)
hZ₀ : (Multiset.map PrimeSpectrum.asIdeal Z₀).prod ≤ I ∧ (Multiset.map PrimeSpectrum.asIdeal Z₀).prod ≠ ⊥
Z : Multiset (PrimeSpectrum A)
h_eraseZ :
  ∀ x ∈ {Z | (Multiset.map PrimeSpectrum.asIdeal Z).prod ≤ I ∧ (Multiset.map PrimeSpectrum.asIdeal Z).prod ≠ ⊥}, ¬x < Z
hZI : (Multiset.map PrimeSpectrum.asIdeal Z).prod ≤ I
hprodZ : (Multiset.map PrimeSpectrum.asIdeal Z).prod ≠ ⊥
P : PrimeSpectrum A
hPZ : P ∈ Z
hPZ' : P.asIdeal ∈ Multiset.map PrimeSpectrum.asIdeal Z
this : Multiset.map PrimeSpectrum.asIdeal (Z.erase P) = (Multiset.map PrimeSpectrum.asIdeal Z).erase P.asIdeal
hP0 : P.asIdeal ≠ ⊥
hZP0 : (Multiset.map PrimeSpectrum.asIdeal (Z.erase P)).prod ≠ ⊥
hIM : I ≤ P.asIdeal
hM : P.asIdeal.IsMaximal
hPM : P.asIdeal ≤ P.asIdeal
⊢ ¬(Multiset.map PrimeSpectrum.asIdeal (Z.erase P)).prod ≤ I

Tactic:
refine fun h => h_eraseZ (Z.erase P) ⟨h, ?_⟩ (Multiset.erase_lt.mpr hPZ)

Result:
case intro.intro.intro.intro.intro.intro.intro.intro.intro.refine_2
A : Type u_2
inst✝¹ : CommRing A
inst✝ : IsDedekindDomain A
hNF : ¬IsField A
I : Ideal A
hI0 : I ≠ ⊥
Z₀ : Multiset (PrimeSpectrum A)
hZ₀ : (Multiset.map PrimeSpectrum.asIdeal Z₀).prod ≤ I ∧ (Multiset.map PrimeSpectrum.asIdeal Z₀).prod ≠ ⊥
Z : Multiset (PrimeSpectrum A)
h_eraseZ :
  ∀ x ∈ {Z | (Multiset.map PrimeSpectrum.asIdeal Z).prod ≤ I ∧ (Multiset.map PrimeSpectrum.asIdeal Z).prod ≠ ⊥}, ¬x < Z
hZI : (Multiset.map PrimeSpectrum.asIdeal Z).prod ≤ I
hprodZ : (Multiset.map PrimeSpectrum.asIdeal Z).prod ≠ ⊥
P : PrimeSpectrum A
hPZ : P ∈ Z
hPZ' : P.asIdeal ∈ Multiset.map PrimeSpectrum.asIdeal Z
this : Multiset.map PrimeSpectrum.asIdeal (Z.erase P) = (Multiset.map PrimeSpectrum.asIdeal Z).erase P.asIdeal
hP0 : P.asIdeal ≠ ⊥
hZP0 : (Multiset.map PrimeSpectrum.asIdeal (Z.erase P)).prod ≠ ⊥
hIM : I ≤ P.asIdeal
hM : P.asIdeal.IsMaximal
hPM : P.asIdeal ≤ P.asIdeal
h : (Multiset.map PrimeSpectrum.asIdeal (Z.erase P)).prod ≤ I
⊢ (Multiset.map PrimeSpectrum.asIdeal (Z.erase P)).prod ≠ ⊥

Proof state:
A : Type u_2
inst✝¹ : CommRing A
inst✝ : IsDedekindDomain A
hNF : ¬IsField A
I M : Ideal A
hI0 : I ≠ ⊥
hIM : I ≤ M
hM : M.IsMaximal
Z₀ : Multiset (PrimeSpectrum A)
hZ₀ : (Multiset.map PrimeSpectrum.asIdeal Z₀).prod ≤ I ∧ (Multiset.map PrimeSpectrum.asIdeal Z₀).prod ≠ ⊥
Z : Multiset (PrimeSpectrum A)
h_eraseZ :
  ∀ x ∈ {Z | (Multiset.map PrimeSpectrum.asIdeal Z).prod ≤ I ∧ (Multiset.map PrimeSpectrum.asIdeal Z).prod ≠ ⊥}, ¬x < Z
hZI : (Multiset.map PrimeSpectrum.asIdeal Z).prod ≤ I
hprodZ : (Multiset.map PrimeSpectrum.asIdeal Z).prod ≠ ⊥
P : PrimeSpectrum A
hPZ : P ∈ Z
hPZ' : P.asIdeal ∈ Multiset.map PrimeSpectrum.asIdeal Z
hPM : P.asIdeal ≤ M
this : Multiset.map PrimeSpectrum.asIdeal (Z.erase P) = (Multiset.map PrimeSpectrum.asIdeal Z).erase P.asIdeal
⊢ P.asIdeal ≠ ⊥ ∧ (Multiset.map PrimeSpectrum.asIdeal (Z.erase P)).prod ≠ ⊥

Tactic:
rwa [Ne, ← Multiset.cons_erase hPZ', Multiset.prod_cons, Ideal.mul_eq_bot, not_or, ←
  this] at hprodZ

Result:
no goals

Proof state:
case intro.intro.intro.intro.intro.intro.intro.intro.intro.refine_1
A : Type u_2
inst✝¹ : CommRing A
inst✝ : IsDedekindDomain A
hNF : ¬IsField A
I : Ideal A
hI0 : I ≠ ⊥
Z₀ : Multiset (PrimeSpectrum A)
hZ₀ : (Multiset.map PrimeSpectrum.asIdeal Z₀).prod ≤ I ∧ (Multiset.map PrimeSpectrum.asIdeal Z₀).prod ≠ ⊥
Z : Multiset (PrimeSpectrum A)
h_eraseZ :
  ∀ x ∈ {Z | (Multiset.map PrimeSpectrum.asIdeal Z).prod ≤ I ∧ (Multiset.map PrimeSpectrum.asIdeal Z).prod ≠ ⊥}, ¬x < Z
hZI : (Multiset.map PrimeSpectrum.asIdeal Z).prod ≤ I
hprodZ : (Multiset.map PrimeSpectrum.asIdeal Z).prod ≠ ⊥
P : PrimeSpectrum A
hPZ : P ∈ Z
hPZ' : P.asIdeal ∈ Multiset.map PrimeSpectrum.asIdeal Z
this : Multiset.map PrimeSpectrum.asIdeal (Z.erase P) = (Multiset.map PrimeSpectrum.asIdeal Z).erase P.asIdeal
hP0 : P.asIdeal ≠ ⊥
hZP0 : (Multiset.map PrimeSpectrum.asIdeal (Z.erase P)).prod ≠ ⊥
hIM : I ≤ P.asIdeal
hM : P.asIdeal.IsMaximal
hPM : P.asIdeal ≤ P.asIdeal
⊢ (P.asIdeal ::ₘ Multiset.map PrimeSpectrum.asIdeal (Z.erase P)).prod ≤ I

Tactic:
convert hZI

Result:
case h.e'_3.h.e'_3
A : Type u_2
inst✝¹ : CommRing A
inst✝ : IsDedekindDomain A
hNF : ¬IsField A
I : Ideal A
hI0 : I ≠ ⊥
Z₀ : Multiset (PrimeSpectrum A)
hZ₀ : (Multiset.map PrimeSpectrum.asIdeal Z₀).prod ≤ I ∧ (Multiset.map PrimeSpectrum.asIdeal Z₀).prod ≠ ⊥
Z : Multiset (PrimeSpectrum A)
h_eraseZ :
  ∀ x ∈ {Z | (Multiset.map PrimeSpectrum.asIdeal Z).prod ≤ I ∧ (Multiset.map PrimeSpectrum.asIdeal Z).prod ≠ ⊥}, ¬x < Z
hZI : (Multiset.map PrimeSpectrum.asIdeal Z).prod ≤ I
hprodZ : (Multiset.map PrimeSpectrum.asIdeal Z).prod ≠ ⊥
P : PrimeSpectrum A
hPZ : P ∈ Z
hPZ' : P.asIdeal ∈ Multiset.map PrimeSpectrum.asIdeal Z
this : Multiset.map PrimeSpectrum.asIdeal (Z.erase P) = (Multiset.map PrimeSpectrum.asIdeal Z).erase P.asIdeal
hP0 : P.asIdeal ≠ ⊥
hZP0 : (Multiset.map PrimeSpectrum.asIdeal (Z.erase P)).prod ≠ ⊥
hIM : I ≤ P.asIdeal
hM : P.asIdeal.IsMaximal
hPM : P.asIdeal ≤ P.asIdeal
⊢ P.asIdeal ::ₘ Multiset.map PrimeSpectrum.asIdeal (Z.erase P) = Multiset.map PrimeSpectrum.asIdeal Z

Proof state:
case h.e'_3.h.e'_3
A : Type u_2
inst✝¹ : CommRing A
inst✝ : IsDedekindDomain A
hNF : ¬IsField A
I : Ideal A
hI0 : I ≠ ⊥
Z₀ : Multiset (PrimeSpectrum A)
hZ₀ : (Multiset.map PrimeSpectrum.asIdeal Z₀).prod ≤ I ∧ (Multiset.map PrimeSpectrum.asIdeal Z₀).prod ≠ ⊥
Z : Multiset (PrimeSpectrum A)
h_eraseZ :
  ∀ x ∈ {Z | (Multiset.map PrimeSpectrum.asIdeal Z).prod ≤ I ∧ (Multiset.map PrimeSpectrum.asIdeal Z).prod ≠ ⊥}, ¬x < Z
hZI : (Multiset.map PrimeSpectrum.asIdeal Z).prod ≤ I
hprodZ : (Multiset.map PrimeSpectrum.asIdeal Z).prod ≠ ⊥
P : PrimeSpectrum A
hPZ : P ∈ Z
hPZ' : P.asIdeal ∈ Multiset.map PrimeSpectrum.asIdeal Z
this : Multiset.map PrimeSpectrum.asIdeal (Z.erase P) = (Multiset.map PrimeSpectrum.asIdeal Z).erase P.asIdeal
hP0 : P.asIdeal ≠ ⊥
hZP0 : (Multiset.map PrimeSpectrum.asIdeal (Z.erase P)).prod ≠ ⊥
hIM : I ≤ P.asIdeal
hM : P.asIdeal.IsMaximal
hPM : P.asIdeal ≤ P.asIdeal
⊢ P.asIdeal ::ₘ Multiset.map PrimeSpectrum.asIdeal (Z.erase P) = Multiset.map PrimeSpectrum.asIdeal Z

Tactic:
rw [this, Multiset.cons_erase hPZ']

Result:
no goals