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

tactic: letI := Classical.decEq α
state_before: α : Type u_1
R : Type ?u.1623144
inst✝⁴ : CancelCommMonoidWithZero R
inst✝³ : UniqueFactorizationMonoid R
inst✝² : CancelCommMonoidWithZero α
inst✝¹ : UniqueFactorizationMonoid α
β : Type u_2
inst✝ : CancelCommMonoidWithZero β
f : α → β
s : Finset α
i j : α → ℕ
is_prime : ∀ (p : α), p ∈ s → Prime p
is_coprime : ∀ (p : α), p ∈ s → ∀ (q : α), q ∈ s → p ∣ q → p = q
h1 : ∀ {x y : α}, IsUnit y → f (x * y) = f x * f y
hpr : ∀ {p : α} (i : ℕ), Prime p → f (p ^ i) = f p ^ i
hcp : ∀ {x y : α}, (∀ (p : α), p ∣ x → p ∣ y → IsUnit p) → f (x * y) = f x * f y
⊢ f (∏ p in s, p ^ (i p + j p)) = f (∏ p in s, p ^ i p) * f (∏ p in s, p ^ j p)

tactic: induction' s using Finset.induction_on with p s hps ih
state_before: α : Type u_1
R : Type ?u.1623144
inst✝⁴ : CancelCommMonoidWithZero R
inst✝³ : UniqueFactorizationMonoid R
inst✝² : CancelCommMonoidWithZero α
inst✝¹ : UniqueFactorizationMonoid α
β : Type u_2
inst✝ : CancelCommMonoidWithZero β
f : α → β
s : Finset α
i j : α → ℕ
is_prime : ∀ (p : α), p ∈ s → Prime p
is_coprime : ∀ (p : α), p ∈ s → ∀ (q : α), q ∈ s → p ∣ q → p = q
h1 : ∀ {x y : α}, IsUnit y → f (x * y) = f x * f y
hpr : ∀ {p : α} (i : ℕ), Prime p → f (p ^ i) = f p ^ i
hcp : ∀ {x y : α}, (∀ (p : α), p ∣ x → p ∣ y → IsUnit p) → f (x * y) = f x * f y
this : DecidableEq α := Classical.decEq α
⊢ f (∏ p in s, p ^ (i p + j p)) = f (∏ p in s, p ^ i p) * f (∏ p in s, p ^ j p)

tactic: have hpr_p := is_prime _ (Finset.mem_insert_self _ _)
state_before: case insert
α : Type u_1
R : Type ?u.1623144
inst✝⁴ : CancelCommMonoidWithZero R
inst✝³ : UniqueFactorizationMonoid R
inst✝² : CancelCommMonoidWithZero α
inst✝¹ : UniqueFactorizationMonoid α
β : Type u_2
inst✝ : CancelCommMonoidWithZero β
f : α → β
s✝ : Finset α
i j : α → ℕ
is_prime✝ : ∀ (p : α), p ∈ s✝ → Prime p
is_coprime✝ : ∀ (p : α), p ∈ s✝ → ∀ (q : α), q ∈ s✝ → p ∣ q → p = q
h1 : ∀ {x y : α}, IsUnit y → f (x * y) = f x * f y
hpr : ∀ {p : α} (i : ℕ), Prime p → f (p ^ i) = f p ^ i
hcp : ∀ {x y : α}, (∀ (p : α), p ∣ x → p ∣ y → IsUnit p) → f (x * y) = f x * f y
this : DecidableEq α := Classical.decEq α
p : α
s : Finset α
hps : ¬p ∈ s
ih :
  (∀ (p : α), p ∈ s → Prime p) →
    (∀ (p : α), p ∈ s → ∀ (q : α), q ∈ s → p ∣ q → p = q) →
      f (∏ p in s, p ^ (i p + j p)) = f (∏ p in s, p ^ i p) * f (∏ p in s, p ^ j p)
is_prime : ∀ (p_1 : α), p_1 ∈ insert p s → Prime p_1
is_coprime : ∀ (p_1 : α), p_1 ∈ insert p s → ∀ (q : α), q ∈ insert p s → p_1 ∣ q → p_1 = q
⊢ f (∏ p in insert p s, p ^ (i p + j p)) = f (∏ p in insert p s, p ^ i p) * f (∏ p in insert p s, p ^ j p)

