Zulip Chat Archive

Stream: new members

Topic: quick proof that the harmonic series diverges


Rado Kirov (Nov 16 2025 at 04:46):

quick lean challenge - can someone write this proof in Lean using mathlib:

image.png
https://x.com/PhDPersuasion/status/1989444431725076728

Jireh Loreaux (Nov 16 2025 at 05:50):

I'm laying in bed, and I'm not going to get up to do it, but the key lemma is docs#tsum_even_add_odd

Weiyi Wang (Nov 16 2025 at 06:10):

Using tsum would only show that this doesn't converge absolutely, but the intent is to also show that this doesn't even converge conditionally, right?

Scott Carnahan (Nov 16 2025 at 07:47):

I suppose we should have a lemma asserting the equivalence of absolute and conditional convergence for totally non-negative functions.

Kenny Lau (Nov 16 2025 at 09:44):

alternatively, we can work in ENNReal

Jireh Loreaux (Nov 16 2025 at 22:31):

@Rado Kirov Here's a faithful translation of that argument (if you're willing to accept unconditional convergence, otherwise you'll need to prove that unconditional convergence and conditional convergence coincide for nonnegative functions):

import Mathlib.Analysis.Normed.Order.Lattice
import Mathlib.Analysis.Normed.Ring.Basic
import Mathlib.Topology.Algebra.InfiniteSum.Order
import Mathlib.Topology.Algebra.InfiniteSum.Ring

example : ¬ Summable (fun n :   (n + 1 : )⁻¹) := by
  intro h
  have hₑ : Summable ((fun n :   (n + 1 : )⁻¹)  (2 * ·)) :=
    h.comp_injective fun _  by grind
  have hₒ : Summable ((fun n :   (n + 1 : )⁻¹)  (2 * · + 1)) :=
    h.comp_injective fun _  by grind
  simp only [Function.comp_def] at hₑ hₒ
  have := calc
    ∑' n : , (n + 1 : )⁻¹
    _ = ∑' n : , ((2 * n : ) + 1 : )⁻¹ + ∑' n : , ((2 * n + 1 : ) + 1 : )⁻¹ := by
      rw [ tsum_even_add_odd]
      exacts [hₑ, hₒ]
    _ > ∑' n : , ((2 * n + 1 : ) + 1 : )⁻¹ + ∑' n : , ((2 * n + 1 : ) + 1 : )⁻¹ := by
      gcongr
      refine hₒ.tsum_strict_mono hₑ <| StrongLT.lt fun n  ?_
      simp only [Nat.cast_add, Nat.cast_mul, Nat.cast_ofNat, Nat.cast_one]
      gcongr
      grind
    _ = ∑' n : , (n + 1 : )⁻¹ := by
      rw [ two_mul,  tsum_mul_left]
      congr! 2
      grind
  grind

Last updated: Dec 20 2025 at 21:32 UTC