Zulip Chat Archive

Stream: PR reviews

Topic: Prerequisites for PNT and Dirichlet's Thm


Michael Stoll (Nov 12 2024 at 17:57):

I am now starting a series of PRs that provide the ingredients for the proof of the Prime Number Theorem and Dirichlet's Theorem on primes in AP. Essentially, one has to show that a certain linear combination of logarithmic derivatives of Dirichlet L-series has certain properties. This will at some point build on the earlier PRs discussed here.

The series stats with #18923, which adds "logarithmic" versions of Euler products of completely multiplicative (complex-valued) functions.

Michael Stoll (Nov 12 2024 at 18:28):

The next one is #18924; it adds two easy IsBigO lemmas that help going from complex functions to their restrictions to the real line.

Michael Stoll (Nov 12 2024 at 18:56):

#18927 is the third; it adds two further IsBigO lemmas for shifted functions.

Michael Stoll (Nov 12 2024 at 19:22):

It continues with #18928; it adds API showing that LSeries commutes with Finset.sum.

Michael Stoll (Nov 12 2024 at 19:32):

The next one will be a bit larger (~270 loc); it will show that L(χ, s) does not vanish for s.re ≥ 1 when χ is a Dirichlet character (and either χ is nontrivial or s ≠ 1). But this depends on the four preparatory PRs mentioned above.

David Loeffler (Nov 12 2024 at 21:21):

Are they literally a series with each PR depending on the previous one, or can they be reviewed in any order?

Ruben Van de Velde (Nov 12 2024 at 21:35):

Does the series converge? (Sorry)

Michael Stoll (Nov 13 2024 at 09:39):

David Loeffler said:

Are they literally a series with each PR depending on the previous one, or can they be reviewed in any order?

These four are independent. Thanks for the reviews!

Michael Stoll (Nov 13 2024 at 11:33):

Michael Stoll said:

#18927 is the third; it adds two further IsBigO lemmas for shifted functions.

After some discussion, whose result was that it is better to inline these two lemmas where they are used (once each, in the next PR), I have closed this now.

Michael Stoll (Nov 13 2024 at 11:51):

#18923 (Euler products) could do with a review...

Michael Stoll (Nov 13 2024 at 15:12):

Another small preparatory PR: #18973. It just adds one lemma (the derivatives of the L-function and the L-series of a Dirichlet character agree on the half-plane of convergence of the latter).

Michael Stoll (Nov 14 2024 at 13:02):

#19034 uses the previously merged PR to establish an exp-log Euler product formula for Dirichlet L-series.

Michael Stoll (Nov 14 2024 at 18:33):

Now the first substantial step: #19043 proves that L(χ,s)0L(\chi, s) \ne 0 for Res1\operatorname{Re} s \ge 1 (unless χ\chi is trivial and s=1s = 1). (About 240 loc.)

Kevin Buzzard (Nov 15 2024 at 06:55):

This is so cool! These results are important!

Michael Stoll (Nov 19 2024 at 16:24):

#19254 adds some results on logarithmic derivatives of L-functions of Dirichlet characters.

Michael Stoll (Nov 21 2024 at 14:29):

#19334 and #19335 are two further (small and indpendent) preparatory PRs.

Michael Stoll (Nov 21 2024 at 14:45):

Next up are the following lemmas.

lemma tsum_eq_tsum_primes_of_support_subset_prime_powers {α : Type*} [AddCommGroup α]
     [UniformSpace α] [UniformAddGroup α] [CompleteSpace α] [T0Space α] {f :   α}
     (hfs : Summable f) (hf : Function.support f  {n | IsPrimePow n}) :
    ∑' n : , f n = ∑' (p : Nat.Primes) (k : ), f (p ^ (k + 1)) := by
  sorry

lemma tsum_eq_tsum_primes_add_tsum_primes_of_support_subset_prime_powers {α : Type*}
    [AddCommGroup α] [UniformSpace α] [UniformAddGroup α] [CompleteSpace α] [T0Space α]
    {f :   α} (hfs : Summable f) (hf : Function.support f  {n | IsPrimePow n}) :
    ∑' n : , f n = (∑' p : Nat.Primes, f p) +  ∑' (p : Nat.Primes) (k : ), f (p ^ (k + 2)) := by
  sorry