tactic: have hpr_s : ∀ p ∈ s, Prime p := fun p hp => is_prime _ (Finset.mem_insert_of_mem hp)
state_before: case insert
α : Type u_1
R : Type ?u.1623144
inst✝⁴ : CancelCommMonoidWithZero R
inst✝³ : UniqueFactorizationMonoid R
inst✝² : CancelCommMonoidWithZero α
inst✝¹ : UniqueFactorizationMonoid α
β : Type u_2
inst✝ : CancelCommMonoidWithZero β
f : α → β
s✝ : Finset α
i j : α → ℕ
is_prime✝ : ∀ (p : α), p ∈ s✝ → Prime p
is_coprime✝ : ∀ (p : α), p ∈ s✝ → ∀ (q : α), q ∈ s✝ → p ∣ q → p = q
h1 : ∀ {x y : α}, IsUnit y → f (x * y) = f x * f y
hpr : ∀ {p : α} (i : ℕ), Prime p → f (p ^ i) = f p ^ i
hcp : ∀ {x y : α}, (∀ (p : α), p ∣ x → p ∣ y → IsUnit p) → f (x * y) = f x * f y
this : DecidableEq α := Classical.decEq α
p : α
s : Finset α
hps : ¬p ∈ s
ih :
  (∀ (p : α), p ∈ s → Prime p) →
    (∀ (p : α), p ∈ s → ∀ (q : α), q ∈ s → p ∣ q → p = q) →
      f (∏ p in s, p ^ (i p + j p)) = f (∏ p in s, p ^ i p) * f (∏ p in s, p ^ j p)
is_prime : ∀ (p_1 : α), p_1 ∈ insert p s → Prime p_1
is_coprime : ∀ (p_1 : α), p_1 ∈ insert p s → ∀ (q : α), q ∈ insert p s → p_1 ∣ q → p_1 = q
hpr_p : Prime p
⊢ f (∏ p in insert p s, p ^ (i p + j p)) = f (∏ p in insert p s, p ^ i p) * f (∏ p in insert p s, p ^ j p)

tactic: have hcp_p := fun i => prime_pow_coprime_prod_of_coprime_insert i p hps is_prime is_coprime
state_before: case insert
α : Type u_1
R : Type ?u.1623144
inst✝⁴ : CancelCommMonoidWithZero R
inst✝³ : UniqueFactorizationMonoid R
inst✝² : CancelCommMonoidWithZero α
inst✝¹ : UniqueFactorizationMonoid α
β : Type u_2
inst✝ : CancelCommMonoidWithZero β
f : α → β
s✝ : Finset α
i j : α → ℕ
is_prime✝ : ∀ (p : α), p ∈ s✝ → Prime p
is_coprime✝ : ∀ (p : α), p ∈ s✝ → ∀ (q : α), q ∈ s✝ → p ∣ q → p = q
h1 : ∀ {x y : α}, IsUnit y → f (x * y) = f x * f y
hpr : ∀ {p : α} (i : ℕ), Prime p → f (p ^ i) = f p ^ i
hcp : ∀ {x y : α}, (∀ (p : α), p ∣ x → p ∣ y → IsUnit p) → f (x * y) = f x * f y
this : DecidableEq α := Classical.decEq α
p : α
s : Finset α
hps : ¬p ∈ s
ih :
  (∀ (p : α), p ∈ s → Prime p) →
    (∀ (p : α), p ∈ s → ∀ (q : α), q ∈ s → p ∣ q → p = q) →
      f (∏ p in s, p ^ (i p + j p)) = f (∏ p in s, p ^ i p) * f (∏ p in s, p ^ j p)
is_prime : ∀ (p_1 : α), p_1 ∈ insert p s → Prime p_1
is_coprime : ∀ (p_1 : α), p_1 ∈ insert p s → ∀ (q : α), q ∈ insert p s → p_1 ∣ q → p_1 = q
hpr_p : Prime p
hpr_s : ∀ (p : α), p ∈ s → Prime p
⊢ f (∏ p in insert p s, p ^ (i p + j p)) = f (∏ p in insert p s, p ^ i p) * f (∏ p in insert p s, p ^ j p)

tactic: have hcp_s : ∀ (p) (_ : p ∈ s) (q) (_ : q ∈ s), p ∣ q → p = q := fun p hp q hq =>
  is_coprime p (Finset.mem_insert_of_mem hp) q (Finset.mem_insert_of_mem hq)
state_before: case insert
α : Type u_1
R : Type ?u.1623144
inst✝⁴ : CancelCommMonoidWithZero R
inst✝³ : UniqueFactorizationMonoid R
inst✝² : CancelCommMonoidWithZero α
inst✝¹ : UniqueFactorizationMonoid α
β : Type u_2
inst✝ : CancelCommMonoidWithZero β
f : α → β
s✝ : Finset α
i j : α → ℕ
is_prime✝ : ∀ (p : α), p ∈ s✝ → Prime p
is_coprime✝ : ∀ (p : α), p ∈ s✝ → ∀ (q : α), q ∈ s✝ → p ∣ q → p = q
h1 : ∀ {x y : α}, IsUnit y → f (x * y) = f x * f y
hpr : ∀ {p : α} (i : ℕ), Prime p → f (p ^ i) = f p ^ i
hcp : ∀ {x y : α}, (∀ (p : α), p ∣ x → p ∣ y → IsUnit p) → f (x * y) = f x * f y
this : DecidableEq α := Classical.decEq α
p : α
s : Finset α
hps : ¬p ∈ s
ih :
  (∀ (p : α), p ∈ s → Prime p) →
    (∀ (p : α), p ∈ s → ∀ (q : α), q ∈ s → p ∣ q → p = q) →
      f (∏ p in s, p ^ (i p + j p)) = f (∏ p in s, p ^ i p) * f (∏ p in s, p ^ j p)
