Theorem: approxOrderOf.smul_eq_of_mul_dvd
File: Mathlib/NumberTheory/WellApproximable.lean

tactic: simp_rw [approxOrderOf, thickening_eq_biUnion_ball, ← image_smul, image_iUnion₂, image_smul,
  smul_ball'', smul_eq_mul, mem_setOf_eq]
state_before: A : Type u_1
inst✝ : SeminormedCommGroup A
a : A
m n : ℕ
δ : ℝ
hn : 0 < n
han : orderOf a ^ 2 ∣ n
⊢ a • approxOrderOf A n δ = approxOrderOf A n δ
state_after: A : Type u_1
inst✝ : SeminormedCommGroup A
a : A
m n : ℕ
δ : ℝ
hn : 0 < n
han : orderOf a ^ 2 ∣ n
⊢ ⋃ i, ⋃ (_ : orderOf i = n), ball (a * i) δ = ⋃ x, ⋃ (_ : orderOf x = n), ball x δ

tactic: replace han : ∀ {b : A}, orderOf b = n → orderOf (a * b) = n := by
  intro b hb
  rw [← hb] at han hn
  rw [sq] at han
  rwa [(Commute.all a b).orderOf_mul_eq_right_of_forall_prime_mul_dvd (orderOf_pos_iff.mp hn)
    fun p _ hp' => dvd_trans (mul_dvd_mul_right hp' <| orderOf a) han]
state_before: A : Type u_1
inst✝ : SeminormedCommGroup A
a : A
m n : ℕ
δ : ℝ
hn : 0 < n
han : orderOf a ^ 2 ∣ n
⊢ ⋃ i, ⋃ (_ : orderOf i = n), ball (a * i) δ = ⋃ x, ⋃ (_ : orderOf x = n), ball x δ
state_after: A : Type u_1
inst✝ : SeminormedCommGroup A
a : A
m n : ℕ
δ : ℝ
hn : 0 < n
han : ∀ {b : A}, orderOf b = n → orderOf (a * b) = n
⊢ ⋃ i, ⋃ (_ : orderOf i = n), ball (a * i) δ = ⋃ x, ⋃ (_ : orderOf x = n), ball x δ

tactic: let f : {b : A | orderOf b = n} → {b : A | orderOf b = n} := fun b => ⟨a * b, han b.property⟩
state_before: A : Type u_1
inst✝ : SeminormedCommGroup A
a : A
m n : ℕ
δ : ℝ
hn : 0 < n
han : ∀ {b : A}, orderOf b = n → orderOf (a * b) = n
⊢ ⋃ i, ⋃ (_ : orderOf i = n), ball (a * i) δ = ⋃ x, ⋃ (_ : orderOf x = n), ball x δ
state_after: A : Type u_1
inst✝ : SeminormedCommGroup A
a : A
m n : ℕ
δ : ℝ
hn : 0 < n
han : ∀ {b : A}, orderOf b = n → orderOf (a * b) = n
f : ↑{b | orderOf b = n} → ↑{b | orderOf b = n} := fun b => ⟨a * ↑b, ⋯⟩
⊢ ⋃ i, ⋃ (_ : orderOf i = n), ball (a * i) δ = ⋃ x, ⋃ (_ : orderOf x = n), ball x δ

tactic: simpa only [mem_setOf_eq, Subtype.coe_mk, iUnion_coe_set] using
  hf.iUnion_comp fun b => ball (b : A) δ
state_before: A : Type u_1
inst✝ : SeminormedCommGroup A
a : A
m n : ℕ
δ : ℝ
hn : 0 < n
han : ∀ {b : A}, orderOf b = n → orderOf (a * b) = n
f : ↑{b | orderOf b = n} → ↑{b | orderOf b = n} := fun b => ⟨a * ↑b, ⋯⟩
hf : Surjective f
⊢ ⋃ i, ⋃ (_ : orderOf i = n), ball (a * i) δ = ⋃ x, ⋃ (_ : orderOf x = n), ball x δ
state_after: no goals

