Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
22d00fc
add erdos-254
danielchin Feb 16, 2026
1173dbf
rebase
danielchin Feb 24, 2026
973a8ac
Bump mathlib to v4.24.0
YaelDillies Jan 25, 2026
c9f4853
Bump mathlib to v4.25.0
YaelDillies Jan 25, 2026
b4f9820
Bump mathlib to v4.26.0
YaelDillies Jan 26, 2026
8502ccd
Bump mathlib to v4.27.0
YaelDillies Jan 26, 2026
3fa614d
Make things compile in docbuild
Paul-Lez Feb 3, 2026
0edc1d2
Don't import `Counterexamples`
YaelDillies Feb 3, 2026
68e3f71
feat(CI): distinguish formally solved Erdős problem status (#2299)
zond Feb 17, 2026
694df06
feat(ErdosProblems): 23 (#2162)
rwst Feb 17, 2026
1b73a71
feat: Gourevitch conjecture (#1883)
Khansa435 Feb 17, 2026
e0c0bde
feat: add bot to help contributors add/remove tags using comments (#2…
Paul-Lez Feb 17, 2026
04e18d7
fix(ErdosProblems): 943 (#2332)
smmercuri Feb 18, 2026
09d0645
fixes after merge
mo271 Feb 19, 2026
2d9e69b
solve(GreensOpenProblems): upper_trivial in 24 (#2358)
theaustinhatfield Feb 19, 2026
2abbaa0
fix(): Update statuses of problems and fix minor issues (#2325)
danielchin Feb 20, 2026
ae66630
address comments
danielchin Feb 23, 2026
6b395eb
Bump mathlib to v4.23.0
YaelDillies Jan 25, 2026
649286d
Bump mathlib to v4.25.0
YaelDillies Jan 25, 2026
4d649e8
feat(CI): change freq and add link (#2357)
mo271 Feb 22, 2026
06fe416
feat(GreensOpenProblems): 26 (#2368)
jeangud Feb 23, 2026
d32269b
fix(ErdosProblems): 434 (#2331)
smmercuri Feb 23, 2026
8b21491
fix(ErdosProblems): 786 (#2283)
smmercuri Feb 23, 2026
763ec14
Feat(FormalConjecturesForMathlib): add general infrastructure for ter…
Paul-Lez Feb 23, 2026
69893b5
feat(ErdosProblems): 1142 (#2369)
franzhusch Feb 23, 2026
fced95a
Merge branch 'main' into erdos-254
danielchin Feb 24, 2026
d5f4d9c
fix incorrect merge
danielchin Feb 24, 2026
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
72 changes: 72 additions & 0 deletions FormalConjectures/ErdosProblems/254.lean
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
/-
Copyright 2026 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 254

*References:*
- [erdosproblems.com/254](https://www.erdosproblems.com/254)
- [Ca60] Cassels, J. W. S., On the representation of integers as the sums of distinct summands taken
from a fixed set. Acta Sci. Math. (Szeged) (1960), 111-124.
-/

open Filter Set

namespace Erdos254

/--
The distance of $x$ from the nearest integer.
-/
noncomputable def nearestIntDist (x : ℝ) : ℝ :=
min (Int.fract x) (1 - Int.fract x)

/--
An integer `n` can be written as a sum of distinct elements of `A`.
-/
def IsSumOfDistinct (A : Set ℕ) (n : ℕ) : Prop :=
∃ S : Finset ℕ, (S : Set ℕ) ⊆ A ∧ S.sum (fun x ↦ x) = n

/--
Let $A\subseteq \mathbb{N}$ be such that $\lvert A\cap [1,2x]\rvert -\lvert A\cap [1,x]\rvert \to
\infty\textrm{ as }x\to \infty$ and $\sum_{n\in A} \{ \theta n\}=\infty$ for every $\theta\in
(0,1)$, where $\{x\}$ is the distance of $x$ from the nearest integer. Then every sufficiently large
integer is the sum of distinct elements of $A$.
-/
@[category research open, AMS 5]
theorem erdos_254 :
∀ (A : Set ℕ),
(Tendsto (fun x : ℕ ↦ (A ∩ Icc 1 (2 * x)).ncard - (A ∩ Icc 1 x).ncard) atTop atTop) ∧
(∀ θ : ℝ, 0 < θ → θ < 1 → ¬ Summable (fun n : A ↦ nearestIntDist (θ * (n : ℝ)))) →
∀ᶠ m in atTop, IsSumOfDistinct A m := by
sorry

/--
Cassels [Ca60] proved this under the alternative hypotheses $\lim \frac{\lvert A\cap [1,2x]\rvert
-\lvert A\cap [1,x]\rvert}{\log\log x}=\infty$ and $\sum_{n\in A} \{ \theta n\}^2=\infty$ for every
$\theta\in (0,1)$.
-/
@[category research solved, AMS 5]
theorem erdos_254.variants.cassels :
∀ (A : Set ℕ),
(Tendsto (fun x : ℕ ↦ (((A ∩ Icc 1 (2 * x)).ncard : ℝ) -
((A ∩ Icc 1 x).ncard : ℝ)) / Real.log (Real.log x)) atTop atTop) ∧
(∀ θ : ℝ, 0 < θ → θ < 1 → ¬ Summable (fun n : A ↦ (nearestIntDist (θ * (n : ℝ)))^2)) →
∀ᶠ m in atTop, IsSumOfDistinct A m := by
sorry

end Erdos254
2 changes: 1 addition & 1 deletion lean-toolchain
Original file line number Diff line number Diff line change
@@ -1 +1 @@
leanprover/lean4:v4.27.0
leanprover/lean4:v4.27.0
Loading