Should these go somewhere under Mathlib.Topology.Algebra.InfiniteSum, or are they too special, so that they should go close to their application?

Michael Stoll (Nov 21 2024 at 20:46):

#19344 creates a new file Mathlib.NumberTheory.LSeries.PrimesInAP that will eventually contain a proof of Dirichlet's Theorem. The first step is to add the lemmas mentioned above. (If desired, they can be moved elsewhere at some point, but there does not appear to be a canonical place.)

Michael Stoll (Nov 22 2024 at 12:51):

#19368 is the next step: properties of the von Mangoldt function restricted to a residue class.

Michael Stoll (Nov 23 2024 at 19:18):

#19418 adds two further relevant statements on docs#ArithmeticFunction.vonMangoldt.residueClass.

Johan Commelin (Nov 23 2024 at 20:09):

Btw, how far are we from Dirichlet's theorem? 10 PRs? Or twice that? Can you already estimate this?

Michael Stoll (Nov 23 2024 at 20:10):

About 200 loc. Probably two further PRs.

Johan Commelin (Nov 23 2024 at 20:11):

Ooh, wow!

Johan Commelin (Nov 23 2024 at 20:11):

Would you mind opening a PR already?

Michael Stoll (Nov 23 2024 at 20:13):

You can see what remains here. (Minus the last part, which needs the Wiener-Ikehara Theorem; this is done in PNT+.)

Michael Stoll (Nov 23 2024 at 20:17):

I prefer tinkering in my own repo rather than pushing everything to a Mathlib branch while I'm working on it. Though I think that the proof in its current shape looks quite good.

Michael Stoll (Nov 23 2024 at 21:51):

I've decided to end the suspense: #19421 contains everything that is still missing including Dirichlet's Theorem itself (in two versions).
Note that this is "just" the infinity statement; more precise asymptotic versions are and will be obtained in the PNT+ project.

Johan Commelin (Nov 25 2024 at 07:03):

I left two comments. But I think people with more expertise in analytic number theory should also take a look.

David Loeffler (Nov 25 2024 at 07:55):

I am travelling at the moment but can take a look on Wednesday, unless someone else gets there first.

Johan Commelin (Nov 25 2024 at 07:57):

Enjoy your travels. If you need some distraction: do you know a nice name for

/-- The auxiliary function used, e.g., with the Wiener-Ikehara Theorem to prove
Dirichlet's Theorem. On `re s > 1`, it agrees with the L-series of the von Mangoldt
function restricted to the residue class `a : ZMod q` minus the principal part
`(q.totient)⁻¹/(s-1)` of the pole at `s = 1`; see `DirichletsThm.auxFun_prop`. -/
noncomputable
abbrev auxFun (s : ) :  :=
  (q.totient : )⁻¹ * (-deriv (LFunctionTrivChar₁ q) s / LFunctionTrivChar₁ q s -
     χ  ({1} : Finset (DirichletCharacter  q)), χ a⁻¹ * deriv (LFunction χ) s / LFunction χ s)

Michael Stoll (Nov 25 2024 at 09:05):

LfunctionResidueClassSubInvTotientDiv is descriptive in a way, but I'm not sure it is actually better. auxFunForDirichletsThm? :smile:

Damiano Testa (Nov 25 2024 at 09:08):

Maybe LfunctionResidueClassAux is a little more explicit, but also maintains an aux status.

Johan Commelin (Nov 25 2024 at 09:09):

It's mostly that when a module docstring starts talking about auxFun, then this decl seems important enough to get a different name...

Michael Stoll (Nov 25 2024 at 13:05):

I'll go with @Damiano Testa's suggestion for now. If somebody comes up with a better idea, we can change it again.

David Loeffler (Nov 25 2024 at 16:14):

Elsewhere in the L-functions library there is a convention of using subscript "0" to mean "L-series modified by adding a multiple of 1 / (s -1) to kill the pole". So perhaps this could be "ZMod.LFunctionVonMangoldt0"?

