This journal is in preparation. Submissions are open as a pilot and the editorial board is being formed. Articles marked Demonstration show the format only.
Journal of Machine-Verified MathematicsPeer-reviewed mathematics with machine-checked proofs, for the age of AI

Challenge.lean

All files · 34 lines · source at the verified commit

1module
2
3public import Mathlib.Analysis.SpecificLimits.Basic
4public import Mathlib.Data.Set.Card
5public import Mathlib.Data.Real.Basic
6
7public section
8
9/-!
10# Hofstadter's set has natural density 2/3
11
12Let `A` be the smallest set of natural numbers that contains 2 and 3 and contains `a * b - 1` for all distinct members `a` and `b`
13(Erdős problem 424, attributed by Erdős to Hofstadter; OEIS A005244). Korsky (arXiv:2608.07910) proved that `A` has positive lower
14density. The statement below says that the proportion of members of `A` below `n` converges, and that its limit is `2 / 3`.
15No member of `A` is congruent to 1 modulo 3, so `2 / 3` is the largest possible value.
16-/
17
18namespace Hofstadter
19
20/-- `Generated n` says that `n` lies in the smallest set of natural numbers that contains 2 and 3 and contains `a * b - 1` whenever it
21contains `a` and `b` and `a ≠ b`. (Members are at least 2, so `a * b - 1` is ordinary subtraction.) -/
22inductive Generated : ℕ → Prop
23 | two : Generated 2
24 | three : Generated 3
25 | step {a b : ℕ} : Generated a → Generated b → a ≠ b → Generated (a * b - 1)
26
27/-- The proportion of generated numbers among the natural numbers below `n` tends to `2 / 3` as `n` tends to infinity. -/
28theorem density_eq_two_thirds :
29 Filter.Tendsto (fun n : ℕ => (Set.ncard {m : ℕ | m < n ∧ Generated m} : ℝ) / n) Filter.atTop
30 (nhds (2 / 3)) := by
31 sorry
32
33end Hofstadter
34