Theorem: Nat.properDivisors_prime_pow
File: Mathlib/NumberTheory/Divisors.lean

tactic: ext a
state_before: n p : ℕ
pp : Prime p
k : ℕ
⊢ (p ^ k).properDivisors = map { toFun := fun x => p ^ x, inj' := ⋯ } (range k)
state_after: case a
n p : ℕ
pp : Prime p
k a : ℕ
⊢ a ∈ (p ^ k).properDivisors ↔ a ∈ map { toFun := fun x => p ^ x, inj' := ⋯ } (range k)

tactic: simp only [mem_properDivisors, Nat.isUnit_iff, mem_map, mem_range, Function.Embedding.coeFn_mk,
  pow_eq]
state_before: case a
n p : ℕ
pp : Prime p
k a : ℕ
⊢ a ∈ (p ^ k).properDivisors ↔ a ∈ map { toFun := fun x => p ^ x, inj' := ⋯ } (range k)
state_after: case a
n p : ℕ
pp : Prime p
k a : ℕ
⊢ a ∣ p ^ k ∧ a < p ^ k ↔ ∃ a_1 < k, p ^ a_1 = a

tactic: have := mem_properDivisors_prime_pow pp k (x := a)
state_before: case a
n p : ℕ
pp : Prime p
k a : ℕ
⊢ a ∣ p ^ k ∧ a < p ^ k ↔ ∃ a_1 < k, p ^ a_1 = a
state_after: case a
n p : ℕ
pp : Prime p
k a : ℕ
this : a ∈ (p ^ k).properDivisors ↔ ∃ j, ∃ (_ : j < k), a = p ^ j
⊢ a ∣ p ^ k ∧ a < p ^ k ↔ ∃ a_1 < k, p ^ a_1 = a

tactic: rw [mem_properDivisors] at this
state_before: case a
n p : ℕ
pp : Prime p
k a : ℕ
this : a ∈ (p ^ k).properDivisors ↔ ∃ j, ∃ (_ : j < k), a = p ^ j
⊢ a ∣ p ^ k ∧ a < p ^ k ↔ ∃ a_1 < k, p ^ a_1 = a
state_after: case a
n p : ℕ
pp : Prime p
k a : ℕ
this : a ∣ p ^ k ∧ a < p ^ k ↔ ∃ j, ∃ (_ : j < k), a = p ^ j
⊢ a ∣ p ^ k ∧ a < p ^ k ↔ ∃ a_1 < k, p ^ a_1 = a

tactic: rw [this]
state_before: case a
n p : ℕ
pp : Prime p
k a : ℕ
this : a ∣ p ^ k ∧ a < p ^ k ↔ ∃ j, ∃ (_ : j < k), a = p ^ j
⊢ a ∣ p ^ k ∧ a < p ^ k ↔ ∃ a_1 < k, p ^ a_1 = a
state_after: case a
n p : ℕ
pp : Prime p
k a : ℕ
this : a ∣ p ^ k ∧ a < p ^ k ↔ ∃ j, ∃ (_ : j < k), a = p ^ j
⊢ (∃ j, ∃ (_ : j < k), a = p ^ j) ↔ ∃ a_1 < k, p ^ a_1 = a

tactic: refine ⟨?_, ?_⟩
state_before: case a
n p : ℕ
pp : Prime p
k a : ℕ
this : a ∣ p ^ k ∧ a < p ^ k ↔ ∃ j, ∃ (_ : j < k), a = p ^ j
⊢ (∃ j, ∃ (_ : j < k), a = p ^ j) ↔ ∃ a_1 < k, p ^ a_1 = a
state_after: case a.refine_1
n p : ℕ
pp : Prime p
k a : ℕ
this : a ∣ p ^ k ∧ a < p ^ k ↔ ∃ j, ∃ (_ : j < k), a = p ^ j
⊢ (∃ j, ∃ (_ : j < k), a = p ^ j) → ∃ a_2 < k, p ^ a_2 = a

case a.refine_2
n p : ℕ
pp : Prime p
k a : ℕ
this : a ∣ p ^ k ∧ a < p ^ k ↔ ∃ j, ∃ (_ : j < k), a = p ^ j
⊢ (∃ a_1 < k, p ^ a_1 = a) → ∃ j, ∃ (_ : j < k), a = p ^ j

tactic: intro h
state_before: case a.refine_1
n p : ℕ
pp : Prime p
k a : ℕ
this : a ∣ p ^ k ∧ a < p ^ k ↔ ∃ j, ∃ (_ : j < k), a = p ^ j
⊢ (∃ j, ∃ (_ : j < k), a = p ^ j) → ∃ a_2 < k, p ^ a_2 = a
state_after: case a.refine_1
n p : ℕ
pp : Prime p
k a : ℕ
this : a ∣ p ^ k ∧ a < p ^ k ↔ ∃ j, ∃ (_ : j < k), a = p ^ j
h : ∃ j, ∃ (_ : j < k), a = p ^ j
⊢ ∃ a_1 < k, p ^ a_1 = a

tactic: rcases h with ⟨j, hj, hap⟩
state_before: case a.refine_1
n p : ℕ
pp : Prime p
k a : ℕ
this : a ∣ p ^ k ∧ a < p ^ k ↔ ∃ j, ∃ (_ : j < k), a = p ^ j
h : ∃ j, ∃ (_ : j < k), a = p ^ j
⊢ ∃ a_1 < k, p ^ a_1 = a
state_after: case a.refine_1.intro.intro
n p : ℕ
pp : Prime p
k a : ℕ
this : a ∣ p ^ k ∧ a < p ^ k ↔ ∃ j, ∃ (_ : j < k), a = p ^ j
j : ℕ
hj : j < k
hap : a = p ^ j
⊢ ∃ a_1 < k, p ^ a_1 = a

tactic: use j
state_before: case a.refine_1.intro.intro
n p : ℕ
pp : Prime p
k a : ℕ
this : a ∣ p ^ k ∧ a < p ^ k ↔ ∃ j, ∃ (_ : j < k), a = p ^ j
j : ℕ
hj : j < k
hap : a = p ^ j
⊢ ∃ a_1 < k, p ^ a_1 = a
state_after: case h
n p : ℕ
pp : Prime p
k a : ℕ
this : a ∣ p ^ k ∧ a < p ^ k ↔ ∃ j, ∃ (_ : j < k), a = p ^ j
j : ℕ
hj : j < k
hap : a = p ^ j
⊢ j < k ∧ p ^ j = a

tactic: tauto
state_before: case h
n p : ℕ
pp : Prime p
k a : ℕ
this : a ∣ p ^ k ∧ a < p ^ k ↔ ∃ j, ∃ (_ : j < k), a = p ^ j
j : ℕ
hj : j < k
hap : a = p ^ j
⊢ j < k ∧ p ^ j = a
state_after: no goals

tactic: tauto
state_before: case a.refine_2
n p : ℕ
pp : Prime p
k a : ℕ
this : a ∣ p ^ k ∧ a < p ^ k ↔ ∃ j, ∃ (_ : j < k), a = p ^ j
⊢ (∃ a_1 < k, p ^ a_1 = a) → ∃ j, ∃ (_ : j < k), a = p ^ j
state_after: no goals