Zulip Chat Archive
Stream: PrimeNumberTheorem+
Topic: Bounds on LCM(1..n) in Mathlib
J. J. Issai (project started by GRP) (Feb 05 2026 at 23:35):
Snir Broshi said:
J. J. Issai (project started by GRP) said:
Well I can poorly bound it by , and Erd{\o}s can do better with elementary means. However I thought it would have a good bound in MathLib (at least log(lcmint(n)) should be bounded by a constant in Mathlib).
IIUC bounds on it are related to the prime-number-theory so would live in the PNT+ repo, see
I suggest asking for this statement in #PrimeNumberTheorem+
I thought there might be a nice bound on LCM(1..n) in Mathlib or in this project. (I'd be happy with log(LCM(1..n)) < 5n.) So I ask on Snir's suggestion, is there? (Of course, above I should have said bounded by a constant times n. Oops.)
Rushil Raghavan (Feb 06 2026 at 00:32):
I'm not sure if general upper bounds on the expression lcm(1,..,n) specifically are in the project, but if you have log lcm(1,...,n) = Chebyshev psi (n), then we do have the estimate psi(n) < 1.11 n in the Blueprint. The proof is not formalized yet, however.
Snir Broshi (Feb 06 2026 at 00:38):
If we show
theorem foo (n : ℕ) : ArithmeticFunction.log (L n) = psi n := sorry
then using docs#ArithmeticFunction.vonMangoldt_le_log we could get an upper bound of log (n!) or n log n, which is a start
Terence Tao (Feb 06 2026 at 16:29):
We have very nearly formalized the bound ψ x ≤ 6 * a * x / 5 + (log (x/5) / log 6) * (5 * log x - 5) for 30 ≤ x, where a = (7/15) * Real.log 2 + (3/10) * Real.log 3 + (1/6) * Real.log 5 is about 0.9213. See https://alexkontorovich.github.io/PrimeNumberTheoremAnd/blueprint/secondary-chapter.html#chebyshev-estimates-sec ; only a few minor sorries remain to finish this off. Ignoring the lower order term, this is a bound roughly of the form . The optimal constant (if one wants a bound that holds for all ) is (due to Rosser and Schoenfeld), which is stated in the blueprint but for which no proof has yet been attempted. The slightly weaker , essentially due to Chebyshev, should be doable soon, the main remaining issue is how to deal with the medium range .
docs#Chebyshev.psi_le already has the weaker bound psi x ≤ Real.log 4 * x + 2 * √x * Real.log x which is the same as bounding the lcm by as you initially noted.
It seems that Real.log (L n) = Chebyshev.psi n is not yet in Mathlib; I'll add it to Lcm.lean as some bonus results.
EDIT: docs#primorial_le_4_pow is closely related to the upper bound since the primorial of is actually most of already (there is a correction term coming from the primes ); this may be another route for your specific application.
Last updated: Feb 28 2026 at 14:05 UTC