Sign inCreate account
Lean-verified mathematics · statements from formal-conjectures
Working right now

Loading…

[Imported from formal-conjectures on 23 Nov 2026]

Title:Erdős Problem 963

Source:Erdős Problems
Open problem Nobody knows the answer yet — neither on paper nor in Lean. First verified proof: +100 points.
Statement:reviewed
Statement:

Let f(n)f(n) be the maximal kk such that in any set A⊂RA\subset \mathbb{R} of size nn there is a subset B⊆AB\subseteq A of size ∣B∣≥k\lvert B\rvert\geq k which is dissociated that is, the sums ∑b∈Sb\sum_{b\in S}b are distinct for all S⊆BS\subseteq B. Estimate f(n)f(n) - in particular, is it true that f(n)≥⌊log⁡2n⌋f(n)\geq \lfloor \log_2 n\rfloor?

This is the first part, a problem of Erdős [Er65, p. 188]. We read "estimate" as an asymptotic equivalence f(n)∼f(n)\sim answer n. The order of magnitude log⁡n\log n is easy (see erdos_963.variants.greedy and the example ai=ia_i=i in [Er65, p. 188]), so the question is the constant.

Subjects:Combinatorics (math.CO); Number Theory (math.NT)
MSC classes:05, 11
Tags:question
Cite as:NS.03783 [math.CO] · NS.03783v1 for this version
Declaration:Erdos963.erdos_963.parts.i
Verification:Lean kernel (formal proof)
Points:first verified proof or disproof: 100, later ones: 10; accepted critique: up to 60
Statement hash:6e2ad233b62429aaa5544ac2f59446404b8ad87b882919d4a234621ead2a99f8
Toolchain:leanprover/lean4:v4.33.1
Licence:Apache-2.0 · google-deepmind/formal-conjectures contributors
Upstream:FormalConjectures/ErdosProblems/963.lean

Formal statement

theorem erdos_963.parts.i :
    (fun n : ℕ ↦ (f n : ℝ)) ~[atTop] erdos_963.parts.i.answer
Show the full Challenge.lean (196 lines) — definitions included
module

public import FormalConjecturesUtil

/-!
# Erdős Problem 963

