Theorem: Submodule.isInternal_prime_power_torsion_of_is_torsion_by_ideal
File: Mathlib/Algebra/Module/DedekindDomain.lean

tactic: let P := factors I
state_before: R : Type u
inst✝⁴ : CommRing R
inst✝³ : IsDomain R
M : Type v
inst✝² : AddCommGroup M
inst✝¹ : Module R M
inst✝ : IsDedekindDomain R
I : Ideal R
hI : I ≠ ⊥
hM : Module.IsTorsionBySet R M ↑I
⊢ DirectSum.IsInternal fun p => torsionBySet R M ↑(↑p ^ Multiset.count (↑p) (factors I))

tactic: have prime_of_mem := fun p (hp : p ∈ P.toFinset) =>
  prime_of_factor p (Multiset.mem_toFinset.mp hp)
state_before: R : Type u
inst✝⁴ : CommRing R
inst✝³ : IsDomain R
M : Type v
inst✝² : AddCommGroup M
inst✝¹ : Module R M
inst✝ : IsDedekindDomain R
I : Ideal R
hI : I ≠ ⊥
hM : Module.IsTorsionBySet R M ↑I
P : Multiset (Ideal R) := factors I
⊢ DirectSum.IsInternal fun p => torsionBySet R M ↑(↑p ^ Multiset.count (↑p) (factors I))

tactic: apply @torsionBySet_isInternal _ _ _ _ _ _ _ _ (fun p => p ^ P.count p) _
state_before: R : Type u
inst✝⁴ : CommRing R
inst✝³ : IsDomain R
M : Type v
inst✝² : AddCommGroup M
inst✝¹ : Module R M
inst✝ : IsDedekindDomain R
I : Ideal R
hI : I ≠ ⊥
hM : Module.IsTorsionBySet R M ↑I
P : Multiset (Ideal R) := factors I
prime_of_mem : ∀ (p : Ideal R), p ∈ Multiset.toFinset P → Prime p
⊢ DirectSum.IsInternal fun p => torsionBySet R M ↑(↑p ^ Multiset.count (↑p) (factors I))

tactic: convert hM
state_before: R : Type u
inst✝⁴ : CommRing R
inst✝³ : IsDomain R
M : Type v
inst✝² : AddCommGroup M
inst✝¹ : Module R M
inst✝ : IsDedekindDomain R
I : Ideal R
hI : I ≠ ⊥
hM : Module.IsTorsionBySet R M ↑I
P : Multiset (Ideal R) := factors I
prime_of_mem : ∀ (p : Ideal R), p ∈ Multiset.toFinset P → Prime p
⊢ Module.IsTorsionBySet R M ↑(⨅ (i : Ideal R) (_ : i ∈ Multiset.toFinset (factors I)), i ^ Multiset.count i P)

tactic: rw [← Finset.inf_eq_iInf, IsDedekindDomain.inf_prime_pow_eq_prod, ← Finset.prod_multiset_count,
  ← associated_iff_eq]
state_before: case h.e'_6.h.e'_4
R : Type u
inst✝⁴ : CommRing R
inst✝³ : IsDomain R
M : Type v
inst✝² : AddCommGroup M
inst✝¹ : Module R M
inst✝ : IsDedekindDomain R
I : Ideal R
hI : I ≠ ⊥
hM : Module.IsTorsionBySet R M ↑I
P : Multiset (Ideal R) := factors I
prime_of_mem : ∀ (p : Ideal R), p ∈ Multiset.toFinset P → Prime p
⊢ (⨅ (i : Ideal R) (_ : i ∈ Multiset.toFinset (factors I)), i ^ Multiset.count i P) = I

tactic: exact factors_prod hI
state_before: case h.e'_6.h.e'_4
R : Type u
inst✝⁴ : CommRing R
inst✝³ : IsDomain R
M : Type v
inst✝² : AddCommGroup M
inst✝¹ : Module R M
inst✝ : IsDedekindDomain R
I : Ideal R
hI : I ≠ ⊥
hM : Module.IsTorsionBySet R M ↑I
P : Multiset (Ideal R) := factors I
prime_of_mem : ∀ (p : Ideal R), p ∈ Multiset.toFinset P → Prime p
⊢ Associated (Multiset.prod (factors I)) I

tactic: exact prime_of_mem
state_before: case h.e'_6.h.e'_4.prime
R : Type u
inst✝⁴ : CommRing R
inst✝³ : IsDomain R
M : Type v
inst✝² : AddCommGroup M
inst✝¹ : Module R M
inst✝ : IsDedekindDomain R
I : Ideal R
hI : I ≠ ⊥
hM : Module.IsTorsionBySet R M ↑I
P : Multiset (Ideal R) := factors I
prime_of_mem : ∀ (p : Ideal R), p ∈ Multiset.toFinset P → Prime p
⊢ ∀ (i : Ideal R), i ∈ Multiset.toFinset (factors I) → Prime i

