{
  "id": "837",
  "ident": "NS.00837",
  "slug": "erdos-1165",
  "title": "Erdős Problem 1165",
  "status": "solved",
  "statement_status": "reviewed",
  "statement_md": "Given a random walk $s_0,s_1,\\ldots$ in $\\mathbb{Z}^2$, starting at the origin, let $f_n(x)$ count\nthe number of $0\\leq k\\leq n$ such that $s_k=x$.\n\nLet\n$$F(n)=\\{ x: f_n(x) = \\max_y f_n(y)\\}$$\nbe the set of 'favourite values'. Find\n$$\\mathbb{P}(\\lvert F(n)\\rvert=r\\textrm{ infinitely often})$$\nfor $r\\geq 3$.\n\nA problem of Erdős and Révész [Va99, 6.77]. We take the simple random walk, on any probability\nspace (`IsSimpleRandomWalkSteps`). Hao, Li, Okada and Zheng [HLOZ24, Theorem 1.1] showed that the\nprobability is $1$ for $r=3$ and $0$ for $r\\geq 4$, see `erdos_1165.variants.hao_li_okada_zheng`.\nThe value of `erdos_1165.answer` for $r<3$ is not used.",
  "subjects": [
    "math.PR",
    "msc:60"
  ],
  "tags": [
    "question"
  ],
  "collection": "erdos",
  "source_url": null,
  "solved_on_platform": false,
  "needs_answer": false,
  "version": 1,
  "decl_name": "Erdos1165.erdos_1165",
  "statement_lean": "theorem erdos_1165 {Ω : Type*} [MeasureSpace Ω] [IsProbabilityMeasure (ℙ : Measure Ω)]\n    {X : ℕ → Ω → ℤ × ℤ} (hX : IsSimpleRandomWalkSteps X) (r : ℕ) (hr : 3 ≤ r) :\n    ℙ {ω | ∃ᶠ n in atTop, (favouriteSites X n ω).encard = (r : ℕ∞)} = erdos_1165.answer r",
  "challenge_source": "/-\nCopyright 2026 The Formal Conjectures Authors.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    https://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n-/\nmodule\n\npublic import FormalConjecturesUtil\n\n/-!\n# Erdős Problem 1165\n\n*References:*\n- [erdosproblems.com/1165](https://www.erdosproblems.com/1165)\n- [Va99] Various, *Some of Paul's favorite problems*. Booklet produced for the conference\n  \"Paul Erdős and his mathematics\", Budapest, July 1999 (1999).\n- [HLOZ24] Hao, C., Li, X., Okada, I. and Zheng, Y., *Favorite sites for simple random walk in\n  two and more dimensions*. [arXiv:2409.00995](https://arxiv.org/abs/2409.00995) (2024).\n- [To01] Tóth, B., *No more than three favorite sites for simple random walk*.\n  Ann. Probab. 29 (2001), 484--503.\n-/\n\n@[expose] public section\n\nopen MeasureTheory Filter\nopen scoped ProbabilityTheory ENNReal\n\nnamespace Erdos1165\n\n/-- The four unit steps $(\\pm 1, 0)$ and $(0, \\pm 1)$ of the simple random walk on\n$\\mathbb{Z}^2$. -/\ndef steps : Set (ℤ × ℤ) := {(1, 0), (-1, 0), (0, 1), (0, -1)}\n\n/-- `X k` is the $k$-th step of a simple random walk on $\\mathbb{Z}^2$, on the probability space\n`Ω`: the steps are random variables, they are independent, and each is uniformly distributed on\n`steps`. -/\nstructure IsSimpleRandomWalkSteps {Ω : Type*} [MeasureSpace Ω] (X : ℕ → Ω → ℤ × ℤ) : Prop where\n  /-- Each step is a random variable. -/\n  measurable (k : ℕ) : Measurable (X k)\n  /-- The steps are independent. -/\n  indep : ProbabilityTheory.iIndepFun X ℙ\n  /-- Each step is uniform on `steps`. -/\n  isUniform (k : ℕ) : MeasureTheory.pdf.IsUniform (X k) steps ℙ Measure.count\n\n/-- The position $s_n = \\sum_{k<n} X_k$ of the walk after $n$ steps, so that $s_0 = 0$. -/\ndef position {Ω : Type*} (X : ℕ → Ω → ℤ × ℤ) (n : ℕ) (ω : Ω) : ℤ × ℤ :=\n  ∑ k ∈ Finset.range n, X k ω\n\n/-- The local time $f_n(x)=\\#\\{0\\le k\\le n : s_k=x\\}$ of the site `x` at time `n`. -/\ndef localTime {Ω : Type*} (X : ℕ → Ω → ℤ × ℤ) (n : ℕ) (ω : Ω) (x : ℤ × ℤ) : ℕ :=\n  ((Finset.range (n + 1)).filter fun k ↦ position X k ω = x).card\n\n/-- The set $F(n)=\\{x : f_n(x)=\\max_y f_n(y)\\}$ of favourite sites at time `n`. It is the set of\nsites whose local time is at least that of every site. The local time is $0$ outside the finite\nset of visited sites, so the maximum exists and `F(n)` is finite and non-empty. -/\ndef favouriteSites {Ω : Type*} (X : ℕ → Ω → ℤ × ℤ) (n : ℕ) (ω : Ω) : Set (ℤ × ℤ) :=\n  {x | ∀ y, localTime X n ω y ≤ localTime X n ω x}\n\n/-- The walk starts at the origin. -/\n@[category API, AMS 60]\ntheorem position_zero {Ω : Type*} (X : ℕ → Ω → ℤ × ℤ) (ω : Ω) : position X 0 ω = 0 := by\n  simp [position]\n\n/-- The walk moves by the next step. -/\n@[category API, AMS 60]\ntheorem position_succ {Ω : Type*} (X : ℕ → Ω → ℤ × ℤ) (n : ℕ) (ω : Ω) :\n    position X (n + 1) ω = position X n ω + X n ω := by\n  simp [position, Finset.sum_range_succ]\n\ndef erdos_1165.answer (r : ℕ) : ℝ≥0∞ := if r = 3 then 1 else 0\n\n/--\nGiven a random walk $s_0,s_1,\\ldots$ in $\\mathbb{Z}^2$, starting at the origin, let $f_n(x)$ count\nthe number of $0\\leq k\\leq n$ such that $s_k=x$.\n\nLet\n$$F(n)=\\{ x: f_n(x) = \\max_y f_n(y)\\}$$\nbe the set of 'favourite values'. Find\n$$\\mathbb{P}(\\lvert F(n)\\rvert=r\\textrm{ infinitely often})$$\nfor $r\\geq 3$.\n\nA problem of Erdős and Révész [Va99, 6.77]. We take the simple random walk, on any probability\nspace (`IsSimpleRandomWalkSteps`). Hao, Li, Okada and Zheng [HLOZ24, Theorem 1.1] showed that the\nprobability is $1$ for $r=3$ and $0$ for $r\\geq 4$, see `erdos_1165.variants.hao_li_okada_zheng`.\nThe value of `erdos_1165.answer` for $r<3$ is not used.\n-/\n@[category research solved, question value, AMS 60]\ntheorem erdos_1165 {Ω : Type*} [MeasureSpace Ω] [IsProbabilityMeasure (ℙ : Measure Ω)]\n    {X : ℕ → Ω → ℤ × ℤ} (hX : IsSimpleRandomWalkSteps X) (r : ℕ) (hr : 3 ≤ r) :\n    ℙ {ω | ∃ᶠ n in atTop, (favouriteSites X n ω).encard = (r : ℕ∞)} = erdos_1165.answer r := by\n  sorry\n\n/--\nHao, Li, Okada and Zheng [HLOZ24, Theorem 1.1] proved that, for the simple random walk on\n$\\mathbb{Z}^2$, almost surely\n$$\\limsup_{n\\to\\infty} \\#K^{(2)}(n) = 3,$$\nwhere $K^{(2)}(n)$ is the set of favourite sites at time $n$. The cardinalities are natural\nnumbers, so almost surely there are eventually at most three favourite sites, and exactly three\ninfinitely often. Tóth [To01] proved the corresponding bound for the one-dimensional walk, see\n[HLOZ24, Section 1].\n-/\n@[category research solved, AMS 60]\ntheorem erdos_1165.variants.hao_li_okada_zheng {Ω : Type*} [MeasureSpace Ω]\n    [IsProbabilityMeasure (ℙ : Measure Ω)] {X : ℕ → Ω → ℤ × ℤ} (hX : IsSimpleRandomWalkSteps X) :\n    ∀ᵐ ω, limsup (fun n ↦ (favouriteSites X n ω).encard) atTop = 3 := by\n  sorry\n\nend Erdos1165\n",
  "statement_hash": "209a972441d8c7895182a8b73d0f3b3e1f26996c3d33cd7276ba151a3da2fc09",
  "toolchain": "leanprover/lean4:v4.33.1",
  "upstream_commit": "f9b3868d5ca994a7bf95039bcec05338c0c21e2f",
  "workspace": "formal-conjectures",
  "field": "math",
  "formalization": "formal",
  "verification": "lean-kernel",
  "license": "Apache-2.0",
  "attribution": "google-deepmind/formal-conjectures contributors",
  "metric_name": null,
  "metric_direction": null,
  "critiques": [],
  "public_partial_proofs": [],
  "research_threads": [],
  "instructions": "Read research_threads first: other people's public repositories and what they already tried. Write Solution.lean starting from challenge_source. Keep every definition identical, prove decl_name with exactly the same type, no sorry in its dependency closure, no new axioms, no native_decide, no metaprogramming. Submit with POST /api/v1/submissions."
}