is_prime : ∀ (p_1 : α), p_1 ∈ insert p s → Prime p_1
is_coprime : ∀ (p_1 : α), p_1 ∈ insert p s → ∀ (q : α), q ∈ insert p s → p_1 ∣ q → p_1 = q
hpr_p : Prime p
hpr_s : ∀ (p : α), p ∈ s → Prime p
hcp_p : ∀ (i : α → ℕ) (q : α), q ∣ p ^ i p → q ∣ ∏ p' in s, p' ^ i p' → IsUnit q
⊢ f (∏ p in insert p s, p ^ (i p + j p)) = f (∏ p in insert p s, p ^ i p) * f (∏ p in insert p s, p ^ j p)

tactic: rw [Finset.prod_insert hps, Finset.prod_insert hps, Finset.prod_insert hps, hcp (hcp_p _),
  hpr _ hpr_p, hcp (hcp_p _), hpr _ hpr_p, hcp (hcp_p (fun p => i p + j p)), hpr _ hpr_p,
  ih hpr_s hcp_s, pow_add, mul_assoc, mul_left_comm (f p ^ j p), mul_assoc]
state_before: case insert
α : Type u_1
R : Type ?u.1623144
inst✝⁴ : CancelCommMonoidWithZero R
inst✝³ : UniqueFactorizationMonoid R
inst✝² : CancelCommMonoidWithZero α
inst✝¹ : UniqueFactorizationMonoid α
β : Type u_2
inst✝ : CancelCommMonoidWithZero β
f : α → β
s✝ : Finset α
i j : α → ℕ
is_prime✝ : ∀ (p : α), p ∈ s✝ → Prime p
is_coprime✝ : ∀ (p : α), p ∈ s✝ → ∀ (q : α), q ∈ s✝ → p ∣ q → p = q
h1 : ∀ {x y : α}, IsUnit y → f (x * y) = f x * f y
hpr : ∀ {p : α} (i : ℕ), Prime p → f (p ^ i) = f p ^ i
hcp : ∀ {x y : α}, (∀ (p : α), p ∣ x → p ∣ y → IsUnit p) → f (x * y) = f x * f y
this : DecidableEq α := Classical.decEq α
p : α
s : Finset α
hps : ¬p ∈ s
ih :
  (∀ (p : α), p ∈ s → Prime p) →
    (∀ (p : α), p ∈ s → ∀ (q : α), q ∈ s → p ∣ q → p = q) →
      f (∏ p in s, p ^ (i p + j p)) = f (∏ p in s, p ^ i p) * f (∏ p in s, p ^ j p)
is_prime : ∀ (p_1 : α), p_1 ∈ insert p s → Prime p_1
is_coprime : ∀ (p_1 : α), p_1 ∈ insert p s → ∀ (q : α), q ∈ insert p s → p_1 ∣ q → p_1 = q
hpr_p : Prime p
hpr_s : ∀ (p : α), p ∈ s → Prime p
hcp_p : ∀ (i : α → ℕ) (q : α), q ∣ p ^ i p → q ∣ ∏ p' in s, p' ^ i p' → IsUnit q
hcp_s : ∀ (p : α), p ∈ s → ∀ (q : α), q ∈ s → p ∣ q → p = q
⊢ f (∏ p in insert p s, p ^ (i p + j p)) = f (∏ p in insert p s, p ^ i p) * f (∏ p in insert p s, p ^ j p)

tactic: simpa using h1 isUnit_one
state_before: case empty
α : Type u_1
R : Type ?u.1623144
inst✝⁴ : CancelCommMonoidWithZero R
inst✝³ : UniqueFactorizationMonoid R
inst✝² : CancelCommMonoidWithZero α
inst✝¹ : UniqueFactorizationMonoid α
β : Type u_2
inst✝ : CancelCommMonoidWithZero β
f : α → β
s : Finset α
i j : α → ℕ
is_prime✝ : ∀ (p : α), p ∈ s → Prime p
is_coprime✝ : ∀ (p : α), p ∈ s → ∀ (q : α), q ∈ s → p ∣ q → p = q
h1 : ∀ {x y : α}, IsUnit y → f (x * y) = f x * f y
hpr : ∀ {p : α} (i : ℕ), Prime p → f (p ^ i) = f p ^ i
hcp : ∀ {x y : α}, (∀ (p : α), p ∣ x → p ∣ y → IsUnit p) → f (x * y) = f x * f y
this : DecidableEq α := Classical.decEq α
is_prime : ∀ (p : α), p ∈ ∅ → Prime p
is_coprime : ∀ (p : α), p ∈ ∅ → ∀ (q : α), q ∈ ∅ → p ∣ q → p = q
⊢ f (∏ p in ∅, p ^ (i p + j p)) = f (∏ p in ∅, p ^ i p) * f (∏ p in ∅, p ^ j p)