Theorem: Ideal.factors_span_eq
File: Mathlib/RingTheory/DedekindDomain/Ideal.lean

tactic: rcases eq_or_ne p 0 with rfl | hp
state_before: R : Type u_1
A : Type u_2
K : Type u_3
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : Field K
inst✝² : IsDedekindDomain A
inst✝¹ : Algebra A K
inst✝ : IsFractionRing A K
p : K[X]
⊢ factors (span {p}) = Multiset.map (fun q => span {q}) (factors p)
state_after: case inl
R : Type u_1
A : Type u_2
K : Type u_3
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : Field K
inst✝² : IsDedekindDomain A
inst✝¹ : Algebra A K
inst✝ : IsFractionRing A K
⊢ factors (span {0}) = Multiset.map (fun q => span {q}) (factors 0)

case inr
R : Type u_1
A : Type u_2
K : Type u_3
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : Field K
inst✝² : IsDedekindDomain A
inst✝¹ : Algebra A K
inst✝ : IsFractionRing A K
p : K[X]
hp : p ≠ 0
⊢ factors (span {p}) = Multiset.map (fun q => span {q}) (factors p)

tactic: have : ∀ q ∈ (factors p).map (fun q ↦ span {q}), Prime q := fun q hq ↦ by
  obtain ⟨r, hr, rfl⟩ := Multiset.mem_map.mp hq
  exact prime_span_singleton_iff.mpr <| prime_of_factor r hr
state_before: case inr
R : Type u_1
A : Type u_2
K : Type u_3
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : Field K
inst✝² : IsDedekindDomain A
inst✝¹ : Algebra A K
inst✝ : IsFractionRing A K
p : K[X]
hp : p ≠ 0
⊢ factors (span {p}) = Multiset.map (fun q => span {q}) (factors p)
state_after: case inr
R : Type u_1
A : Type u_2
K : Type u_3
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : Field K
inst✝² : IsDedekindDomain A
inst✝¹ : Algebra A K
inst✝ : IsFractionRing A K
p : K[X]
hp : p ≠ 0
this : ∀ q ∈ Multiset.map (fun q => span {q}) (factors p), Prime q
⊢ factors (span {p}) = Multiset.map (fun q => span {q}) (factors p)

tactic: rw [← span_singleton_eq_span_singleton.mpr (factors_prod hp), ← multiset_prod_span_singleton,
  factors_eq_normalizedFactors, normalizedFactors_prod_of_prime this]
state_before: case inr
R : Type u_1
A : Type u_2
K : Type u_3
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : Field K
inst✝² : IsDedekindDomain A
inst✝¹ : Algebra A K
inst✝ : IsFractionRing A K
p : K[X]
hp : p ≠ 0
this : ∀ q ∈ Multiset.map (fun q => span {q}) (factors p), Prime q
⊢ factors (span {p}) = Multiset.map (fun q => span {q}) (factors p)
state_after: no goals

tactic: simpa [Set.singleton_zero] using normalizedFactors_zero
state_before: case inl
R : Type u_1
A : Type u_2
K : Type u_3
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : Field K
inst✝² : IsDedekindDomain A
inst✝¹ : Algebra A K
inst✝ : IsFractionRing A K
⊢ factors (span {0}) = Multiset.map (fun q => span {q}) (factors 0)
state_after: no goals

tactic: obtain ⟨r, hr, rfl⟩ := Multiset.mem_map.mp hq
state_before: R : Type u_1
A : Type u_2
K : Type u_3
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : Field K
inst✝² : IsDedekindDomain A
inst✝¹ : Algebra A K
inst✝ : IsFractionRing A K
p : K[X]
hp : p ≠ 0
q : Ideal K[X]
hq : q ∈ Multiset.map (fun q => span {q}) (factors p)
⊢ Prime q
state_after: case intro.intro
R : Type u_1
A : Type u_2
K : Type u_3
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : Field K
inst✝² : IsDedekindDomain A
inst✝¹ : Algebra A K
inst✝ : IsFractionRing A K
p : K[X]
hp : p ≠ 0
r : K[X]
hr : r ∈ factors p
hq : span {r} ∈ Multiset.map (fun q => span {q}) (factors p)
⊢ Prime (span {r})

tactic: exact prime_span_singleton_iff.mpr <| prime_of_factor r hr
state_before: case intro.intro
R : Type u_1
A : Type u_2
K : Type u_3
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : Field K
inst✝² : IsDedekindDomain A
inst✝¹ : Algebra A K
inst✝ : IsFractionRing A K
p : K[X]
hp : p ≠ 0
r : K[X]
hr : r ∈ factors p
hq : span {r} ∈ Multiset.map (fun q => span {q}) (factors p)
⊢ Prime (span {r})
state_after: no goals