*References:*
- [erdosproblems.com/963](https://www.erdosproblems.com/963)
- [Er65] Erdős, P., *Extremal problems in number theory*. Proc. Sympos. Pure Math., Vol. VIII
  (1965), 181-189. [PDF](https://www.renyi.hu/~p_erdos/1965-02.pdf)

A set `B` of real numbers is dissociated if all sums over its finite subsets are distinct. This is
`AddDissociated` in Mathlib.
-/

@[expose] public section

open Filter Asymptotics

namespace Erdos963

/-- $f(n)$ is the largest $k$ such that every set $A\subset\mathbb{R}$ with $n$ elements has a
dissociated subset with at least $k$ elements. The set of such $k$ contains $0$ (take the empty
subset) and is bounded by $n$, so `sSup` is a true maximum. The set $A$ may contain $0$, which
can never belong to a dissociated set. For $n = 0$ the value is $0$. -/
noncomputable def f (n : ℕ) : ℕ :=
  sSup {k : ℕ | ∀ A : Finset ℝ, A.card = n →
    ∃ B ⊆ A, k ≤ B.card ∧ AddDissociated (B : Set ℝ)}

/-- If every set of `n` reals has a dissociated subset with at least `k` elements, then
$k \leq f(n)$. -/
@[category API, AMS 5 11]
theorem le_f {n k : ℕ}
    (h : ∀ A : Finset ℝ, A.card = n → ∃ B ⊆ A, k ≤ B.card ∧ AddDissociated (B : Set ℝ)) :
    k ≤ f n := by
  refine le_csSup ⟨n, fun m hm ↦ ?_⟩ h
  obtain ⟨A, hA⟩ := Infinite.exists_subset_card_eq ℝ n
  obtain ⟨B, hBA, hmB, -⟩ := hm A hA
  exact hmB.trans ((Finset.card_le_card hBA).trans hA.le)

/-- If `A` has `n` elements and all dissociated subsets of `A` have at most `m` elements, then
$f(n) \leq m$. -/
@[category API, AMS 5 11]
theorem f_le {n m : ℕ} (A : Finset ℝ) (hA : A.card = n)
    (h : ∀ B ⊆ A, AddDissociated (B : Set ℝ) → B.card ≤ m) : f n ≤ m := by
  refine csSup_le ⟨0, fun A' _ ↦ ⟨∅, Finset.empty_subset _, Nat.zero_le _, by simp⟩⟩ ?_
  intro k hk
  obtain ⟨B, hBA, hkB, hB⟩ := hk A hA
  exact hkB.trans (h B hBA hB)

def erdos_963.parts.i.answer : ℕ → ℝ := sorry

/--
Let $f(n)$ be the maximal $k$ such that in any set $A\subset \mathbb{R}$ of size $n$ there is a
subset $B\subseteq A$ of size $\lvert B\rvert\geq k$ which is dissociated that is, the sums
$\sum_{b\in S}b$ are distinct for all $S\subseteq B$. Estimate $f(n)$ - in particular, is it true
that $f(n)\geq \lfloor \log_2 n\rfloor$?

This is the first part, a problem of Erdős [Er65, p. 188]. We read "estimate" as an asymptotic
equivalence $f(n)\sim$ `answer n`. The order of magnitude $\log n$ is easy (see
`erdos_963.variants.greedy` and the example $a_i=i$ in [Er65, p. 188]), so the question is the
constant.
-/
@[category research open, question value, AMS 5 11]
theorem erdos_963.parts.i :
    (fun n : ℕ ↦ (f n : ℝ)) ~[atTop] erdos_963.parts.i.answer := by
  sorry

/--
Let $f(n)$ be the maximal $k$ such that in any set $A\subset \mathbb{R}$ of size $n$ there is a
subset $B\subseteq A$ of size $\lvert B\rvert\geq k$ which is dissociated that is, the sums
$\sum_{b\in S}b$ are distinct for all $S\subseteq B$. Estimate $f(n)$ - in particular, is it true
that $f(n)\geq \lfloor \log_2 n\rfloor$?

This is the second part. Erdős [Er65, p. 188] asks whether the bound $\lfloor\log_3 n\rfloor$ can
be improved to $\lfloor\log_2 n\rfloor$. We state it for all $n\geq 1$, with
$\lfloor\log_2 n\rfloor$ written as `Nat.log 2 n`.

As on the problem page, $A$ is any set of reals. [Er65] speaks of "given numbers" and uses the
example $a_i=i$. Allowing negative numbers makes the question harder. A dissociated set never
contains both $x$ and $-x$, and changing signs keeps a set dissociated. So the largest dissociated
subsets of $A$ and of $\{\lvert a\rvert : a\in A,\ a\neq 0\}$ have the same size, and the sets
$\{\pm a : a\in S\}$ (with $0$ added for odd $n$) show that $f(2m)=f(2m+1)$ is the least size of a
largest dissociated subset of a set of $m$ positive reals. Hence this statement asks for
$\lfloor\log_2 m\rfloor+1$ for $m$ positive reals. The question for positive reals with
$\lfloor\log_2\lvert A\rvert\rfloor$, one less, is `erdos_963.variants.positive`; it follows from
this statement.
-/
@[category research open, question, AMS 5 11]
theorem erdos_963.parts.ii : ∀ n : ℕ, 1 ≤ n → Nat.log 2 n ≤ f n := by
  sorry

section Greedy

/-- The sums $\sum_{b\in B}\varepsilon_b b$ with all coefficients $\varepsilon_b\in\{-1,0,1\}$. -/
private noncomputable def signedSums (B : Finset ℝ) : Finset ℝ :=
  (Fintype.piFinset fun _ : B ↦ ({-1, 0, 1} : Finset ℝ)).image fun ε ↦ ∑ b : B, ε b * b

/-- There are at most $3^{\lvert B\rvert}$ signed sums of `B`. -/
@[category API, AMS 5 11]
private lemma card_signedSums_le (B : Finset ℝ) : (signedSums B).card ≤ 3 ^ B.card := by
  refine Finset.card_image_le.trans ?_
  rw [Fintype.card_piFinset]
  refine (Finset.prod_le_pow_card _ _ 3 fun _ _ ↦ Finset.card_le_three).trans ?_
  simp

/-- The difference of two subset sums of `B` is a signed sum of `B`. -/
@[category API, AMS 5 11]
private lemma sum_sub_sum_mem_signedSums {B t u : Finset ℝ} (ht : t ⊆ B) (hu : u ⊆ B) :
    ∑ x ∈ u, x - ∑ x ∈ t, x ∈ signedSums B := by
  classical
  refine Finset.mem_image.2 ⟨fun b ↦ (if (b : ℝ) ∈ u then 1 else 0) - if (b : ℝ) ∈ t then 1 else 0,
    Fintype.mem_piFinset.2 fun b ↦ ?_, ?_⟩
  · split_ifs <;> simp
  · simp only [sub_mul, ite_mul, one_mul, zero_mul, Finset.sum_sub_distrib]
    rw [Finset.sum_coe_sort B fun x ↦ if x ∈ u then x else 0,
      Finset.sum_coe_sort B fun x ↦ if x ∈ t then x else 0, Finset.sum_ite_mem,
      Finset.sum_ite_mem, Finset.inter_eq_right.2 hu, Finset.inter_eq_right.2 ht]

/-- If `t` and `u` are disjoint subsets of `insert a B` with the same sum and `a ∈ t`, then `a` is
a signed sum of `B`. -/
@[category API, AMS 5 11]
private lemma mem_signedSums_of_mem {B t u : Finset ℝ} {a : ℝ} (ht : t ⊆ insert a B)
    (hu : u ⊆ insert a B) (htu : Disjoint t u) (hsum : ∑ x ∈ t, x = ∑ x ∈ u, x) (ha : a ∈ t) :
    a ∈ signedSums B := by
  classical
  have h := sum_sub_sum_mem_signedSums (Finset.subset_insert_iff.1 ht)
    ((Finset.subset_insert_iff_of_notMem (Finset.disjoint_left.1 htu ha)).1 hu)
  rwa [← hsum, ← Finset.add_sum_erase t _ ha, add_sub_cancel_right] at h

end Greedy

/--
Erdős noted that the greedy algorithm showed $f(n)\geq \lfloor \log_3 n\rfloor$
[Er65, p. 188].
-/
@[category research solved, AMS 5 11]
theorem erdos_963.variants.greedy (n : ℕ) : Nat.log 3 n ≤ f n := by
  classical
  refine le_f fun A hA ↦ ?_
  -- Take a maximal dissociated subset `B` of `A`.
  obtain ⟨B, hB⟩ :=
    (A.powerset.filter fun B : Finset ℝ ↦ AddDissociated (B : Set ℝ)).exists_maximal
      ⟨∅, Finset.mem_filter.2 ⟨Finset.empty_mem_powerset _, by simp⟩⟩
  simp only [Finset.mem_filter, Finset.mem_powerset] at hB
  -- Every element of `A` is a signed sum of `B`.
  have hAB : A ⊆ signedSums B := by
    intro a ha
    by_cases haB : a ∈ B
    · simpa using
        sum_sub_sum_mem_signedSums (Finset.empty_subset B) (Finset.singleton_subset_iff.2 haB)
    obtain ⟨t, u, ht, hu, htu, hne, hsum⟩ := not_addDissociated_iff_exists_disjoint.1 fun h ↦
      hB.not_gt ⟨Finset.insert_subset_iff.2 ⟨ha, hB.1.1⟩, h⟩ <| Finset.ssubset_insert haB
    rw [Finset.coe_subset] at ht hu
    by_cases hat : a ∈ t
    · exact mem_signedSums_of_mem ht hu htu hsum hat
    by_cases hau : a ∈ u
    · exact mem_signedSums_of_mem hu ht htu.symm hsum.symm hau
    rw [Finset.subset_insert_iff_of_notMem hat] at ht
    rw [Finset.subset_insert_iff_of_notMem hau] at hu
    exact absurd (hB.1.2 (Finset.coe_subset.2 ht) (Finset.coe_subset.2 hu) hsum) hne
  refine ⟨B, hB.1.1, ?_, hB.1.2⟩
  calc Nat.log 3 n = Nat.log 3 A.card := by rw [hA]
    _ ≤ Nat.log 3 (3 ^ B.card) :=
        Nat.log_mono_right ((Finset.card_le_card hAB).trans (card_signedSums_le B))
    _ = B.card := Nat.log_pow (by norm_num) _

/--
The second part for sets of positive reals, with $\lfloor\log_2\lvert A\rvert\rfloor$ as in
[Er65, p. 188] and its example $a_i=i$: every set $A$ of positive reals has a dissociated subset
with at least $\lfloor\log_2 \lvert A\rvert\rfloor$ elements.
-/
@[category research open, question, AMS 5 11]
theorem erdos_963.variants.positive :
    ∀ A : Finset ℝ, (∀ a ∈ A, 0 < a) →
      ∃ B ⊆ A, Nat.log 2 A.card ≤ B.card ∧ AddDissociated (B : Set ℝ) := by
  sorry

end Erdos963

To prove it: keep every definition of Challenge.lean unchanged and prove Erdos963.erdos_963.parts.i with the same type — no sorry in what it depends on, no new axioms. To disprove it: add theorem not_i : ¬ (…) in the same namespace, stating exactly the negation, and submit it as a disproof.

nosorry fetch erdos-963
nosorry submit erdos-963 nosorry/erdos-963/Solution.lean --wait

Formal variants

Other formal statements attached to the same informal problem (weaker, stronger, special cases). Each is scored separately.

Contributions

No contributions yet — be the first. Submit a proof or a finding.

Research in progress

People working on this problem share their repository and a summary of what they have tried — dead ends included. Read these before starting, build on them, and credit them in prior work when you submit.

Nobody has shared research on this problem yet.

Sign in to share your research.

Statement review

Is the formal statement faithful to the problem? Too weak, too strong, already solved in the literature? An accepted critique creates a new statement version; proofs of the previous version are re-checked and their points adjusted.

Sign in to open a critique.