Theorem: PadicInt.valuation_p_pow_mul
File: Mathlib/NumberTheory/Padics/PadicIntegers.lean

tactic: have : ‖(p : ℤ_[p]) ^ n * c‖ = ‖(p : ℤ_[p]) ^ n‖ * ‖c‖ := norm_mul _ _
state_before: p : ℕ
hp : Fact (Nat.Prime p)
n : ℕ
c : ℤ_[p]
hc : c ≠ 0
⊢ (↑p ^ n * c).valuation = ↑n + c.valuation
state_after: p : ℕ
hp : Fact (Nat.Prime p)
n : ℕ
c : ℤ_[p]
hc : c ≠ 0
this : ‖↑p ^ n * c‖ = ‖↑p ^ n‖ * ‖c‖
⊢ (↑p ^ n * c).valuation = ↑n + c.valuation

tactic: rwa [norm_eq_pow_val aux, norm_p_pow, norm_eq_pow_val hc, ← zpow_add₀, ← neg_add,
  zpow_inj, neg_inj] at this
state_before: p : ℕ
hp : Fact (Nat.Prime p)
n : ℕ
c : ℤ_[p]
hc : c ≠ 0
this : ‖↑p ^ n * c‖ = ‖↑p ^ n‖ * ‖c‖
aux : ↑p ^ n * c ≠ 0
⊢ (↑p ^ n * c).valuation = ↑n + c.valuation
state_after: case h₀
p : ℕ
hp : Fact (Nat.Prime p)
n : ℕ
c : ℤ_[p]
hc : c ≠ 0
this : ↑p ^ (-(↑p ^ n * c).valuation) = ↑p ^ (-(↑n + c.valuation))
aux : ↑p ^ n * c ≠ 0
⊢ 0 < ↑p

case h₁
p : ℕ
hp : Fact (Nat.Prime p)
n : ℕ
c : ℤ_[p]
hc : c ≠ 0
this : ↑p ^ (-(↑p ^ n * c).valuation) = ↑p ^ (-(↑n + c.valuation))
aux : ↑p ^ n * c ≠ 0
⊢ ↑p ≠ 1

case ha
p : ℕ
hp : Fact (Nat.Prime p)
n : ℕ
c : ℤ_[p]
hc : c ≠ 0
this : ↑p ^ (-(↑p ^ n * c).valuation) = ↑p ^ (-↑n) * ↑p ^ (-c.valuation)
aux : ↑p ^ n * c ≠ 0
⊢ ↑p ≠ 0

tactic: contrapose! hc
state_before: p : ℕ
hp : Fact (Nat.Prime p)
n : ℕ
c : ℤ_[p]
hc : c ≠ 0
this : ‖↑p ^ n * c‖ = ‖↑p ^ n‖ * ‖c‖
⊢ ↑p ^ n * c ≠ 0
state_after: p : ℕ
hp : Fact (Nat.Prime p)
n : ℕ
c : ℤ_[p]
this : ‖↑p ^ n * c‖ = ‖↑p ^ n‖ * ‖c‖
hc : ↑p ^ n * c = 0
⊢ c = 0

tactic: rw [mul_eq_zero] at hc
state_before: p : ℕ
hp : Fact (Nat.Prime p)
n : ℕ
c : ℤ_[p]
this : ‖↑p ^ n * c‖ = ‖↑p ^ n‖ * ‖c‖
hc : ↑p ^ n * c = 0
⊢ c = 0
state_after: p : ℕ
hp : Fact (Nat.Prime p)
n : ℕ
c : ℤ_[p]
this : ‖↑p ^ n * c‖ = ‖↑p ^ n‖ * ‖c‖
hc : ↑p ^ n = 0 ∨ c = 0
⊢ c = 0

tactic: cases' hc with hc hc
state_before: p : ℕ
hp : Fact (Nat.Prime p)
n : ℕ
c : ℤ_[p]
this : ‖↑p ^ n * c‖ = ‖↑p ^ n‖ * ‖c‖
hc : ↑p ^ n = 0 ∨ c = 0
⊢ c = 0
state_after: case inl
p : ℕ
hp : Fact (Nat.Prime p)
n : ℕ
c : ℤ_[p]
this : ‖↑p ^ n * c‖ = ‖↑p ^ n‖ * ‖c‖
hc : ↑p ^ n = 0
⊢ c = 0

case inr
p : ℕ
hp : Fact (Nat.Prime p)
n : ℕ
c : ℤ_[p]
this : ‖↑p ^ n * c‖ = ‖↑p ^ n‖ * ‖c‖
hc : c = 0
⊢ c = 0

tactic: refine (hp.1.ne_zero ?_).elim
state_before: case inl
p : ℕ
hp : Fact (Nat.Prime p)
n : ℕ
c : ℤ_[p]
this : ‖↑p ^ n * c‖ = ‖↑p ^ n‖ * ‖c‖
hc : ↑p ^ n = 0
⊢ c = 0
state_after: case inl
p : ℕ
hp : Fact (Nat.Prime p)
n : ℕ
c : ℤ_[p]
this : ‖↑p ^ n * c‖ = ‖↑p ^ n‖ * ‖c‖
hc : ↑p ^ n = 0
⊢ p = 0

tactic: exact_mod_cast pow_eq_zero hc
state_before: case inl
p : ℕ
hp : Fact (Nat.Prime p)
n : ℕ
c : ℤ_[p]
this : ‖↑p ^ n * c‖ = ‖↑p ^ n‖ * ‖c‖
hc : ↑p ^ n = 0
⊢ p = 0
state_after: no goals

tactic: exact hc
state_before: case inr
p : ℕ
hp : Fact (Nat.Prime p)
n : ℕ
c : ℤ_[p]
this : ‖↑p ^ n * c‖ = ‖↑p ^ n‖ * ‖c‖
hc : c = 0
⊢ c = 0
state_after: no goals

tactic: exact mod_cast hp.1.pos
state_before: case h₀
p : ℕ
hp : Fact (Nat.Prime p)
n : ℕ
c : ℤ_[p]
hc : c ≠ 0
this : ↑p ^ (-(↑p ^ n * c).valuation) = ↑p ^ (-(↑n + c.valuation))
aux : ↑p ^ n * c ≠ 0
⊢ 0 < ↑p
state_after: no goals

tactic: exact mod_cast hp.1.ne_one
state_before: case h₁
p : ℕ
hp : Fact (Nat.Prime p)
n : ℕ
c : ℤ_[p]
hc : c ≠ 0
this : ↑p ^ (-(↑p ^ n * c).valuation) = ↑p ^ (-(↑n + c.valuation))
aux : ↑p ^ n * c ≠ 0
⊢ ↑p ≠ 1
state_after: no goals

tactic: exact mod_cast hp.1.ne_zero
state_before: case ha
p : ℕ
hp : Fact (Nat.Prime p)
n : ℕ
c : ℤ_[p]
hc : c ≠ 0
this : ↑p ^ (-(↑p ^ n * c).valuation) = ↑p ^ (-↑n) * ↑p ^ (-c.valuation)
aux : ↑p ^ n * c ≠ 0
⊢ ↑p ≠ 0
state_after: no goals