Theorem: EisensteinSeries.summable_one_div_norm_rpow
File: Mathlib/NumberTheory/ModularForms/EisensteinSeries/UniformConvergence.lean

tactic: rw [← (finTwoArrowEquiv _).symm.summable_iff, summable_partition _ Int.existsUnique_mem_box]
state_before: z : ℍ
k : ℝ
hk : 2 < k
⊢ Summable fun x => ‖x‖ ^ (-k)
state_after: z : ℍ
k : ℝ
hk : 2 < k
⊢ (∀ (j : ℕ), Summable fun i => ((fun x => ‖x‖ ^ (-k)) ∘ ⇑(finTwoArrowEquiv ℤ).symm) ↑i) ∧
    Summable fun j => ∑' (i : ↑fun i => i ∈ (box j).val), ((fun x => ‖x‖ ^ (-k)) ∘ ⇑(finTwoArrowEquiv ℤ).symm) ↑i

z : ℍ
k : ℝ
hk : 2 < k
⊢ 0 ≤ (fun x => ‖x‖ ^ (-k)) ∘ ⇑(finTwoArrowEquiv ℤ).symm

tactic: simp only [finTwoArrowEquiv_symm_apply, Function.comp_def]
state_before: z : ℍ
k : ℝ
hk : 2 < k
⊢ (∀ (j : ℕ), Summable fun i => ((fun x => ‖x‖ ^ (-k)) ∘ ⇑(finTwoArrowEquiv ℤ).symm) ↑i) ∧
    Summable fun j => ∑' (i : ↑fun i => i ∈ (box j).val), ((fun x => ‖x‖ ^ (-k)) ∘ ⇑(finTwoArrowEquiv ℤ).symm) ↑i
state_after: z : ℍ
k : ℝ
hk : 2 < k
⊢ (∀ (j : ℕ), Summable fun i => ‖![(↑i).1, (↑i).2]‖ ^ (-k)) ∧
    Summable fun j => ∑' (i : ↑fun i => i ∈ (box j).val), ‖![(↑i).1, (↑i).2]‖ ^ (-k)

tactic: refine ⟨fun n ↦ (hasSum_fintype (β := box (α := ℤ × ℤ) n) _).summable, ?_⟩
state_before: z : ℍ
k : ℝ
hk : 2 < k
⊢ (∀ (j : ℕ), Summable fun i => ‖![(↑i).1, (↑i).2]‖ ^ (-k)) ∧
    Summable fun j => ∑' (i : ↑fun i => i ∈ (box j).val), ‖![(↑i).1, (↑i).2]‖ ^ (-k)
state_after: z : ℍ
k : ℝ
hk : 2 < k
⊢ Summable fun j => ∑' (i : ↑fun i => i ∈ (box j).val), ‖![(↑i).1, (↑i).2]‖ ^ (-k)

tactic: suffices Summable fun n : ℕ ↦ ∑' (_ : box (α := ℤ × ℤ) n), (n : ℝ) ^ (-k) by
  refine this.congr fun n ↦ tsum_congr fun p ↦ ?_
  simp only [← Int.mem_box.mp p.2, Nat.cast_max, norm_eq_max_natAbs, Matrix.cons_val_zero,
    Matrix.cons_val_one, Matrix.head_cons]
state_before: z : ℍ
k : ℝ
hk : 2 < k
⊢ Summable fun j => ∑' (i : ↑fun i => i ∈ (box j).val), ‖![(↑i).1, (↑i).2]‖ ^ (-k)
state_after: z : ℍ
k : ℝ
hk : 2 < k
⊢ Summable fun n => ∑' (x : { x // x ∈ box n }), ↑n ^ (-k)

tactic: simp only [tsum_fintype, univ_eq_attach, sum_const, card_attach, nsmul_eq_mul]
state_before: z : ℍ
k : ℝ
hk : 2 < k
⊢ Summable fun n => ∑' (x : { x // x ∈ box n }), ↑n ^ (-k)
state_after: z : ℍ
k : ℝ
hk : 2 < k
⊢ Summable fun n => ↑(box n).card * ↑n ^ (-k)