tactic: intro b hb
state_before: A : Type u_1
inst✝ : SeminormedCommGroup A
a : A
m n : ℕ
δ : ℝ
hn : 0 < n
han : orderOf a ^ 2 ∣ n
⊢ ∀ {b : A}, orderOf b = n → orderOf (a * b) = n
state_after: A : Type u_1
inst✝ : SeminormedCommGroup A
a : A
m n : ℕ
δ : ℝ
hn : 0 < n
han : orderOf a ^ 2 ∣ n
b : A
hb : orderOf b = n
⊢ orderOf (a * b) = n

tactic: rw [← hb] at han hn
state_before: A : Type u_1
inst✝ : SeminormedCommGroup A
a : A
m n : ℕ
δ : ℝ
hn : 0 < n
han : orderOf a ^ 2 ∣ n
b : A
hb : orderOf b = n
⊢ orderOf (a * b) = n
state_after: A : Type u_1
inst✝ : SeminormedCommGroup A
a : A
m n : ℕ
δ : ℝ
b : A
hn : 0 < orderOf b
han : orderOf a ^ 2 ∣ orderOf b
hb : orderOf b = n
⊢ orderOf (a * b) = n

tactic: rw [sq] at han
state_before: A : Type u_1
inst✝ : SeminormedCommGroup A
a : A
m n : ℕ
δ : ℝ
b : A
hn : 0 < orderOf b
han : orderOf a ^ 2 ∣ orderOf b
hb : orderOf b = n
⊢ orderOf (a * b) = n
state_after: A : Type u_1
inst✝ : SeminormedCommGroup A
a : A
m n : ℕ
δ : ℝ
b : A
hn : 0 < orderOf b
han : orderOf a * orderOf a ∣ orderOf b
hb : orderOf b = n
⊢ orderOf (a * b) = n

tactic: rwa [(Commute.all a b).orderOf_mul_eq_right_of_forall_prime_mul_dvd (orderOf_pos_iff.mp hn)
  fun p _ hp' => dvd_trans (mul_dvd_mul_right hp' <| orderOf a) han]
state_before: A : Type u_1
inst✝ : SeminormedCommGroup A
a : A
m n : ℕ
δ : ℝ
b : A
hn : 0 < orderOf b
han : orderOf a * orderOf a ∣ orderOf b
hb : orderOf b = n
⊢ orderOf (a * b) = n
state_after: no goals

tactic: rintro ⟨b, hb⟩
state_before: A : Type u_1
inst✝ : SeminormedCommGroup A
a : A
m n : ℕ
δ : ℝ
hn : 0 < n
han : ∀ {b : A}, orderOf b = n → orderOf (a * b) = n
f : ↑{b | orderOf b = n} → ↑{b | orderOf b = n} := fun b => ⟨a * ↑b, ⋯⟩
⊢ Surjective f
state_after: case mk
A : Type u_1
inst✝ : SeminormedCommGroup A
a : A
m n : ℕ
δ : ℝ
hn : 0 < n
han : ∀ {b : A}, orderOf b = n → orderOf (a * b) = n
f : ↑{b | orderOf b = n} → ↑{b | orderOf b = n} := fun b => ⟨a * ↑b, ⋯⟩
b : A
hb : b ∈ {b | orderOf b = n}
⊢ ∃ a, f a = ⟨b, hb⟩

tactic: refine ⟨⟨a⁻¹ * b, ?_⟩, ?_⟩
state_before: case mk
A : Type u_1
inst✝ : SeminormedCommGroup A
a : A
m n : ℕ
δ : ℝ
hn : 0 < n
han : ∀ {b : A}, orderOf b = n → orderOf (a * b) = n
f : ↑{b | orderOf b = n} → ↑{b | orderOf b = n} := fun b => ⟨a * ↑b, ⋯⟩
b : A
hb : b ∈ {b | orderOf b = n}
⊢ ∃ a, f a = ⟨b, hb⟩
state_after: case mk.refine_1
A : Type u_1
inst✝ : SeminormedCommGroup A
a : A
m n : ℕ
δ : ℝ
hn : 0 < n
han : ∀ {b : A}, orderOf b = n → orderOf (a * b) = n
f : ↑{b | orderOf b = n} → ↑{b | orderOf b = n} := fun b => ⟨a * ↑b, ⋯⟩
b : A
hb : b ∈ {b | orderOf b = n}
⊢ a⁻¹ * b ∈ {b | orderOf b = n}