tactic: exact fun _ _ _ _ ij => ij
state_before: case h.e'_6.h.e'_4.coprime
R : Type u
inst✝⁴ : CommRing R
inst✝³ : IsDomain R
M : Type v
inst✝² : AddCommGroup M
inst✝¹ : Module R M
inst✝ : IsDedekindDomain R
I : Ideal R
hI : I ≠ ⊥
hM : Module.IsTorsionBySet R M ↑I
P : Multiset (Ideal R) := factors I
prime_of_mem : ∀ (p : Ideal R), p ∈ Multiset.toFinset P → Prime p
⊢ ∀ (i : Ideal R),
    i ∈ Multiset.toFinset (factors I) → ∀ (j : Ideal R), j ∈ Multiset.toFinset (factors I) → i ≠ j → i ≠ j

tactic: intro p hp q hq pq
state_before: R : Type u
inst✝⁴ : CommRing R
inst✝³ : IsDomain R
M : Type v
inst✝² : AddCommGroup M
inst✝¹ : Module R M
inst✝ : IsDedekindDomain R
I : Ideal R
hI : I ≠ ⊥
hM : Module.IsTorsionBySet R M ↑I
P : Multiset (Ideal R) := factors I
prime_of_mem : ∀ (p : Ideal R), p ∈ Multiset.toFinset P → Prime p
⊢ Set.Pairwise ↑(Multiset.toFinset (factors I)) fun i j =>
    (fun p => p ^ Multiset.count p P) i ⊔ (fun p => p ^ Multiset.count p P) j = ⊤

tactic: dsimp
state_before: R : Type u
inst✝⁴ : CommRing R
inst✝³ : IsDomain R
M : Type v
inst✝² : AddCommGroup M
inst✝¹ : Module R M
inst✝ : IsDedekindDomain R
I : Ideal R
hI : I ≠ ⊥
hM : Module.IsTorsionBySet R M ↑I
P : Multiset (Ideal R) := factors I
prime_of_mem : ∀ (p : Ideal R), p ∈ Multiset.toFinset P → Prime p
p : Ideal R
hp : p ∈ ↑(Multiset.toFinset (factors I))
q : Ideal R
hq : q ∈ ↑(Multiset.toFinset (factors I))
pq : p ≠ q
⊢ (fun p => p ^ Multiset.count p P) p ⊔ (fun p => p ^ Multiset.count p P) q = ⊤

tactic: rw [irreducible_pow_sup]
state_before: R : Type u
inst✝⁴ : CommRing R
inst✝³ : IsDomain R
M : Type v
inst✝² : AddCommGroup M
inst✝¹ : Module R M
inst✝ : IsDedekindDomain R
I : Ideal R
hI : I ≠ ⊥
hM : Module.IsTorsionBySet R M ↑I
P : Multiset (Ideal R) := factors I
prime_of_mem : ∀ (p : Ideal R), p ∈ Multiset.toFinset P → Prime p
p : Ideal R
hp : p ∈ ↑(Multiset.toFinset (factors I))
q : Ideal R
hq : q ∈ ↑(Multiset.toFinset (factors I))
pq : p ≠ q
⊢ p ^ Multiset.count p (factors I) ⊔ q ^ Multiset.count q (factors I) = ⊤

tactic: suffices (normalizedFactors _).count p = 0 by rw [this, zero_min, pow_zero, Ideal.one_eq_top]
state_before: R : Type u
inst✝⁴ : CommRing R
inst✝³ : IsDomain R
M : Type v
inst✝² : AddCommGroup M
inst✝¹ : Module R M
inst✝ : IsDedekindDomain R
I : Ideal R
hI : I ≠ ⊥
hM : Module.IsTorsionBySet R M ↑I
P : Multiset (Ideal R) := factors I
prime_of_mem : ∀ (p : Ideal R), p ∈ Multiset.toFinset P → Prime p
p : Ideal R
hp : p ∈ ↑(Multiset.toFinset (factors I))
q : Ideal R
hq : q ∈ ↑(Multiset.toFinset (factors I))
pq : p ≠ q
⊢ p ^ min (Multiset.count p (normalizedFactors (q ^ Multiset.count q (factors I)))) (Multiset.count p (factors I)) = ⊤

tactic: rw [this, zero_min, pow_zero, Ideal.one_eq_top]
state_before: R : Type u
inst✝⁴ : CommRing R
inst✝³ : IsDomain R
M : Type v
inst✝² : AddCommGroup M
inst✝¹ : Module R M
inst✝ : IsDedekindDomain R
I : Ideal R
hI : I ≠ ⊥
hM : Module.IsTorsionBySet R M ↑I
P : Multiset (Ideal R) := factors I
prime_of_mem : ∀ (p : Ideal R), p ∈ Multiset.toFinset P → Prime p
p : Ideal R
hp : p ∈ ↑(Multiset.toFinset (factors I))
q : Ideal R
hq : q ∈ ↑(Multiset.toFinset (factors I))
pq : p ≠ q
this : Multiset.count p (normalizedFactors ?m.89951) = 0
⊢ p ^ min (Multiset.count p (normalizedFactors (q ^ Multiset.count q (factors I)))) (Multiset.count p (factors I)) = ⊤

