Zulip Chat Archive

Stream: Is there code for X?

Topic: Riemann series theorem?


Niels Voss (Mar 05 2023 at 07:10):

Is there a proof of the Riemann series theorem (also called the Riemann rearrangement theorem) in Lean? I tried looking around in mathlib's infinite sum API but if I understand this correctly, it seemed that most sums were of the form

limS becomes a larger and larger finite subset of XtSt\lim_{S \text{ becomes a larger and larger finite subset of X}} \sum_{t \in S}t

so I couldn't find much on series defined as the limit of partial sums. My understanding (and I might be wrong) is that mathlib's definition only works for series that converge absolutely.

More generally, is there any easier way to work with these types of series other than something like filter.tendsto (λ k, (finset.range k).sum f) filter.at_top (nhds c). Alternatively, how do you work with conditionally convergent series?

Eric Wieser (Mar 05 2023 at 07:13):

Can you write the lean statement you're looking for?

Niels Voss (Mar 05 2023 at 07:16):

This wasn't actually for an existing project, I was just interested in knowing if anyone had tried this yet.
My best attempt at recreating this in a Lean statement was (and this might be totally wrong):

import data.real.basic
import topology.algebra.infinite_sum.basic
import topology.instances.real
import analysis.normed.group.basic

def converges (series :   ) : Prop :=  c : , filter.tendsto (λ k, (finset.range k).sum series) filter.at_top (nhds c)
def converges_absolutely (series :   ) : Prop := converges (λ n, (series n))

theorem riemann_rearrangement_theorem {series :   } (h₁ : converges series)
  (h₂ : ¬converges_absolutely series) (C : ) :  (p :   ), function.bijective p 
    filter.tendsto (λ k, (finset.range k).sum (λ n, series (p n))) filter.at_top (nhds C) := sorry

I haven't really checked this because I'm somewhat unfamiliar with how limits in Lean work in general

Yaël Dillies (Mar 05 2023 at 08:53):

@Yakov Pechersky, that's a you question :eyes:

Kevin Buzzard (Mar 05 2023 at 08:54):

Yes, we don't have this kind of sum in lean. I'm not an analyst but my impression is that this concept of summation is just used for undergraduate teaching and is not particularly central any more (summing divergent series used to be a thing but perhaps not so much now)

Kevin Buzzard (Mar 05 2023 at 08:55):

The lean definition of sum, as you say Niels, is equivalent to "absolutely convergent, and sum is..."

Yaël Dillies (Mar 05 2023 at 08:57):

Not quite, Kevin, no. It's not absolute convergence that we have in mathlib, but unconditional convergence., which is (slightly) weaker.

Yakov Pechersky (Mar 05 2023 at 08:59):

I think Yael is right. For an example, I think the alternating harmonic series is summable.

Kevin Buzzard (Mar 05 2023 at 08:59):

What? Surely not.

Yakov Pechersky (Mar 05 2023 at 09:00):

Because the partial sums when split out both diverge?

Kevin Buzzard (Mar 05 2023 at 09:00):

Do absolute and unconditional convergence coincide for nat-indexed sequences of reals? (I have no idea what unconditional convergence is)

Sebastien Gouezel (Mar 05 2023 at 09:04):

For sequences of reals, yes, they are equivalent. Not in general, though: let e_n be the standard basis of a Hilbert space. Then n -> e_n / n is not absolutely converging, but it is unconditionally converging.

Sebastien Gouezel (Mar 05 2023 at 09:05):

(i.e., in whatever order you do the summation you will get the same limit).

Pedro Sánchez Terraf (Mar 05 2023 at 12:07):

Kevin Buzzard said:

Yes, we don't have this kind of sum in lean. I'm not an analyst but my impression is that this concept of summation is just used for undergraduate teaching and is not particularly central any more (summing divergent series used to be a thing but perhaps not so much now)