tactic: apply ((Real.summable_nat_rpow.mpr (by linarith : 1 - k < -1)).mul_left
  8).of_norm_bounded_eventually_nat
state_before: z : ℍ
k : ℝ
hk : 2 < k
⊢ Summable fun n => ↑(box n).card * ↑n ^ (-k)
state_after: z : ℍ
k : ℝ
hk : 2 < k
⊢ ∀ᶠ (i : ℕ) in Filter.atTop, ‖↑(box i).card * ↑i ^ (-k)‖ ≤ 8 * ↑i ^ (1 - k)

tactic: filter_upwards [Filter.eventually_gt_atTop 0] with n hn
state_before: z : ℍ
k : ℝ
hk : 2 < k
⊢ ∀ᶠ (i : ℕ) in Filter.atTop, ‖↑(box i).card * ↑i ^ (-k)‖ ≤ 8 * ↑i ^ (1 - k)
state_after: case h
z : ℍ
k : ℝ
hk : 2 < k
n : ℕ
hn : 0 < n
⊢ ‖↑(box n).card * ↑n ^ (-k)‖ ≤ 8 * ↑n ^ (1 - k)

tactic: rw [Int.card_box hn.ne', Real.norm_of_nonneg (by positivity), sub_eq_add_neg,
  Real.rpow_add (Nat.cast_pos.mpr hn), Real.rpow_one, Nat.cast_mul, Nat.cast_ofNat, mul_assoc]
state_before: case h
z : ℍ
k : ℝ
hk : 2 < k
n : ℕ
hn : 0 < n
⊢ ‖↑(box n).card * ↑n ^ (-k)‖ ≤ 8 * ↑n ^ (1 - k)
state_after: no goals

tactic: refine this.congr fun n ↦ tsum_congr fun p ↦ ?_
state_before: z : ℍ
k : ℝ
hk : 2 < k
this : Summable fun n => ∑' (x : { x // x ∈ box n }), ↑n ^ (-k)
⊢ Summable fun j => ∑' (i : ↑fun i => i ∈ (box j).val), ‖![(↑i).1, (↑i).2]‖ ^ (-k)
state_after: z : ℍ
k : ℝ
hk : 2 < k
this : Summable fun n => ∑' (x : { x // x ∈ box n }), ↑n ^ (-k)
n : ℕ
p : { x // x ∈ box n }
⊢ ↑n ^ (-k) = ‖![(↑p).1, (↑p).2]‖ ^ (-k)

tactic: simp only [← Int.mem_box.mp p.2, Nat.cast_max, norm_eq_max_natAbs, Matrix.cons_val_zero,
  Matrix.cons_val_one, Matrix.head_cons]
state_before: z : ℍ
k : ℝ
hk : 2 < k
this : Summable fun n => ∑' (x : { x // x ∈ box n }), ↑n ^ (-k)
n : ℕ
p : { x // x ∈ box n }
⊢ ↑n ^ (-k) = ‖![(↑p).1, (↑p).2]‖ ^ (-k)
state_after: no goals

tactic: linarith
state_before: z : ℍ
k : ℝ
hk : 2 < k
⊢ 1 - k < -1
state_after: no goals

tactic: positivity
state_before: z : ℍ
k : ℝ
hk : 2 < k
n : ℕ
hn : 0 < n
⊢ 0 ≤ ↑(8 * n) * ↑n ^ (-k)
state_after: no goals

tactic: exact fun n ↦ Real.rpow_nonneg (norm_nonneg _) _
state_before: z : ℍ
k : ℝ
hk : 2 < k
⊢ 0 ≤ (fun x => ‖x‖ ^ (-k)) ∘ ⇑(finTwoArrowEquiv ℤ).symm
state_after: no goals