case mk.refine_2
A : Type u_1
inst✝ : SeminormedCommGroup A
a : A
m n : ℕ
δ : ℝ
hn : 0 < n
han : ∀ {b : A}, orderOf b = n → orderOf (a * b) = n
f : ↑{b | orderOf b = n} → ↑{b | orderOf b = n} := fun b => ⟨a * ↑b, ⋯⟩
b : A
hb : b ∈ {b | orderOf b = n}
⊢ f ⟨a⁻¹ * b, ?mk.refine_1⟩ = ⟨b, hb⟩

tactic: rw [mem_setOf_eq, ← orderOf_inv, mul_inv_rev, inv_inv, mul_comm]
state_before: case mk.refine_1
A : Type u_1
inst✝ : SeminormedCommGroup A
a : A
m n : ℕ
δ : ℝ
hn : 0 < n
han : ∀ {b : A}, orderOf b = n → orderOf (a * b) = n
f : ↑{b | orderOf b = n} → ↑{b | orderOf b = n} := fun b => ⟨a * ↑b, ⋯⟩
b : A
hb : b ∈ {b | orderOf b = n}
⊢ a⁻¹ * b ∈ {b | orderOf b = n}
state_after: case mk.refine_1
A : Type u_1
inst✝ : SeminormedCommGroup A
a : A
m n : ℕ
δ : ℝ
hn : 0 < n
han : ∀ {b : A}, orderOf b = n → orderOf (a * b) = n
f : ↑{b | orderOf b = n} → ↑{b | orderOf b = n} := fun b => ⟨a * ↑b, ⋯⟩
b : A
hb : b ∈ {b | orderOf b = n}
⊢ orderOf (a * b⁻¹) = n

tactic: apply han
state_before: case mk.refine_1
A : Type u_1
inst✝ : SeminormedCommGroup A
a : A
m n : ℕ
δ : ℝ
hn : 0 < n
han : ∀ {b : A}, orderOf b = n → orderOf (a * b) = n
f : ↑{b | orderOf b = n} → ↑{b | orderOf b = n} := fun b => ⟨a * ↑b, ⋯⟩
b : A
hb : b ∈ {b | orderOf b = n}
⊢ orderOf (a * b⁻¹) = n
state_after: case mk.refine_1.a
A : Type u_1
inst✝ : SeminormedCommGroup A
a : A
m n : ℕ
δ : ℝ
hn : 0 < n
han : ∀ {b : A}, orderOf b = n → orderOf (a * b) = n
f : ↑{b | orderOf b = n} → ↑{b | orderOf b = n} := fun b => ⟨a * ↑b, ⋯⟩
b : A
hb : b ∈ {b | orderOf b = n}
⊢ orderOf b⁻¹ = n

tactic: simpa
state_before: case mk.refine_1.a
A : Type u_1
inst✝ : SeminormedCommGroup A
a : A
m n : ℕ
δ : ℝ
hn : 0 < n
han : ∀ {b : A}, orderOf b = n → orderOf (a * b) = n
f : ↑{b | orderOf b = n} → ↑{b | orderOf b = n} := fun b => ⟨a * ↑b, ⋯⟩
b : A
hb : b ∈ {b | orderOf b = n}
⊢ orderOf b⁻¹ = n
state_after: no goals

tactic: simp only [f, Subtype.mk_eq_mk, Subtype.coe_mk, mul_inv_cancel_left]
state_before: case mk.refine_2
A : Type u_1
inst✝ : SeminormedCommGroup A
a : A
m n : ℕ
δ : ℝ
hn : 0 < n
han : ∀ {b : A}, orderOf b = n → orderOf (a * b) = n
f : ↑{b | orderOf b = n} → ↑{b | orderOf b = n} := fun b => ⟨a * ↑b, ⋯⟩
b : A
hb : b ∈ {b | orderOf b = n}
⊢ f ⟨a⁻¹ * b, ⋯⟩ = ⟨b, hb⟩
state_after: no goals