Theorem: UniqueFactorizationMonoid.prime_pow_coprime_prod_of_coprime_insert
File: Mathlib/RingTheory/UniqueFactorizationDomain.lean

tactic: have hp := is_prime _ (Finset.mem_insert_self _ _)
state_before: α : Type u_1
R : Type ?u.1372972
inst✝⁵ : CancelCommMonoidWithZero R
inst✝⁴ : UniqueFactorizationMonoid R
inst✝³ : CancelCommMonoidWithZero α
inst✝² : UniqueFactorizationMonoid α
β : Type ?u.1372999
inst✝¹ : CancelCommMonoidWithZero β
inst✝ : DecidableEq α
s : Finset α
i : α → ℕ
p : α
hps : ¬p ∈ s
is_prime : ∀ (q : α), q ∈ insert p s → Prime q
is_coprime : ∀ (q : α), q ∈ insert p s → ∀ (q' : α), q' ∈ insert p s → q ∣ q' → q = q'
⊢ ∀ (q : α), q ∣ p ^ i p → q ∣ ∏ p' in s, p' ^ i p' → IsUnit q

tactic: refine' fun _ => no_factors_of_no_prime_factors (pow_ne_zero _ hp.ne_zero) _
state_before: α : Type u_1
R : Type ?u.1372972
inst✝⁵ : CancelCommMonoidWithZero R
inst✝⁴ : UniqueFactorizationMonoid R
inst✝³ : CancelCommMonoidWithZero α
inst✝² : UniqueFactorizationMonoid α
β : Type ?u.1372999
inst✝¹ : CancelCommMonoidWithZero β
inst✝ : DecidableEq α
s : Finset α
i : α → ℕ
p : α
hps : ¬p ∈ s
is_prime : ∀ (q : α), q ∈ insert p s → Prime q
is_coprime : ∀ (q : α), q ∈ insert p s → ∀ (q' : α), q' ∈ insert p s → q ∣ q' → q = q'
hp : Prime p
⊢ ∀ (q : α), q ∣ p ^ i p → q ∣ ∏ p' in s, p' ^ i p' → IsUnit q

tactic: intro d hdp hdprod hd
state_before: α : Type u_1
R : Type ?u.1372972
inst✝⁵ : CancelCommMonoidWithZero R
inst✝⁴ : UniqueFactorizationMonoid R
inst✝³ : CancelCommMonoidWithZero α
inst✝² : UniqueFactorizationMonoid α
β : Type ?u.1372999
inst✝¹ : CancelCommMonoidWithZero β
inst✝ : DecidableEq α
s : Finset α
i : α → ℕ
p : α
hps : ¬p ∈ s
is_prime : ∀ (q : α), q ∈ insert p s → Prime q
is_coprime : ∀ (q : α), q ∈ insert p s → ∀ (q' : α), q' ∈ insert p s → q ∣ q' → q = q'
hp : Prime p
x✝ : α
⊢ ∀ {d : α}, d ∣ p ^ i p → d ∣ ∏ p' in s, p' ^ i p' → ¬Prime d

tactic: apply hps
state_before: α : Type u_1
R : Type ?u.1372972
inst✝⁵ : CancelCommMonoidWithZero R
inst✝⁴ : UniqueFactorizationMonoid R
inst✝³ : CancelCommMonoidWithZero α
inst✝² : UniqueFactorizationMonoid α
β : Type ?u.1372999
inst✝¹ : CancelCommMonoidWithZero β
inst✝ : DecidableEq α
s : Finset α
i : α → ℕ
p : α
hps : ¬p ∈ s
is_prime : ∀ (q : α), q ∈ insert p s → Prime q
is_coprime : ∀ (q : α), q ∈ insert p s → ∀ (q' : α), q' ∈ insert p s → q ∣ q' → q = q'
hp : Prime p
x✝ d : α
hdp : d ∣ p ^ i p
hdprod : d ∣ ∏ p' in s, p' ^ i p'
hd : Prime d
⊢ False

tactic: replace hdp := hd.dvd_of_dvd_pow hdp
state_before: α : Type u_1
R : Type ?u.1372972
inst✝⁵ : CancelCommMonoidWithZero R
inst✝⁴ : UniqueFactorizationMonoid R
inst✝³ : CancelCommMonoidWithZero α
inst✝² : UniqueFactorizationMonoid α
β : Type ?u.1372999
inst✝¹ : CancelCommMonoidWithZero β
inst✝ : DecidableEq α
s : Finset α
i : α → ℕ
p : α
hps : ¬p ∈ s
is_prime : ∀ (q : α), q ∈ insert p s → Prime q
is_coprime : ∀ (q : α), q ∈ insert p s → ∀ (q' : α), q' ∈ insert p s → q ∣ q' → q = q'
hp : Prime p
x✝ d : α
hdp : d ∣ p ^ i p
hdprod : d ∣ ∏ p' in s, p' ^ i p'
hd : Prime d
⊢ p ∈ s

tactic: obtain ⟨q, q_mem', hdq⟩ := hd.exists_mem_multiset_dvd hdprod
state_before: α : Type u_1
R : Type ?u.1372972
inst✝⁵ : CancelCommMonoidWithZero R
inst✝⁴ : UniqueFactorizationMonoid R
inst✝³ : CancelCommMonoidWithZero α
inst✝² : UniqueFactorizationMonoid α
β : Type ?u.1372999
inst✝¹ : CancelCommMonoidWithZero β
inst✝ : DecidableEq α
s : Finset α
i : α → ℕ
p : α
hps : ¬p ∈ s
is_prime : ∀ (q : α), q ∈ insert p s → Prime q
is_coprime : ∀ (q : α), q ∈ insert p s → ∀ (q' : α), q' ∈ insert p s → q ∣ q' → q = q'
hp : Prime p
x✝ d : α
hdprod : d ∣ ∏ p' in s, p' ^ i p'
hd : Prime d
hdp : d ∣ p
⊢ p ∈ s

tactic: obtain ⟨q, q_mem, rfl⟩ := Multiset.mem_map.mp q_mem'
state_before: case intro.intro
α : Type u_1
R : Type ?u.1372972
inst✝⁵ : CancelCommMonoidWithZero R
inst✝⁴ : UniqueFactorizationMonoid R
inst✝³ : CancelCommMonoidWithZero α
inst✝² : UniqueFactorizationMonoid α
β : Type ?u.1372999
inst✝¹ : CancelCommMonoidWithZero β
inst✝ : DecidableEq α
s : Finset α
i : α → ℕ
p : α
hps : ¬p ∈ s
is_prime : ∀ (q : α), q ∈ insert p s → Prime q
is_coprime : ∀ (q : α), q ∈ insert p s → ∀ (q' : α), q' ∈ insert p s → q ∣ q' → q = q'
hp : Prime p
x✝ d : α
hdprod : d ∣ ∏ p' in s, p' ^ i p'
hd : Prime d
hdp : d ∣ p
q : α
q_mem' : q ∈ Multiset.map (fun p' => p' ^ i p') s.val
hdq : d ∣ q
⊢ p ∈ s

tactic: replace hdq := hd.dvd_of_dvd_pow hdq
state_before: case intro.intro.intro.intro
α : Type u_1
R : Type ?u.1372972
inst✝⁵ : CancelCommMonoidWithZero R
inst✝⁴ : UniqueFactorizationMonoid R
inst✝³ : CancelCommMonoidWithZero α
inst✝² : UniqueFactorizationMonoid α
β : Type ?u.1372999
inst✝¹ : CancelCommMonoidWithZero β
inst✝ : DecidableEq α
s : Finset α
i : α → ℕ
p : α
hps : ¬p ∈ s
is_prime : ∀ (q : α), q ∈ insert p s → Prime q
is_coprime : ∀ (q : α), q ∈ insert p s → ∀ (q' : α), q' ∈ insert p s → q ∣ q' → q = q'
hp : Prime p
x✝ d : α
hdprod : d ∣ ∏ p' in s, p' ^ i p'
hd : Prime d
hdp : d ∣ p
q : α
q_mem : q ∈ s.val
q_mem' : q ^ i q ∈ Multiset.map (fun p' => p' ^ i p') s.val
hdq : d ∣ q ^ i q
⊢ p ∈ s

tactic: have : p ∣ q := dvd_trans (hd.irreducible.dvd_symm hp.irreducible hdp) hdq
state_before: case intro.intro.intro.intro
α : Type u_1
R : Type ?u.1372972
inst✝⁵ : CancelCommMonoidWithZero R
inst✝⁴ : UniqueFactorizationMonoid R
inst✝³ : CancelCommMonoidWithZero α
inst✝² : UniqueFactorizationMonoid α
β : Type ?u.1372999
inst✝¹ : CancelCommMonoidWithZero β
inst✝ : DecidableEq α
s : Finset α
i : α → ℕ
p : α
hps : ¬p ∈ s
is_prime : ∀ (q : α), q ∈ insert p s → Prime q
is_coprime : ∀ (q : α), q ∈ insert p s → ∀ (q' : α), q' ∈ insert p s → q ∣ q' → q = q'
hp : Prime p
x✝ d : α
hdprod : d ∣ ∏ p' in s, p' ^ i p'
hd : Prime d
hdp : d ∣ p
q : α
q_mem : q ∈ s.val
q_mem' : q ^ i q ∈ Multiset.map (fun p' => p' ^ i p') s.val
hdq : d ∣ q
⊢ p ∈ s

tactic: convert q_mem
state_before: case intro.intro.intro.intro
α : Type u_1
R : Type ?u.1372972
inst✝⁵ : CancelCommMonoidWithZero R
inst✝⁴ : UniqueFactorizationMonoid R
inst✝³ : CancelCommMonoidWithZero α
inst✝² : UniqueFactorizationMonoid α
β : Type ?u.1372999
inst✝¹ : CancelCommMonoidWithZero β
inst✝ : DecidableEq α
s : Finset α
i : α → ℕ
p : α
hps : ¬p ∈ s
is_prime : ∀ (q : α), q ∈ insert p s → Prime q
is_coprime : ∀ (q : α), q ∈ insert p s → ∀ (q' : α), q' ∈ insert p s → q ∣ q' → q = q'
hp : Prime p
x✝ d : α
hdprod : d ∣ ∏ p' in s, p' ^ i p'
hd : Prime d
hdp : d ∣ p
q : α
q_mem : q ∈ s.val
q_mem' : q ^ i q ∈ Multiset.map (fun p' => p' ^ i p') s.val
hdq : d ∣ q
this : p ∣ q
⊢ p ∈ s

tactic: rw [Finset.mem_val,
  is_coprime _ (Finset.mem_insert_self p s) _ (Finset.mem_insert_of_mem q_mem) this]
state_before: case a
α : Type u_1
R : Type ?u.1372972
inst✝⁵ : CancelCommMonoidWithZero R
inst✝⁴ : UniqueFactorizationMonoid R
inst✝³ : CancelCommMonoidWithZero α
inst✝² : UniqueFactorizationMonoid α
β : Type ?u.1372999
inst✝¹ : CancelCommMonoidWithZero β
inst✝ : DecidableEq α
s : Finset α
i : α → ℕ
p : α
hps : ¬p ∈ s
is_prime : ∀ (q : α), q ∈ insert p s → Prime q
is_coprime : ∀ (q : α), q ∈ insert p s → ∀ (q' : α), q' ∈ insert p s → q ∣ q' → q = q'
hp : Prime p
x✝ d : α
hdprod : d ∣ ∏ p' in s, p' ^ i p'
hd : Prime d
hdp : d ∣ p
q : α
q_mem : q ∈ s.val
q_mem' : q ^ i q ∈ Multiset.map (fun p' => p' ^ i p') s.val
hdq : d ∣ q
this : p ∣ q
⊢ p ∈ s ↔ q ∈ s.val