Michael Stoll (Nov 25 2024 at 16:15):

The function it's related to the L-series of is not periodic, so ZMod is not the right namespace. Perhaps ArithmeticFunction.vonMangoldt.LFunctionResidueClass₀?

David Loeffler (Nov 25 2024 at 16:21):

Using vonMangoldt as a namespace seems a bit unorthodox. I would also be happy with Damiano's suggestion, and (as Johan observes) it would be very easy to change the name later anyway so it's probably not worth worrying too much about it now.

Michael Stoll (Nov 25 2024 at 16:23):

I've put the modified von Mangoldt function in the ArithmeticFunction.vonMangoldt namespace because I think this makes sense. Then using this namespace also for the associated L-function follows in a way the precedent of DirichletCharacter.LFunction.

Michael Stoll (Nov 25 2024 at 16:24):

The alternative would probably be to use ArithmeticFunction.vonMangoldtResidueClass, but then one has to write out the "vonMangoldt" part every single time...

Johan Commelin (Nov 25 2024 at 16:56):

Besides this name... does anybody have any other comments?

Johan Commelin (Nov 25 2024 at 16:57):

LGTM, and I'm happy to get this merged today :grinning:

Riccardo Brasca (Nov 25 2024 at 17:10):

Having a look

David Loeffler (Nov 25 2024 at 17:11):

I gave it a quick once-over (while sitting in a hotel room in Amsterdam). All looks reasonable to me, and I think it is important enough that we should merge it ASAP and sort out any rough edges later.

Riccardo Brasca (Nov 25 2024 at 17:16):

It looks (very) good also to me, I've left two minor comments and I think it is ready to go.

Riccardo Brasca (Nov 25 2024 at 17:16):

A related question, do we want to remove Mathlib.NumberTheory.PrimesCongruentOne?

Johan Commelin (Nov 25 2024 at 17:27):

:bors:

Johan Commelin (Nov 25 2024 at 17:28):

Mathlib.NumberTheory.PrimesCongruentOne is used in an IMO problem. It seems a bit extravagant to use Dirichlet for that... but ey, it typechecks :rofl:

Riccardo Brasca (Nov 25 2024 at 17:30):

Well, we can always move everything in the same IMO file, it is a short proof. Anyway I think we will have more and more situation like this, when easy results become a special case of big ones

Yaël Dillies (Nov 25 2024 at 17:44):

Johan Commelin said:

Mathlib.NumberTheory.PrimesCongruentOne is used in an IMO problem. It seems a bit extravagant to use Dirichlet for that... but ey, it typechecks :rofl:

Makes sense to me. Dirichlet's theorem is one of the first things I learned when preparing for the IMO, along with Hensel's lemma

Johan Commelin (Nov 25 2024 at 17:51):

It's landed! Massive milestone! Congrats @Michael Stoll

Michael Stoll (Nov 25 2024 at 18:06):

Just noticed that it should be LFunctionResidueClassAux instead of LfunctionResidueClassAux...

Michael Stoll (Nov 25 2024 at 18:33):

#19474 fixes the names.

Antoine Chambert-Loir (Nov 25 2024 at 19:44):

Riccardo Brasca said:

A related question, do we want to remove Mathlib.NumberTheory.PrimesCongruentOne?