tactic: rw [Multiset.count_eq_zero,
  normalizedFactors_of_irreducible_pow (prime_of_mem q hq).irreducible,
  Multiset.mem_replicate]
state_before: R : Type u
inst✝⁴ : CommRing R
inst✝³ : IsDomain R
M : Type v
inst✝² : AddCommGroup M
inst✝¹ : Module R M
inst✝ : IsDedekindDomain R
I : Ideal R
hI : I ≠ ⊥
hM : Module.IsTorsionBySet R M ↑I
P : Multiset (Ideal R) := factors I
prime_of_mem : ∀ (p : Ideal R), p ∈ Multiset.toFinset P → Prime p
p : Ideal R
hp : p ∈ ↑(Multiset.toFinset (factors I))
q : Ideal R
hq : q ∈ ↑(Multiset.toFinset (factors I))
pq : p ≠ q
⊢ Multiset.count p (normalizedFactors (q ^ Multiset.count q (factors I))) = 0

tactic: exact fun H => pq <| H.2.trans <| normalize_eq q
state_before: R : Type u
inst✝⁴ : CommRing R
inst✝³ : IsDomain R
M : Type v
inst✝² : AddCommGroup M
inst✝¹ : Module R M
inst✝ : IsDedekindDomain R
I : Ideal R
hI : I ≠ ⊥
hM : Module.IsTorsionBySet R M ↑I
P : Multiset (Ideal R) := factors I
prime_of_mem : ∀ (p : Ideal R), p ∈ Multiset.toFinset P → Prime p
p : Ideal R
hp : p ∈ ↑(Multiset.toFinset (factors I))
q : Ideal R
hq : q ∈ ↑(Multiset.toFinset (factors I))
pq : p ≠ q
⊢ ¬(Multiset.count q (factors I) ≠ 0 ∧ p = ↑normalize q)

tactic: rw [← Ideal.zero_eq_bot]
state_before: case hI
R : Type u
inst✝⁴ : CommRing R
inst✝³ : IsDomain R
M : Type v
inst✝² : AddCommGroup M
inst✝¹ : Module R M
inst✝ : IsDedekindDomain R
I : Ideal R
hI : I ≠ ⊥
hM : Module.IsTorsionBySet R M ↑I
P : Multiset (Ideal R) := factors I
prime_of_mem : ∀ (p : Ideal R), p ∈ Multiset.toFinset P → Prime p
p : Ideal R
hp : p ∈ ↑(Multiset.toFinset (factors I))
q : Ideal R
hq : q ∈ ↑(Multiset.toFinset (factors I))
pq : p ≠ q
⊢ q ^ Multiset.count q (factors I) ≠ ⊥

tactic: apply pow_ne_zero
state_before: case hI
R : Type u
inst✝⁴ : CommRing R
inst✝³ : IsDomain R
M : Type v
inst✝² : AddCommGroup M
inst✝¹ : Module R M
inst✝ : IsDedekindDomain R
I : Ideal R
hI : I ≠ ⊥
hM : Module.IsTorsionBySet R M ↑I
P : Multiset (Ideal R) := factors I
prime_of_mem : ∀ (p : Ideal R), p ∈ Multiset.toFinset P → Prime p
p : Ideal R
hp : p ∈ ↑(Multiset.toFinset (factors I))
q : Ideal R
hq : q ∈ ↑(Multiset.toFinset (factors I))
pq : p ≠ q
⊢ q ^ Multiset.count q (factors I) ≠ 0

tactic: exact (prime_of_mem q hq).ne_zero
state_before: case hI.h
R : Type u
inst✝⁴ : CommRing R
inst✝³ : IsDomain R
M : Type v
inst✝² : AddCommGroup M
inst✝¹ : Module R M
inst✝ : IsDedekindDomain R
I : Ideal R
hI : I ≠ ⊥
hM : Module.IsTorsionBySet R M ↑I
P : Multiset (Ideal R) := factors I
prime_of_mem : ∀ (p : Ideal R), p ∈ Multiset.toFinset P → Prime p
p : Ideal R
hp : p ∈ ↑(Multiset.toFinset (factors I))
q : Ideal R
hq : q ∈ ↑(Multiset.toFinset (factors I))
pq : p ≠ q
⊢ q ≠ 0

tactic: exact (prime_of_mem p hp).irreducible
state_before: case hJ
R : Type u
inst✝⁴ : CommRing R
inst✝³ : IsDomain R
M : Type v
inst✝² : AddCommGroup M
inst✝¹ : Module R M
inst✝ : IsDedekindDomain R
I : Ideal R
hI : I ≠ ⊥
hM : Module.IsTorsionBySet R M ↑I
P : Multiset (Ideal R) := factors I
prime_of_mem : ∀ (p : Ideal R), p ∈ Multiset.toFinset P → Prime p
p : Ideal R
hp : p ∈ ↑(Multiset.toFinset (factors I))
q : Ideal R
hq : q ∈ ↑(Multiset.toFinset (factors I))
pq : p ≠ q
⊢ Irreducible p