Theorem: Nat.prod_pow_prime_padicValNat
File: Mathlib/Data/Nat/Factorization/Basic.lean

tactic: conv =>
  rhs
  rw [← factorization_prod_pow_eq_self hn]
state_before: a b m✝ n✝ p n : ℕ
hn : n ≠ 0
m : ℕ
pr : n < m
⊢ ∏ p ∈ Finset.filter Prime (Finset.range m), p ^ padicValNat p n = n
state_after: a b m✝ n✝ p n : ℕ
hn : n ≠ 0
m : ℕ
pr : n < m
⊢ ∏ p ∈ Finset.filter Prime (Finset.range m), p ^ padicValNat p n = n.factorization.prod fun x x_1 => x ^ x_1

tactic: rw [eq_comm]
state_before: a b m✝ n✝ p n : ℕ
hn : n ≠ 0
m : ℕ
pr : n < m
⊢ ∏ p ∈ Finset.filter Prime (Finset.range m), p ^ padicValNat p n = n.factorization.prod fun x x_1 => x ^ x_1
state_after: a b m✝ n✝ p n : ℕ
hn : n ≠ 0
m : ℕ
pr : n < m
⊢ (n.factorization.prod fun x x_1 => x ^ x_1) = ∏ p ∈ Finset.filter Prime (Finset.range m), p ^ padicValNat p n

tactic: apply Finset.prod_subset_one_on_sdiff
state_before: a b m✝ n✝ p n : ℕ
hn : n ≠ 0
m : ℕ
pr : n < m
⊢ (n.factorization.prod fun x x_1 => x ^ x_1) = ∏ p ∈ Finset.filter Prime (Finset.range m), p ^ padicValNat p n
state_after: case h
a b m✝ n✝ p n : ℕ
hn : n ≠ 0
m : ℕ
pr : n < m
⊢ n.factorization.support ⊆ Finset.filter Prime (Finset.range m)

case hg
a b m✝ n✝ p n : ℕ
hn : n ≠ 0
m : ℕ
pr : n < m
⊢ ∀ x ∈ Finset.filter Prime (Finset.range m) \ n.factorization.support, x ^ padicValNat x n = 1

case hfg
a b m✝ n✝ p n : ℕ
hn : n ≠ 0
m : ℕ
pr : n < m
⊢ ∀ x ∈ n.factorization.support, (fun x x_1 => x ^ x_1) x (n.factorization x) = x ^ padicValNat x n

tactic: exact fun p hp => Finset.mem_filter.mpr ⟨Finset.mem_range.2 <| pr.trans_le' <|
  le_of_mem_primeFactors hp, prime_of_mem_primeFactors hp⟩
state_before: case h
a b m✝ n✝ p n : ℕ
hn : n ≠ 0
m : ℕ
pr : n < m
⊢ n.factorization.support ⊆ Finset.filter Prime (Finset.range m)
state_after: no goals

tactic: intro p hp
state_before: case hg
a b m✝ n✝ p n : ℕ
hn : n ≠ 0
m : ℕ
pr : n < m
⊢ ∀ x ∈ Finset.filter Prime (Finset.range m) \ n.factorization.support, x ^ padicValNat x n = 1
state_after: case hg
a b m✝ n✝ p✝ n : ℕ
hn : n ≠ 0
m : ℕ
pr : n < m
p : ℕ
hp : p ∈ Finset.filter Prime (Finset.range m) \ n.factorization.support
⊢ p ^ padicValNat p n = 1

tactic: cases' Finset.mem_sdiff.mp hp with hp1 hp2
state_before: case hg
a b m✝ n✝ p✝ n : ℕ
hn : n ≠ 0
m : ℕ
pr : n < m
p : ℕ
hp : p ∈ Finset.filter Prime (Finset.range m) \ n.factorization.support
⊢ p ^ padicValNat p n = 1
state_after: case hg.intro
a b m✝ n✝ p✝ n : ℕ
hn : n ≠ 0
m : ℕ
pr : n < m
p : ℕ
hp : p ∈ Finset.filter Prime (Finset.range m) \ n.factorization.support
hp1 : p ∈ Finset.filter Prime (Finset.range m)
hp2 : p ∉ n.factorization.support
⊢ p ^ padicValNat p n = 1

tactic: rw [← factorization_def n (Finset.mem_filter.mp hp1).2]
state_before: case hg.intro
a b m✝ n✝ p✝ n : ℕ
hn : n ≠ 0
m : ℕ
pr : n < m
p : ℕ
hp : p ∈ Finset.filter Prime (Finset.range m) \ n.factorization.support
hp1 : p ∈ Finset.filter Prime (Finset.range m)
hp2 : p ∉ n.factorization.support
⊢ p ^ padicValNat p n = 1
state_after: case hg.intro
a b m✝ n✝ p✝ n : ℕ
hn : n ≠ 0
m : ℕ
pr : n < m
p : ℕ
hp : p ∈ Finset.filter Prime (Finset.range m) \ n.factorization.support
hp1 : p ∈ Finset.filter Prime (Finset.range m)
hp2 : p ∉ n.factorization.support
⊢ p ^ n.factorization p = 1

tactic: simp [Finsupp.not_mem_support_iff.mp hp2]
state_before: case hg.intro
a b m✝ n✝ p✝ n : ℕ
hn : n ≠ 0
m : ℕ
pr : n < m
p : ℕ
hp : p ∈ Finset.filter Prime (Finset.range m) \ n.factorization.support
hp1 : p ∈ Finset.filter Prime (Finset.range m)
hp2 : p ∉ n.factorization.support
⊢ p ^ n.factorization p = 1
state_after: no goals

tactic: intro p hp
state_before: case hfg
a b m✝ n✝ p n : ℕ
hn : n ≠ 0
m : ℕ
pr : n < m
⊢ ∀ x ∈ n.factorization.support, (fun x x_1 => x ^ x_1) x (n.factorization x) = x ^ padicValNat x n
state_after: case hfg
a b m✝ n✝ p✝ n : ℕ
hn : n ≠ 0
m : ℕ
pr : n < m
p : ℕ
hp : p ∈ n.factorization.support
⊢ (fun x x_1 => x ^ x_1) p (n.factorization p) = p ^ padicValNat p n

tactic: simp [factorization_def n (prime_of_mem_primeFactors hp)]
state_before: case hfg
a b m✝ n✝ p✝ n : ℕ
hn : n ≠ 0
m : ℕ
pr : n < m
p : ℕ
hp : p ∈ n.factorization.support
⊢ (fun x x_1 => x ^ x_1) p (n.factorization p) = p ^ padicValNat p n
state_after: no goals