Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions FormalConjectures/ErdosProblems/5.lean
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
/-
Copyright 2025 The Formal Conjectures Authors.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

https://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-/

import FormalConjectures.Util.ProblemImports

/-!
# Erdős Problem 5

*Reference:* [erdosproblems.com/5](https://www.erdosproblems.com/5)
-/

open Real Filter Function
open scoped Topology

/--
For every nonnegative real number x, there exists a strictly increasing sequence of indices (n_i)
such that the limit of $(p_{n_{i+1}} - p_{n_i}) / log n_i$ equals $x$,
where $p_k$ denotes the k-th prime number.

Note: the condition `n 0 ≥ 2` ensures the logarithm is defined for all indices
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this condition is not quite needed because log takes the junk value 0 for the remaining indices, and StrictMono will only allow log (n 0) and log (n 1) to take junk values. So these should not affect the final asymptotic assertion -- although I guess it can't hurt to leave it in

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking through the sources, it also looks like some of the more modern statements of this problem equivalently use $\log(p_n)$ as the denominator, rather than $\log(n)$, which would avoid this issue entirely

-/
@[category research open, AMS 11]
theorem erdos_5.finite_case (x : ℝ) (hx : 0 ≤ x) :
∃ n : ℕ → ℕ, StrictMono n ∧ n 0 ≥ 2 ∧
Tendsto (fun i ↦ ((n (i+1)).nth Prime - (n i).nth Prime : ℝ) / log (n i)) atTop (𝓝 x) := by
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: the cast to real can be removed here and in infinite_case, this will be inferred from Real.log in the denom

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I see that! Thank you!

sorry

/--
There exists a strictly increasing sequence of indices (n_i)
such that the limit of $(p_{n_{i+1}} - p_{n_i}) / log n_i$ equals $\infty$,
where $p_k$ denotes the k-th prime number.

Note: the condition `n 0 ≥ 2` ensures the logarithm is defined for all indices
-/
@[category research solved, AMS 11]
theorem erdos_5.infinite_case :
∃ n : ℕ → ℕ, StrictMono n ∧ n 0 ≥ 2 ∧
Tendsto (fun i ↦ ((n (i+1)).nth Prime - (n i).nth Prime : ℝ) / log (n i)) atTop atTop := by
sorry