I'd suggest that the proof of that file should be transferred to another part of mathlib, so that it isn't lost (it's a Proof from the Book!), but the theorem should be refactored using Dirichlet's theorem.

Michael Stoll (Nov 25 2024 at 19:45):

Maybe move it to Archive?

Michael Stoll (Nov 25 2024 at 20:14):

It seems that this result is only used in Imo2008Q3 (and there is a comment in file#Mathlib/NumberTheory/FermatPsp referring to docs#Nat.frequently_atTop_modEq_one).

Antoine Chambert-Loir (Nov 25 2024 at 22:04):

You see, I'm not sure the full Dirichlet's theorem will have many applications in mathlib before some time!
The congruent to one case has a nice proof that can serve as an interesting example to people, and I would even suggest that mathlib documents it.

Michael Stoll (Nov 25 2024 at 22:06):

I hope to get the Hasse-Minkowski Theorem (over Q\mathbb Q at least) into Mathlib eventually, and this will need Dirichlet's Theorem at some point. But this will certainly take a while...

Antoine Chambert-Loir (Nov 25 2024 at 22:07):

And that will be a wonderful application!

Joseph Myers (Nov 26 2024 at 02:09):

Some people have a notion that IMO problems shouldn't depend for their solution on non-elementary cases of Dirichlet's theorem (but that such dependence would be considered fine at some other competitions such as the Romanian Master of Mathematics): that while it's OK to use non-elementary results in solving a problem (indeed, people might occasionally quote FLT or Catalan-Mihăilescu in olympiad solutions), a problem ought to have a solution that doesn't use such results.

Joseph Myers (Nov 26 2024 at 02:11):

That's not relevant for what goes in mathlib; heavy dependencies are fine in the mathlib archive without needing to be concerned with whether the particular case of Dirichlet used is or is not an elementary one. Rather, the key question for whether to keep an elementary special case of Dirichlet in mathlib would be whether there is likely to be anything added to mathlib itself that (a) depends on such a case and (b) ought to have limited dependencies.

Joseph Myers (Nov 26 2024 at 02:17):

Moving to a particular IMO file in the mathlib archive doesn't seem such a good idea, though, since quite likely other IMO problems might also want to use that special case. (Though IMO 2003 P6 is more a matter of "solution uses similar ideas" than "solution quotes the result" - albeit that there is said to be a solution to 2003 P6 by quoting Chebotarev. Maybe once we have Chebotarev formalized we can see if that ends up much shorter than the elementary solution in compfiles.)

Alex Kontorovich (Nov 26 2024 at 04:24):

Antoine Chambert-Loir said:

You see, I'm not sure the full Dirichlet's theorem will have many applications in mathlib before some time!
The congruent to one case has a nice proof that can serve as an interesting example to people, and I would even suggest that mathlib documents it.

How about bounded generation of higher rank groups like SLn(Z)SL_n(\Z), n3n\ge3...?

Violeta Hernández (Nov 26 2024 at 07:20):

Johan Commelin said:

Mathlib.NumberTheory.PrimesCongruentOne is used in an IMO problem. It seems a bit extravagant to use Dirichlet for that... but ey, it typechecks :rofl:

Which one? There's always the possibility that there's some alternate solution without it that isn't much harder.

Johan Commelin (Nov 26 2024 at 07:24):

Archive/Imo/Imo2008Q3.lean

Thomas Browning (Nov 26 2024 at 07:38):

Seems like it just needs infinitely many primes congruent to 1 mod 4

Kevin Buzzard (Nov 26 2024 at 07:49):

And there's an elementary proof of this (given finitely many such primes, multiply them all together, double, square, add one and take a factor, using the fact that -1 is a square mod the factor)

Antoine Chambert-Loir (Nov 26 2024 at 16:52):

And having primes congruent to -1 mod 4 is easy as well. Even easier.

Thomas Browning (Nov 26 2024 at 16:55):

Kevin Buzzard said:

And there's an elementary proof of this (given finitely many such primes, multiply them all together, double, square, add one and take a factor, using the fact that -1 is a square mod the factor)

Although technically this proof follows the same route as the general 1 mod n proof, since you're using the fourth cyclotomic polynomial.

Joseph Myers (Nov 27 2024 at 03:35):

I think the general version of the elementary argument for primes -1 mod 4 results in: given a subgroup of (ZMod n)ˣ that's not the whole group, there are infinitely many primes whose values mod n are not in that subgroup.

Riccardo Brasca (Nov 27 2024 at 08:03):

The general result is (I think) that there infinitely many primes not congruent to 1 mod n, but this gives -1 only mod 4.

Michael Stoll (Nov 27 2024 at 10:24):

That's the special case of what @Joseph Myers says when the subgroup is trivial. But the more general result also includes the statement that there are infinitely many primes that are quadratic nonresidues mod a fixed prime, for example. (And the complementary statement that there are infinitely many primes that are quadratic residues follows from an argument like the one @Kevin Buzzard has sketched.)


Last updated: May 02 2025 at 03:31 UTC