Not an analyst either, but I seem to recall that “summability methods” were/are used for something, and actually prominent examples of those are based on looking at the summation of the first terms (calibrated by some weight, for instance, Cesàro's).

Kevin Buzzard (Mar 05 2023 at 12:46):

Right -- Hardy even wrote a book on divergent series. But that was a long time ago.

Eric Rodriguez (Mar 05 2023 at 13:48):

I find the idea that "this maths isn't trendy anymore" to be a weak explanation for not having certain things. Certainly if the methods have evolved to give the same results, that's nice, but if we miss maths due to the results not being as trendy?

Reid Barton (Mar 05 2023 at 13:49):

I mean, there is a lot of trendy math that we are missing too (almost all of it in fact).

Reid Barton (Mar 05 2023 at 13:49):

One has to choose what to do somehow.

Patrick Massot (Mar 05 2023 at 14:07):

Yes, it's all a matter of priorities. People are welcome to work on numerical series, and this work will get to mathlib at some point after the port.

Niels Voss (Mar 05 2023 at 20:30):

So, just to confirm, we don't have the Riemann series theorem in Lean and it is generally low priority, but could be added to mathlib after the port or if there is time? I was considering working on it, though I'm not quite sure I know enough to actually prove it.

Patrick Massot (Mar 05 2023 at 20:50):

I think so.

Jireh Loreaux (Mar 07 2023 at 03:46):

As an analyst who has done some reasonable amount of work with divergent series I can say that they definitely still matter. At the same time, I completely understand why mathlib has taken an alternate approach and considers these sorts of things low priority.

Mario Carneiro (Mar 07 2023 at 04:01):

I've always viewed the riemann series theorem as a curiosity or endpoint theorem. It helps you understand the nature of conditionally convergent series but it's not actually all that useful as a building block for other things, is it?

Julien Puydt (Mar 07 2023 at 05:56):

Riemann series are useful as a reference family to prove the convergence of other series.

David Loeffler (Mar 07 2023 at 06:52):

@Julien Puydt I think you have misunderstood what this thread is about. (I suspect you are thinking about the convergence of the series defining the Riemann zeta function for Re(s)>1\operatorname{Re}(s) > 1, which has been in mathlib essentially forever.)

Julien Puydt (Mar 07 2023 at 06:54):

@David Loeffler indeed ; sorry for the noise!

Jireh Loreaux (Mar 07 2023 at 13:16):

Mario, I haven't used the Riemann rearrangement theorem explicitly that I recall, but I have definitely seen similar theorems used. For instance, I know an argument that makes use of the following fact: given a divergent series of positive numbers (terms converge to zero though), and any other nonsummable sequence of positive numbers (not necessarily converging to zero), there is a partition of the series such that the sum of each subseries is the corresponding term in the second sequence.

Jireh Loreaux (Mar 07 2023 at 13:20):

Oh actually I take it back, I think I have used the Riemann rearrangement theorem. I have a paper which shows that an idempotent operator acting on a Hilbert space is not a Hilbert-Schmidt perturbation of a projection if and only if there is an orthonormal basis relative to which the diagonal of the matrix representation of this operator is the zero sequence. I'm fairly certain the forward implication uses this result under the hood somewhere.

Kevin Buzzard (Mar 07 2023 at 13:30):

Well this has been very enlightening :-) Thanks Jireh! @Niels Voss maybe you want to make a little PR about convergent (in the undergrad sense) series?

Niels Voss (Mar 07 2023 at 15:46):

I don't have much free time this week, but I can try next week.
Would it be better to keep the definition of a series as nat -> real, or should I define a new type which allows for dot notation (kind of like how matrix defined its own type)? Alternatively I could use seq which allows both finite and infinite series

Kevin Buzzard (Mar 07 2023 at 16:37):

My instinct is nat -> some topological monoid

Yaël Dillies (Mar 07 2023 at 16:47):

I would say α → β where locally_finite_order_bot α and topological_ring β.

Niels Voss (Mar 07 2023 at 23:43):

Aside from the level of generality, should it be defined as something like

def series (R : Type u) [topological_ring R] := nat -> R

Or should there not be any special type for series at all, and nat -> R will be used directly in theorem statements?
I normally think of a series as a special way of interpreting a sequence, and so the latter feels more natural to me, but the former allows dot notation and typeclass instances for series. And I have heard of people studying series as their own type of object as well.

Yaël Dillies (Mar 08 2023 at 07:50):

I would expect no special type.

Eric Wieser (Mar 08 2023 at 08:30):

Niels Voss said:

like how matrix defined its own type

This is necessary because matrix multiplication is not function (elementwise) multiplication


Last updated: Dec 20 2023 at 11:08 UTC