[{"data":1,"prerenderedAt":4},["ShallowReactive",2],{"UvOq009XRz":3},"> **Note.** This entire repository was machine-written by AI assistants at the direction of Tom Adamczewski. The Lean proof itself was written by GPT-6 Astra, as described below.\n\n# Erdős problem #548 (Erdős–Sós conjecture): proof\n\n[![CI](https://github.com/tadamcz/erdos548/actions/workflows/ci.yml/badge.svg)](https://github.com/tadamcz/erdos548/actions/workflows/ci.yml)\n\nMachine-checked proof of [Erdős problem #548](https://www.erdosproblems.com/548) in Lean 4 with Mathlib, found autonomously by a\npre-release version of **GPT-6 Astra** (OpenAI) in the **FrontierMath Erdős** benchmark (Adamczewski and Bloom, 2026). The\nrepository packages the AI-written proof for the [Palomar registry](https://palomar-registry.org/): `Challenge.lean` is the\nsmall statement a reader audits, `Solution.lean` proves it, and [Comparator](https://github.com/leanprover/comparator) checks that the two\nstatements coincide and that only the standard axioms are used.\n\n## The result\n\nThe Erdős–Sós conjecture (1962) states that every graph on `n` vertices with more than `(k-2)n/2` edges contains every\ntree on `k` vertices. The weaker statement with `(k-2)n` edges is an easy induction, and the conjecture was proved in\nmany special cases (for example for trees of bounded diameter, for spiders, and for large `k` relative to `n` in the\nwork announced by Ajtai, Komlós, Simonovits and Szemerédi), but it remained open in general; Chung's collection of\nErdős's graph problems called it \"one of the most tantalizing problems in extremal graph theory\". erdosproblems.com\nlists a $100 prize and states the problem as: let `n ≥ k+1`; every graph on `n` vertices with at least `(k-1)n/2 + 1`\nedges contains every tree on `k+1` vertices.\n\nThe conjecture is **true**. Formally, the theorem proved is `Erdos548.erdos_548`, the statement of the FrontierMath\nErdős benchmark: for all `n, k` with `k + 1 ≤ n`, every `G : SimpleGraph (Fin n)` with `(k-1)/2 · n + 1 ≤ |E(G)|` (as\nrationals) contains every tree `T : SimpleGraph (Fin (k+1))` as a (not necessarily induced) subgraph, `T.IsContained G`.\n\nThe compared declaration, from `Challenge.lean`:\n\n```lean\ntheorem erdos_548 :\n    ∀ (n k : ℕ), k + 1 ≤ n → ∀ G : SimpleGraph (Fin n),\n      ((k : ℚ) - 1) / 2 * n + 1 ≤ (G.edgeSet.ncard : ℚ) →\n        ∀ T : SimpleGraph (Fin (k + 1)), T.IsTree → T.IsContained G := by\n  sorry\n```\n\n\n\n**Fidelity.** Relative to the cited source (the erdosproblems.com statement) there is no divergence: the compared theorem is its\ndirect formalisation, with trees on `k+1` vertices and the hypothesis `|E| ≥ (k-1)n/2 + 1`. Relative to the classical\nphrasing of the Erdős–Sós conjecture (\"more than `(t-2)n/2` edges, trees on `t` vertices\"; here `t = k+1`) there is one\nmarginal difference: when `(k-1)n` is odd, `|E| > (k-1)n/2` already holds with one edge fewer than `|E| ≥ (k-1)n/2 + 1`\nrequires, so in that parity case the compared theorem assumes half an edge more and is very slightly weaker than the\nclassical statement (the classical statement implies it, not conversely). The Lean proof's internal counting lemma\nderives `2|E(G)| ≤ (k-1)n` whenever the tree is absent, which is the sharp classical bound, but only the advertised\nstatement is compared. The vertex type `Fin n` loses no generality; `G.edgeSet.ncard` is the number of edges; `T.IsTree`\nand `T.IsContained G` are Mathlib's notions (containment as a not necessarily induced subgraph); `k + 1 ≤ n` is `n ≥\nk+1`.\n\n## Provenance\n\n**Benchmark.** FrontierMath Erdős (Adamczewski and Bloom, 2026) evaluates AI systems on 68 open Erdős problems selected by Thomas F. Bloom, in the Lean proof\nassistant, autonomously and under a fixed, disclosed budget ($300 and 72 hours of working time per attempt in the default configuration). The\nagent works in a network-isolated Docker container with a Lean 4 toolchain (v4.27.0) and Mathlib, SageMath and Python; its final\n`Spec.lean` is checked in a separate pristine container by Comparator against the trusted statement, permitting only `propext`,\n`Quot.sound` and `Classical.choice`. The benchmark, harness and statements are public at\n[epoch-research/LeanOpenProblems](https://github.com/epoch-research/LeanOpenProblems); the paper is in preparation. No human saw or steered the proof search.\n\n**Statement.** The problem had no statement in Formal Conjectures. The statement was produced by the benchmark authors' autoformalization pipeline and reviewed for faithfulness by Thomas F. Bloom; the file the model received is [`apn/data/erdos_autoformalized/Isolated/Erdos548.erdos_548.lean`](https://github.com/epoch-research/LeanOpenProblems/blob/77882c437ca1dfefab3b27fa00f1d29788100311/apn/data/erdos_autoformalized/Isolated/Erdos548.erdos_548.lean).\n\n**Resolutions.** One attempt resolved this statement.\n\"Default configuration\" is the deepagent-based agent with subagents, memory and an offline arXiv snapshot under the benchmark's\nbudget of $300 and 72 hours of working time per attempt; \"ReAct agent, larger budget\" is a basic agent under a $1,000 budget.\n**Cost** is computed from the attempt's exact token counts (from the harness's eval logs) at GPT-6 Astra's standard rates as provided\nby OpenAI on 3 September 2026: $10 per million input tokens, $50 per million output tokens, $1 per million cache-read tokens and\n$12.50 per million cache-write tokens. The harness itself metered spend at stand-in GPT-5.6 Sol prices, which is what the `usd` figure\nin each file name reflects. **Working time** is the harness's `working_time` (time the agent was actually working, excluding waits on\nAPI retries and rate limits), read from the harness's eval logs; the `h` figure in each file name is instead wall-clock time.\n\n| Module | Role | Attempt | Cost | Working time | Tokens, millions (input / output / cache read / cache write) |\n|---|---|---|---|---|---|\n| `Erdos548/Resolutions/Erdos548_192usd_21h.lean` | **primary** (wired to `Solution.lean`) | ReAct agent, larger budget, 26 Aug 2026 | $363 | 20.5 h | 0.19 / 2.1 / 113 / 11.5 |\n\n## Proof account\n\nThe accounts below paraphrase the module documentation the model wrote inside each file; they describe the Lean proofs actually\npresent. They are not a human verification of the mathematics beyond what Comparator establishes.\n\n**`Erdos548_192usd_21h`** (ReAct agent, larger budget, 26 Aug 2026). Counts, for each permutation word of the host vertices, the prefixes ending at a neighbour of the first vertex that support a rooted copy of the target tree. Two reversible word operations (rotating the first qualifying prefix; reversing both blocks at a cut, which moves the root to a newly attached leaf) drive an induction on the tree, giving `rooted_word_tree_bound`: the number of adjacency-marked states, exactly `2|E(G)|(n-1)!`, is at most the rooted-copy count plus `(t-2) n!`. If the tree is absent this yields `2|E(G)| ≤ (t-2) n`, contradicting the edge density.\n\n**Informal summary from the FrontierMath Erdős paper** (Thomas F. Bloom, appendix; a fuller sketch is on the problem page of\nerdosproblems.com): The proof is surprisingly short and elegant. It considers the number of pairs `(π, j)` where `π = (v_1 ⋯ v_n)` is an\nordering of the vertices of `G` and `2 ≤ j ≤ n` is a label such that `v_1 v_j` is an edge. The number of such pairs is\n`2m(n-1)!`, where `m` is the number of edges. On the other hand, for any fixed tree `T` on `k` vertices, an inductive\nargument shows this number to be at most `C(T) + (k-2)n!`, where `C(T)` counts the pairs in which `(v_1 ⋯ v_j)` contains\na copy of `T` rooted at `v_1`. If `G` contains no copy of `T` then `C(T) = 0`, and rearranging yields the result.\n\n## Repository layout\n\n- `Challenge.lean` — the statement surface: definitions copied verbatim from the benchmark statement and the compared theorem with `sorry`.\n- `Solution.lean` — imports the primary resolution module, in whose environment the compared theorem is proved.\n- `Erdos548.lean`, `Erdos548/Resolutions/` — the AI-written proof module(s); `Erdos548.lean` imports the primary one.\n\n- `comparator.json` — Comparator configuration naming `Erdos548.erdos_548`.\n- `formalization.yaml` — structured metadata (provenance, sources, classification, automation, review) in the mathlib-initiative v0.4 format.\n- `provenance/` — SHA-256 sums of the benchmark output files and unified diffs from them to the modules here.\n- `scripts/verify-comparator.sh` runs the pinned Comparator, lean4export, NanoDa and Landrun locally (Linux); `scripts/validate-formalization.rb` checks the metadata file.\n- `.github/workflows/ci.yml` — builds the project and runs Comparator (layout from the Palomar template; the template's doc-gen4 job is omitted because the modules import all of Mathlib).\n\n## Edits relative to the benchmark output\n\nThe proof modules are the model's final `Spec.lean` files, verified by the benchmark, with only the following mechanical changes; the\nexact diffs are in `provenance/`. The toolchain was moved from Lean v4.27.0 / Mathlib (via Formal Conjectures at commit\n`488aade2`) to Lean v4.28.0 / Mathlib v4.28.0, the oldest release Palomar accepts; the only change this required is the\n`loopless` adjustment listed below for the files it affects.\n\n- `Erdos548_192usd_21h.lean` (SHA-256 of the benchmark output: `f34f78eff21941750ffd45f93c0201a80cdd71ebe4bb808b79031028d93ff7fd`):\n  - line 1: `import FormalConjecturesUtil` → `import Mathlib`\n  - no other changes (react-agent file: statement contained only the proved direction)\n  - port to Mathlib v4.28.0: Mathlib v4.28.0 changed the field `SimpleGraph.loopless` from `Irreflexive Adj` to the class `Std.Irrefl Adj`, so proofs of that field need a `constructor` step (or an anonymous-constructor wrapper) and uses of `G.loopless` as a function become `G.loopless.irrefl`. Changed lines:\n    - line 601: `loopless := by rintro (a | a) \u003C;> simp` → `loopless := by constructor; rintro (a | a) \u003C;> simp`\n\n## Verification\n\n```sh\nlake exe cache get\nlake build\nruby scripts/validate-formalization.rb\n./scripts/verify-comparator.sh   # Linux: Comparator + NanoDa under Landrun\n```\n\nCI runs the same checks. The compared theorem depends on no `sorry` and on no axioms beyond `propext`, `Quot.sound` and\n`Classical.choice`. This repository is prepared for submission to Palomar through the\n[submission form](https://submit.palomar-registry.org/) with the full commit SHA; registration is a separate step by the maintainer.\n\n## Licence and attribution\n\nThis repository snapshot is licensed under the Apache License 2.0 (see `LICENSE`). The benchmark statement it reproduces is\nfrom the FrontierMath Erdős benchmark (Adamczewski and Bloom; LeanOpenProblems, MIT licence; see `NOTICE`). Cited papers,\nerdosproblems.com and Mathlib retain their own licences.\n",1789154841396]