{
  "id": "1021",
  "ident": "NS.01021",
  "slug": "erdos-1212",
  "title": "Erdős Problem 1212",
  "status": "solved",
  "statement_status": "reviewed",
  "statement_md": "Let $G$ be the graph with vertex set those pairs $(x,y)\\in \\mathbb{N}^2$ with\n$\\mathrm{gcd}(x,y)=1$, in which we join two vertices if the differ in only one coordinate, and\nthere by $\\pm 1$.\n\nIs there a path going to infinity on $G$, say $P$, such that for all $(x,y)\\in P$ both\n$\\min(x,y)>1$ and at least one of $x$ or $y$ is composite?\n\nThe weaker version (only $\\min(x,y) > 1$) was solved by C. Stewart via the prime-pair path\n$(p_k, p_{k+1}) \\to (p_{k+1}, p_{k+2})$, as recounted in [Er80]; the compositeness condition\nforbids those anchors.\n\nThe strengthened problem was solved by Alex Chengyu Li; see\n[Li's construction](https://crabresearch.com/research/erdos-1212-algebraic-corridors)\nand the accompanying\n[Lean formalization](https://github.com/crabsatellite/erdos-1212-visible-lattice-path).",
  "subjects": [
    "math.NT",
    "msc:11"
  ],
  "tags": [
    "question",
    "formal_proof"
  ],
  "collection": "erdos",
  "source_url": null,
  "solved_on_platform": false,
  "needs_answer": false,
  "version": 1,
  "decl_name": "Erdos1212.erdos_1212",
  "statement_lean": "theorem erdos_1212 :\n    ∃ f : ℕ → ℕ × ℕ, Function.Injective f ∧ (∀ n, Adj (f n) (f (n + 1))) ∧\n      (∀ n, Valid (f n)) ∧\n      Tendsto (fun n => (f n).1 + (f n).2) atTop atTop",
  "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 1212\n\n*References:*\n- [erdosproblems.com/1212](https://www.erdosproblems.com/1212)\n- [Er80] Erdős, P., _Some notes on problems and results in number theory_ (1980), p. 114.\n\nThis file also records machine-checked cores of verified partial results (2026):\na composite-anchor sufficient reduction and an impossibility theorem for periodic\ncertificates; see the corresponding lemmas below.\n-/\n\n@[expose] public section\n\nopen Filter\n\nnamespace Erdos1212\n\n/-- A vertex of the strengthened problem: a visible lattice point with both coordinates\nexceeding 1 and at least one coordinate composite. -/\ndef Valid (p : ℕ × ℕ) : Prop :=\n  1 < p.1 ∧ 1 < p.2 ∧ Nat.gcd p.1 p.2 = 1 ∧ (¬ p.1.Prime ∨ ¬ p.2.Prime)\n\n/-- Sanity check for `Valid`: the vertex $(4, 3)$ is valid — both coordinates exceed $1$,\nthey are coprime, and $4$ is composite. -/\n@[category test, AMS 11]\ntheorem valid_four_three : Valid (4, 3) := by\n  refine ⟨?_, ?_, ?_, ?_⟩ <;> decide\n\n/-- Two lattice points are adjacent iff they differ by exactly 1 in exactly one coordinate. -/\ndef Adj (p q : ℕ × ℕ) : Prop :=\n  (p.1 = q.1 ∧ (p.2 = q.2 + 1 ∨ q.2 = p.2 + 1)) ∨\n  (p.2 = q.2 ∧ (p.1 = q.1 + 1 ∨ q.1 = p.1 + 1))\n\nset_option linter.style.formal_proof_palomar false in\n/--\nLet $G$ be the graph with vertex set those pairs $(x,y)\\in \\mathbb{N}^2$ with\n$\\mathrm{gcd}(x,y)=1$, in which we join two vertices if the differ in only one coordinate, and\nthere by $\\pm 1$.\n\nIs there a path going to infinity on $G$, say $P$, such that for all $(x,y)\\in P$ both\n$\\min(x,y)>1$ and at least one of $x$ or $y$ is composite?\n\nThe weaker version (only $\\min(x,y) > 1$) was solved by C. Stewart via the prime-pair path\n$(p_k, p_{k+1}) \\to (p_{k+1}, p_{k+2})$, as recounted in [Er80]; the compositeness condition\nforbids those anchors.\n\nThe strengthened problem was solved by Alex Chengyu Li; see\n[Li's construction](https://crabresearch.com/research/erdos-1212-algebraic-corridors)\nand the accompanying\n[Lean formalization](https://github.com/crabsatellite/erdos-1212-visible-lattice-path).\n-/\n@[category research solved, question, AMS 11, formal_proof using lean4 at\n  \"https://github.com/crabsatellite/erdos-1212-visible-lattice-path/blob/400001f0847afe36a26c588d34445210dbdc116e/kernel/Erdos1212Kernel/AlgebraicCorridorKernelAudit.lean\"]\ntheorem erdos_1212 :\n    ∃ f : ℕ → ℕ × ℕ, Function.Injective f ∧ (∀ n, Adj (f n) (f (n + 1))) ∧\n      (∀ n, Valid (f n)) ∧\n      Tendsto (fun n => (f n).1 + (f n).2) atTop atTop := by\n  sorry\n\n/- ### Verified partial results (2026): machine-checked cores -/\n\n/-- Core of the composite-anchor reduction: vertical-leg vertices $(a, s)$ for\n$b \\le s \\le c$ are valid vertices of the strengthened problem, given the anchor $a$ is\ncomposite and coprime to the whole leg. -/\n@[category API, AMS 11]\ntheorem vertical_leg_valid {a b c : ℕ} (ha : a.Composite) (hb : 2 ≤ b)\n    (hV : ∀ s, b ≤ s → s ≤ c → Nat.gcd a s = 1) :\n    ∀ s, b ≤ s → s ≤ c → Valid (a, s) := by\n  intro s hs1 hs2\n  have ha2 := ha.1\n  exact ⟨by omega, by omega, hV s hs1 hs2, Or.inl ha.2⟩\n\n/-- Core of the composite-anchor reduction: horizontal-leg vertices $(s, c)$ for\n$a \\le s \\le b$ are valid, given the anchor $c$ is composite and coprime to the whole leg. -/\n@[category API, AMS 11]\ntheorem horizontal_leg_valid {a b c : ℕ} (hc : c.Composite) (ha2 : 2 ≤ a)\n    (hH : ∀ s, a ≤ s → s ≤ b → Nat.gcd s c = 1) :\n    ∀ s, a ≤ s → s ≤ b → Valid (s, c) := by\n  intro s hs1 hs2\n  have hc2 := hc.1\n  exact ⟨by omega, by omega, hH s hs1 hs2, Or.inr hc.2⟩\n\n/-- Roughness criterion (sufficiency for the anchor conditions): if $a < s$ for all $s$ in\nthe leg and the leg stays below $a + P^-(a)$, then $a$ is coprime to the whole leg. Stated\nvia divisibility: no prime factor of $a$ divides any $s$ with $a < s < a + p$ for all\nprime factors $p$ of $a$. -/\n@[category API, AMS 11]\ntheorem anchor_coprime_of_short_leg {a s : ℕ} (hs : a < s)\n    (h : ∀ p, p.Prime → p ∣ a → s < a + p) : Nat.gcd a s = 1 := by\n  by_contra hg\n  obtain ⟨p, hp, hpd⟩ := Nat.exists_prime_and_dvd (n := Nat.gcd a s) (by\n    intro h1\n    exact hg h1)\n  have hpa : p ∣ a := hpd.trans (Nat.gcd_dvd_left a s)\n  have hps : p ∣ s := hpd.trans (Nat.gcd_dvd_right a s)\n  have hlt : s < a + p := h p hp hpa\n  -- s is a multiple of p strictly between a (a multiple of p) and a + p: impossible\n  obtain ⟨k, hk⟩ := hpa\n  obtain ⟨l, hl⟩ := hps\n  have hp0 : 0 < p := hp.pos\n  have hkl : k < l := by\n    have : p * k < p * l := by omega\n    exact Nat.lt_of_mul_lt_mul_left this\n  have : p * (k + 1) ≤ p * l := Nat.mul_le_mul_left p hkl\n  have : a + p ≤ s := by\n    have hpk : p * (k + 1) = a + p := by rw [hk]; ring\n    omega\n  omega\n\n/-- Isolation lemma, right neighbour (core of the no-periodic-certificate theorem): if every\nprime in $P$ divides $x$ and none divides $y$, then no prime of $P$ divides either\ncoordinate of $(x+1, y)$. -/\n@[category API, AMS 11]\ntheorem right_neighbor_witness_free {P : Finset ℕ} {x y : ℕ} (hP : ∀ p ∈ P, p.Prime)\n    (hx : ∀ p ∈ P, p ∣ x) (hy : ∀ p ∈ P, ¬ p ∣ y) :\n    ∀ p ∈ P, ¬ p ∣ (x + 1) ∧ ¬ p ∣ y := by\n  intro p hp\n  refine ⟨fun hdvd => ?_, hy p hp⟩\n  have h1 : p ∣ 1 := by\n    have h := Nat.dvd_sub hdvd (hx p hp)\n    simpa using h\n  have := (hP p hp).one_lt\n  have := Nat.dvd_one.mp h1\n  omega\n\n/-- Isolation lemma, left neighbour. -/\n@[category API, AMS 11]\ntheorem left_neighbor_witness_free {P : Finset ℕ} {x y : ℕ} (hP : ∀ p ∈ P, p.Prime)\n    (hx1 : 1 ≤ x) (hx : ∀ p ∈ P, p ∣ x) (hy : ∀ p ∈ P, ¬ p ∣ y) :\n    ∀ p ∈ P, ¬ p ∣ (x - 1) ∧ ¬ p ∣ y := by\n  intro p hp\n  refine ⟨fun hdvd => ?_, hy p hp⟩\n  have h1 : p ∣ 1 := by\n    have h := Nat.dvd_sub (hx p hp) hdvd\n    have hx_sub : x - (x - 1) = 1 := by omega\n    rwa [hx_sub] at h\n  have := (hP p hp).one_lt\n  have := Nat.dvd_one.mp h1\n  omega\n\n/-- Isolation lemma, vertical neighbours: both coordinates even. -/\n@[category API, AMS 11]\ntheorem vertical_neighbor_both_even {x y : ℕ} (h2x : 2 ∣ x) (h2y : ¬ 2 ∣ y) :\n    (2 ∣ x ∧ 2 ∣ (y + 1)) ∧ (1 ≤ y → 2 ∣ x ∧ 2 ∣ (y - 1)) := by\n  refine ⟨⟨h2x, by omega⟩, fun hy1 => ⟨h2x, by omega⟩⟩\n\nend Erdos1212\n",
  "statement_hash": "22eddd957e13622e787faf6bf50e612eb40df407fe1bc38551c42fab3d852d29",
  "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."
}