-
Notifications
You must be signed in to change notification settings - Fork 281
feat(ErdosProblems): formalize 423, 839 #3586
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,99 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| /- | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 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 423 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| *Reference:* [erdosproblems.com/423](https://www.erdosproblems.com/423) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Let $a_1 = 1$ and $a_2 = 2$, and for $k \ge 3$ choose $a_k$ to be the least integer | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| $> a_{k-1}$ which is the sum of at least two consecutive terms of the sequence. What is | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| the asymptotic behaviour of this sequence? | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| The sequence begins $1, 2, 3, 5, 6, 8, 10, 11, \ldots$ (OEIS A005243). | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Asked by Hofstadter (Erdős says Hofstadter was inspired by a similar question of Ulam). | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Bolan and Tang have independently proved that $a_n - n$ is nondecreasing and unbounded, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| so there are infinitely many integers not appearing in the sequence. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+24
to
+32
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's not repeat the problem here, those comments should go the definition of the sequence the corresponding conjectures/theorems. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| [Er77c] Erdős, P., *Problems and results on combinatorial number theory. III*, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Number theory day (Proc. Conf., Rockefeller Univ., New York, 1976), 1977, pp. 43–72. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| [ErGr80] Erdős, P. and Graham, R., *Old and new problems and results in combinatorial | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| number theory*, Monographies de L'Enseignement Mathématique (1980). | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| [Bolan] Bolan, M., *Hofstader–Ulam Sequence*, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| https://github.com/mjtb49/HofstaderUlam/blob/main/HofstaderUlamSequence.pdf | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| [Tang] Tang, Q., *On Erdős Problem 423*, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| https://github.com/QuanyuTang/erdos-problem-423/blob/main/On_Erd%C5%91s_Problem_423.pdf | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+22
to
+44
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
not the added OEIS reference (it was mentioned before, now listed in the reference with link) |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| -/ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| open Finset BigOperators | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| namespace Erdos423 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| /-- `IsConsecutiveBlockSum a k m` means that $m$ equals the sum of at least two | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| consecutive terms of the sequence $a$, using indices from $\{1, \ldots, k - 1\}$. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| That is, there exist $i, j$ with $1 \le i$, $i + 1 \le j$, $j \le k - 1$ such that | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| $m = a(i) + a(i+1) + \cdots + a(j)$. -/ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| def IsConsecutiveBlockSum (a : ℕ → ℕ) (k : ℕ) (m : ℕ) : Prop := | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ∃ i j : ℕ, 1 ≤ i ∧ i + 1 ≤ j ∧ j + 1 ≤ k ∧ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| m = ∑ l ∈ Finset.Icc i j, a l | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| /-- The Hofstadter sequence (OEIS A005243): $a(1) = 1$, $a(2) = 2$, and for $k \ge 3$, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| $a(k)$ is the least integer $> a(k-1)$ that equals the sum of at least two | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| consecutive terms from $\{a(1), \ldots, a(k-1)\}$. -/ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| def IsHofstadterSeq (a : ℕ → ℕ) : Prop := | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| a 1 = 1 ∧ a 2 = 2 ∧ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ∀ k : ℕ, 3 ≤ k → | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| IsConsecutiveBlockSum a k (a k) ∧ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| a (k - 1) < a k ∧ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ∀ m : ℕ, a (k - 1) < m → m < a k → ¬IsConsecutiveBlockSum a k m | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. it might make sense to add some test statements here to make sure we have formalised the correct sequence similar to how it is done in #3586
Suggested change
for the second one the proof /-- The fourth term of the Hofstadter sequence is $a(4) = 5 = a(2) + a(3) = 2 + 3$. -/
@[category test, AMS 5 11]
theorem erdos_423.test.a4 : ∀ a : ℕ → ℕ, IsHofstadterSeq a → a 4 = 5 := by
intro a ⟨ha1, ha2, hk⟩
have ha3 : a 3 = 3 := erdos_423.test.a3 a ⟨ha1, ha2, hk⟩
obtain ⟨⟨i, j, hi, hij, hjk, hsum⟩, hlt, hmin⟩ := hk 4 (by omega)
-- j ≤ 3, i ≥ 1, j ≥ i+1. Possible: (1,2), (1,3), (2,3)
-- a 4 > a 3 = 3. Sums: (1,2)→3, (2,3)→5, (1,3)→6. So a 4 ∈ {5,6}.
have h_ij : (i = 1 ∧ j = 2) ∨ (i = 2 ∧ j = 3) ∨ (i = 1 ∧ j = 3) := by omega
rcases h_ij with ⟨rfl, rfl⟩ | ⟨rfl, rfl⟩ | ⟨rfl, rfl⟩
· -- (1,2): sum = a1 + a2 = 3, but a 4 > 3, contradiction
simp only [show Finset.Icc 1 2 = {1, 2} from by decide,
Finset.sum_pair (by decide : (1:ℕ) ≠ 2), ha1, ha2] at hsum
rw [ha3] at hlt; omega
· -- (2,3): sum = a2 + a3 = 5 ✓
simp only [show Finset.Icc 2 3 = {2, 3} from by decide,
Finset.sum_pair (by decide : (2:ℕ) ≠ 3), ha2, ha3] at hsum
omega
· -- (1,3): sum = a1+a2+a3 = 6, but 5 is also a sum (2,3), contradicting minimality
have hIcc : Finset.Icc 1 3 = {1, 2, 3} := by decide
rw [hIcc, Finset.sum_insert (by decide : (1:ℕ) ∉ ({2, 3} : Finset ℕ)),
Finset.sum_pair (by decide : (2:ℕ) ≠ 3), ha1, ha2, ha3] at hsum
-- hsum : a 4 = 1 + (2 + 3) = 6
rw [ha3] at hlt
have ha4_eq : a 4 = 6 := by omega
have h3_lt_5 : a 3 < 5 := by omega
have h5_lt_a4 : 5 < a 4 := by omega
exfalso; apply hmin 5 h3_lt_5 h5_lt_a4
refine ⟨2, 3, by omega, by omega, by omega, ?_⟩
rw [show Finset.Icc 2 3 = {2, 3} from by decide,
Finset.sum_pair (by decide : (2:ℕ) ≠ 3), ha2, ha3]seems too long, but still good to have it as a test statement. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| /-- | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Erdős Problem 423 [Er77c, p.71; ErGr80, p.83]: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Let $a(1) = 1$, $a(2) = 2$, and for $k \ge 3$ let $a(k)$ be the least integer greater | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| than $a(k-1)$ that is a sum of at least two consecutive terms of the sequence. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Then $a(n) - n \to \infty$ as $n \to \infty$. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Equivalently, there are infinitely many positive integers not in the range of $a$. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| This was proved independently by Bolan and Tang. The full asymptotic behaviour | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| of the sequence remains an open question. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| -/ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| @[category research solved, AMS 5 11] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| theorem erdos_423 : | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
this is not the main variant here! |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ∀ a : ℕ → ℕ, IsHofstadterSeq a → | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ∀ M : ℕ, ∃ N : ℕ, ∀ n : ℕ, N ≤ n → M + n ≤ a n := by | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Could use |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| sorry | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+76
to
+84
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Regarding the @[category research solved, AMS 5 11]
theorem erdos_423 :
∀ a : ℕ → ℕ, IsHofstadterSeq a →
∀ M : ℕ, ∃ N : ℕ, ∀ n : ℕ, N ≤ n → M + n ≤ a n := by
sorry
@[category research solved, AMS 5 11]
theorem erdos_423' :
∀ a : ℕ → ℕ, IsHofstadterSeq a →
Set.Infinite (Set.range a)ᶜ := by
sorry
@[category test, AMS 5 11]
theorem equivalence : type_of% erdos_423 ↔ type_of% erdos_423' := by
constructor
· -- Forward: a(n) - n → ∞ implies (range a)ᶜ is infinite
intro h a ha
by_contra hfin
rw [Set.not_infinite] at hfin
-- (range a)ᶜ is finite, hence bounded
obtain ⟨ha1, ha2, hk⟩ := ha
have hfin_bdd := hfin.bddAbove
obtain ⟨B, hB⟩ := hfin_bdd
-- ∀ m > B, m ∈ range a
have hmem : ∀ m : ℕ, B < m → m ∈ Set.range a := by
intro m hm; by_contra hc; exact Nat.not_le.mpr hm (hB hc)
-- Use h with M = B + 2
obtain ⟨N, hN⟩ := h a ⟨ha1, ha2, hk⟩ (B + 2)
-- a is strictly increasing on {1,...}: extract this
have ha_lt : ∀ k : ℕ, 1 ≤ k → a k < a (k + 1) := by
intro k' hk'
rcases Nat.eq_or_lt_of_le hk' with rfl | hk''
· -- k' = 1: a 1 < a 2 from base case
rw [ha1, ha2]; omega
· -- k' ≥ 2: use recursive property
exact (hk (k' + 1) (by omega)).2.1
-- a is StrictMono on {1,...}: a i < a j for 1 ≤ i < j
have ha_smono : ∀ i j : ℕ, 1 ≤ i → i < j → a i < a j := by
intro i j hi hij
induction j with
| zero => omega
| succ j ih =>
rcases Nat.eq_or_lt_of_le (Nat.lt_succ_iff.mp hij) with heq | hlt
· subst heq; exact ha_lt i (by omega)
· exact Nat.lt_trans (ih hlt) (ha_lt j (by omega))
-- a(n) ≤ n + B + 1 for n ≥ 1: pigeonhole
replace hmem:.Icc (B+1) (B+2+N) ⊆(Finset.range (N + 1)).image a
· use fun and μ=>(Finset.mem_Icc.1 μ).elim (hmem and ·|>.elim fun and R M=> Finset.mem_image.2 (by use and,List.mem_range.2 (by match hN and with | S=>omega)))
· use (by valid ∘(((Nat.card_Icc _ _▸ Finset.card_mono hmem).trans Finset.card_image_le).trans_eq)) ( Finset.card_range _)
· -- Backward: (range a)ᶜ infinite implies a(n) - n → ∞
intro h a ha M
obtain ⟨ha1, ha2, hk⟩ := ha
-- a is strictly increasing on {1,...}
have ha_lt : ∀ k : ℕ, 1 ≤ k → a k < a (k + 1) := by
intro k' hk'
rcases Nat.eq_or_lt_of_le hk' with rfl | hk''
· rw [ha1, ha2]; omega
· exact (hk (k' + 1) (by omega)).2.1
have ha_smono : ∀ i j : ℕ, 1 ≤ i → i < j → a i < a j := by
intro i j hi hij
induction j with
| zero => omega
| succ j ih =>
rcases Nat.eq_or_lt_of_le (Nat.lt_succ_iff.mp hij) with heq | hlt
· subst heq; exact ha_lt i (by omega)
· exact Nat.lt_trans (ih hlt) (ha_lt j (by omega))
delta IsConsecutiveBlockSum at*
specialize h a _
· use ?_
· simp_all(config := {singlePass:=1})[IsConsecutiveBlockSum]
· omega
choose A B using(h).exists_gt
replace ha_lt:StrictMonoOn a (.Ici (1)) := fun and _ _ _ _=>(? _)
· by_cases h: BddAbove ((a ·-by valid) ''.Ici 01)
· obtain ⟨a, (i : 1 ≤a), _⟩:=Nat.sSup_mem (by repeat constructor) h
replace h : ∀B≥a, (by apply_rules : ℕ → ℕ) B≥B+((by apply_rules : ℕ → ℕ) a-a)
· exact (a.le_induction (a.add_sub_of_le ↑(i.rec ha1.ge fun and=>(ha_lt and (Nat.succ_pos _) (by constructor)).trans_le')).le fun and μ=>Nat.succ_add _ _▸(ha_smono _ _ (by valid) (by constructor)).trans_le')
by_cases h: BddAbove ((fun B=> (by apply_rules : ℕ → _) B-B) ''.Ici 1)
· replace h : ∀ x≥a, (by apply_rules : ℕ → ℕ) x = x+((by apply_rules : ℕ → ℕ) a-a)
· refine fun and (H) =>le_antisymm (tsub_le_iff_left.1 (by convert le_csSup h ⟨ _,i.trans H, rfl⟩)) (by apply_rules)
· rcases(B _).left ⟨ _,(h _).comp (le_of_lt) (Nat.le_sub_of_add_le (not_lt.mp (by·grind))) |>.trans (Nat.sub_add_cancel ((Nat.sub_le _ _).trans (le_of_lt (B _).2)))⟩
· exact (Set.exists_mem_image.1 (not_bddAbove_iff.1 h M)).imp fun and ⟨a, C⟩ A B=>and.le_induction (lt_tsub_iff_right.1 C).le (fun R M=>((ha_smono _ _ (a.trans M) (by constructor))).trans_le') A B
· exact (Set.exists_mem_image.1 (not_bddAbove_iff.1 h M)).imp fun and ⟨a, S⟩ A B=>B.rec (lt_tsub_iff_right.1 S).le fun and true => true.trans_lt (ha_smono _ _ (by valid) (by constructor))
· classical apply_rules |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| /-- | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Erdős Problem 423 — nondecreasing variant [Bolan; Tang]: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| The sequence $a(n) - n$ is nondecreasing. This is a stronger structural property than | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| the unboundedness stated in `erdos_423`, and was also proved independently by Bolan and | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Tang. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| -/ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| @[category research solved, AMS 5 11] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| theorem erdos_423_nondecreasing : | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
there is a README.md in |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ∀ a : ℕ → ℕ, IsHofstadterSeq a → | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ∀ n m : ℕ, n ≤ m → a n - n ≤ a m - m := by | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| sorry | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| end Erdos423 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,77 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| /- | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 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 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import FormalConjecturesForMathlib.Data.Set.Density | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Those imports are automatic when inlcuding the |
||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| /-! | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Erdős Problem 839 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| *Reference:* [erdosproblems.com/839](https://www.erdosproblems.com/839) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Given a strictly increasing sequence of positive integers where no term equals the sum of | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| consecutive earlier terms, is it true that $\limsup a_n / n = \infty$? A stronger form asks | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| whether $(1/\log x) \sum_{a_n < x} 1/a_n \to 0$. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| A problem of Erdős [Er78f][Er92c]. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| [Er78f] Erdős, P., *Problems in number theory and combinatorics*, Proc. Sixth Manitoba Conf. on | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Numerical Math. (1978), 35-58. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| [Er92c] Erdős, P., *Some of my favourite unsolved problems*, J. Combin. Theory Ser. A (1992). | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| [Fr93] Freud, R., *Adding numbers — on a problem of P. Erdős*, James Cook Mathematical Notes | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| (1993), 6199–6202. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+21
to
+37
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| -/ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+21
to
+38
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same comment as in 423 apply: |
||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| open Filter Real Finset | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| namespace Erdos839 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| /-- A sequence $a : \mathbb{N} \to \mathbb{N}$ is "sum-of-consecutive-free" if no term equals | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| the sum of a contiguous block of earlier terms. That is, for all $i$, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| $a_i \neq a_j + a_{j+1} + \cdots + a_k$ for any $j \leq k < i$. -/ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| def SumOfConsecutiveFree (a : ℕ → ℕ) : Prop := | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ∀ i : ℕ, ∀ j k : ℕ, j ≤ k → k < i → | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| a i ≠ ∑ l ∈ Finset.Icc j k, a l | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| /-- | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Erdős Problem 839 (Part 1) [Er78f][Er92c]: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Let $1 \leq a_1 < a_2 < \cdots$ be a strictly increasing sequence of positive integers | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| such that no $a_i$ is the sum of consecutive $a_j$ for $j < i$. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Is it true that $\limsup a_n / n = \infty$? | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| -/ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| @[category research open, AMS 11] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| theorem erdos_839 : answer(sorry) ↔ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
is the naming convention, I think |
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ∀ (a : ℕ → ℕ), (∀ n, 1 ≤ a n) → StrictMono a → SumOfConsecutiveFree a → | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ∀ M : ℝ, ∃ᶠ n in atTop, M < (a n : ℝ) / (n : ℝ) := by | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Better to use
Suggested change
with Or |
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| sorry | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| /-- | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Erdős Problem 839 (Part 2, stronger) [Er78f][Er92c]: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Let $1 \leq a_1 < a_2 < \cdots$ be a strictly increasing sequence of positive integers | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| such that no $a_i$ is the sum of consecutive $a_j$ for $j < i$. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Is it true that $\lim_{x \to \infty} \frac{1}{\log x} \sum_{a_n < x} \frac{1}{a_n} = 0$? | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Good usage of this, instead of the manual definition! |
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| -/ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| @[category research open, AMS 11] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| theorem erdos_839.variants.stronger : answer(sorry) ↔ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
this is not from the additional material, hence a |
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ∀ (a : ℕ → ℕ), (∀ n, 1 ≤ a n) → StrictMono a → SumOfConsecutiveFree a → | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Set.HasLogDensity (Set.range a) 0 := by | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| sorry | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please add a |
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| end Erdos839 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The problem with this file is that it doesn't contain the main question "What is the asymptotic behaviour of this sequence?"
There are plenty of example of how we handle this rather vague question in general but in this case there has been quite some recent development in the comment section https://www.erdosproblems.com/forum/thread/423
So the best approach here would to use the formulations conjecture and known bounds (upper and lower) from there.
We I don't think we ever had added a file where the main question is missing and only the additional material is there. Quite often, we only do the main question.